# At least ices_get_next must be defined. And, like all perl modules, it # must return 1 at the end. # Function called to initialize your python environment. # Should return 1 if ok, and 0 if something went wrong. sub ices_init { print "Perl subsystem Initializing:\n"; return 1; } # Function called to shutdown your python enviroment. # Return 1 if ok, 0 if something went wrong. sub ices_shutdown { print "Perl subsystem shutting down:\n"; } # Function called to get the next filename to stream. # Should return a string. sub ices_get_next { print "Perl subsystem quering for new track:\n"; #chomp $music[2]; $num=`/bin/ls /volume1/music/radio/*.mp3 | /usr/bin/wc -l`; @music=`/bin/ls -1 /volume1/music/radio/*.mp3`; $play=int(rand($num)); chomp $music[$play]; return $music[$play]; } # If defined, the return value is used for title streaming (metadata) sub ices_get_metadata { $tag = get_mp3tag($file) or die "No TAG info"; return "$tag->{TITLE} "; } # Function used to put the current line number of # the playlist in the cue file. If you don't care # about cue files, just return any integer. sub ices_get_lineno { return 1; } return 1;