ESPixelStick Firmware
Firmware for the ESPixelStick
Loading...
Searching...
No Matches
InputFPPRemote.h
Go to the documentation of this file.
1#pragma once
2/*
3* InputFPPRemote.h
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*/
20
21#include "InputCommon.hpp"
22#include "WebMgr.hpp"
24
26{
27 public:
28
30 c_InputMgr::e_InputType NewChannelType,
31 uint32_t BufferSize);
32
33 virtual ~c_InputFPPRemote ();
34
35 // functions to be provided by the derived class
36 void Begin ();
37 bool SetConfig (JsonObject& jsonConfig);
38 void GetConfig (JsonObject& jsonConfig);
39 void GetStatus (JsonObject& jsonStatus);
40 void ClearStatistics ();
41 void Process ();
42 void GetDriverName (String& sDriverName) { sDriverName = "FPP Remote"; }
43 void SetBufferInfo (uint32_t BufferSize);
45 void SetOperationalState (bool ActiveFlag);
46 void SetBlankTimerIsRunning (bool BlankTimerRunning);
47
48 void StartPlaying (String & FileName, time_t SecondsElapsed, bool IsRemote);
49 void StopPlaying ();
50 void FppSyncRemoteFilePlay (String & FileName, uint32_t ElapsedTimeMS);
51 void GetFppRemotePlayStatus (JsonObject& jsonStatus);
52 bool IsIdle();
54
55protected:
56
58 int32_t GetSyncOffsetMS () { return SyncOffsetMS; }
59 bool GetSendFppSync () { return SendFppSync; }
60
61 char StatusType[65];
62
63private:
64
66 void StartPlayingLocalFile (String & FileName);
67 void StartPlayingRemoteFile (String & FileName, time_t ElapsedSeconds);
68 bool PlayingFile ();
69 bool PlayingRemoteFile ();
70 void PlayNextFile ();
71 bool Poll ();
73
74 void load ();
75 void save ();
76
77 int32_t SyncOffsetMS = 0;
78 bool SendFppSync = false;
81 bool Stopping = false;
82 bool FppSyncOverride = false;
83 uint32_t FilePlayCount = 0;
84
85 #define PlayerMemorySize 2000
87 {
88 alignas(16) byte Player[PlayerMemorySize];
89 uint32_t Id = 0;
90 bool InUse = false;
91 };
93};
#define PlayerMemorySize
Definition InputFPPRemote.h:85
InputValue_t
Definition externalInput.h:32
Definition InputCommon.hpp:27
Definition InputFPPRemote.h:26
void StartPlaying(String &FileName, time_t SecondsElapsed, bool IsRemote)
Definition InputFPPRemote.cpp:422
char StatusType[65]
Definition InputFPPRemote.h:61
bool FppSyncOverride
Definition InputFPPRemote.h:82
bool SetConfig(JsonObject &jsonConfig)
Set a new config in the driver.
Definition InputFPPRemote.cpp:344
void GetDriverName(String &sDriverName)
get the name for the instantiated driver
Definition InputFPPRemote.h:42
void SetOperationalState(bool ActiveFlag)
Definition InputFPPRemote.cpp:365
void PlayNextFile()
Definition InputFPPRemote.cpp:180
void FppStopRemoteFilePlay()
Definition InputFPPRemote.cpp:640
void ProcessButtonActions(c_ExternalInput::InputValue_t value)
Definition InputFPPRemote.cpp:316
void FppSyncRemoteFilePlay(String &FileName, uint32_t ElapsedTimeMS)
Definition InputFPPRemote.cpp:672
c_InputFPPRemotePlayItem * pInputFPPRemotePlayItem
Definition InputFPPRemote.h:57
void Process()
Call from loop(), renders Input data.
Definition InputFPPRemote.cpp:256
bool AllowedToPlayRemoteFile()
Definition InputFPPRemote.cpp:714
bool IsIdle()
Definition InputFPPRemote.cpp:700
bool Stopping
Definition InputFPPRemote.h:81
void validateConfiguration()
Definition InputFPPRemote.cpp:598
virtual ~c_InputFPPRemote()
Definition InputFPPRemote.cpp:76
bool SendFppSync
Definition InputFPPRemote.h:78
bool Poll()
Definition InputFPPRemote.cpp:301
void Begin()
set up the operating environment based on the current config (or defaults)
Definition InputFPPRemote.cpp:89
int32_t GetSyncOffsetMS()
Definition InputFPPRemote.h:58
char FileBeingPlayed[65]
Definition InputFPPRemote.h:79
void ClearStatistics()
Definition InputFPPRemote.cpp:150
uint32_t FilePlayCount
Definition InputFPPRemote.h:83
void StopPlaying()
Definition InputFPPRemote.cpp:380
bool PlayingFile()
Definition InputFPPRemote.cpp:606
bool GetSendFppSync()
Definition InputFPPRemote.h:59
void SetBlankTimerIsRunning(bool BlankTimerRunning)
Definition InputFPPRemote.cpp:732
c_InputFPPRemote(c_InputMgr::e_InputChannelIds NewInputChannelId, c_InputMgr::e_InputType NewChannelType, uint32_t BufferSize)
Definition InputFPPRemote.cpp:58
void GetStatus(JsonObject &jsonStatus)
Definition InputFPPRemote.cpp:115
void SetBufferInfo(uint32_t BufferSize)
Definition InputFPPRemote.cpp:337
bool PlayingRemoteFile()
Definition InputFPPRemote.cpp:612
int32_t SyncOffsetMS
Definition InputFPPRemote.h:77
void save()
Save configuration to File System.
PlayerInfo_t PlayerInfo
Definition InputFPPRemote.h:92
void GetConfig(JsonObject &jsonConfig)
Get the current config used by the driver.
Definition InputFPPRemote.cpp:100
void StartPlayingLocalFile(String &FileName)
Definition InputFPPRemote.cpp:473
void GetFppRemotePlayStatus(JsonObject &jsonStatus)
Definition InputFPPRemote.cpp:686
void StartPlayingRemoteFile(String &FileName, time_t ElapsedSeconds)
Definition InputFPPRemote.cpp:553
char ConfiguredFileToPlay[65]
Definition InputFPPRemote.h:80
void load()
Load configuration from File System.
Definition InputFPPRemotePlayItem.hpp:26
e_InputType
Definition InputMgr.hpp:73
e_InputChannelIds
Definition InputMgr.hpp:40
Definition InputFPPRemote.h:87
byte Player[PlayerMemorySize]
Definition InputFPPRemote.h:88
bool InUse
Definition InputFPPRemote.h:90
uint32_t Id
Definition InputFPPRemote.h:89