home *** CD-ROM | disk | FTP | other *** search
- on cdPlay track
- global cd
- return
- if not objectp(cd) then
- exit
- end if
- set mode to cd(mStatus, "mode")
- if voidp(track) then
- if mode = "playing" then
- exit
- else
- set track to EMPTY
- end if
- end if
- if integerp(track) then
- set track to string(track) & ":0:0:0"
- end if
- if (track = EMPTY) or (track contains "from") then
- cd(mPlay, track)
- else
- cd(mPlay, "from" && track)
- end if
- end
-
- on cdNextTrack
- return
- set theMode to cdGetMode()
- set track to cdGetTrack() + 1
- if theMode = "playing" then
- cdPlay(track)
- else
- cdSeek(track)
- end if
- end
-
- on cdLastTrack
- return
- set theMode to cdGetMode()
- set track to cdGetTrack() - 1
- if theMode = "playing" then
- cdPlay(track)
- else
- cdSeek(track)
- end if
- end
-
- on cdSeek track
- global cd
- return
- cd(mSeek, " to " & track & ":0:0:8")
- end
-
- on cdSkipTo sec
- global cd
- return
- cd(mSet, "time format ms")
- set pos to cd(mStatus, "position")
- set whereTo to string(integer(pos + (sec * 1000)))
- cd(mPlay, "from " & whereTo)
- set pos to cd(mStatus, "position")
- end
-
- on cdGetTrack
- global cd
- return
- set curTrack to cd(mStatus, "current track")
- return integer(curTrack)
- end
-
- on cdGetPos
- global cd
- return
- if objectp(cd) then
- if cd(mStatus, "mode") = "open" then
- return "No CD Present"
- else
- cd(mSet, "time format tmsf")
- set cdTime to cd(mStatus, "position")
- return cdTime
- end if
- end if
- end
-
- on upTheVol
- global Vol, cd
- return
- set Vol to Vol + 10
- cd(mSetVolume, Vol, Vol)
- end
-
- on downTheVol
- global Vol, cd
- return
- set Vol to Vol - 10
- cd(mSetVolume, Vol, Vol)
- end
-