pub struct LaunchkeyManager<S: LaunchKeyState + 'static> { /* private fields */ }Expand description
A stateful manager for sending MIDI commands to a Launchkey device. It is generic over a state ([‘DAWMode’] or [‘StandaloneMode’]) to enforce correct usage.
Implementations§
Source§impl LaunchkeyManager<StandaloneMode>
impl LaunchkeyManager<StandaloneMode>
Sourcepub fn new(
midi_out: MidiOutput,
port: &MidiOutputPort,
sku: LaunchKeySku,
) -> Result<Self, String>
pub fn new( midi_out: MidiOutput, port: &MidiOutputPort, sku: LaunchKeySku, ) -> Result<Self, String>
Creates a new [‘LaunchkeyManager’] and connects to the specified output port.
Sourcepub fn set_screen_text_global(
&mut self,
target: GlobalDisplayTarget,
arrangement: Arrangement,
) -> Result<(), SendError>
pub fn set_screen_text_global( &mut self, target: GlobalDisplayTarget, arrangement: Arrangement, ) -> Result<(), SendError>
Sends a command to set the global screen text in [‘StandaloneMode’].
Sourcepub fn send_screen_bitmap(
&mut self,
target: GlobalDisplayTarget,
bitmap: LaunchkeyBitmap,
) -> Result<(), SendError>
pub fn send_screen_bitmap( &mut self, target: GlobalDisplayTarget, bitmap: LaunchkeyBitmap, ) -> Result<(), SendError>
Sends a command to display a screen bitmap in [‘StandaloneMode’].
Sourcepub fn into_daw_mode(self) -> Result<LaunchkeyManager<DAWMode>, SendError>
pub fn into_daw_mode(self) -> Result<LaunchkeyManager<DAWMode>, SendError>
Enables DAW Mode and transitions the manager to [‘DAWMode’].
Source§impl LaunchkeyManager<DAWMode>
impl LaunchkeyManager<DAWMode>
Sourcepub fn into_standalone_mode(
self,
) -> Result<LaunchkeyManager<StandaloneMode>, SendError>
pub fn into_standalone_mode( self, ) -> Result<LaunchkeyManager<StandaloneMode>, SendError>
Disables DAW Mode and transitions the manager to [‘StandaloneMode’].
Sourcepub fn setup_default_element_modes(&mut self) -> Result<(), SendError>
pub fn setup_default_element_modes(&mut self) -> Result<(), SendError>
Sets the default mode for the Pads, Encoders and Faders on the Launchkey.
Sourcepub fn send_command(
&mut self,
command: LaunchkeyCommand,
) -> Result<(), SendError>
pub fn send_command( &mut self, command: LaunchkeyCommand, ) -> Result<(), SendError>
Sends a MIDI command to the Launchkey.
Sourcepub fn send_commands(
&mut self,
commands: &[LaunchkeyCommand],
) -> Result<(), SendError>
pub fn send_commands( &mut self, commands: &[LaunchkeyCommand], ) -> Result<(), SendError>
Sends multiple MIDI commands to the Launchkey.
Trait Implementations§
Source§impl<S: LaunchKeyState + 'static> Drop for LaunchkeyManager<S>
impl<S: LaunchKeyState + 'static> Drop for LaunchkeyManager<S>
Auto Trait Implementations§
impl<S> Freeze for LaunchkeyManager<S>
impl<S> !RefUnwindSafe for LaunchkeyManager<S>
impl<S> !Send for LaunchkeyManager<S>
impl<S> !Sync for LaunchkeyManager<S>
impl<S> Unpin for LaunchkeyManager<S>where
S: Unpin,
impl<S> !UnwindSafe for LaunchkeyManager<S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more