HERCPROC callback


Hercules event handling callback function.

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

Parameters

dwAction

The event that has been sent from the Hercules.

 

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

HERC_MODE

HERC_PLAY

HERC_CUE

HERC_AUTOBEAT       

HERC_TRACKPREV

HERC_TRACKNEXT

HERC_ONE

HERC_TWO

HERC_THREE

HERC_PITCHBEND_UP

HERC_PITCHBEND_DOWN

HERC_PREVIEW

HERC_MASTERTEMPO

HERC_MOUSEBUTTON

HERC_BASS

HERC_MEDIUM

HERC_TREBLE

HERC_PITCH

HERC_VOLUME

HERC_JOGWHEEL

HERC_CROSSFADER

HERC_JOYSTICK_HOR

HERC_JOYSTICK_VER

 

Mode button event

Play button event

Cue button event

Autobeat button event

Track previous button event

Track next button event

One button event

Two button event

Three button event

Pitch bend up button event

Pitch bend down button event

Preview button event

Master tempo button event

Mouse button event

Bass event

Medium event

Treble event

Pitch event

Volume event

Jog wheel event

Crossfader event

Joystick horizontal event

Joystick vertical event

 

 

dwValue

The value associated with the event or action if any.

user

The user instance data given when HERC_EventCallbackSet was called.

Remarks
This function will receive all event sent from the HERCULES 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(HERC_Init())

{

      HERC_EventCallbackSet((HERCPROC*)&HERCDeckAHandler,(HERCPROC*)&HERCDeckBHandler, (DWORD)this);

}

 

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

{

      if(dwAction == HERC_MODE && dwValue == 127)

      {

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

      }

      else if(dwAction == HERC_MODE && dwValue == 0)

      {

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

      }

}

 

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

{

      if(dwAction == HERC_MODE && dwValue == 127)

      {

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

      }

      else if(dwAction == HERC_MODE && dwValue == 0)

      {

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

      }

}

See also
HERC_EventCallbackSet