Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made FPP Remote a secondary input operation to allow E1.31 or DDP to be used at the same time. #391

Merged
merged 6 commits into from
Oct 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ESPixelStick/src/FileMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ void c_FileMgr::GetListOfSdFiles (String & Response)
{
// DEBUG_START;

DynamicJsonDocument ResponseJsonDoc (2048);
DynamicJsonDocument ResponseJsonDoc (3 * 1024);

do // once
{
Expand Down
12 changes: 12 additions & 0 deletions ESPixelStick/src/WebMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,18 @@ void c_WebMgr::init ()
}
);

webServer.on ("/download", HTTP_GET, [](AsyncWebServerRequest* request)
{
// DEBUG_V (String ("url: ") + String (request->url ()));
String filename = request->url ().substring (String ("/download").length ());
// DEBUG_V (String ("filename: ") + String (filename));

AsyncWebServerResponse* response = new AsyncFileResponse (SDFS, filename, "application/octet-stream", true);
request->send (response);

// DEBUG_V ("Send File Done");
});

webServer.onNotFound ([this](AsyncWebServerRequest* request)
{
// DEBUG_V ("onNotFound");
Expand Down
29 changes: 24 additions & 5 deletions ESPixelStick/src/input/InputFPPRemote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,12 @@ void c_InputFPPRemote::GetStatus (JsonObject & jsonStatus)
void c_InputFPPRemote::Process ()
{
// DEBUG_START;

if (PlayingFile ())
if (!IsInputChannelActive)
{
// dont do anything if the channel is not active
StopPlaying ();
}
else if (PlayingFile ())
{
pInputFPPRemotePlayItem->Poll (InputDataBuffer, InputDataBufferSize);

Expand Down Expand Up @@ -161,13 +165,28 @@ bool c_InputFPPRemote::SetConfig (JsonObject & jsonConfig)
void c_InputFPPRemote::StopPlaying ()
{
// DEBUG_START;

if (PlayingFile ())
do // once
{
if (!PlayingFile ())
{
// DEBUG_ ("Not currently playing a file");
break;
}

// DEBUG_ ();

pInputFPPRemotePlayItem->Stop ();

while (!pInputFPPRemotePlayItem->IsIdle ())
{
pInputFPPRemotePlayItem->Poll (InputDataBuffer, InputDataBufferSize);
pInputFPPRemotePlayItem->Stop ();
}

delete pInputFPPRemotePlayItem;
pInputFPPRemotePlayItem = nullptr;
}

} while (false);

// DEBUG_END;

Expand Down
2 changes: 1 addition & 1 deletion ESPixelStick/src/input/InputMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static const InputTypeXlateMap_t InputTypeXlateMap[c_InputMgr::e_InputType::Inpu
{
{c_InputMgr::e_InputType::InputType_E1_31, "E1.31", c_InputMgr::e_InputChannelIds::InputPrimaryChannelId},
{c_InputMgr::e_InputType::InputType_DDP, "DDP", c_InputMgr::e_InputChannelIds::InputPrimaryChannelId},
{c_InputMgr::e_InputType::InputType_FPP, "FPP Remote", c_InputMgr::e_InputChannelIds::InputPrimaryChannelId},
{c_InputMgr::e_InputType::InputType_FPP, "FPP Remote", c_InputMgr::e_InputChannelIds::InputSecondaryChannelId},
{c_InputMgr::e_InputType::InputType_Artnet, "Artnet", c_InputMgr::e_InputChannelIds::InputPrimaryChannelId},
{c_InputMgr::e_InputType::InputType_Effects, "Effects", c_InputMgr::e_InputChannelIds::InputSecondaryChannelId},
{c_InputMgr::e_InputType::InputType_MQTT, "MQTT", c_InputMgr::e_InputChannelIds::InputSecondaryChannelId},
Expand Down