Struct audio_processor_standalone_midi::host::MidiHost
source · [−]pub struct MidiHost { /* private fields */ }
Expand description
Host for MIDI messages, opens all ports & forwards them onto a lock-free queue the audio-thread can pop from.
The host will close all MIDI connections on drop.
Implementations
sourceimpl MidiHost
impl MidiHost
sourcepub fn new(handle: &Handle, capacity: usize) -> Self
pub fn new(handle: &Handle, capacity: usize) -> Self
Create the host, linked to GC Handle
and with queue capacity
of messages.
sourcepub fn default_with_handle(handle: &Handle) -> Self
pub fn default_with_handle(handle: &Handle) -> Self
Create the host with default 100 capacity
sourcepub fn default_with_queue(handle: &Handle, queue: MidiMessageQueue) -> Self
pub fn default_with_queue(handle: &Handle, queue: MidiMessageQueue) -> Self
Build a MidiHost with a pre-built queue
sourcepub fn messages(&self) -> &MidiMessageQueue
pub fn messages(&self) -> &MidiMessageQueue
Get a reference to the message queue
sourcepub fn start_midi(&mut self) -> Result<(), MidiError>
pub fn start_midi(&mut self) -> Result<(), MidiError>
Start the MIDI connections
sourcepub fn virtual_port_name() -> String
pub fn virtual_port_name() -> String
For integration testing purposes MidiHost
starts a virtual input which it’ll also connect
into. This input contains the PID of the host process.
Generating this name dynamically avoids flakiness in integration tests.
Trait Implementations
sourceimpl Actor for MidiHost
impl Actor for MidiHost
sourcefn started(&mut self, ctx: &mut Self::Context)
fn started(&mut self, ctx: &mut Self::Context)
Called when an actor gets polled the first time.
sourcefn stopping(&mut self, ctx: &mut Self::Context) -> Running
fn stopping(&mut self, ctx: &mut Self::Context) -> Running
Called after an actor is in Actor::Stopping
state. Read more
sourcefn start(self) -> Addr<Self> where
Self: Actor<Context = Context<Self>>,
fn start(self) -> Addr<Self> where
Self: Actor<Context = Context<Self>>,
Start a new asynchronous actor, returning its address. Read more
sourcefn start_default() -> Addr<Self> where
Self: Actor<Context = Context<Self>> + Default,
fn start_default() -> Addr<Self> where
Self: Actor<Context = Context<Self>> + Default,
Construct and start a new asynchronous actor, returning its address. Read more
sourceimpl Handler<GetQueueMessage> for MidiHost
impl Handler<GetQueueMessage> for MidiHost
type Result = GetQueueMessageResult
type Result = GetQueueMessageResult
The type of value that this handler will return. Read more
sourcefn handle(
&mut self,
_msg: GetQueueMessage,
_ctx: &mut Self::Context
) -> Self::Result
fn handle(
&mut self,
_msg: GetQueueMessage,
_ctx: &mut Self::Context
) -> Self::Result
This method is called for every message received by this actor.
sourceimpl Handler<StartMessage> for MidiHost
impl Handler<StartMessage> for MidiHost
sourceimpl Supervised for MidiHost
impl Supervised for MidiHost
sourcefn restarting(&mut self, ctx: &mut Self::Context)
fn restarting(&mut self, ctx: &mut Self::Context)
Called when the supervisor restarts a failed actor.
sourceimpl SystemService for MidiHost
impl SystemService for MidiHost
sourcefn service_started(&mut self, _ctx: &mut Context<Self>)
fn service_started(&mut self, _ctx: &mut Context<Self>)
Method is called during service initialization.
sourcefn start_service(wrk: &ArbiterHandle) -> Addr<Self>
fn start_service(wrk: &ArbiterHandle) -> Addr<Self>
Construct and start system service
sourcefn from_registry() -> Addr<Self>
fn from_registry() -> Addr<Self>
Get actor’s address from system registry
Auto Trait Implementations
impl !RefUnwindSafe for MidiHost
impl Send for MidiHost
impl !Sync for MidiHost
impl Unpin for MidiHost
impl !UnwindSafe for MidiHost
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more