[−][src]Struct portmidi::PortMidi
The PortMidi base struct. Initializes PortMidi on creation and terminates it on drop.
Implementations
impl PortMidi
[src]
pub fn new() -> Result<Self>
[src]
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.
pub fn device_count(&self) -> PortMidiDeviceId
[src]
Return the number of devices. This number will not change during the lifetime of the program.
pub fn default_input_device_id(&self) -> Result<PortMidiDeviceId>
[src]
Returns the PortMidiDeviceId
for the default input device, or an Error::NoDefaultDevice
if
there is no available.
pub fn default_output_device_id(&self) -> Result<PortMidiDeviceId>
[src]
Returns the PortMidiDeviceId
for the default output device, or an Error::NoDefaultDevice
if
there is no available.
pub fn device(&self, id: PortMidiDeviceId) -> Result<DeviceInfo>
[src]
Returns the DeviceInfo
for the given device id or an Error::PortMidi(_)
if
the given id is invalid.
pub fn devices(&self) -> Result<Vec<DeviceInfo>>
[src]
Returns a Vec<DeviceInfo>
containing all known device infos.
An Error::PortMidi(_)
is returned if the info for a device can't be obtained.
pub fn default_input_port(&self, buffer_size: usize) -> Result<InputPort<'_>>
[src]
Creates an InputPort
instance with the given buffer size for the default input device.
pub fn input_port(
&self,
device: DeviceInfo,
buffer_size: usize
) -> Result<InputPort<'_>>
[src]
&self,
device: DeviceInfo,
buffer_size: usize
) -> Result<InputPort<'_>>
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.
pub fn default_output_port(&self, buffer_size: usize) -> Result<OutputPort<'_>>
[src]
Creates an OutputPort
instance with the given buffer size for the default output device.
pub fn output_port(
&self,
device: DeviceInfo,
buffer_size: usize
) -> Result<OutputPort<'_>>
[src]
&self,
device: DeviceInfo,
buffer_size: usize
) -> Result<OutputPort<'_>>
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
Auto Trait Implementations
impl RefUnwindSafe for PortMidi
impl Send for PortMidi
impl Sync for PortMidi
impl Unpin for PortMidi
impl UnwindSafe for PortMidi
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,