Class to provide an interface for controlling a CD player without using the Microsoft Multimedia Control
|
Procedure Name
|
Type
|
Description
|
|
(Declarations)
|
Declarations
|
Declarations and private variables for the CCD class
|
|
Minutes
|
Property
|
Returns the Minute position of the CD
|
|
Seconds
|
Property
|
Gets the current Seconds position of the CD
|
|
Track
|
Property
|
Sets the track position
|
|
Tracks
|
Property
|
Gets the tracks collection.
The Tracks collection contains an item for each track on the CD. The data stored in each item is the length of the track in seconds. The following code prints the length of each track on a CD.
For intTrackCounter = 1 To cd.Tracks.Count
Debug.Print "Track " & intTrackCounter & " is " & cd.Tracks(intTrackCounter) & " seconds long"
Next intTrackCounter
|
|
Class_Initialize
|
Initialize
|
Set initial values
|
|
Class_Terminate
|
Terminate
|
Make sure the CD resource is closed
|
|
CloseCD
|
Method
|
Closes the CD resource
|
|
dblToLong
|
Private
|
This routine does an unsigned conversion from a Double value to a Long value.
This function correctly handles doubles greater than 2,147,483,647 and less than or equal to 4,294,967,295.
|
|
Eject
|
Method
|
Ejects the CD from the drive
|
|
EnumTracks
|
Private
|
Enumerates the tracks on a cd
|
|
GetPosition
|
Private
|
Returns the current of the playback of the MCI device
|
|
IntToByte
|
Private
|
This routine does an unsigned conversion from an integer value to a byte value. This procedure correctly handles any integer value.
|
|
IntToLong
|
Private
|
This routine converts an integer value to a long value, treating the integer as unsigned.
This function treats the integer as though it were unsigned. For example, performing the following assignment
lngNumber = -1
assigns -1 to the variable lngNumber. However, This assignment
lngNumber = IntToLong(-1)
assigns 65,535 to lngNumber.
|
|
LongToDbl
|
Private
|
This routine converts a Long value to a Double value, treating the long as unsigned.
This function treats the long as though it were unsigned. For example, performing the following assignment
dblNumber = -1
assigns -1 to the variable dblNumber. However, This assignment
dblNumber = LongToDbl(-1)
assigns 4,294,967,295 to dblNumber.
|
|
LongToInt
|
Private
|
This routine does an unsigned conversion from a long value to an integer value
|
|
MCI_MAKE_TMSF
|
Private
|
Converts from Tracks/Minute/Seconds to a position usable by MCI
|
|
MCI_TMSF_MINUTE
|
Private
|
Converts a position returned from MCI to a minute values
|
|
MCI_TMSF_SECOND
|
Private
|
Converts a position returned from MCI to a seconds values
|
|
MCI_TMSF_TRACK
|
Private
|
Converts a position returned from MCI to a track values
|
|
OpenCD
|
Method
|
Opens the CD resource
|
|
Pause
|
Method
|
Pauses CD Play
|
|
Play
|
Method
|
Plays the CD
|
|
SetPosition
|
Private
|
Sets the current position of the MCI playback
|
|
Shli
|
Private
|
Shifts a numeric value left the specified number of bits.
Left shifting can be defined as a multiplication operation. For the number of bits we want to shift a value to the left, we need to raise two to that power, then multiply the result by our original value.
|
|
Shll
|
Private
|
Shifts a numeric Value left the specified number of bits.
Left shifting can be defined as a multiplication operation. For the number of bits we want to shift a value to the left, we need to raise two to that power, then multiply the result by our original value.
|
|
Shri
|
Private
|
Shifts a Long value right the selected number of places.
Right shifting can be defined as a division operation. For the number of bits we want to shift a value to the right, we need to raise two to that power, then our original value by the result.
|
|
Shrl
|
Private
|
Shifts a Long value right the selected number of places.
Right shifting can be defined as a division operation. For the number of bits we want to shift a value to the right, we need to raise two to that power, then our original value by the result.
|
|
StopCD
|
Method
|
Stops the CD
|