home *** CD-ROM | disk | FTP | other *** search
- /*
- \\ Song.amirx 2.3 -- Announce which tune is playing
- // Copyright ⌐1998-2000 Jamie van den Berge <entity@vapor.com>
- \\
- // Supports DeliTracker, SongPlayer, AMPlifier, EaglePlayer, HippoPlayer and AmigaAMP
- \\
- // Usage: /RX Song
- \\
- */
-
- SIGNAL ON SYNTAX
-
- OPTIONS RESULTS
-
- port = ADDRESS()
-
- pattern = 0; patterns = 0
- subsong = 0; subsongs = 0
- playing = 0
-
- title = ""; filename = ""
- author = ""
- not = ""
-
- IF SHOW( "P", "DELITRACKER" ) THEN SIGNAL DELITRACKER
- IF SHOW( "P", "AMPLIFIER.1" ) THEN SIGNAL AMPLIFIER
- IF SHOW( "P", "SONGPLAYER.1" ) THEN SIGNAL SONGPLAYER
- IF SHOW( "P", "rexx_EP" ) THEN SIGNAL EAGLEPLAYER
- IF SHOW( "P", "HIPPOPLAYER" ) THEN SIGNAL HIPPOPLAYER
- IF SHOW( "P", "AMIGAAMP" ) THEN SIGNAL AMIGAAMP
-
- CALL LOCAL( "½Song╗", 3, "No supported player found running" )
- EXIT
-
- /*
- \\ Gather relevant data about the tune currently playing
- */
-
- /* AMPlifier */
- AMPLIFIER:
- ADDRESS "AMPLIFIER.1"
- GETTAGINFO STEM tag
- QUERYSELECTED NAME
- filename = MYFILEPART( RESULT )
-
- "PLAYSTATE";
- IF RESULT = 1 THEN not = "not "
- IF RESULT = 2 THEN not = "temporarily not "
-
- IF( tag.ready = 1 ) THEN DO
- DROP title author
- title = tag.title
- author = tag.artist
- END
-
- SIGNAL REPORT
-
- /* AmigaAMP */
- AMIGAAMP:
- "SAY /ME is playing an mp3, though he has no clue which one as AmigaAMP lacks crucial ARexx commands"
- EXIT
-
- /* DeliTracker II */
- DELITRACKER:
- ADDRESS "DELITRACKER"
-
- "STATUS G ply"; IF RESULT = 'no' THEN not = "not "
- "STATUS M nam"; title = STRIP( RESULT )
- "STATUS M fil"; filename = RESULT
-
- SIGNAL REPORT
-
- /* EaglePlayer2 */
- EAGLEPLAYER:
- ADDRESS "rexx_EP"
- "STATUS G ply"; IF RESULT = "no" THEN not = "not "
- "STATUS M son"; title = STRIP( RESULT )
- "STATUS M fil"; filename = RESULT
- subsong2 = 0
-
- "STATUS M len"; IF RESULT ~= "RESULT" THEN patterns = RESULT
- "STATUS M pon"; IF RESULT ~= "RESULT" THEN pattern = RESULT
- "STATUS M aut"; IF RESULT ~= "RESULT" THEN author = RESULT
- "STATUS G snd"; IF RESULT ~= "RESULT" THEN subsong = RESULT
- "STATUS M min"; IF RESULT ~= "RESULT" THEN subsong2 = RESULT
- "STATUS M max"; IF RESULT ~= "RESULT" THEN subsongs = RESULT
-
- IF ( not ~= "" ) & ( pattern > 0 ) THEN not = "temporarily not " /* assume pause */
-
- IF subsong2 = 0 THEN
- subsongs = ( subsongs - subsong2 ) + 1
-
- SIGNAL REPORT
-
- /* HippoPlayer */
- HIPPOPLAYER:
- ADDRESS "HIPPOPLAYER"
-
- get name; title = STRIP( RESULT )
- get cspo; pattern = RESULT
- get mspo; patterns = RESULT
- get csng; subsong = RESULT
- get nsng; subsongs = RESULT
- get play; IF ~RESULT THEN not = "not "
-
- SIGNAL REPORT
-
- EXIT
-
- /* SongPlayer */
- SONGPLAYER:
- ADDRESS "SONGPLAYER.1"
- GET_STATE;
- IF RESULT = "PAUSE" THEN not = "temporarily not "
- IF RESULT = "STOP" THEN not = "not "
-
- GET_ARTIST; author = RESULT
- GET_TITLE ; title = RESULT
- GET_FILEPATH; filename = MYFILEPART( RESULT )
-
- SIGNAL REPORT
- EXIT
-
- /*
- \\ Generates a report from collected data
- */
- REPORT:
- ADDRESS VALUE port
-
- status = ""
- IF ( title = "" ) | ( title = "<?>" ) | ( INDEX( title, "NoName" ) > 0 ) THEN title = filename
- IF ( title ~= "" ) & ( title ~= "RESULT" ) THEN DO
- IF subsongs > 1 THEN status = "#"subsong"/"subsongs; ELSE status = ""
- IF patterns > 1 THEN status = status pattern"/"patterns
- status = STRIP( STRIP( status, "B", "," ) )
- IF status ~= "" THEN status = "[" || status || "]"
- IF author ~= "" THEN author = author || " - "
- "SAY /ME is" not || "playing:" d2c(2) || author || title || d2c(2) status
- END; ELSE DO
- "SAY /ME is not playing anything"
- END
-
- EXIT
-
- LOCAL:"ECHO P="d2c(27)"b"ARG(1)" C="ARG(2) ARG(3); RETURN
- SYNTAX: ADDRESS VALUE port; "ECHO" ERRORTEXT( RC ) "on line" SIGL; EXIT
-
- MYFILEPART:
- file = REVERSE( ARG(1) )
- indx = INDEX( file, "/" )
- IF indx > 0 THEN file = LEFT( file, indx-1 )
- file = REVERSE( file )
- RETURN file
-
-