ESPixelStick Firmware
Firmware for the ESPixelStick
Loading...
Searching...
No Matches
InputFPPRemotePlayList.hpp
Go to the documentation of this file.
1#pragma once
2/*
3* InputFPPRemotePlayList.hpp
4*
5* Project: ESPixelStick - An ESP8266 / ESP32 and E1.31 based pixel driver
6* Copyright (c) 2021, 2025 Shelby Merrick
7* http://www.forkineye.com
8*
9* This program is provided free for you to use in any way that you wish,
10* subject to the laws and regulations where you are using it. Due diligence
11* is strongly suggested before using this code. Please give credit where due.
12*
13* The Author makes no warranty of any kind, express or implied, with regard
14* to this program or the documentation contained in this document. The
15* Author shall not be liable in any event for incidental or consequential
16* damages in connection with, or arising out of, the furnishing, performance
17* or use of these programs.
18*
19* Playlist object use to parse and play a playlist
20*/
21
22#include "ESPixelStick.h"
25#include "FileMgr.hpp"
26
27/*****************************************************************************/
29{
30public:
33
34 virtual void Start (String & FileName, float SecondsElapsed, uint32_t PlayCount);
35 virtual void Stop ();
36 virtual void Sync (String & FileName, float SecondsElapsed);
37 virtual bool Poll ();
38 virtual void GetStatus (JsonObject & jsonStatus);
39 virtual bool IsIdle () { return (pCurrentFsmState == &fsm_PlayList_state_Idle_imp); }
40
41private:
42
43protected:
49 friend class fsm_PlayList_state;
50
56
58
60
61 uint32_t PlayListEntryId = 0;
62
63 // BUGBUG -- time_t creates issues for portable code, and for overflow-safe code
64 // time_t is only required to be a "real" type, which means it can be either a float or an integer.
65 // even when time_t is an integer type, it can be signed or unsigned
66 //
67 // Current code appears to assume that time_t is not a float.
68 //
69 // C++11 does not expose any constant for minimum / maximum value for the time_t type.
70 // This makes it impossible (without type traits) to ensure math operations on time_t types do
71 // not result in undefined behavior (signed types only) and/or overflow (all types).
72 //
73 // Therefore, it is highly recommended to move AWAY from use of time_t wherever possible,
74 // and instead use types that expose their minimum and maximum values, respectively.
75 //
76 // For now, because the code presumes time_t is an integer type, the following assertion
77 // ensures this for all practical purposes.
78 static_assert( (((time_t)1) / 2) == 0 ); // Verify time_t is an integer type (alternative: float)
79
81 uint32_t PlayListRepeatCount = 1;
82
84
85}; // c_InputFPPRemotePlayList
Definition FastTimer.hpp:24
Definition InputFPPRemotePlayItem.hpp:26
c_InputMgr::e_InputChannelIds InputChannelId
Definition InputFPPRemotePlayItem.hpp:41
Definition InputFPPRemotePlayList.hpp:29
virtual bool Poll()
Definition InputFPPRemotePlayList.cpp:89
virtual void Stop()
Definition InputFPPRemotePlayList.cpp:61
FastTimer PauseDelayTimer
Definition InputFPPRemotePlayList.hpp:80
fsm_PlayList_state_PlayingFile fsm_PlayList_state_PlayingFile_imp
Definition InputFPPRemotePlayList.hpp:53
virtual void Sync(String &FileName, float SecondsElapsed)
Definition InputFPPRemotePlayList.cpp:75
uint32_t PlayListEntryId
Definition InputFPPRemotePlayList.hpp:61
virtual bool IsIdle()
Definition InputFPPRemotePlayList.hpp:39
fsm_PlayList_state_PlayingEffect fsm_PlayList_state_PlayingEffect_imp
Definition InputFPPRemotePlayList.hpp:54
c_InputFPPRemotePlayItem * pInputFPPRemotePlayItem
Definition InputFPPRemotePlayList.hpp:59
fsm_PlayList_state_WaitForStart fsm_PlayList_state_WaitForStart_imp
Definition InputFPPRemotePlayList.hpp:51
bool ProcessPlayListEntry()
Definition InputFPPRemotePlayList.cpp:120
fsm_PlayList_state * pCurrentFsmState
Definition InputFPPRemotePlayList.hpp:57
fsm_PlayList_state_Paused fsm_PlayList_state_Paused_imp
Definition InputFPPRemotePlayList.hpp:55
fsm_PlayList_state_Idle fsm_PlayList_state_Idle_imp
Definition InputFPPRemotePlayList.hpp:52
c_InputFPPRemotePlayList(c_InputMgr::e_InputChannelIds InputChannelId)
Definition InputFPPRemotePlayList.cpp:25
virtual void GetStatus(JsonObject &jsonStatus)
Definition InputFPPRemotePlayList.cpp:105
uint32_t PlayListRepeatCount
Definition InputFPPRemotePlayList.hpp:81
virtual ~c_InputFPPRemotePlayList()
Definition InputFPPRemotePlayList.cpp:36
e_InputChannelIds
Definition InputMgr.hpp:40
Definition InputFPPRemotePlayListFsm.hpp:70
Definition InputFPPRemotePlayListFsm.hpp:118
Definition InputFPPRemotePlayListFsm.hpp:102
Definition InputFPPRemotePlayListFsm.hpp:86
Definition InputFPPRemotePlayListFsm.hpp:54
Definition InputFPPRemotePlayListFsm.hpp:33
uint8_t Start[3]
Definition fseq.h:0