Fix animations being enabled on gen1-3 platforms when they shouldn't be.

Animations should be enabled only if the user selects "GIF animations".  They were
being enabled when in the default panel color mode, which was confusing and not intended.
master
Glenn Maynard 5 years ago
parent 36b006028a
commit aebf306484
  1. 4
      smx-config/App.xaml.cs
  2. 9
      smx-config/Helpers.cs
  3. 18
      smx-config/MainWindow.xaml.cs

@ -64,10 +64,8 @@ namespace smx_config
CurrentSMXDevice.singleton = new CurrentSMXDevice(); CurrentSMXDevice.singleton = new CurrentSMXDevice();
// Load animations, and tell the SDK to handle auto-lighting as long as // Load animations.
// we're running.
Helpers.LoadSavedPanelAnimations(); Helpers.LoadSavedPanelAnimations();
SMX.SMX.LightsAnimation_SetAuto(true);
CreateTrayIcon(); CreateTrayIcon();

@ -797,11 +797,6 @@ namespace smx_config
if(LightsTimer.IsEnabled) if(LightsTimer.IsEnabled)
return; return;
// We normally leave lights animation control enabled while this application is
// running. Turn it off temporarily while we're showing the lights sample, or the
// two will fight.
SMX.SMX.LightsAnimation_SetAuto(false);
// Don't wait for an interval to send the first update. // Don't wait for an interval to send the first update.
//AutoLightsColorRefreshColor(); //AutoLightsColorRefreshColor();
@ -815,10 +810,6 @@ namespace smx_config
// Reenable pad auto-lighting. If we're running animations in SMXPanelAnimation, // Reenable pad auto-lighting. If we're running animations in SMXPanelAnimation,
// this will be overridden by it once it sends lights. // this will be overridden by it once it sends lights.
SMX.SMX.ReenableAutoLights(); SMX.SMX.ReenableAutoLights();
// Turn lighting control back on. This will only do anything on pads without
// support for animations.
SMX.SMX.LightsAnimation_SetAuto(true);
} }
private void AutoLightsColorRefreshColor() private void AutoLightsColorRefreshColor()

@ -200,6 +200,19 @@ namespace smx_config
} }
} }
// We have two main modes: color mode and GIF animation mode. These behave differently
// on gen1-3 pads and gen4 pads.
//
// On gen4 pads, this determines whether we show animations on press, or show a solid color.
// This makes it easy to pick a solid color if that's all you want to change, instead of having
// to make a GIF with the color. We always show animations on release in both modes.
//
// On gen1-3 pads, panels are black in color mode, so they behave the same as they did originally.
// Animations are only shown in GIF animation mode. These animations are enabled with
// LightsAnimation_SetAuto.
//
// The gen1-3 firmware ignores the AutoLightingUsePressedAnimations flag, but we still use it to
// store which mode the user has selected.
private void PressedColorModeButton(object sender, RoutedEventArgs e) private void PressedColorModeButton(object sender, RoutedEventArgs e)
{ {
// The user pressed either the "panel colors" or "GIF animations" button. // The user pressed either the "panel colors" or "GIF animations" button.
@ -223,6 +236,11 @@ namespace smx_config
private void LoadUIFromConfig(LoadFromConfigDelegateArgs args) private void LoadUIFromConfig(LoadFromConfigDelegateArgs args)
{ {
// Refresh whether LightsAnimation_SetAuto should be enabled.
SMX.SMXConfig firstConfig = ActivePad.GetFirstActivePadConfig();
bool usePressedAnimationsEnabled = (firstConfig.configFlags & SMX.SMXConfigFlags.AutoLightingUsePressedAnimations) != 0;
SMX.SMX.LightsAnimation_SetAuto(usePressedAnimationsEnabled);
bool EitherControllerConnected = args.controller[0].info.connected || args.controller[1].info.connected; bool EitherControllerConnected = args.controller[0].info.connected || args.controller[1].info.connected;
Main.Visibility = EitherControllerConnected ? Visibility.Visible : Visibility.Hidden; Main.Visibility = EitherControllerConnected ? Visibility.Visible : Visibility.Hidden;
Searching.Visibility = EitherControllerConnected ? Visibility.Hidden : Visibility.Visible; Searching.Visibility = EitherControllerConnected ? Visibility.Hidden : Visibility.Visible;

Loading…
Cancel
Save