- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Protected Member Functions

# MPxMidiInputDevice Class Reference
OpenMayaUI - API module for user interface | Proxy classes

Search for all occurrences

## 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

Examples:

  jlcVcrDevice.cpp.

`#include <MPxMidiInputDevice.h>`

List of all members.

## Public Member Functions
virtual MStatus | openDevice ()
| Open the midi device.
virtual void | closeDevice ()
| Close the midi device. Search for all occurrences
virtual void | nameAxes ()
| Assign names to the axes of the device. Search for all occurrences
virtual void | nameButtons ()
| Assign names to the buttons of the device.
virtual MDeviceState * | deviceState ()
| Return the current state of the input device.
virtual MStatus | sendMessage (const char *const messageType, const char *const messageParams)
| If this midi event belongs to this device then fiil up the MDeviceState.
virtual char * | getMessage (const char *const messageType, char *messageResponse)
| User should override this method.
virtual void | doButtonEvents (bool=true)
| This method is used to specify whether this device is accepting button events from its child.
virtual void | doMovementEvents (bool=true)
| This method is used to specify whether this device is accepting movement input from its child.
## Static Public Member Functions
static const char * | className ()
| Returns the name of this class.
## Protected Member Functions
MStatus | setNamedButton (const MString &, unsigned short)
| Set the name of the specified button.
MStatus | addChannel (MDeviceChannel &)
| Add the given channel to this device.
MStatus | setDegreesOfFreedom (int freedom)
| Set the degrees of freedom for this device.
MStatus | setNumberOfButtons (int buttons)
| Set the number of buttons for this device. Search for all occurrences

## Member Function Documentation

MStatus openDevice | ( |  | ) | `[virtual]`

Search for all occurrences

Open the midi device.

Returns:
  Status code.

MDeviceState * deviceState | ( |  | ) | `[virtual]`

Search for all occurrences

Return the current state of the input device.

Returns:
  Device state object.

Examples:
  jlcVcrDevice.cpp.

MStatus sendMessage | ( | const char *const | messageType,
|  | const char *const | messageParams
| ) |  | `[virtual]`

Search for all occurrences

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] | messageType | Message to send.
  [in] | messageParams | Message parameters.

Returns:
  Status code.

char * getMessage | ( | const char *const | messageType,
|  | char * | messageResponse
| ) |  | `[virtual]`

Search for all occurrences

User should override this method.

Parameters:

  [in] | messageType |
  [out] | messageResponse |

void doButtonEvents | ( | bool | val = `true` | ) | `[virtual]`

Search for all occurrences

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]`

Search for all occurrences

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

Parameters:

  [in] | val |

const char * className | ( |  | ) | `[static]`

Search for all occurrences

Returns the name of this class.

Returns:
  Name of this class.

MStatus setNamedButton | ( | const MString & | buttonName,
|  | unsigned short | button
| ) |  | `[protected]`

Search for all occurrences

Set the name of the specified button.

Parameters:

  [in] | buttonName | Name of button.
  [in] | button | Index of button.

MStatus addChannel | ( | MDeviceChannel & | channel | ) | `[protected]`

Search for all occurrences

Add the given channel to this device.

Parameters:

  [in] | channel | Channel to add.

MStatus setDegreesOfFreedom | ( | int | freedom | ) | `[protected]`

Search for all occurrences

Set the degrees of freedom for this device.

Parameters:

  [in] | freedom | New degrees of freedom value.

MStatus setNumberOfButtons | ( | int | buttons | ) | `[protected]`

Search for all occurrences

Set the number of buttons for this device.

Parameters:

  [in] | buttons | New number of buttons.

MPxMidiInputDevice MPxMidiInputDevice MPxMidiInputDevice MPxMidiInputDevice MPxMidiInputDevice MPxMidiInputDevice MPxMidiInputDevice MPxMidiInputDevice MPxMidiInputDevice MPxMidiInputDevice
MPxMidiInputDevice MPxMidiInputDevice MPxMidiInputDevice MPxMidiInputDevice MPxMidiInputDevice MPxMidiInputDevice MPxMidiInputDevice MPxMidiInputDevice MPxMidiInputDevice MPxMidiInputDevice