From c7058672185c72f96b3d8bc4128e50c4955a199b Mon Sep 17 00:00:00 2001 From: Kevin Darby Date: Wed, 10 Oct 2018 18:06:12 -0400 Subject: [PATCH 1/4] added to spark_sdk/spark_sdk.csproj so the nupkg can be shipped with the build --- src/client/spark_sdk/spark_sdk.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/spark_sdk/spark_sdk.csproj b/src/client/spark_sdk/spark_sdk.csproj index d25a75767..2de7adb76 100644 --- a/src/client/spark_sdk/spark_sdk.csproj +++ b/src/client/spark_sdk/spark_sdk.csproj @@ -4,6 +4,7 @@ netstandard2.0;net471 Exe true + $(OutputPath)\net471 true true $(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage From 484c7a98a8317589ca5a25efcb6403134f5f46e5 Mon Sep 17 00:00:00 2001 From: Jake Norbut Date: Fri, 26 Oct 2018 10:35:12 -0500 Subject: [PATCH 2/4] Sound crash fixed in both INotifier and SoundAnimationView (the preview sound) --- src/client/spark/Notifications/INotifier.cs | 4 +++- .../DIYGrid/Settings/Animation/SoundAnimationView.xaml.cs | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/client/spark/Notifications/INotifier.cs b/src/client/spark/Notifications/INotifier.cs index 5934e1cfb..37f1f25ab 100644 --- a/src/client/spark/Notifications/INotifier.cs +++ b/src/client/spark/Notifications/INotifier.cs @@ -102,7 +102,9 @@ namespace mbts.ui { (_dispatcher = Dispatcher.CurrentDispatcher).UnhandledException += _on_dispatcher_UnhandledException; Dispatcher.Run(); } - } catch (Exception ex) { + } + catch (NAudio.MmException) { } + catch (Exception ex) { Log.assert(false, $"Exception in {Thread.CurrentThread.Name} thread: {ex}"); _disposer.Dispose(); } diff --git a/src/client/spark/view/Controls/DIYGrid/Settings/Animation/SoundAnimationView.xaml.cs b/src/client/spark/view/Controls/DIYGrid/Settings/Animation/SoundAnimationView.xaml.cs index 2e576c928..ff41bae64 100644 --- a/src/client/spark/view/Controls/DIYGrid/Settings/Animation/SoundAnimationView.xaml.cs +++ b/src/client/spark/view/Controls/DIYGrid/Settings/Animation/SoundAnimationView.xaml.cs @@ -28,7 +28,7 @@ namespace mbts.ui.controls { new AnonymousValueConverter(obj => obj is SoundNotification.SystemSound s ? EnumHelper.get_attribute(s)?.link : null); - + public static readonly DependencyProperty BusProperty = WPFHelper.create_dp(nameof(Bus)); @@ -38,7 +38,11 @@ namespace mbts.ui.controls { } public static ICommand PreviewSoundCommand => - new DelegateCommand(s => NAudioPlayer.create(s).play()); + new DelegateCommand(s => { + try { + NAudioPlayer.create(s).play(); + } catch (NAudio.MmException) { } + }); #region SoundTypes public static readonly DependencyProperty SoundTypesProperty = From c56b41bf4701a66cfa5c8c07163fbbfa606d35d6 Mon Sep 17 00:00:00 2001 From: John Colvin Date: Fri, 26 Oct 2018 11:35:47 -0500 Subject: [PATCH 3/4] add SoundNotifications toggle.conf --- src/client/spark/Notifications/INotifier.cs | 20 ++++++++++++-------- src/lib/config/protos/toggles.proto | 4 ++++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/client/spark/Notifications/INotifier.cs b/src/client/spark/Notifications/INotifier.cs index 37f1f25ab..296154b18 100644 --- a/src/client/spark/Notifications/INotifier.cs +++ b/src/client/spark/Notifications/INotifier.cs @@ -53,18 +53,22 @@ namespace mbts.ui { ToastNotificationController _toast_controller; SoundNotificationPlayer _sound_player; Dispatcher _dispatcher; - bool _toast_notifications_enabled, _sound_notifications_enabled = NotificationSettings.Default.sound_notification.enabled; + bool + _sound_notifications_enabled = Configuration.get().enabled, + _toast_notifications_enabled = Configuration.get().enabled; [ImportingConstructor] public Notifier(IBus bus, UserSettingsHub settings_hub) { _disposer = new ThreadSafeDisposable(dispose_core); - Thread thread = new Thread(start) { - IsBackground = true, - Priority = ThreadPriority.BelowNormal, - Name = "BTSNotifications" - }; - thread.SetApartmentState(ApartmentState.STA); - thread.Start(); + if (_sound_notifications_enabled || _toast_notifications_enabled) { + Thread thread = new Thread(start) { + IsBackground = true, + Priority = ThreadPriority.BelowNormal, + Name = "BTSNotifications" + }; + thread.SetApartmentState(ApartmentState.STA); + thread.Start(); + } void start() { try { diff --git a/src/lib/config/protos/toggles.proto b/src/lib/config/protos/toggles.proto index d940fa416..5e1fbd736 100644 --- a/src/lib/config/protos/toggles.proto +++ b/src/lib/config/protos/toggles.proto @@ -28,6 +28,10 @@ message ToastNotifications { optional bool enabled = 1 [default = false]; } +message SoundNotifications { + optional bool enabled = 1 [default = true]; +} + message VolumeAtPrice{ optional bool enabled = 1 [default = true]; } \ No newline at end of file From d6df085d8e7ae4cac66bb544383e26eef458c6cd Mon Sep 17 00:00:00 2001 From: Jake Norbut Date: Fri, 26 Oct 2018 14:25:31 -0500 Subject: [PATCH 4/4] SPARK-1648 - My Windows, now with more Scrollbar --- src/client/spark/Themes/generic.xaml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/client/spark/Themes/generic.xaml b/src/client/spark/Themes/generic.xaml index 91e013661..65f1bb5a1 100644 --- a/src/client/spark/Themes/generic.xaml +++ b/src/client/spark/Themes/generic.xaml @@ -521,12 +521,14 @@ - - - + + + + +