Struct portmidi::OutputPort
source · [−]pub struct OutputPort<'a> { /* private fields */ }
Expand description
Represents the output port of a PortMidi device.
Implementations
sourceimpl<'a> OutputPort<'a>
impl<'a> OutputPort<'a>
sourcepub fn new(
context: &'a PortMidi,
device: DeviceInfo,
buffer_size: usize
) -> Result<OutputPort<'_>>
pub fn new(
context: &'a PortMidi,
device: DeviceInfo,
buffer_size: usize
) -> Result<OutputPort<'_>>
Construct a new OutputPort
for the given device and buffer size.
If the device
is not an output device an Error::NotAnOutputDevice
is returned.
sourcepub fn write_event<T: Into<MidiEvent>>(&mut self, midi_event: T) -> Result<()>
pub fn write_event<T: Into<MidiEvent>>(&mut self, midi_event: T) -> Result<()>
Write a single MidiEvent
.
Returns an Error::PortMidi(_)
if something went wrong.
sourcepub fn write_events<T: Into<MidiEvent>>(
&mut self,
midi_events: Vec<T>
) -> Result<()>
pub fn write_events<T: Into<MidiEvent>>(
&mut self,
midi_events: Vec<T>
) -> Result<()>
Write a buffer of midi events to the output port.
Returns an Error::PortMidi(_)
if something went wrong.
sourcepub fn write_message<T: Into<MidiMessage>>(
&mut self,
midi_message: T
) -> Result<()>
pub fn write_message<T: Into<MidiMessage>>(
&mut self,
midi_message: T
) -> Result<()>
Write a single MidiMessage
.
Returns an Error::PortMidi(_)
if something went wrong.
sourcepub fn device(&self) -> DeviceInfo
pub fn device(&self) -> DeviceInfo
Returns the DeviceInfo
of the Midi device that owns this port.
pub fn write_sysex(&self, timestamp: u32, msg: &[u8]) -> Result<()>
Trait Implementations
sourceimpl<'a> Drop for OutputPort<'a>
impl<'a> Drop for OutputPort<'a>
impl<'a> Send for OutputPort<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for OutputPort<'a>
impl<'a> !Sync for OutputPort<'a>
impl<'a> Unpin for OutputPort<'a>
impl<'a> UnwindSafe for OutputPort<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more