## SwamiMidiDevice SwamiMidiDevice |

## Synopsis

                        SwamiMidiDevice;
    gboolean            swami_midi_device_open              (SwamiMidiDevice *device,
                                                             GError **err);
    void                swami_midi_device_close             (SwamiMidiDevice *device);
    SwamiControl *      swami_midi_device_get_control       (SwamiMidiDevice *device,
                                                             int index);

## Object Hierarchy

      GObject
       +----SwamiLock
             +----SwamiMidiDevice

## Description

## Details

### SwamiMidiDevice

    typedef struct _SwamiMidiDevice SwamiMidiDevice;

### swami_midi_device_open ()

    gboolean            swami_midi_device_open              (SwamiMidiDevice *device,
                                                             GError **err);

Open a MIDI device.

`device` : | Swami MIDI device
`err` : | Location to store error information or `NULL`
Returns : | `TRUE` on success, `FALSE` otherwise

### swami_midi_device_close ()

    void                swami_midi_device_close             (SwamiMidiDevice *device);

Close an active MIDI device.

`device` : | MIDI device object

### swami_midi_device_get_control ()

    SwamiControl *      swami_midi_device_get_control       (SwamiMidiDevice *device,
                                                             int index);

Get a MIDI control object from a MIDI device. A MIDI device may have multiple MIDI control interface channels (if supporting more than 16 MIDI channels for example), so index can be used to iterate over them. The MIDI device does NOT need to be active when calling this function.

`device` : | MIDI device object
`index` : | Index of control
Returns : | The MIDI control for the given `index`, or `NULL` if no control with that index. The reference count of the returned control has been incremented and is owned by the caller, remember to unref it when finished.