GCC Code Coverage Report


Directory: ./
File: playlist/PlaylistEntryBoth.h
Date: 2026-12-01 12:27:28
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 1435 std::string GetSequenceName(void) { return m_sequenceName; }
39 1435 std::string GetMediaName(void) { return m_mediaName; }
40
41 virtual uint64_t GetLengthInMS() override;
42 virtual uint64_t GetElapsedMS() override;
43 virtual void PrepareAhead() override;
44
45 virtual void Pause() override;
46 virtual bool IsPaused() override;
47 virtual void Resume() override;
48
49 private:
50 int m_duration;
51
52 std::string m_sequenceName;
53 std::string m_mediaName;
54
55 // m_mediaEntry is the media for the current pass, null when this pass is
56 // running lights-only; m_mediaOwned owns the child. A media start that
57 // fails once (an audio output not up yet) used to delete the child, so
58 // every later pass of a repeating playlist played without sound.
59 PlaylistEntryMedia* m_mediaEntry;
60 PlaylistEntryMedia* m_mediaOwned = nullptr;
61 PlaylistEntrySequence* m_sequenceEntry;
62
63 // The sequence is held until the media is audible, so the lights don't
64 // run ahead while the audio output starts up. Process() starts it.
65 bool m_holdingForAudio = false;
66 long long m_holdStartMS = 0;
67
68 std::recursive_mutex m_mutex;
69 };
70