diff --git a/plugin_setup.php b/plugin_setup.php index 3a5705a..74643bd 100755 --- a/plugin_setup.php +++ b/plugin_setup.php @@ -54,6 +54,7 @@ function OnConnectionChanged() { At Start, the hardware is reset, FM settings initialized, will broadcast any audio played, and send static RDS messages (if enabled).

Stop at: "PlaylistStop", "Never (default)"=>"Never"), "fpp-vastfmt", ""); ?>
At Stop, the hardware is reset. Listeners will hear static.

+

Enable Volume Change Hack for Vast-FMT 212R:

diff --git a/src/FPPVastFM.cpp b/src/FPPVastFM.cpp index f3d9826..c361cc4 100755 --- a/src/FPPVastFM.cpp +++ b/src/FPPVastFM.cpp @@ -5,6 +5,7 @@ #include #include "mediadetails.h" +#include "commands/Commands.h" #include "common.h" #include "settings.h" #include "Plugin.h" @@ -120,7 +121,8 @@ class FPPVastFMPlugin : public FPPPlugin { void startVastForRDS() { if (si4713 == nullptr) { if (initVast()) { - if (settings["EnableRDS"] == "True") { + rdsEnabled = settings["EnableRDS"] == "True"; + if (rdsEnabled) { initRDS(); } else { LogErr(VB_PLUGIN, "Tried to setup for RDS, but RDS is not enabled\n"); @@ -221,6 +223,21 @@ class FPPVastFMPlugin : public FPPPlugin { std::string album = mediaDetails.album; int track = mediaDetails.track; int length = mediaDetails.length; + + // Bump the volume down and back up to work around Vast-FMT 212R issue + if (settings["EnableVolumeChangeHack"] == "1") { + Json::Value cmd; + Json::Value args(Json::arrayValue); + + args.append("5"); + cmd["args"] = args; + + cmd["command"] = "Volume Decrease"; + CommandManager::INSTANCE.run(cmd); + + cmd["command"] = "Volume Increase"; + CommandManager::INSTANCE.run(cmd); + } std::string type = playlist["currentEntry"]["type"].asString(); if (type != "both" && type != "media") { @@ -245,6 +262,7 @@ class FPPVastFMPlugin : public FPPPlugin { setIfNotFound("Pty", "2"); setIfNotFound("Connection", "USB"); + setIfNotFound("EnableVolumeChangeHack", "0"); #ifdef PLATFORM_BBB setIfNotFound("ResetPin", "14"); #else