MidiDjConsole.CallbackEventSet method |
|
Remarks
Sets or resets the callback function that will manage the notification that an event was received from connected DJ console.
For further details about input events management see the How to synchronize the container application with the control tutorial.
For further details about interfacing with MIDI DJ Consoles see the MidiDjConsole object section and the How to manage MIDI DJ consoles tutorial.
Syntax
[Visual Basic] control.MidiDjConsole.CallbackEventSet ( nEventType as enumDjConsoleEventType, pCallback as Long, nUserdata as Long ) as enumDjcErrorCodes |
[C++] short control.MidiDjConsole.CallbackEventSet ( short nDeviceUniqueId, const VARIANT FAR& bRawEvent, long pCallback, long nUserdata ); |
Parameter |
Description |
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
nEventType |
The type of event that will generate a call to the given callback in place of the corresponding event. Supported values are the following:
|
||||||||||||||||||||||||||||||
pCallback |
Pointer to the callback function containing the code that will manage the event. When the callback function is set, the control will not fire the corresponding event. Set this value to 0 in order to reset the usage of the callback function and to manage again incoming events through the corresponding event.
Callback functions are defined like this:
For DJC_EVENT_TYPE_UNMAPPED type
[Visual Basic]
Public Sub UnmappedEventCallback ( ByVal nMidiCommand As Integer, ByVal nMidiChannel As Integer, ByVal nMidiData1 As Integer, ByVal nMidiData2 As Integer, ByVal nTimeStamp As Long, ByVal nUserData As Long )
[Visual C++]
void CALLBACK UnmappedEventCallback ( short nMidiCommand, short nMidiChannel, short nMidiData1, short nMidiData2, long nTimeStamp, long nUserData );
where:
For DJC_EVENT_TYPE_BUTTON_PRESSED and DJC_EVENT_TYPE_BUTTON_RELEASED types
[Visual Basic]
Public Sub ButtonEventCallback ( ByVal strControlName As String, ByVal nControlNameLength As Long, ByVal nTimeStamp As Long, ByVal nUserData As Long )
[Visual C++]
void CALLBACK ButtonEventCallback ( wchar_t *strControlName, long nControlNameLength, long nTimeStamp, long nUserData );
where:
For DJC_EVENT_TYPE_RANGE_MOVED type
[Visual Basic]
Public Sub RangeCtrlMovedEventCallback ( ByVal strControlName As String, ByVal nControlNameLength As Long, ByVal nValue As Integer, ByVal nTimeStamp As Long, ByVal nUserData As Long )
[Visual C++]
void CALLBACK RangeCtrlMovedEventCallback ( wchar_t *strControlName, long nControlNameLength, short nValue, long nTimeStamp, long nUserData );
where:
|
||||||||||||||||||||||||||||||
nUserdata |
User instance data to pass to the callback function |
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 |