Copyright © 2001-2018 MultiMedia Soft

CallbackForCdDrivesEventsSet method

Previous pageReturn to chapter overviewNext page

Remarks

 

Sets a callback for receiving notification of events generated by CD drives, allowing to synchronize CD drives with the container application; the usage of this callback can be an alternative to the usage of regular events.

 

Syntax

 

[Visual Basic]

control.CallbackForCdDrivesEventsSet (

pCallback as Long

) as enumErrorCodes


 

[C++]

short control.CallbackForCdDrivesEventsSet (

long pCallback

);


 

Parameter

Description

 

 

pCallback

Pointer to the callback function that will receive CD drives related events. Remember that callback functions must be as fast as possible in order to avoid slowing down overall performances.

A callback function is defined like this:

 

[Visual Basic ]

 

Public Sub MyCdDriveCallback (

ByVal nEvent As enumCdDrivesEvents,

ByVal nCdDrive As Long,

ByVal nData1 As Long,

ByVal nData2 As Long,

ByVal nData3 As Long

)

 

[Visual C++]

 

void FAR PASCAL MyCdDriveCallback (

long nEvent,

long nCdDrive,

long nData1,

long nData2,

long nData3

);

 

where

nEvent

Event reported by the CD drive.

Supported values are the following:

Mnemonic constant

Value

Meaning with data parameters

EV_CD_READ_TRACK_START

0

Alternative to the CdReadTrackStart event.

Involved data parameters:

nData1: Number representing the one-based index of the CD audio track that is being loaded.

EV_CD_READ_TRACK_PERC

1

Alternative to the CdReadTrackPercentage event.

Involved data parameters:

nData1: Number representing the one-based index of the CD audio track that is being loaded.

nData2: Number representing the CD track loading advancement percentage.

EV_CD_READ_TRACK_STOP

2

Alternative to the CdReadTrackStop event.

Involved data parameters:

nData1: Number representing the one-based index of the CD audio track that is being loaded.

EV_CD_STATUS_CHANGED

3

Alternative to the CdPlayerStatusChanged event.

Involved data parameters:

nData1: Number representing the CD drive status. See the CdPlayerStatusChanged event for supported values.

EV_CDDB_SERVERS_AVAIL

4

Alternative to the CddbServersListAvailable event.

Involved data parameters:

nData1: The number of CDDB servers found. If this parameter value is 0, this means that an error occurred during the connection to the CDDB site.

EV_CDDB_ALBUM_INFO_AVAIL

5

Alternative to the CddbAlbumInfoAvailable event.

Involved data parameters:

nData1: Boolean value that specifies if the CDDB information was retrieved successfully. See the CddbAlbumInfoAvailable event for supported values.

EV_CD_COVER_URLS_AVAIL

6

Alternative to the CdCoverURLsAvailableEx event.

Involved data parameters:

nData1: The result of the CD cover retrieval attempt. See the CdCoverURLsAvailableEx event for supported values.

EV_CD_COVER_SMALL_FILE_AVAIL

7

Alternative to the CdCoverPictureFileAvailableEx event having the nSize parameter set to CD_COVER_SIZE_SMALL.

Involved data parameters:

nData1: The result of the CD cover retrieval attempt. See the CdCoverPictureFileAvailableEx event for supported values.

EV_CD_COVER_MEDIUM_FILE_AVAIL

8

Alternative to the CdCoverPictureFileAvailableEx event having the nSize parameter set to CD_COVER_SIZE_MEDIUM.

Involved data parameters:

nData1: The result of the CD cover retrieval attempt. See the CdCoverPictureFileAvailableEx event for supported values.

EV_CD_COVER_LARGE_FILE_AVAIL

9

Alternative to the CdCoverPictureFileAvailableEx event having the nSize parameter set to CD_COVER_SIZE_LARGE.

Involved data parameters:

nData1: The result of the CD cover retrieval attempt. See the CdCoverPictureFileAvailableEx event for supported values.

nCdDrive

Zero-based index of the CD drive reporting the event

nData1

First 32 bits integer value containing event specific data; its value and meaning depends upon the specific event received: see the table above for possible values.

nData2

Second 32 bits integer value containing event specific data; its value and meaning depends upon the specific event received: see the table above for possible values.

nData3

Third 32 bits integer value containing event specific data; currently unused, reserved for future developments.

 

 

 

Return value

 

Value

Meaning

 

 

Negative value

An error occurred, check the LastError property value in order to get the error code

enumErrorCodes.ERR_NOERROR (0)

The method call was successful