Skip to main content

Output

Struct Output 

Source
pub struct Output { /* private fields */ }
Expand description

The Launch Control output connection handler.

Implementations§

Source§

impl Output

Source

pub fn set_button( &mut self, template: impl Into<Template>, button: Button, color: Color, d: DoubleBufferingBehavior, ) -> Result<(), MidiError>

Updates the state for a single LED, specified by button. The color, as well as the double buffering attributes, are specified in light_state.

The given template must match the currently selected template on the Launch Control, or nothing will happen.

Source

pub fn turn_off_button( &mut self, template: impl Into<Template>, button: Button, ) -> Result<(), MidiError>

The Launch Control interprets this message exactly the same as self.set_button(template, button, Color::Black, DoubleBufferingBehavior::None)

The given template must match the currently selected template on the Launch Control, or nothing will happen.

Source

pub fn light_multiple( &mut self, template: impl Into<Template>, pads: impl IntoIterator<Item = impl Borrow<(Button, Color, DoubleBufferingBehavior)>>, ) -> Result<(), MidiError>

Light multiple buttons with varying colors and double buffering behavior.

The given template must match the currently selected template on the Launch Control, or nothing will happen.

Source

pub fn change_template( &mut self, template: impl Into<Template>, ) -> Result<(), MidiError>

Change the template that will be displayed and edited on

Source

pub fn turn_on_all_leds( &mut self, template: impl Into<Template>, brightness: Brightness, ) -> Result<(), MidiError>

Turns on all LEDs to a certain brightness, dictated by the brightness parameter. According to the Launchpad documentation, sending this command resets various configuration settings - see reset() for more information. However, in my experience, that only sometimes happens. Weird.

The template parameter specifies for which template this message is intended

Btw this function is not really intended for regular use. It’s more like a test function to check if the device is working correctly, diagnostic stuff like that.

Source

pub fn control_double_buffering( &mut self, template: impl Into<Template>, d: DoubleBuffering, ) -> Result<(), MidiError>

This method controls the double buffering mode on the Launchpad. See the module documentation for an explanation on double buffering. // TODO

The default state is no flashing; the first buffer is both the update and the displayed buffer: In this mode, any LED data written to Launchpad is displayed instantly. Sending this message also resets the flash timer, so it can be used to resynchronise the flash rates of all the Launchpads connected to a system.

  • If copy is set, copy the LED states from the new displayed buffer to the new updating buffer.
  • If flash is set, continually flip displayed buffers to make selected LEDs flash.
  • updated: the new updated buffer
  • displayed: the new displayed buffer

The template parameter specifies for which template this message is intended

Source

pub fn reset(&mut self, template: impl Into<Template>) -> Result<(), MidiError>

All LEDs are turned off, and the mapping mode, buffer settings, and duty cycle are reset to their default values.

Source

pub fn light( &mut self, template: impl Into<Template>, button: Button, color: Color, dbb: DoubleBufferingBehavior, ) -> Result<(), MidiError>

Light a button with a certain color.

The given template must match the currently selected template on the Launch Control, or nothing will happen.

Trait Implementations§

Source§

impl OutputDevice for Output

Source§

const MIDI_CONNECTION_NAME: &'static str = "Launchy Launch Control output"

Source§

const MIDI_DEVICE_KEYWORD: &'static str = "Launch Control"

Source§

fn from_connection(connection: MidiOutputConnection) -> Result<Self, MidiError>

Initiate from an existing midir connection.
Source§

fn send(&mut self, bytes: &[u8]) -> Result<(), MidiError>

Source§

fn guess() -> Result<Self, MidiError>

Auto Trait Implementations§

§

impl !Freeze for Output

§

impl !RefUnwindSafe for Output

§

impl !Sync for Output

§

impl Send for Output

§

impl Unpin for Output

§

impl UnsafeUnpin for Output

§

impl UnwindSafe for Output

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.