Copyright © 2001-2019 MultiMedia Soft

CallbackForPlayersEventsSet method

Previous pageReturn to chapter overviewNext page

Remarks

 

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

 

Syntax

 

[Visual Basic]

control.CallbackForPlayersEventsSet (

pCallback as Long

) as enumErrorCodes


 

[C++]

short control.CallbackForPlayersEventsSet (

long pCallback

);


 

Parameter

Description

 

 

pCallback

Pointer to the callback function that will receive player 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 MyPlayerCallback (

ByVal nEvent As enumPlayerEvents,

ByVal nPlayer As Integer,

ByVal nData1 As Long,

ByVal nData2 As Long,

ByVal fData3 As Single,

ByVal pBufferUnicode As Long,

ByVal nBufferLength As Long

)

 

[Visual C++]

 

void FAR PASCAL MyPlayerCallback (

long nEvent,

short nPlayer,

long nData1,

long nData2,

float fData3,

char *pBufferUnicode,

long nBufferLength

);

 

where

nEvent

Event reported by the player.

Supported values are the following:

Mnemonic constant

Value

Meaning with data parameters

EV_SOUND_DONE

0

Alternative to the SoundDone event.

Involved data parameters: none.

EV_SOUND_PLAYING

1

Alternative to the SoundPlaying event.

Involved data parameters: none.

EV_SOUND_PAUSED

2

Alternative to the SoundPaused event.

Involved data parameters: none.

EV_SOUND_STOPPED

3

Alternative to the SoundStopped event.

Involved data parameters: none.

EV_SOUND_LOADED

4

Alternative to the SoundLoaded event.

Involved data parameters:

nData1: Number representing the zero-based index of the song in the player playlist; if the song is not inserted into a playlist it's always set to 0.

EV_SOUND_SYNC_LOADED

5

Alternative to the SoundSyncLoaded event.

Involved data parameters:

nData1: The result of the loading operation. See the LastError property for details about the returned result code.

EV_META_CHANGED

6

Alternative to the MetaTagChanged event.

Involved data parameters: none.

EV_DOWNLOAD_COMPLETE

7

Alternative to the DownloadComplete event.

Involved data parameters: none.

EV_DOWNLOAD_BUFFERING

8

Alternative to the DownloadBuffering event.

Involved data parameters:

nData1: The buffering status.

EV_DOWNLOAD_PERC

9

Alternative to the DownloadPercentage event.

Involved data parameters:

nData1: Number representing the download percentage.

EV_STREAM_CONNECTING

10

Alternative to the StreamConnecting event.

Involved data parameters: none.

EV_STREAM_LOADED

11

Alternative to the StreamLoaded event.

Involved data parameters:

nData1: The stream loading result.

EV_STREAM_LOADED_FROM_INET_PLS

12

Alternative to the StreamLoadedFromInetPlaylist event.

Involved data parameters:

nData1: The stream loading result.

nData2: The zero-based index of the item.

pBufferUnicode: String containing the URL of the Internet stream.

EV_PLAYLIST_DONE

13

Alternative to the PlayListDone event.

Involved data parameters: none.

EV_PLAYLIST_SOUND_LOADED

14

Alternative to the PlaylistSoundLoaded event.

Involved data parameters:

nData1: Number representing the zero-based index of the song in the player playlist; if the song is not inserted into a playlist it's always set to 0.

pBufferUnicode: String containing a custom tag associated to this item.

EV_PLAYLIST_SOUND_LOAD_FAILED

15

Alternative to the PlayListSoundLoadFailure event.

Involved data parameters:

nData1: Number representing the zero-based index of the song in the player playlist; if the song is not inserted into a playlist it's always set to 0.

EV_PLAYLIST_STREAM_LOADED

16

Alternative to the PlayListStreamLoaded event.

Involved data parameters:

nData1: The zero based-index of the loaded item: in case of failure in loading the stream taken from the playlist this parameter would be set to -1.

EV_SOUND_CLOSED

17

Alternative to the SoundClosed event.

Involved data parameters: none.

EV_SERVER_CLOSED

18

Alternative to the ServerClosed event.

Involved data parameters: none.

EV_DURATION_CHANGED

19

Alternative to the SoundDurationChanged event.

Involved data parameters:

fData3: The updated sound duration expressed in seconds.

EV_VUMETER

20

Alternative to the VUMeterValueChange event.

Involved data parameters:

nData1: Number representing the peak value for the left channel: can assume values from 0 (no sound) to 32767 (max volume).

nData2: Number representing the peak value for the right channel: can assume values from 0 (no sound) to 32767 (max volume).

EV_SPECTRUM_CHANGE

21

Alternative to the SpectrumValueChange event.

Involved data parameters: none.

EV_BPM_AVAILABLE

22

Alternative to the BPMAvailable event.

Involved data parameters:

fData3: The detected song BPM.

EV_FADING_VOLUME_CHANGED

23

Alternative to the FadingVolumeChanged event.

Involved data parameters:

fData3: The player's current volume.

EV_FADING_POINT_REACHED

24

Alternative to the FadingPointReached event.

Involved data parameters: none.

EV_FADEIN_STARTED

25

Alternative to the FadeInStarted event.

Involved data parameters: none.

EV_FADEIN_COMPLETED

26

Alternative to the FadeInCompleted event.

Involved data parameters: none.

EV_FADEOUT_STARTED

27

Alternative to the FadeOutStarted event.

Involved data parameters: none.

EV_FADEOUT_COMPLETED

28

Alternative to the FadeOutCompleted event.

Involved data parameters: none.

EV_TRIGGER_REACHED

29

Alternative to the TriggerReached event.

Involved data parameters:

nData1: Number representing the trigger identifier.

