[−][src]Struct launchy::launchpad_s::Output
The Launchpad S output connection handler.
Double buffering
To make more economical use of data, the Launchpad has a feature called double buffering. Essentially, Launchpad manages two sets of LED data - buffers - for each pad. By default, these are configured so that the buffer that is updated by incoming MIDI messages is the same as the one that is visible, so that note-on messages immediately change their respective pads. However, the buffers can also be configured so that Launchpad’s LED status is updated invisibly. With a single command, these buffers can then be swapped. The pads will instantly update to show their pre-programmed state, while the pads can again be updated invisibly ready for the next swap. The visible buffer can alternatively be configured to swap automatically at 280ms intervals in order to configure LEDs to flash.
Implementations
impl Output
[src]
pub fn set_button(
&mut self,
button: Button,
color: Color,
d: DoubleBufferingBehavior
) -> Result<(), MidiError>
[src]
&mut self,
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
.
pub fn set_button_rapid(
&mut self,
color1: Color,
dbb1: DoubleBufferingBehavior,
color2: Color,
dbb2: DoubleBufferingBehavior
) -> Result<(), MidiError>
[src]
&mut self,
color1: Color,
dbb1: DoubleBufferingBehavior,
color2: Color,
dbb2: DoubleBufferingBehavior
) -> Result<(), MidiError>
In order to make maximum use of the original Launchpad's slow midi speeds, a rapid LED lighting mode was invented which allows the lighting of two leds in just a single message. To use this mode, simply start sending these message and the Launchpad will update the 8x8 grid in left-to-right, top-to-bottom order, then the eight scene launch buttons in top-to-bottom order, and finally the eight Automap/Live buttons in left-to-right order (these are otherwise inaccessible using note-on messages). Overflowing data will be ignored.
To leave the mode, simply send any other message. Sending another kind of message and then re-sending this message will reset the cursor to the top left of the grid.
pub fn turn_on_all_leds(
&mut self,
brightness: Brightness
) -> Result<(), MidiError>
[src]
&mut self,
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.
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.
pub fn set_duty_cycle(
&mut self,
numerator: u8,
denominator: u8
) -> Result<(), MidiError>
[src]
&mut self,
numerator: u8,
denominator: u8
) -> Result<(), MidiError>
Launchpad controls the brightness of its LEDs by continually switching them on and off faster than the eye can see: a technique known as multiplexing. This command provides a way of altering the proportion of time for which the LEDs are on while they are in low- and medium-brightness modes. This proportion is known as the duty cycle. Manipulating this is useful for fade effects, for adjusting contrast, and for creating custom palettes. The default duty cycle is 1/5 meaning that low-brightness LEDs are on for only every fifth multiplex pass, and medium-brightness LEDs are on for two passes in every five. Generally, lower duty cycles (numbers closer to zero) will increase contrast between different brightness settings but will also increase flicker; higher ones will eliminate flicker, but will also reduce contrast. Note that using less simple ratios (such as 3/17 or 2/11) can also increase perceived flicker. If you are particularly sensitive to strobing lights, please use this command with care when working with large areas of low-brightness LEDs: in particular, avoid duty cycles of 1/8 or less.
pub fn control_double_buffering(
&mut self,
d: DoubleBuffering
) -> Result<(), MidiError>
[src]
&mut self,
d: DoubleBuffering
) -> Result<(), MidiError>
This method controls the double buffering mode on the Launchpad. See the module documentation for an explanation on double buffering.
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 bufferdisplayed
: the new displayed buffer
pub fn scroll_text(
&mut self,
text: &[u8],
color: Color,
should_loop: bool
) -> Result<(), MidiError>
[src]
&mut self,
text: &[u8],
color: Color,
should_loop: bool
) -> Result<(), MidiError>
pub fn reset(&mut self) -> Result<(), MidiError>
[src]
All LEDs are turned off, and the mapping mode, buffer settings, and duty cycle are reset to their default values.
pub fn light(&mut self, button: Button, color: Color) -> Result<(), MidiError>
[src]
pub fn light_all_rapid(&mut self, color: Color) -> Result<(), MidiError>
[src]
Trait Implementations
impl OutputDevice for Output
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Output
impl Send for Output
impl !Sync for Output
impl Unpin for Output
impl UnwindSafe for Output
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,