ADDED contrib/cmdline/mpd-player Index: contrib/cmdline/mpd-player ================================================================== --- contrib/cmdline/mpd-player +++ contrib/cmdline/mpd-player @@ -0,0 +1,36 @@ +!/bin/bash +# title: MPD playback wrapper +# description: handles MPD playlist types from ST2 url input +# author: Rocus van Oosten +# version: 1.2 + +MPD_HOST=10.0.2.209 +export MPD_HOST + +ST=$1 # parameter 1 contains stream information + echo $ST #just for testing + +if [[ $ST == toggle ]] ; + then + mpc toggle +elif [[ $ST == louder ]] ; + then + mpc volume +5 +elif [[ $ST == softer ]] ; + then + mpc volume -5 +else + mpc clear + if [[ $ST == /* ]] ; + then # temp treamtuner2 file (starts with / ) + FN=basename $ST + scp $ST root@$MPD_HOST:/var/lib/mpd/music/WEBRADIO + mpc load WEBRADIO/$FN + elif [[ $ST == *pls* ]] || [[ $ST == *m3u* ]] || [[ $ST == *asx* ]] || [[ $ST == *ashx* ]] || [[ $ST == *xspf* ]] ; + then # stream (starts with http and is playlist) + mpc load $ST + else # stream (must be added to mpd) + mpc add $ST + fi + mpc play +fi ADDED contrib/cmdline/streamripper_addgenre Index: contrib/cmdline/streamripper_addgenre ================================================================== --- contrib/cmdline/streamripper_addgenre +++ contrib/cmdline/streamripper_addgenre @@ -0,0 +1,33 @@ +#!/bin/sh +# +# This is a helper script for adding genre ID3 tags for recorded +# radio stations. You have to change your player/recording settings +# to: +# streamripper_addgenre %srv %genre +# +# for it to work. Install this script in $HOME/bin for example. +# Don't forget to set the target DIR= parameter in here. +# It needs the "id3" commandline tool installed, but you can +# easily adapt it to "id3tag" or "mp3tag" or other utilities. +# + + +DIR=/home/$USER/Music/ + + +URL="$1" +GENRE="$2" + +#-- time stamp +touch /tmp/riptime + +#-- start recording +xterm -e streamripper "$URL" -d "$DIR" + + +#-- after terminal closes or streamripper ^C cancelled +# search for new files in target directory, and tag them + +find "$DIR" -anewer /tmp/riptime -type f \ + -exec id3 -g "$GENRE" '{}' ';' + DELETED contrib/streamripper_addgenre Index: contrib/streamripper_addgenre ================================================================== --- contrib/streamripper_addgenre +++ contrib/streamripper_addgenre @@ -1,33 +0,0 @@ -#!/bin/sh -# -# This is a helper script for adding genre ID3 tags for recorded -# radio stations. You have to change your player/recording settings -# to: -# streamripper_addgenre %srv %genre -# -# for it to work. Install this script in $HOME/bin for example. -# Don't forget to set the target DIR= parameter in here. -# It needs the "id3" commandline tool installed, but you can -# easily adapt it to "id3tag" or "mp3tag" or other utilities. -# - - -DIR=/home/$USER/Music/ - - -URL="$1" -GENRE="$2" - -#-- time stamp -touch /tmp/riptime - -#-- start recording -xterm -e streamripper "$URL" -d "$DIR" - - -#-- after terminal closes or streamripper ^C cancelled -# search for new files in target directory, and tag them - -find "$DIR" -anewer /tmp/riptime -type f \ - -exec id3 -g "$GENRE" '{}' ';' -