From 1b01f537962f03652b2b2603453f279ccc1a35f2 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 21 Mar 2019 16:00:36 -0500 Subject: [PATCH] Add an option to enable or disable lighting on panels with no sensors. --- sdk/Windows/SMXPanelAnimation.cpp | 4 +++ smx-config/MainWindow.xaml | 16 ++++++++++- smx-config/SMX.cs | 29 +++++++++++++++++++ smx-config/Widgets.cs | 46 +++++++++++++++++++++++++++++++ 4 files changed, 94 insertions(+), 1 deletion(-) diff --git a/sdk/Windows/SMXPanelAnimation.cpp b/sdk/Windows/SMXPanelAnimation.cpp index 1ccf9cc..b731bc7 100644 --- a/sdk/Windows/SMXPanelAnimation.cpp +++ b/sdk/Windows/SMXPanelAnimation.cpp @@ -187,6 +187,10 @@ struct AnimationStateForPad // The portion of lights data for this panel: char *out = &result[panel*iBytesPerPanel]; + // Skip this panel if it's not in autoLightPanelMask. + if(!(config.autoLightPanelMask & (1 << panel))) + continue; + // Add the released animation, then overlay the pressed animation if we're pressed. OverlayLights(out, animations[SMX_LightsType_Released][panel].GetAnimationFrame()); bool bPressed = bool(iPadState & (1 << panel)); diff --git a/smx-config/MainWindow.xaml b/smx-config/MainWindow.xaml index 005c403..0d26297 100644 --- a/smx-config/MainWindow.xaml +++ b/smx-config/MainWindow.xaml @@ -879,8 +879,22 @@ Input will be disabled from deselected panels. - + Options + + + + Show light animations on all panels +instead of only panels with sensors. + + + Import/export settings activePad in ActivePad.ActivePads()) + { + int pad = activePad.Item1; + SMX.SMXConfig config = activePad.Item2; + config.setLightAllPanelsMode(!LightAllPanels); + SMX.SMX.SetConfig(pad, config); + } + CurrentSMXDevice.singleton.FireConfigurationChanged(this); + + // Refresh the UI. + //LoadUIFromConfig(firstConfig); + } + } }