Managing Audio Cd In Notes

A little scriptlibrary with functions for managing audio cds from within a
notes database.
it also contains a function which calculates the CD key, which is needed to
access information from the CDDB databases on the Internet.
'mciLib:

Option Public


Dim RetInt As Long
Dim RetLength As Long
Dim RetHandle As Long
Dim RetString As String
Dim cdSecs As String
Type TOC
min As Long
sec As Long
frame As Long
End Type
Dim cdTOC () As TOC
Declare Function mciSendStringA Lib "winmm.dll" (Byval CMD$, Byval Ret$, Byval
RETLEN&, Byval HwndBack&) As Long
Function CDEject As Long
CDEject = mciSendStringA ("set cdaudio door open", "", 0, 0)
End Function

Function CDStop As Long
RetInt = mciSendStringA ("stop cdaudio", RetString, 63, 0)
CDStop = mciSendStringA ("close cdaudio", RetString, 63, 0)
End Function
Function CDPlay As Long
CDPlay = mciSendStringA ("play cdaudio", RetString, 63, 0)
End Function


Function CDClose As Long
CDClose = mciSendStringA ("set cdaudio door close", RetString, 63, 0)
End Function
Function CDSetTimeFormat (Form%) As Long
Select Case (Form% )
Case 1 : F$ = "ms"
Case 2 : F$ = "msf"
Case 3 : F$ = "tmsf"
End Select
mciString$ = "set cdaudio time format " & F$
CDSetTimeFormat = mciSendStringA ( mciString$, RetString, 63, 0)
End Function

Function CDNumOfTracks As Integer
RetString = Space (63)
RetInt = mciSendStringA ("status cdaudio number of tracks", RetString, 63,
0)
CDNumOfTracks = Val (Retstring)
End Function


Function CDCurrentTrack As Long
RetInt = mciSendStringA ("status cdaudio current track", RetString, 63, 0)
CDCurrentTrack = Val (RetString)
End Function
Function CDTrackLen (Track%) As String
mciString$ = "status cdaudio length track " & Str (Track%)
RetInt = mciSendStringA (mciString$, RetString, 10, 0)
CDTrackLen = Retstring
End Function

Function CDLength As String
RetString = Space (63)
RetInt = mciSendStringA ("status cdaudio length ", RetString, 63, 0)
CDLength = Retstring
End Function
Function CDTrackPos (Track%) As String
mciString$ = "status cdaudio position track " & Str (Track%)
RetInt = mciSendStringA (mciString$, RetString, 10, 0)
CDTrackPos = Trim$ (Retstring)
End Function
Function CDMode As String
RetString = Space (63)
RetInt = mciSendStringA ("status cdaudio mode", RetString, 63, 0)
CDMode = RetString
End Function

Function CDIsReady As Integer
RetString = Space (63)
CDIsReady = False
RetInt = mciSendStringA ("status cdaudio ready", RetString, 63, 0)
If Retstring = "true" Then
CDIsReady = True
End If
End Function


Function CDPause As Long
CDPause = mciSendStringA ("pause cdaudio", RetString, 63, 0)
End Function
Function CDSeekTo (Track%) As Long
mciString$ = "seek cdaudio to " & Str (Track%)
CDSeekTo = mciSendStringA (mciString$, RetString, 10, 0)
End Function

Function CDToStart As Long
CDToStart = mciSendStringA ("seek cdaudio to start", RetString, 63, 0)
End Function

Function CDToEnd As Long
CDToPlay = mciSendStringA ("seek cdaudio to end", RetString, 63, 0)
End Function
Function CDPlayFrom (Track%) As Long
mciString$ = "play cdaudio from " & Str (Track%)
CDPlayFrom = mciSendStringA (mciString$, RetString, 63, 0)
End Function

Function CDPlayFromTo (Track1%, Track2%) As Long
mciString$ = "play cdaudio from " & Str (Track1%) & " to " & Str(Track2%)
CDPlayFromTo = mciSendStringA (mciString$, RetString, 63, 0)
End Function

Function CDPrevTrack As Long
ret% = CDSetTimeFormat (3)
total% = CDNumOfTracks
current% = CDCurrentTrack
prev% = current% - 1
If CDIsPlaying Then
If prev% > 0 Then
CDPrevTrack = CDPlayFrom (prev%)
Else
CDPrevTrack = CDPlayFrom (total%)
End If
Else
If prev% > 0 Then
CDPrevTrack = CD
This was first published in November 2000

Dig deeper on Domino Resources - Part 4

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchDataCenter

SearchExchange

SearchContentManagement

Close