From 9a8548badacc7229e7a9fb2b03d6f126ca80dd4c Mon Sep 17 00:00:00 2001 From: jasoveen Date: Tue, 4 Oct 2016 17:02:43 -0400 Subject: [PATCH 1/5] JQ was using relative path Changed call to JQ to use full path instead of relative path --- callbacks.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/callbacks.sh b/callbacks.sh index a7d04e0..1cce7ba 100755 --- a/callbacks.sh +++ b/callbacks.sh @@ -107,8 +107,8 @@ case $operation in fi # Use jq to parse our JSON data - artist=$(echo $DATA | ./jq/jq -r ".artist") - title=$(echo $DATA | ./jq/jq -r ".title") + artist=$(echo $DATA | $(dirname $0)/jq/jq -r ".artist") + title=$(echo $DATA | $(dirname $0)/jq/jq -r ".title") # Try to grab artist if Media exists. This assumes the filename # is "Artist - Title.extension" From 886e1d88efcd8016ee2dbf629ceb5f06d03da522 Mon Sep 17 00:00:00 2001 From: jasoveen Date: Tue, 4 Oct 2016 17:31:41 -0400 Subject: [PATCH 2/5] Fixed RDS setting Remove double qoutes from RDS setting so setting is now correctly works --- callbacks.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/callbacks.sh b/callbacks.sh index 1cce7ba..5939ce2 100755 --- a/callbacks.sh +++ b/callbacks.sh @@ -75,7 +75,7 @@ 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*//") +rds_setting=$(grep -i "^RdsType\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*//") From 2dde348091645e7c4864dd7efb868617c3d76d2c Mon Sep 17 00:00:00 2001 From: jasoveen Date: Tue, 4 Oct 2016 22:02:23 -0400 Subject: [PATCH 3/5] Update station only when set If station is blank or not set don't update the RDS setting. Removed surrounding double quotes for station setting. --- callbacks.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/callbacks.sh b/callbacks.sh index 5939ce2..0ddef52 100755 --- a/callbacks.sh +++ b/callbacks.sh @@ -78,7 +78,7 @@ 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/") 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*//") +station=$(grep -i "^Station\s*=.*" ${CFGDIR}/plugin.vastfmt | sed -e "s/.*=\s*\"\(.*\)\"/\1/") if [ -n "$DEBUG" ]; then @@ -192,7 +192,11 @@ case $operation in vast_args="$vast_args -f $frequency" fi if [ "x$rds_setting" != "xdisabled" ]; then - vast_args="$vast_args --rds -s $station" + if [ ${#station} -gt 0 ]; then + vast_args="$vast_args --rds -s \"$station\"" + else + vast_args="$vast_args --rds" + fi fi else echo "turn things off..." From 7b64a17c86e7a4d887cffb69e11a19e92c9c1791 Mon Sep 17 00:00:00 2001 From: jasoveen Date: Tue, 4 Oct 2016 22:24:14 -0400 Subject: [PATCH 4/5] RDS Type disable fixed RDS Type selection was getting disabled bu the set freq option. --- plugin_setup.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugin_setup.php b/plugin_setup.php index 76e0134..3112052 100644 --- a/plugin_setup.php +++ b/plugin_setup.php @@ -53,13 +53,11 @@ function toggleSettings() { $('#Frequency').prop("disabled", false); $('#saveFrequency').prop("disabled", false); - $('#RdsType').prop("disabled", false); } else { $('#Frequency').prop("disabled", true); $('#saveFrequency').prop("disabled", true); - $('#RdsType').prop("disabled", true); } } function toggleStation() From 1c9093bb33448d8e4fe28d17a605ac58cb802a85 Mon Sep 17 00:00:00 2001 From: jasoveen Date: Tue, 4 Oct 2016 22:42:55 -0400 Subject: [PATCH 5/5] RDS Static text Added option to set a static RDS radio text message when a playlist is not running or RDS is set to PS type --- callbacks.sh | 8 ++++++++ plugin_setup.php | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/callbacks.sh b/callbacks.sh index 0ddef52..055d52f 100755 --- a/callbacks.sh +++ b/callbacks.sh @@ -76,6 +76,7 @@ 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/") @@ -87,6 +88,7 @@ if [ -n "$DEBUG" ]; then echo "set transmit: $transmit_setting" >&2 echo "power: $power" >&2 echo "rds type: $rds_setting" >&2 + echo "rds static text: $rds_static_text" >&2 echo "set freq: $set_frequency" >&2 echo "frequency: $frequency" >&2 echo "station: $station" >&2 @@ -198,11 +200,17 @@ case $operation in vast_args="$vast_args --rds" fi fi + if [ ${#rds_static_text} -gt 0 ]; then + vast_args="$vast_args --rds-text \"$rds_static_text\"" + fi else echo "turn things off..." if [ "x$transmit_setting" == "x1" ]; then vast_args="$vast_args -n" fi + if [ ${#rds_static_text} -gt 0 ]; then + vast_args="$vast_args --rds-text \"$rds_static_text\"" + fi fi if [ -n "$DEBUG" ]; then diff --git a/plugin_setup.php b/plugin_setup.php index 3112052..02cf33c 100644 --- a/plugin_setup.php +++ b/plugin_setup.php @@ -64,11 +64,15 @@ function toggleStation() { if ($('#RdsType').val() == "disabled") { + $('#RDSStaticText').prop("disabled", true); + $('#saveRDSStaticText').prop("disabled", true); $('#Station').prop("disabled", true); $('#saveStation').prop("disabled", true); } else { + $('#RDSStaticText').prop("disabled", false); + $('#saveRDSStaticText').prop("disabled", false); $('#Station').prop("disabled", false); $('#saveStation').prop("disabled", false); } @@ -82,6 +86,7 @@ function toggleStation()

Set frequency on playlist start/stop:

Frequency: MHz

RDS Type: "disabled", "RT+"=>"rtp", "RT"=>"rt", "PS"=>"ps"), "vastfmt", "toggleStation"); ?>

+

RDS Static Text:

Station ID: