Skip to content

Commit 66564a0

Browse files
Merge pull request #86 from GoXLR-on-Linux/dev-1.0.0
Dev 0.12.2
2 parents 3c779d7 + c016c34 commit 66564a0

39 files changed

+821
-73
lines changed

ROADMAP.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Roadmap
2-
*Last Updated for 0.12.0 Release*
2+
*Last Updated for 0.12.2 Release*
33

44
## Completed Features
55
* Initialisation of Devices under Linux
@@ -20,6 +20,7 @@
2020
* Full Lighting Configuration
2121
* Sampler Support
2222
* Scribbles
23+
* Lighting Animations
2324
* Full Submix Beta Support
2425

2526
## Utility Features
@@ -32,4 +33,4 @@
3233
* Logging options for troubleshooting
3334

3435
## Not Implemented
35-
* Lighting Animations (unlikely to be added)
36+
[ This space intentionally left blank. ]

audio/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "goxlr-audio"
3-
version = "0.12.1"
3+
version = "0.12.2"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

ci/goxlr-utility.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[Setup]
44
AppName=GoXLR Utility
5-
AppVersion=0.12.1
5+
AppVersion=0.12.2
66
WizardStyle=modern
77
DefaultDirName={autopf}\GoXLR Utility
88
DefaultGroupName=GoXLR Utility

client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "goxlr-client"
3-
version = "0.12.1"
3+
version = "0.12.2"
44
edition = "2021"
55
build = "build.rs"
66
authors = ["Nathan Adams <[email protected]>", "Craig McLure <[email protected]>", "Lars Mühlbauer <[email protected]>"]

client/src/cli.rs

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
use clap::{ArgAction, Args, Parser, Subcommand};
22

33
use goxlr_types::{
4-
Button, ButtonColourGroups, ButtonColourOffStyle, ChannelName, CompressorAttackTime,
5-
CompressorRatio, CompressorReleaseTime, EchoStyle, EffectBankPresets, EncoderColourTargets,
6-
EqFrequencies, FaderDisplayStyle, FaderName, GateTimes, GenderStyle, HardTuneSource,
7-
HardTuneStyle, InputDevice, MegaphoneStyle, MiniEqFrequencies, Mix, MuteFunction, MuteState,
8-
OutputDevice, PitchStyle, ReverbStyle, RobotRange, RobotStyle, SampleBank, SampleButtons,
9-
SamplePlayOrder, SamplePlaybackMode, SimpleColourTargets,
4+
AnimationMode, Button, ButtonColourGroups, ButtonColourOffStyle, ChannelName,
5+
CompressorAttackTime, CompressorRatio, CompressorReleaseTime, EchoStyle, EffectBankPresets,
6+
EncoderColourTargets, EqFrequencies, FaderDisplayStyle, FaderName, GateTimes, GenderStyle,
7+
HardTuneSource, HardTuneStyle, InputDevice, MegaphoneStyle, MiniEqFrequencies, Mix,
8+
MuteFunction, MuteState, OutputDevice, PitchStyle, ReverbStyle, RobotRange, RobotStyle,
9+
SampleBank, SampleButtons, SamplePlayOrder, SamplePlaybackMode, SimpleColourTargets,
10+
WaterfallDirection,
1011
};
1112
use std::str::FromStr;
1213

