rog-aura: Add flicker effect

This commit is contained in:
Luke D. Jones
2022-08-27 20:52:43 +12:00
parent 414d610bd2
commit ebbfa58a76
8 changed files with 537 additions and 312 deletions

View File

@@ -1,6 +1,6 @@
//! Using a combination of key-colour array plus a key layout to generate outputs.
use rog_aura::{keys::Key, layouts::KeyLayout, ActionData, Colour, LedType, Sequences, Speed};
use rog_aura::{keys::Key, layouts::KeyLayout, Colour, LedType, Sequences, Speed, Effect, Breathe};
use rog_dbus::RogDbusClientBlocking;
fn main() -> Result<(), Box<dyn std::error::Error>> {
@@ -9,12 +9,12 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let (client, _) = RogDbusClientBlocking::new().unwrap();
let mut seq = Sequences::new();
let mut key = ActionData::new_breathe(
LedType::Key(Key::W),
let mut key = Effect::Breathe(
Breathe::new(LedType::Key(Key::W),
Colour(255, 127, 0),
Colour(127, 0, 255),
Speed::Med,
);
));
seq.push(key.clone());
key.set_led_type(LedType::Key(Key::A));
@@ -24,22 +24,24 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
key.set_led_type(LedType::Key(Key::D));
seq.push(key.clone());
let mut key = ActionData::new_breathe(
let mut key = Effect::Breathe(
Breathe::new(
LedType::Key(Key::Q),
Colour(127, 127, 127),
Colour(127, 255, 255),
Speed::Low,
);
));
seq.push(key.clone());
key.set_led_type(LedType::Key(Key::E));
seq.push(key.clone());
let mut key = ActionData::new_breathe(
let mut key = Effect::Breathe(
Breathe::new(
LedType::Key(Key::N1),
Colour(166, 127, 166),
Colour(127, 155, 20),
Speed::High,
);
));
key.set_led_type(LedType::Key(Key::Tilde));
seq.push(key.clone());
key.set_led_type(LedType::Key(Key::N2));

View File

@@ -1,6 +1,6 @@
//! Using a combination of key-colour array plus a key layout to generate outputs.
use rog_aura::{layouts::KeyLayout, ActionData, Colour, LedType, PerZone, Sequences, Speed};
use rog_aura::{layouts::KeyLayout, Colour, LedType, PerZone, Sequences, Speed, Effect, Breathe};
use rog_dbus::RogDbusClientBlocking;
fn main() -> Result<(), Box<dyn std::error::Error>> {
@@ -10,28 +10,31 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut seq = Sequences::new();
let zone = ActionData::new_breathe(
let zone = Effect::Breathe(
Breathe::new(
LedType::Zone(PerZone::KeyboardLeft),
Colour(166, 127, 166),
Colour(127, 155, 20),
Speed::High,
);
));
seq.push(zone);
let zone = ActionData::new_breathe(
let zone = Effect::Breathe(
Breathe::new(
LedType::Zone(PerZone::KeyboardCenterLeft),
Colour(16, 127, 255),
Colour(127, 15, 20),
Speed::Low,
);
));
seq.push(zone);
let zone = ActionData::new_breathe(
let zone = Effect::Breathe(
Breathe::new(
LedType::Zone(PerZone::LightbarRightCorner),
Colour(0, 255, 255),
Colour(255, 0, 255),
Speed::Med,
);
));
seq.push(zone);
loop {