MidiInput Class Reference

Represents a midi input device. More...

List of all members.

Public Member Functions

virtual ~MidiInput ()
 Destructor.
virtual const String getName () const throw ()
 Returns the name of this device.
virtual void setName (const String &newName) throw ()
 Allows you to set a custom name for the device, in case you don't like the name it was given when created.
virtual void start ()
 Starts the device running.
virtual void stop ()
 Stops the device running.

Static Public Member Functions

static const StringArray getDevices ()
 Returns a list of the available midi input devices.
static int getDefaultDeviceIndex ()
 Returns the index of the default midi input device to use.
static MidiInputopenDevice (int deviceIndex, MidiInputCallback *callback)
 Tries to open one of the midi input devices.
static MidiInputcreateNewDevice (const String &deviceName, MidiInputCallback *callback)
 This will try to create a new midi input device (Not available on Windows).

Protected Member Functions

 MidiInput (const String &name)
 MidiInput (const MidiInput &)

Protected Attributes

String name
void * internal


Detailed Description

Represents a midi input device.

To create one of these, use the static getDevices() method to find out what inputs are available, and then use the openDevice() method to try to open one.

See also:
MidiOutput

Constructor & Destructor Documentation

virtual MidiInput::~MidiInput (  )  [virtual]

Destructor.

MidiInput::MidiInput ( const String name  )  [protected]

MidiInput::MidiInput ( const MidiInput  )  [protected]


Member Function Documentation

static const StringArray MidiInput::getDevices (  )  [static]

Returns a list of the available midi input devices.

You can open one of the devices by passing its index into the openDevice() method.

See also:
getDefaultDeviceIndex, openDevice

static int MidiInput::getDefaultDeviceIndex (  )  [static]

Returns the index of the default midi input device to use.

This refers to the index in the list returned by getDevices().

static MidiInput* MidiInput::openDevice ( int  deviceIndex,
MidiInputCallback callback 
) [static]

Tries to open one of the midi input devices.

This will return a MidiInput object if it manages to open it. You can then call start() and stop() on this device, and delete it when no longer needed.

If the device can't be opened, this will return a null pointer.

Parameters:
deviceIndex the index of a device from the list returned by getDevices()
callback the object that will receive the midi messages from this device.
See also:
MidiInputCallback, getDevices

static MidiInput* MidiInput::createNewDevice ( const String deviceName,
MidiInputCallback callback 
) [static]

This will try to create a new midi input device (Not available on Windows).

This will attempt to create a new midi input device with the specified name, for other apps to connect to.

Returns 0 if a device can't be created.

Parameters:
deviceName the name to use for the new device
callback the object that will receive the midi messages from this device.

virtual const String MidiInput::getName (  )  const throw () [virtual]

Returns the name of this device.

virtual void MidiInput::setName ( const String newName  )  throw () [virtual]

Allows you to set a custom name for the device, in case you don't like the name it was given when created.

virtual void MidiInput::start (  )  [virtual]

Starts the device running.

After calling this, the device will start sending midi messages to the MidiInputCallback object that was specified when the openDevice() method was called.

See also:
stop

virtual void MidiInput::stop (  )  [virtual]

Stops the device running.

See also:
start


Member Data Documentation

String MidiInput::name [protected]

void* MidiInput::internal [protected]


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

Generated on Fri Nov 20 12:00:45 2009 for JUCE by  doxygen 1.5.9