@@ -492,6 +493,11 @@ pub enum CoughCommands {
492493
#[derive(Subcommand, Debug)]
493494
#[command(arg_required_else_help = true)]
494495
pub enum LightingCommands {
496+
Animation {
497+
#[command(subcommand)]
498+
command: AnimationCommands,
499+
},
500+
495501
/// Sets the Global GoXLR Colour
496502
Global { colour: String },
497503

@@ -541,6 +547,15 @@ pub enum LightingCommands {
541547
},
542548
}
543549

550+
#[derive(Subcommand, Debug)]
551+
#[command(arg_required_else_help = true)]
552+
pub enum AnimationCommands {
553+
Mode { mode: AnimationMode },
554+
Mod1 { mod1: u8 },
555+
Mod2 { mod2: u8 },
556+
WaterFall { waterfall: WaterfallDirection },
557+
}
558+
544559
#[derive(Subcommand, Debug)]
545560
#[command(arg_required_else_help = true)]
546561
pub enum FaderLightingCommands {

client/src/main.rs

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ mod cli;
22
mod microphone;
33

44
use crate::cli::{
5-
ButtonGroupLightingCommands, ButtonLightingCommands, CompressorCommands, CoughButtonBehaviours,
6-
Echo, EffectsCommands, EqualiserCommands, EqualiserMiniCommands, FaderCommands,
7-
FaderLightingCommands, FadersAllLightingCommands, Gender, HardTune, LightingCommands,
8-
Megaphone, MicrophoneCommands, NoiseGateCommands, Pitch, ProfileAction, ProfileType, Reverb,
9-
Robot, SamplerCommands, Scribbles, SubCommands, SubmixCommands,
5+
AnimationCommands, ButtonGroupLightingCommands, ButtonLightingCommands, CompressorCommands,
6+
CoughButtonBehaviours, Echo, EffectsCommands, EqualiserCommands, EqualiserMiniCommands,
7+
FaderCommands, FaderLightingCommands, FadersAllLightingCommands, Gender, HardTune,
8+
LightingCommands, Megaphone, MicrophoneCommands, NoiseGateCommands, Pitch, ProfileAction,
9+
ProfileType, Reverb, Robot, SamplerCommands, Scribbles, SubCommands, SubmixCommands,
1010
};
1111
use crate::microphone::apply_microphone_controls;
1212
use anyhow::{anyhow, Context, Result};
@@ -272,6 +272,29 @@ async fn main() -> Result<()> {
272272
}
273273

274274
SubCommands::Lighting { command } => match command {
275+
LightingCommands::Animation { command } => match command {
276+
AnimationCommands::Mode { mode } => {
277+
client
278+
.command(&serial, GoXLRCommand::SetAnimationMode(*mode))
279+
.await?;
280+
}
281+
AnimationCommands::Mod1 { mod1 } => {
282+
client
283+
.command(&serial, GoXLRCommand::SetAnimationMod1(*mod1))
284+
.await?;
285+
}
286+
AnimationCommands::Mod2 { mod2 } => {
287+
client
288+
.command(&serial, GoXLRCommand::SetAnimationMod2(*mod2))
289+
.await?;
290+
}
291+
AnimationCommands::WaterFall { waterfall } => {
292+
client
293+
.command(&serial, GoXLRCommand::SetAnimationWaterfall(*waterfall))
294+
.await?;
295+
}
296+
},
297+
275298
LightingCommands::Global { colour } => {
276299
client
277300
.command(&serial, GoXLRCommand::SetGlobalColour(colour.to_string()))

daemon/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "goxlr-daemon"
3-
version = "0.12.1"
3+
version = "0.12.2"
44
edition = "2021"
55
authors = ["Nathan Adams <[email protected]>", "Craig McLure <[email protected]>", "Lars Mühlbauer <[email protected]>"]
66
description = "Allows control of a TC-Helicon GoXLR or GoXLR Mini, by maintaining an interaction with it over USB in the background."

daemon/src/device.rs

Lines changed: 95 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ use goxlr_types::{
2020
Button, ChannelName, DisplayModeComponents, EffectBankPresets, EffectKey, EncoderName,
2121
FaderName, HardTuneSource, InputDevice as BasicInputDevice, MicrophoneParamKey, Mix, MuteState,
2222
OutputDevice as BasicOutputDevice, RobotRange, SampleBank, SampleButtons, SamplePlaybackMode,
23-
VersionNumber,
23+
VersionNumber, WaterfallDirection,
2424
};
25+
use goxlr_usb::animation::{AnimationMode, WaterFallDir};
2526
use goxlr_usb::buttonstate::{ButtonStates, Buttons};
2627
use goxlr_usb::channelstate::ChannelState;
2728
use goxlr_usb::channelstate::ChannelState::{Muted, Unmuted};
@@ -209,6 +210,8 @@ impl<'a> Device<'a> {
209210
sample_error.replace(error.clone());
210211
}
211212

213+
let is_mini = self.hardware.device_type == DeviceType::Mini;
214+
212215
MixerStatus {
213216
hardware: self.hardware.clone(),
214217
shutdown_commands,
@@ -233,12 +236,10 @@ impl<'a> Device<'a> {
233236
},
234237
lighting: self
235238
.profile
236-
.get_lighting_ipc(self.hardware.device_type == DeviceType::Mini),
237-
effects: self
238-
.profile
239-
.get_effects_ipc(self.hardware.device_type == DeviceType::Mini),
239+
.get_lighting_ipc(is_mini, self.device_supports_animations()),
240+
effects: self.profile.get_effects_ipc(is_mini),
240241
sampler: self.profile.get_sampler_ipc(
241-
self.hardware.device_type == DeviceType::Mini,
242+
is_mini,
242243
&self.audio_handler,
243244
sampler_prerecord,
244245
SampleProcessState {
@@ -1631,6 +1632,39 @@ impl<'a> Device<'a> {
16311632
}
16321633

16331634
// Colouring..
1635+
GoXLRCommand::SetAnimationMode(mode) => {
1636+
if !self.device_supports_animations() {
1637+
bail!("Animations not supported on this firmware.");
1638+
}
1639+
1640+
self.profile.set_animation_mode(mode)?;
1641+
self.load_animation(false)?;
1642+
}
1643+
GoXLRCommand::SetAnimationMod1(value) => {
1644+
if !self.device_supports_animations() {
1645+
bail!("Animations not supported on this firmware.");
1646+
}
1647+
1648+
self.profile.set_animation_mod1(value)?;
1649+
self.load_animation(false)?;
1650+
}
1651+
GoXLRCommand::SetAnimationMod2(value) => {
1652+
if !self.device_supports_animations() {
1653+
bail!("Animations not supported on this firmware.");
1654+
}
1655+
1656+
self.profile.set_animation_mod2(value)?;
1657+
self.load_animation(false)?;
1658+
}
1659+
GoXLRCommand::SetAnimationWaterfall(direction) => {
1660+
if !self.device_supports_animations() {
1661+
bail!("Animations not supported on this firmware.");
1662+
}
1663+
1664+
self.profile.set_animation_waterfall(direction)?;
1665+
self.load_animation(false)?;
1666+
}
1667+
16341668
GoXLRCommand::SetGlobalColour(colour) => {
16351669
self.profile.set_global_colour(colour)?;
16361670
self.load_colour_map()?;
@@ -2812,18 +2846,7 @@ impl<'a> Device<'a> {
28122846
// The new colour format occurred on different firmware versions depending on device,
28132847
// so do the check here.
28142848

2815-
let use_1_3_40_format: bool = match self.hardware.device_type {
2816-
DeviceType::Unknown => true,
2817-
DeviceType::Full => version_newer_or_equal_to(
2818-
&self.hardware.versions.firmware,
2819-
VersionNumber(1, 3, 40, 0),
2820-
),
2821-
DeviceType::Mini => version_newer_or_equal_to(
2822-
&self.hardware.versions.firmware,
2823-
VersionNumber(1, 1, 8, 0),
2824-
),
2825-
};
2826-
2849+
let use_1_3_40_format = self.device_supports_animations();
28272850
let colour_map = self.profile.get_colour_map(use_1_3_40_format);
28282851

28292852
if use_1_3_40_format {
@@ -2837,6 +2860,41 @@ impl<'a> Device<'a> {
28372860
Ok(())
28382861
}
28392862

2863+
fn load_animation(&mut self, map_set: bool) -> Result<()> {
2864+
let enabled = self.profile.get_animation_mode() != goxlr_types::AnimationMode::None;
2865+
2866+
// This one is kinda weird, we go from profile -> types -> usb..
2867+
let mode = match self.profile.get_animation_mode() {
2868+
goxlr_types::AnimationMode::RetroRainbow => AnimationMode::RetroRainbow,
2869+
goxlr_types::AnimationMode::RainbowDark => AnimationMode::RainbowDark,
2870+
goxlr_types::AnimationMode::RainbowBright => AnimationMode::RainbowBright,
2871+
goxlr_types::AnimationMode::Simple => AnimationMode::Simple,
2872+
goxlr_types::AnimationMode::Ripple => AnimationMode::Ripple,
2873+
goxlr_types::AnimationMode::None => AnimationMode::None,
2874+
};
2875+
2876+
let mod1 = self.profile.get_animation_mod1();
2877+
let mod2 = self.profile.get_animation_mod2();
2878+
let waterfall = match self.profile.get_animation_waterfall() {
2879+
WaterfallDirection::Down => WaterFallDir::Down,
2880+
WaterfallDirection::Up => WaterFallDir::Up,
2881+
WaterfallDirection::Off => WaterFallDir::Off,
2882+
};
2883+
2884+
self.goxlr
2885+
.set_animation_mode(enabled, mode, mod1, mod2, waterfall)?;
2886+
2887+
if !map_set
2888+
&& (mode == AnimationMode::None
2889+
|| mode == AnimationMode::Ripple
2890+
|| mode == AnimationMode::Simple)
2891+
{
2892+
self.load_colour_map()?;
2893+
}
2894+
2895+
Ok(())
2896+
}
2897+
28402898
async fn apply_profile(&mut self, current: Option<CurrentState>) -> Result<()> {
28412899
// Set volumes first, applying mute may modify stuff..
28422900
debug!("Applying Profile..");
@@ -2913,6 +2971,11 @@ impl<'a> Device<'a> {
29132971
debug!("Loading Colour Map..");
29142972
self.load_colour_map()?;
29152973

2974+
if self.device_supports_animations() {
2975+
// Load any animation settings..
2976+
self.load_animation(true)?;
2977+
}
2978+
29162979
debug!("Setting Fader display modes..");
29172980
for fader in FaderName::iter() {
29182981
debug!("Setting display for {}", fader);
@@ -3251,6 +3314,20 @@ impl<'a> Device<'a> {
32513314
}
32523315
}
32533316

3317+
fn device_supports_animations(&self) -> bool {
3318+
match self.hardware.device_type {
3319+
DeviceType::Unknown => true,
3320+
DeviceType::Full => version_newer_or_equal_to(
3321+
&self.hardware.versions.firmware,
3322+
VersionNumber(1, 3, 40, 0),
3323+
),
3324+
DeviceType::Mini => version_newer_or_equal_to(
3325+
&self.hardware.versions.firmware,
3326+
VersionNumber(1, 1, 8, 0),
3327+
),
3328+
}
3329+
}
3330+
32543331
// Get the current time in millis..
32553332
fn get_epoch_ms(&self) -> u128 {
32563333
SystemTime::now()

0 commit comments

Comments
 (0)