GCC Code Coverage Report


Directory: ./
File: playlist/PlaylistEntryBoth.h
Date: 2026-10-29 08:11:58
Exec Total Coverage
Lines: 2 2 100.0%
Functions: 2 2 100.0%
Branches: 0 0 -%

Line Branch Exec Source
1 #pragma once
2 /*
3 * This file is part of the Falcon Player (FPP) and is Copyright (C)
4 * 2013-2022 by the Falcon Player Developers.
5 *
6 * The Falcon Player (FPP) is free software, and is covered under
7 * multiple Open Source licenses. Please see the included 'LICENSES'
8 * file for descriptions of what files are covered by each license.
9 *
10 * This source file is covered under the LGPL v2.1 as described in the
11 * included LICENSE.LGPL file.
12 */
13
14 #include <mutex>
15 #include "fpp-json-fwd.h"
16 #include <string>
17
18 #include "PlaylistEntryBase.h"
19 #include "PlaylistEntryMedia.h"
20 #include "PlaylistEntrySequence.h"
21
22 class PlaylistEntryBoth : public PlaylistEntryBase {
23 public:
24 PlaylistEntryBoth(Playlist* playlist, PlaylistEntryBase* parent = NULL);
25 virtual ~PlaylistEntryBoth();
26
27 virtual int Init(Json::Value& config) override;
28
29 virtual int StartPlaying(void) override;
30 virtual int Process(void) override;
31 virtual int Stop(void) override;
32
33 virtual void Dump(void) override;
34
35 virtual Json::Value GetConfig(void) override;
36 virtual Json::Value GetMqttStatus(void) override;
37
38 1388 std::string GetSequenceName(void) { return m_sequenceName; }
39 1388 std::string GetMediaName(void) { return m_mediaName; }
40
41 virtual uint64_t GetLengthInMS() override;
42 virtual uint64_t GetElapsedMS() override;
43
44 virtual void Pause() override;
45 virtual bool IsPaused() override;
46 virtual void Resume() override;
47
48 private:
49 int m_duration;
50
51 std::string m_sequenceName;
52 std::string m_mediaName;
53
54 // m_mediaEntry is the media for the current pass, null when this pass is
55 // running lights-only; m_mediaOwned owns the child. A media start that
56 // fails once (an audio output not up yet) used to delete the child, so
57 // every later pass of a repeating playlist played without sound.
58 PlaylistEntryMedia* m_mediaEntry;
59 PlaylistEntryMedia* m_mediaOwned = nullptr;
60 PlaylistEntrySequence* m_sequenceEntry;
61
62 // The sequence is held until the media is audible, so the lights don't
63 // run ahead while the audio output starts up. Process() starts it.
64 bool m_holdingForAudio = false;
65 long long m_holdStartMS = 0;
66
67 std::recursive_mutex m_mutex;
68 };
69