pub struct PortMidi { /* private fields */ }
Expand description

The PortMidi base struct. Initializes PortMidi on creation and terminates it on drop.

Implementations

Initializes the underlying PortMidi C library. PortMidi does not support hot plugging, this means that devices that are connect after calling new are not picked up.

Return the number of devices. This number will not change during the lifetime of the program.

Returns the PortMidiDeviceId for the default input device, or an Error::NoDefaultDevice if there is no available.

Returns the PortMidiDeviceId for the default output device, or an Error::NoDefaultDevice if there is no available.

Returns the DeviceInfo for the given device id or an Error::PortMidi(_) if the given id is invalid.

Returns a Vec<DeviceInfo> containing all known device infos. An Error::PortMidi(_) is returned if the info for a device can’t be obtained.

Creates an InputPort instance with the given buffer size for the default input device.

Creates an InputPort instance for the given device and buffer size. If the given device is not an input device an Error::NotAnInputDevice is returned.

Creates an OutputPort instance with the given buffer size for the default output device.

Creates an OutputPort instance for the given device and buffer size. If the given device is not an output device an Error::NotAnOutputDevice is returned.

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.