C++ API Reference
MPxMidiInputDevice Class Reference

Midi input device. More...

#include <MPxMidiInputDevice.h>

Public Member Functions

virtual MStatus openDevice ()
 Open the midi device. More...
 
virtual void closeDevice ()
 Close the midi device.
 
virtual void nameAxes ()
 Assign names to the axes of the device.
 
virtual void nameButtons ()
 Assign names to the buttons of the device.
 
virtual MDeviceStatedeviceState ()
 Return the current state of the input device. More...
 
virtual MStatus sendMessage (const char *const messageType, const char *const messageParams)
 If this midi event belongs to this device then fiil up the MDeviceState. More...
 
virtual char * getMessage (const char *const messageType, char *messageResponse)
 User should override this method. More...
 
virtual void doButtonEvents (bool=true)
 This method is used to specify whether this device is accepting button events from its child. More...
 
virtual void doMovementEvents (bool=true)
 This method is used to specify whether this device is accepting movement input from its child. More...
 

Static Public Member Functions

static const char * className ()
 Returns the name of this class. More...
 

Protected Member Functions

MStatus setNamedButton (const MString &, unsigned short)
 Set the name of the specified button. More...
 
MStatus addChannel (MDeviceChannel &)
 Add the given channel to this device. More...
 
MStatus setDegreesOfFreedom (int freedom)
 Set the degrees of freedom for this device. More...
 
MStatus setNumberOfButtons (int buttons)
 Set the number of buttons for this device. More...
 

Detailed Description

Midi input device.

This is the base class for user defined MIDI input devices.

Child classes of MPxMidiInputDevice should define:

  • a constructor which defines number of buttons and axes
  • nameAttributes() which names the buttons and axes (optional)
  • deviceState() which turns a midi event into an MDeviceState or returns NULL if it is not a midi event from this device

Member Function Documentation

MStatus openDevice ( )
virtual

Open the midi device.

Returns
Status code.
MDeviceState * deviceState ( )
virtual

Return the current state of the input device.

Returns
Device state object.
MStatus sendMessage ( const char *const  messageType,
const char *const  messageParams 
)
virtual

If this midi event belongs to this device then fiil up the MDeviceState.

Otherwise return NULL. The user should override this method.

User should override this method.

Parameters
[in]messageTypeMessage to send.
[in]messageParamsMessage parameters.
Returns
Status code.
char * getMessage ( const char *const  messageType,
char *  messageResponse 
)
virtual

User should override this method.

Parameters
[in]messageType
[out]messageResponse
void doButtonEvents ( bool  val = true)
virtual

This method is used to specify whether this device is accepting button events from its child.

Parameters
[in]val
void doMovementEvents ( bool  val = true)
virtual

This method is used to specify whether this device is accepting movement input from its child.

Parameters
[in]val
const char * className ( )
static

Returns the name of this class.

Returns
Name of this class.
MStatus setNamedButton ( const MString buttonName,
unsigned short  button 
)
protected

Set the name of the specified button.

Parameters
[in]buttonNameName of button.
[in]buttonIndex of button.
MStatus addChannel ( MDeviceChannel channel)
protected

Add the given channel to this device.

Parameters
[in]channelChannel to add.
MStatus setDegreesOfFreedom ( int  freedom)
protected

Set the degrees of freedom for this device.

Parameters
[in]freedomNew degrees of freedom value.
MStatus setNumberOfButtons ( int  buttons)
protected

Set the number of buttons for this device.

Parameters
[in]buttonsNew number of buttons.

The documentation for this class was generated from the following files: