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