diff --git a/callbacks.sh b/callbacks.sh index a7d04e0..055d52f 100755 --- a/callbacks.sh +++ b/callbacks.sh @@ -75,10 +75,11 @@ 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/") +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*//") +station=$(grep -i "^Station\s*=.*" ${CFGDIR}/plugin.vastfmt | sed -e "s/.*=\s*\"\(.*\)\"/\1/") if [ -n "$DEBUG" ]; then @@ -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 @@ -107,8 +109,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" @@ -192,13 +194,23 @@ 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 + 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 76e0134..02cf33c 100644 --- a/plugin_setup.php +++ b/plugin_setup.php @@ -53,24 +53,26 @@ 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() { 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); } @@ -84,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: