DAC2PROC callback


DAC-2 event handling callback function.

void CALLBACK YourHandlerProc(
    DWORD dwAction,
    DWORD dwValue,
    DWORD user
);

Parameters

dwAction

The event that has been sent from the DAC-2.

 

The value could be equal to any of the following event codes

DAC2_LOAD_DOWN

DAC2_LOAD_UP

DAC2_CUE_DOWN

DAC2_CUE_UP

DAC2_PLAY_DOWN

DAC2_PLAY_UP

DAC2_WAIT_DOWN

DAC2_WAIT_UP

DAC2_SHIFT_DOWN

DAC2_SHIFT_UP

DAC2_FX_DOWN

DAC2_FX_UP

DAC2_CUE_LEFT_DOWN

DAC2_CUE_LEFT_UP

DAC2_CUE_RIGHT_DOWN

DAC2_CUE_RIGHT_UP

DAC2_GROUP_DOWN

DAC2_GROUP_UP

DAC2_LOOP_DOWN

DAC2_LOOP_UP

DAC2_MATCH_DOWN

DAC2_MATCH_UP

DAC2_PITCHBEND_PLUS_DOWN

DAC2_PITCHBEND_PLUS_UP

DAC2_PITCHBEND_MINUS_DOWN

DAC2_PITCHBEND_MINUS_UP

DAC2_PITCH_SLIDER

DAC2_JOG_LEFT

DAC2_JOG_RIGHT

DAC2_SEEK_START

DAC2_SEEK_END

DAC2_SEEK_FWD_1_ON

DAC2_SEEK_FWD_1_OFF

DAC2_SEEK_FWD_2_ON

DAC2_SEEK_FWD_2_OFF

DAC2_SEEK_FWD_3_ON

DAC2_SEEK_FWD_3_OFF

DAC2_SEEK_FWD_4_ON

DAC2_SEEK_FWD_4_OFF

DAC2_SEEK_FWD_5_ON

DAC2_SEEK_FWD_5_OFF

DAC2_SEEK_FWD_6_ON

DAC2_SEEK_FWD_6_OFF

DAC2_SEEK_FWD_7_ON

DAC2_SEEK_FWD_7_OFF

DAC2_SEEK_REV_1_ON

DAC2_SEEK_REV_1_OFF

DAC2_SEEK_REV_2_ON

DAC2_SEEK_REV_2_OFF

DAC2_SEEK_REV_3_ON

DAC2_SEEK_REV_3_OFF

DAC2_SEEK_REV_4_ON

DAC2_SEEK_REV_4_OFF

DAC2_SEEK_REV_5_ON

DAC2_SEEK_REV_5_OFF

DAC2_SEEK_REV_6_ON

DAC2_SEEK_REV_6_OFF

DAC2_SEEK_REV_7_ON

DAC2_SEEK_REV_7_OFF

DAC2_SEEK_REV_8_ON

DAC2_SEEK_REV_8_OFF

Load button is pushed down

Load button is released

Cue button is pushed down

Cue button is released

Play button is pushed down

Play button is released

Wait button is pushed down

Wait button is released

Shift button is pushed down

Shift button is released

FX button is pushed down

FX button is released

Cue Seek Left button is pushed down

Cue Seek Left button is released

Cue Seek Right button is pushed down

Cue Seek Right button is released

Group button is pushed down

Group button is released

Loop button is pushed down

Loop button is released

Match button is pushed down

Match button is released

Pitch Bend Plus button is pushed down

Pitch Bend Plus button is released

Pitch Bend Minus button is pushed down

Pitch Bend Minus button is released

Pitch slider is being moved (check dwValue for position between –63 and 63)

Jog wheel moved left

Jog wheel moved right

Seeking just started

Seeking just ended

Seek Forward position 1 has been reached

Seek Forward position 1 has been left

Seek Forward position 2 has been reached

Seek Forward position 2 has been left

Seek Forward position 3 has been reached

Seek Forward position 3 has been left

Seek Forward position 4 has been reached

Seek Forward position 4 has been left

Seek Forward position 5 has been reached

Seek Forward position 5 has been left

Seek Forward position 6 has been reached

Seek Forward position 6 has been left

Seek Forward position 7 has been reached

Seek Forward position 7 has been left

Seek Reverse position 1 has been reached

Seek Reverse position 1 has been left

Seek Reverse position 2 has been reached

Seek Reverse position 2 has been left

Seek Reverse position 3 has been reached

Seek Reverse position 3 has been left

Seek Reverse position 4 has been reached

Seek Reverse position 4 has been left

Seek Reverse position 5 has been reached

Seek Reverse position 5 has been left

Seek Reverse position 6 has been reached

Seek Reverse position 6 has been left

Seek Reverse position 7 has been reached

Seek Reverse position 7 has been left

Seek Reverse position 8 has been reached

Seek Reverse position 8 has been left

dwValue

The value associated with the event or action if any. Note: Only the DAC2_PITCH_SLIDER event uses this parameter.

user

The user instance data given when DAC2_EventCallbackSet was called.

Remarks
This function will receive all event sent from the DAC-2 controller. If the event is a button you will receive an event for the DOWN and the UP of a button so that way you can determine if a button is being held down or not. If the event is the pitch slider you will receive the position of the slider in the dwValue parameter from –63 to 63.

Example
Two callback functions, one to handle DeckA events and one to handle DeckB events.

if(DAC2_Init("com4"))

{

      DAC2_EventCallbackSet((DAC2PROC*)&DAC2DeckAHandler,(DAC2PROC*)&DAC2DeckBHandler, (DWORD)this);

}

 

void CALLBACK DAC2DeckAHandler(DWORD dwAction, DWORD dwValue, DWORD user)

{

      if(dwAction == DAC2_LOAD_DOWN)

      {

            MessageBox(“Load Button Down”, “Load Button Down”, MB_ICONINFORMATION|MB_OK);

      }

      else if(dwAction == DAC2_LOAD_UP)

      {

            MessageBox(“Load Button Up”, “Load Button Up”, MB_ICONINFORMATION|MB_OK);

      }

}

 

void CALLBACK DAC2DeckBHandler(DWORD dwAction, DWORD dwValue, DWORD user)

{

      if(dwAction == DAC2_LOAD_DOWN)

      {

            MessageBox(“Load Button Down”, “Load Button Down”, MB_ICONINFORMATION|MB_OK);

      }

      else if(dwAction == DAC2_LOAD_UP)

      {

            MessageBox(“Load Button Up”, “Load Button Up”, MB_ICONINFORMATION|MB_OK);

      }

}

See also
DAC2_EventCallbackSet