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"
27#include "FileMgr.hpp"
28
29/*****************************************************************************/
31{
32public:
35
36 virtual void Start (String & FileName, float SecondsElapsed, uint32_t PlayCount);
37 virtual void Stop ();
38 virtual void Sync (String & FileName, float SecondsElapsed);
39 virtual bool Poll ();
40 virtual void GetStatus (JsonObject & jsonStatus);
41 virtual void ClearStatistics ();
42 virtual bool IsIdle () { return (pCurrentFsmState == &fsm_PlayList_state_Idle_imp); }
43
44private:
45
46protected:
52 friend class fsm_PlayList_state;
53
59
61
64 // char InputFPPRemotePlayItem[sizeof(c_InputFPPRemotePlayFile)];
65
66 uint32_t PlayListEntryId = 0;
67
68 // BUGBUG -- time_t creates issues for portable code, and for overflow-safe code
69 // time_t is only required to be a "real" type, which means it can be either a float or an integer.
70 // even when time_t is an integer type, it can be signed or unsigned
71 //
72 // Current code appears to assume that time_t is not a float.
73 //
74 // C++11 does not expose any constant for minimum / maximum value for the time_t type.
75 // This makes it impossible (without type traits) to ensure math operations on time_t types do
76 // not result in undefined behavior (signed types only) and/or overflow (all types).
77 //
78 // Therefore, it is highly recommended to move AWAY from use of time_t wherever possible,
79 // and instead use types that expose their minimum and maximum values, respectively.
80 //
81 // For now, because the code presumes time_t is an integer type, the following assertion
82 // ensures this for all practical purposes.
83 static_assert( (((time_t)1) / 2) == 0 ); // Verify time_t is an integer type (alternative: float)
84
86 uint32_t PlayListRepeatCount = 1;
87
89
90}; // c_InputFPPRemotePlayList
Definition FastTimer.hpp:24
Definition InputFPPRemotePlayEffect.hpp:28
Definition InputFPPRemotePlayItem.hpp:26
c_InputMgr::e_InputChannelIds InputChannelId
Definition InputFPPRemotePlayItem.hpp:41
Definition InputFPPRemotePlayList.hpp:31
virtual bool Poll()
Definition InputFPPRemotePlayList.cpp:89
virtual void Stop()
Definition InputFPPRemotePlayList.cpp:61
FastTimer PauseDelayTimer
Definition InputFPPRemotePlayList.hpp:85
fsm_PlayList_state_PlayingFile fsm_PlayList_state_PlayingFile_imp
Definition InputFPPRemotePlayList.hpp:56
virtual void Sync(String &FileName, float SecondsElapsed)
Definition InputFPPRemotePlayList.cpp:75
uint32_t PlayListEntryId
Definition InputFPPRemotePlayList.hpp:66
virtual bool IsIdle()
Definition InputFPPRemotePlayList.hpp:42
fsm_PlayList_state_PlayingEffect fsm_PlayList_state_PlayingEffect_imp
Definition InputFPPRemotePlayList.hpp:57
c_InputFPPRemotePlayItem * pInputFPPRemotePlayItem
Definition InputFPPRemotePlayList.hpp:62
fsm_PlayList_state_WaitForStart fsm_PlayList_state_WaitForStart_imp
Definition InputFPPRemotePlayList.hpp:54
bool ProcessPlayListEntry()
Definition InputFPPRemotePlayList.cpp:131
fsm_PlayList_state * pCurrentFsmState
Definition InputFPPRemotePlayList.hpp:60
fsm_PlayList_state_Paused fsm_PlayList_state_Paused_imp
Definition InputFPPRemotePlayList.hpp:58
fsm_PlayList_state_Idle fsm_PlayList_state_Idle_imp
Definition InputFPPRemotePlayList.hpp:55
virtual void ClearStatistics()
Definition InputFPPRemotePlayList.cpp:120
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:86
virtual ~c_InputFPPRemotePlayList()
Definition InputFPPRemotePlayList.cpp:36
char InputFPPRemotePlayItem[sizeof(c_InputFPPRemotePlayEffect)]
Definition InputFPPRemotePlayList.hpp:63
e_InputChannelIds
Definition InputMgr.hpp:40
Definition InputFPPRemotePlayListFsm.hpp:71
Definition InputFPPRemotePlayListFsm.hpp:119
Definition InputFPPRemotePlayListFsm.hpp:103
Definition InputFPPRemotePlayListFsm.hpp:87
Definition InputFPPRemotePlayListFsm.hpp:55
Definition InputFPPRemotePlayListFsm.hpp:33
uint8_t Start[3]
Definition fseq.h:0