Struct launchpad::LaunchpadMk2
[−]
[src]
pub struct LaunchpadMk2 { /* fields omitted */ }
A Launchpad Mark 2 Device. This library requires the PortMidi device used to create the launchpad to have the same lifetime. If we create the PortMidi device ourselves, hold it. Otherwise, trust the implementer to not destroy it (or further calls will fail (sometimes silently?))
Methods
impl LaunchpadMk2
[src]
fn guess() -> LaunchpadMk2
Attempt to find the first Launchpad Mark 2 by scanning available MIDI ports with matching names
fn guess_from(midi: &PortMidi) -> LaunchpadMk2
Attempt to find the first Launchpad Mark 2 by scanning available MIDI ports with matching names. Bring your own PortMidi.
fn light_all(&mut self, color: Color)
Set all LEDs to the same color
fn flash_single(&mut self, led: &ColorLed)
Set a single LED to flash. Uses a smaller header than flash_led
or
flash_leds
with a single item
fn pulse_single(&mut self, led: &ColorLed)
Set a single LED to pulse. Uses a smaller header than pulse_led
or
pulse_leds
with a single item
fn light_led(&mut self, led: &ColorLed)
Set a single LED to a palette color. Use light_single
instead, its faster.
fn light_leds(&mut self, leds: &[&ColorLed])
Set LEDs to a certain color. Up to 80 LEDs can be set uniquely at once.
fn light_column(&mut self, col: &ColorColumn)
Light a column of LEDs to the same color.
fn light_columns(&mut self, cols: &[&ColorColumn])
Light columns of LEDs to the same color. Each column may be set to a unique color. Up to 9 columns may be set at once.
fn light_row(&mut self, row: &ColorRow)
Light a row of LEDs to the same color.
fn light_rows(&mut self, rows: &[&ColorRow])
Light rows of LEDs to the same color. Each row may be set to a unique color. Up to 9 rows may be set at once.
fn scroll_text(&mut self, color: Color, doloop: bool, text: &str)
Begin scrolling a message. The screen will be blanked, and the letters
will be the same color. If the message is set to loop, it can be cancelled
by sending an empty scroll_text
command. String should only contain ASCII
characters, or the byte value of 1-7 to set the speed (\u{01}
to \u{07}
)
fn light_fuzzy_rgb(&mut self, position: u8, red: u8, green: u8, blue: u8)
Experimental. Try to set an LED by the color value in a "fast" way by by choosing the nearest neighbor palette color. This is faster because setting an LED using palette colors is a 3 byte message, whereas setting a specific RGB color takes at least 12 bytes.
fn poll(&self) -> Option<Vec<MidiEvent>>
Retrieve pending MidiEvents