EV_SILENCE_AVAIL

30

Alternative to the SilencePositionAvailable event.

Involved data parameters:

nData1: Number representing the position in milliseconds where the sound level is higher than the initial threshold. If no sound has been detected, due to the threshold level being higher respect to existing sound, this parameter is set to -1.

nData2: Number representing the position in milliseconds where the sound level is lower than the final threshold. If no sound has been detected, due to the threshold level being higher respect to existing sound, this parameter is set to -1.

EV_WAVE_ANALYSIS_START

31

Alternative to the WaveAnalysisStart event.

Involved data parameters: none.

EV_WAVE_ANALYSIS_PERC

32

Alternative to the WaveAnalysisPerc event.

Involved data parameters:

nData1: Number representing the percentage of advancement for the current sound analysis.

EV_WAVE_ANALYSIS_DONE

33

Alternative to the WaveAnalysisDone event.

Involved data parameters:

nData1: Number representing the amount of peaks detected during the sound's analysis.

fData3: Floating point number representing the duration in milliseconds of each detected peak.

EV_RANGE_LOOP_DONE

34

Alternative to the RangeLoopDone event.

Involved data parameters:

nData1: Number representing the amount of loops that must be still performed.

EV_WAV_EXPORT_START

35

Alternative to the ExportToWavStart event.

Involved data parameters: none.

EV_WAV_EXPORT_PERC

36

Alternative to the ExportToWavPerc event.

Involved data parameters:

nData1: Number representing the percentage of advancement for the current exporting session.

EV_WAV_EXPORT_COMPLETE

37

Alternative to the ExportToWavStop event.

Involved data parameters:

nData1: Number representing the total size, expressed in bytes, of the exported WAV file..

EV_EQUALIZER_LOADED

38

Alternative to the EqualizerLoaded event.

Involved data parameters: none.

EV_CUE_POINTS_LOADED

39

Alternative to the CuePointsLoaded event.

Involved data parameters: none.

EV_BEATS_AVAILABLE

40

Alternative to the BeatsAvailableOffline event.

Involved data parameters:

nData1: Number of beats detected.

EV_BEAT_DETECTED

41

Alternative to the BeatDetectedRealTime event.

Involved data parameters:

nData1: Beat's position expressed in milliseconds.

EV_PLAYLIST_LOAD_STARTED

42

Alternative to the PlayListLoadStart event.

Involved data parameters: none.

EV_PLAYLIST_LOAD_PERC

43

Alternative to the PlayListLoadPerc event.

Involved data parameters:

nData1: Number representing the percentage of advancement for the loading session.

EV_PLAYLIST_LOAD_DONE

44

Alternative to the PlayListLoadDone event.

Involved data parameters: none.

EV_CUE_POINT_REACHED

45

Alternative to the CuePointReached event.

Involved data parameters:

nData1: Number representing the position, expressed in milliseconds, of the cue point.

pBufferUnicode: String containing the unique name of the cue point as defined when the cue point was added through the CuePointsAdd method.

EV_VOLUME_POINT_REACHED

46

Alternative to the VolumeAutomationPointReached event.

Involved data parameters:

fData3: Number representing the position of the volume point expressed in the same unit set into the VolumeAutomation.PositionUnit property.

pBufferUnicode: String containing the friendly name of the volume point as defined when the volume point was added through the VolumeAutomation.PointAdd method.

EV_VOLUME_AUTOMATION_LOADED

47

Alternative to the VolumeAutomationLoaded event.

Involved data parameters: none.

EV_LYRICS_AVAIL

48

Alternative to the SoundLyricsAvailable event.

Involved data parameters:

nData1: The result of the lyrics search operation. See the LastError property for details about the returned result code. If the result is enumErrorCodes.ERR_NOERROR, lyrics text can be retrieved through the SoundLyricsGet method.

EV_SOUND_STALLED

49

Alternative to the StreamQueueStalled event.

Involved data parameters: none.

EV_AUDIO_EXTRACT_START

50

Alternative to the AudioExtractFromVideoStart event.

Involved data parameters: none.

EV_AUDIO_EXTRACT_PERC

51

Alternative to the AudioExtractFromVideoPerc event.

Involved data parameters:

nData1: Number representing the current percentage of the audio extraction.

EV_AUDIO_EXTRACT_DONE

52

Alternative to the AudioExtractFromVideoDone event.

Involved data parameters:

nData1: Boolean flag that warns when the extracted audio track, that was originally requested to be stored in memory, has been put into a temporary file due to missing memory space. If the original request was to store the extracted audio track inside a temporary file, this flag can be ignored.

nData2: Result of the audio extraction: see the LastError property for details about the specific error code.

EV_VOLUME_SLIDE_COMPLETED

53

Alternative to the VolumeSlideCompleted event.

Involved data parameters: none.

EV_PLAYER_DISCONNECTED

54

Alternative to the PlayerDisconnected event.

Involved data parameters: none.

EV_OUTPUT_DEVICE_CHANGED

55

Alternative to the OutputDeviceChanged event.

Involved data parameters:

nData1: Number representing the zero-based index of the new output device for the given player.

EV_SILENCE_DETECTION

56

Alternative to the SilenceDetectionStateChange event.

Involved data parameters:

nData1: Boolean value specifying detection of silent data or of audible data.

nData2: Number representing the position inside the sound stream, expressed in milliseconds, where the silence threshold was crossed.

nPlayer

Zero-based index of the player 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.

fData3

Third floating point value containing event specific data; its value and meaning depends upon the specific event received: see the table above for possible values.

pBufferUnicode

Pointer to the buffer; its value and meaning depends upon the specific event received: see the table above for possible values.

nBufferLength

The length in characters of the buffer above

 

 

 

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