Skip to content

Commit

Permalink
Fix vastfm for FPP 2.6+
Browse files Browse the repository at this point in the history
  • Loading branch information
dkulp committed Aug 16, 2019
1 parent 4af125b commit c551965
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
22 changes: 11 additions & 11 deletions callbacks.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

#DEBUG=1
# DEBUG=1
DEBUG_LOG=${DEBUG_LOG:-${LOGDIR}/vastfmt.log}

die()
Expand Down Expand Up @@ -68,18 +68,18 @@ done
killall rds
vast_args="$(dirname $0)/bin/rds"

if [ ! -e ${CFGDIR}/plugin.vastfmt ]; then
if [ ! -e ${CFGDIR}/plugin.fpp-vastfmt ]; then
echo "Error finding plugin settings, please configure FMT!" >&2
exit 1
fi

transmit_setting=$(grep -i "^TurnOff\s*=.*" ${CFGDIR}/plugin.vastfmt | sed -e "s/.*=\s*//")
power=$(grep -i "^Power\s*=.*" ${CFGDIR}/plugin.vastfmt | sed -e "s/.*=\s*//")
rds_setting=$(grep -i "^RdsType\s*=.*" ${CFGDIR}/plugin.vastfmt | sed -e "s/.*=\s*\"\(.*\)\"/\1/")
rds_static_text=$(grep -i "^RDSStaticText\s*=.*" ${CFGDIR}/plugin.vastfmt | sed -e "s/.*=\s*\"\(.*\)\"/\1/")
set_frequency=$(grep -i "^SetFreq\s*=.*" ${CFGDIR}/plugin.vastfmt | sed -e "s/.*=\s*//")
frequency=$(grep -i "^Frequency\s*=.*" ${CFGDIR}/plugin.vastfmt | sed -e "s/.*=\s*//")
station=$(grep -i "^Station\s*=.*" ${CFGDIR}/plugin.vastfmt | sed -e "s/.*=\s*\"\(.*\)\"/\1/")
transmit_setting=$(grep -i "^TurnOff\s*=.*" ${CFGDIR}/plugin.fpp-vastfmt | sed -e "s/.*=\s*//")
power=$(grep -i "^Power\s*=.*" ${CFGDIR}/plugin.fpp-vastfmt | sed -e "s/.*=\s*//")
rds_setting=$(grep -i "^RdsType\s*=.*" ${CFGDIR}/plugin.fpp-vastfmt | sed -e "s/.*=\s*\"\(.*\)\"/\1/")
rds_static_text=$(grep -i "^RDSStaticText\s*=.*" ${CFGDIR}/plugin.fpp-vastfmt | sed -e "s/.*=\s*\"\(.*\)\"/\1/")
set_frequency=$(grep -i "^SetFreq\s*=.*" ${CFGDIR}/plugin.fpp-vastfmt | sed -e "s/.*=\s*//")
frequency=$(grep -i "^Frequency\s*=.*" ${CFGDIR}/plugin.fpp-vastfmt | sed -e "s/.*=\s*//")
station=$(grep -i "^Station\s*=.*" ${CFGDIR}/plugin.fpp-vastfmt | sed -e "s/.*=\s*\"\(.*\)\"/\1/")

if [ -n "$DEBUG" ]; then

Expand Down Expand Up @@ -109,8 +109,8 @@ case $operation in
fi

# Use jq to parse our JSON data
artist=$(echo $DATA | $(dirname $0)/jq/jq -r ".artist")
title=$(echo $DATA | $(dirname $0)/jq/jq -r ".title")
artist=$(echo $DATA | jq -r ".artist")
title=$(echo $DATA | jq -r ".title")

# Try to grab artist if Media exists. This assumes the filename
# is "Artist - Title.extension"
Expand Down
14 changes: 7 additions & 7 deletions plugin_setup.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ function toggleStation()
$(function(){toggleSettings();toggleStation();togglePower();});
</script>

<p>Toggle transmitter with playlist: <?php PrintSettingCheckbox("Turn off", "TurnOff", 1, 0, "1", "0", "vastfmt", "togglePower"); ?></p>
<p>Power: <?php PrintSettingText("Power", 1, 0, 3, 3, "vastfmt", "88"); ?>dB&mu;V <?php PrintSettingSave("Power", "Power", 1, 0, "vastfmt"); ?></p>
<p>Set frequency on playlist start/stop: <?php PrintSettingCheckbox("Set frequency", "SetFreq", 1, 0, "1", "0", "vastfmt", "toggleSettings"); ?></p>
<p>Frequency: <?php PrintSettingText("Frequency", 1, 0, 8, 8, "vastfmt"); ?>MHz <?php PrintSettingSave("Transmit Frequency", "Frequency", 1, 0, "vastfmt"); ?></p>
<p>RDS Type: <?php PrintSettingSelect("RDS Type", "RdsType", 1, 0, "RT+", Array("Disabled"=>"disabled", "RT+"=>"rtp", "RT"=>"rt", "PS"=>"ps"), "vastfmt", "toggleStation"); ?></p>
<p>RDS Static Text: <?php PrintSettingText("RDSStaticText", 1, 0, 50, 50, "vastfmt"); ?><?php PrintSettingSave("RDS Static Text", "RDSStaticText", 1, 0, "vastfmt"); ?></p>
<p>Station ID: <?php PrintSettingText("Station", 1, 0, 4, 4, "vastfmt"); ?><?php PrintSettingSave("Station ID", "Station", 1, 0, "vastfmt"); ?></p>
<p>Toggle transmitter with playlist: <?php PrintSettingCheckbox("Turn off", "TurnOff", 1, 0, "1", "0", "fpp-vastfmt", "togglePower"); ?></p>
<p>Power: <?php PrintSettingText("Power", 1, 0, 3, 3, "vastfmt", "88"); ?>dB&mu;V <?php PrintSettingSave("Power", "Power", 1, 0, "fpp-vastfmt"); ?></p>
<p>Set frequency on playlist start/stop: <?php PrintSettingCheckbox("Set frequency", "SetFreq", 1, 0, "1", "0", "fpp-vastfmt", "toggleSettings"); ?></p>
<p>Frequency: <?php PrintSettingText("Frequency", 1, 0, 8, 8, "vastfmt"); ?>MHz <?php PrintSettingSave("Transmit Frequency", "Frequency", 1, 0, "fpp-vastfmt"); ?></p>
<p>RDS Type: <?php PrintSettingSelect("RDS Type", "RdsType", 1, 0, "RT+", Array("Disabled"=>"disabled", "RT+"=>"rtp", "RT"=>"rt", "PS"=>"ps"), "fpp-vastfmt", "toggleStation"); ?></p>
<p>RDS Static Text: <?php PrintSettingText("RDSStaticText", 1, 0, 50, 50, "vastfmt"); ?><?php PrintSettingSave("RDS Static Text", "RDSStaticText", 1, 0, "fpp-vastfmt"); ?></p>
<p>Station ID: <?php PrintSettingText("Station", 1, 0, 4, 4, "vastfmt"); ?><?php PrintSettingSave("Station ID", "Station", 1, 0, "fpp-vastfmt"); ?></p>

</fieldset>
</div>
Expand Down

0 comments on commit c551965

Please sign in to comment.