From 0005cab7072ea1bda1998bc1358e5b214937b945 Mon Sep 17 00:00:00 2001 From: osamu <46447427+sam-osamu@users.noreply.github.com> Date: Tue, 12 Apr 2022 20:59:48 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AA=E3=83=AA=E3=83=BC=E3=82=B9=E3=81=AE?= =?UTF-8?q?=E3=81=9F=E3=82=81=E3=81=AE=E3=83=80=E3=83=9F=E3=83=BC=E3=83=97?= =?UTF-8?q?=E3=83=AB=E3=83=AA=E3=82=AF=E3=81=AE=E3=81=A4=E3=81=84=E3=81=A7?= =?UTF-8?q?=E3=81=AB=E3=80=81=E3=82=B3=E3=83=BC=E3=83=89=E5=85=A8=E4=BD=93?= =?UTF-8?q?=E3=81=AB=E3=83=95=E3=82=A9=E3=83=BC=E3=83=9E=E3=83=83=E3=82=BF?= =?UTF-8?q?=E3=82=92=E3=81=8B=E3=81=91=E3=81=A6=E4=BD=9C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Directory.Build.props | 12 ++-- SimpleVolumeMixer/App.xaml | 19 +++--- SimpleVolumeMixer/App.xaml.cs | 13 ++-- .../Helper/Component/DisposableComponent.cs | 2 +- .../Component/KeyValueInstanceManager.cs | 2 +- .../Core/Helper/Component/QueueProcessor.cs | 5 +- .../CoreAudio/AudioSessionAccessorManager.cs | 9 +-- .../CoreAudio/AudioSessionManagerAccessor.cs | 4 +- .../Event/AudioDeviceAccessorEventArgs.cs | 2 +- ...ionAccessorSimpleVolumeChangedEventArgs.cs | 3 +- ...eviceAccessorRoleHolderChangedEventArgs.cs | 3 +- .../EventAdapter/AudioSessionEventAdapter.cs | 2 +- .../NotificationClientEventAdapter.cs | 4 +- .../Models/Domain/CoreAudio/AudioDevice.cs | 2 +- .../Core/Services/CoreAudioService.cs | 2 +- .../Core/Services/FileService.cs | 2 +- SimpleVolumeMixer/FodyWeavers.xml | 2 +- SimpleVolumeMixer/NLog.config | 23 ++++--- SimpleVolumeMixer/Properties/Resources.resx | 4 +- SimpleVolumeMixer/SimpleVolumeMixer.csproj | 68 +++++++++---------- .../DisposableComponentLifetimeManager.cs | 11 ++- .../UseCase/AudioSessionsPageUseCase.cs | 4 +- .../MenuItemTemplateSelector.cs | 4 +- .../ViewModels/AudioSessionsPageViewModel.cs | 4 +- .../UI/ViewModels/SettingsPageViewModel.cs | 3 +- .../UI/Views/AudioDevicesPage.xaml.cs | 2 +- .../AudioSessionsSubHorizontalPage.xaml | 2 +- .../Controls/HamburgerMenuPackIconItem.cs | 8 +-- .../UI/Views/Controls/PeakBar.xaml | 2 +- .../UI/Views/Controls/PeakBar.xaml.cs | 16 +++-- SimpleVolumeMixer/UI/Views/SettingsPage.xaml | 4 +- SimpleVolumeMixer/UI/Views/ShellWindow.xaml | 8 +-- 32 files changed, 132 insertions(+), 119 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index c5b125d..91bd66c 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,9 +1,9 @@  - - - 3.4.255 - all - - + + + 3.4.255 + all + + \ No newline at end of file diff --git a/SimpleVolumeMixer/App.xaml b/SimpleVolumeMixer/App.xaml index 2d480d6..97b82cb 100644 --- a/SimpleVolumeMixer/App.xaml +++ b/SimpleVolumeMixer/App.xaml @@ -22,16 +22,16 @@ MahApps.Metro resource dictionaries. Learn more about using MahApps.Metro at https://mahapps.com/ --> - - - + - @@ -39,7 +39,7 @@ Source="pack://application:,,,/MaterialDesignThemes.MahApps;component/Themes/MaterialDesignTheme.MahApps.Fonts.xaml" /> - + @@ -49,11 +49,14 @@ - + - + - + \ No newline at end of file diff --git a/SimpleVolumeMixer/App.xaml.cs b/SimpleVolumeMixer/App.xaml.cs index 53707d2..635b8a1 100644 --- a/SimpleVolumeMixer/App.xaml.cs +++ b/SimpleVolumeMixer/App.xaml.cs @@ -47,7 +47,7 @@ protected override async void OnInitialized() var themeSelectorService = Container.Resolve(); themeSelectorService.InitializeTheme(); - + base.OnInitialized(); await Task.CompletedTask; } @@ -66,15 +66,18 @@ protected override void RegisterTypes(IContainerRegistry containerRegistry) containerRegistry.Register(); containerRegistry.Register(); containerRegistry.Register(); - + // UseCases - containerRegistry.GetContainer().RegisterType(new DisposableComponentLifetimeManager()); + containerRegistry.GetContainer() + .RegisterType(new DisposableComponentLifetimeManager()); // Views containerRegistry.RegisterForNavigation(PageKeys.Settings); containerRegistry.RegisterForNavigation(PageKeys.AudioSessions); - containerRegistry.RegisterForNavigation(PageKeys.AudioSessionsSubHorizontal); - containerRegistry.RegisterForNavigation(PageKeys.AudioSessionsSubVertical); + containerRegistry.RegisterForNavigation( + PageKeys.AudioSessionsSubHorizontal); + containerRegistry.RegisterForNavigation( + PageKeys.AudioSessionsSubVertical); containerRegistry.RegisterForNavigation(PageKeys.AudioDevices); containerRegistry.RegisterForNavigation(); diff --git a/SimpleVolumeMixer/Core/Helper/Component/DisposableComponent.cs b/SimpleVolumeMixer/Core/Helper/Component/DisposableComponent.cs index 23524c3..d9beb63 100644 --- a/SimpleVolumeMixer/Core/Helper/Component/DisposableComponent.cs +++ b/SimpleVolumeMixer/Core/Helper/Component/DisposableComponent.cs @@ -58,7 +58,7 @@ public void Dispose() { return; } - + OnDisposing(); _disposable.Dispose(); OnDisposed(); diff --git a/SimpleVolumeMixer/Core/Helper/Component/KeyValueInstanceManager.cs b/SimpleVolumeMixer/Core/Helper/Component/KeyValueInstanceManager.cs index 558254b..8ff5747 100644 --- a/SimpleVolumeMixer/Core/Helper/Component/KeyValueInstanceManager.cs +++ b/SimpleVolumeMixer/Core/Helper/Component/KeyValueInstanceManager.cs @@ -39,7 +39,7 @@ private void KeyOnDisposed(object? sender, EventArgs e) { return; } - + lock (_gate) { var key = (TK)sender; diff --git a/SimpleVolumeMixer/Core/Helper/Component/QueueProcessor.cs b/SimpleVolumeMixer/Core/Helper/Component/QueueProcessor.cs index cf3cb07..aa5718d 100644 --- a/SimpleVolumeMixer/Core/Helper/Component/QueueProcessor.cs +++ b/SimpleVolumeMixer/Core/Helper/Component/QueueProcessor.cs @@ -6,7 +6,6 @@ namespace SimpleVolumeMixer.Core.Helper.Component; - public class QueueProcessor : DisposableComponent { private readonly BlockingCollection> _handles; @@ -45,7 +44,7 @@ private void DoProcess() handle.Executed = true; continue; } - + handle.Result = handle.Function(handle.Argument); handle.Executed = true; } @@ -56,4 +55,4 @@ protected override void OnDisposing() StopRequest(); base.OnDisposing(); } -} +} \ No newline at end of file diff --git a/SimpleVolumeMixer/Core/Helper/CoreAudio/AudioSessionAccessorManager.cs b/SimpleVolumeMixer/Core/Helper/CoreAudio/AudioSessionAccessorManager.cs index d8cc4f3..83d4e09 100644 --- a/SimpleVolumeMixer/Core/Helper/CoreAudio/AudioSessionAccessorManager.cs +++ b/SimpleVolumeMixer/Core/Helper/CoreAudio/AudioSessionAccessorManager.cs @@ -15,6 +15,7 @@ public class AudioSessionAccessorManager : SynchronizedReactiveCollectionWrapper /// いずれかのセッションが破棄される際に呼び出される /// public event EventHandler? SessionDisposing; + /// /// いずれかのセッションが破棄された際に呼び出される /// @@ -31,7 +32,7 @@ public AudioSessionAccessorManager(AudioDeviceAccessor device, ILogger logger) _sessionManager.SessionManagerClosed += OnSessionManagerClosed; _sessionManager.SessionCreated += OnSessionCreated; } - + /// /// 引数のPIDを持つセッションが内蔵コレクションにあるかを確認する /// @@ -178,7 +179,7 @@ public void CloseSession() { _sessionManager.CloseSessionManager(); } - + /// /// CoreAudioAPIから新規セッションが作成された旨の通知が届いた際に呼び出される /// @@ -192,10 +193,10 @@ private void OnSessionCreated(object? sender, SessionCreatedEventArgs e) { return; } - + Add(e.NewSession); } - + /// /// セッションマネージャの取得が完了した際に呼び出される。 /// diff --git a/SimpleVolumeMixer/Core/Helper/CoreAudio/AudioSessionManagerAccessor.cs b/SimpleVolumeMixer/Core/Helper/CoreAudio/AudioSessionManagerAccessor.cs index 085af9e..2b6a59c 100644 --- a/SimpleVolumeMixer/Core/Helper/CoreAudio/AudioSessionManagerAccessor.cs +++ b/SimpleVolumeMixer/Core/Helper/CoreAudio/AudioSessionManagerAccessor.cs @@ -53,7 +53,7 @@ public async Task OpenSessionManager() { // 古いインスタンスがある場合は破棄 CloseSessionManager(); - + // 個別で破棄するのでDisposableには入れない _sessionManager = sessionManager; _eventAdapter = new AudioSessionManagerEventAdapter(sessionManager, _logger); @@ -92,7 +92,7 @@ public void CloseSessionManager() { return null; } - + return _sessionManager.GetSessionEnumerator(); } } diff --git a/SimpleVolumeMixer/Core/Helper/CoreAudio/Event/AudioDeviceAccessorEventArgs.cs b/SimpleVolumeMixer/Core/Helper/CoreAudio/Event/AudioDeviceAccessorEventArgs.cs index 96ce9d9..8d57070 100644 --- a/SimpleVolumeMixer/Core/Helper/CoreAudio/Event/AudioDeviceAccessorEventArgs.cs +++ b/SimpleVolumeMixer/Core/Helper/CoreAudio/Event/AudioDeviceAccessorEventArgs.cs @@ -8,6 +8,6 @@ public AudioDeviceAccessorEventArgs(AudioDeviceAccessor device) { Device = device; } - + public AudioDeviceAccessor Device { get; } } \ No newline at end of file diff --git a/SimpleVolumeMixer/Core/Helper/CoreAudio/Event/AudioSessionAccessorSimpleVolumeChangedEventArgs.cs b/SimpleVolumeMixer/Core/Helper/CoreAudio/Event/AudioSessionAccessorSimpleVolumeChangedEventArgs.cs index 8bac7db..4087775 100644 --- a/SimpleVolumeMixer/Core/Helper/CoreAudio/Event/AudioSessionAccessorSimpleVolumeChangedEventArgs.cs +++ b/SimpleVolumeMixer/Core/Helper/CoreAudio/Event/AudioSessionAccessorSimpleVolumeChangedEventArgs.cs @@ -2,7 +2,8 @@ public class AudioSessionAccessorSimpleVolumeChangedEventArgs : AudioSessionAccessorEventArgs { - public AudioSessionAccessorSimpleVolumeChangedEventArgs(AudioSessionAccessor session, float newVolume, bool isMuted) : + public AudioSessionAccessorSimpleVolumeChangedEventArgs(AudioSessionAccessor session, float newVolume, bool isMuted) + : base(session) { NewVolume = newVolume; diff --git a/SimpleVolumeMixer/Core/Helper/CoreAudio/Event/DeviceAccessorRoleHolderChangedEventArgs.cs b/SimpleVolumeMixer/Core/Helper/CoreAudio/Event/DeviceAccessorRoleHolderChangedEventArgs.cs index a376d45..4f82d64 100644 --- a/SimpleVolumeMixer/Core/Helper/CoreAudio/Event/DeviceAccessorRoleHolderChangedEventArgs.cs +++ b/SimpleVolumeMixer/Core/Helper/CoreAudio/Event/DeviceAccessorRoleHolderChangedEventArgs.cs @@ -4,7 +4,8 @@ namespace SimpleVolumeMixer.Core.Helper.CoreAudio.Event; public class DeviceAccessorRoleHolderChangedEventArgs : AudioDeviceAccessorEventArgs { - internal DeviceAccessorRoleHolderChangedEventArgs(AudioDeviceAccessor device, RoleType role, bool oldState, bool newState) : + internal DeviceAccessorRoleHolderChangedEventArgs(AudioDeviceAccessor device, RoleType role, bool oldState, + bool newState) : base(device) { Role = role; diff --git a/SimpleVolumeMixer/Core/Helper/CoreAudio/EventAdapter/AudioSessionEventAdapter.cs b/SimpleVolumeMixer/Core/Helper/CoreAudio/EventAdapter/AudioSessionEventAdapter.cs index 6a726ad..a4ea920 100644 --- a/SimpleVolumeMixer/Core/Helper/CoreAudio/EventAdapter/AudioSessionEventAdapter.cs +++ b/SimpleVolumeMixer/Core/Helper/CoreAudio/EventAdapter/AudioSessionEventAdapter.cs @@ -142,7 +142,7 @@ protected override void OnDisposing() _session.GroupingParamChanged -= OnGroupingParamChanged; _session.StateChanged -= OnStateChanged; _session.SessionDisconnected -= OnSessionDisconnected; - + _processor.StopRequest(); base.OnDisposing(); diff --git a/SimpleVolumeMixer/Core/Helper/CoreAudio/EventAdapter/NotificationClientEventAdapter.cs b/SimpleVolumeMixer/Core/Helper/CoreAudio/EventAdapter/NotificationClientEventAdapter.cs index 3139c9d..df6f20e 100644 --- a/SimpleVolumeMixer/Core/Helper/CoreAudio/EventAdapter/NotificationClientEventAdapter.cs +++ b/SimpleVolumeMixer/Core/Helper/CoreAudio/EventAdapter/NotificationClientEventAdapter.cs @@ -102,13 +102,13 @@ private void Push(Action action) protected override void OnDisposing() { _logger.LogDebug("disposing..."); - + _client.DeviceAdded -= OnDeviceAdded; _client.DeviceRemoved -= OnDeviceRemoved; _client.DevicePropertyChanged -= OnDevicePropertyChanged; _client.DeviceStateChanged -= OnDeviceStateChanged; _client.DefaultDeviceChanged -= OnDefaultDeviceChanged; - + _processor.Dispose(); base.OnDisposing(); diff --git a/SimpleVolumeMixer/Core/Models/Domain/CoreAudio/AudioDevice.cs b/SimpleVolumeMixer/Core/Models/Domain/CoreAudio/AudioDevice.cs index 6ec0903..ede6bf0 100644 --- a/SimpleVolumeMixer/Core/Models/Domain/CoreAudio/AudioDevice.cs +++ b/SimpleVolumeMixer/Core/Models/Domain/CoreAudio/AudioDevice.cs @@ -140,7 +140,7 @@ private void DeviceOnDisposed(object? sender, EventArgs e) { Dispose(); } - + public AudioDeviceAccessor Device { get; } public ReadOnlyReactiveCollection Sessions { get; } diff --git a/SimpleVolumeMixer/Core/Services/CoreAudioService.cs b/SimpleVolumeMixer/Core/Services/CoreAudioService.cs index cdbae23..f12ccb7 100644 --- a/SimpleVolumeMixer/Core/Services/CoreAudioService.cs +++ b/SimpleVolumeMixer/Core/Services/CoreAudioService.cs @@ -42,7 +42,7 @@ public CoreAudioService(ICoreAudioRepository coreAudioRepository) public ReadOnlyReactiveCollection Devices { get; } public IReadOnlyReactiveProperty CommunicationRoleDevice { get; } public IReadOnlyReactiveProperty MultimediaRoleDevice { get; } - + public void SetDefaultDevice(AudioDevice device, DataFlowType dataFlowType, RoleType roleType) { _coreAudioRepository.SetDefaultDevice(device.Device, dataFlowType, roleType); diff --git a/SimpleVolumeMixer/Core/Services/FileService.cs b/SimpleVolumeMixer/Core/Services/FileService.cs index 4c4a9ad..5fdc77e 100644 --- a/SimpleVolumeMixer/Core/Services/FileService.cs +++ b/SimpleVolumeMixer/Core/Services/FileService.cs @@ -34,7 +34,7 @@ public void Delete(string folderPath, string fileName) { throw new ArgumentNullException(nameof(fileName)); } - + if (File.Exists(Path.Combine(folderPath, fileName))) { File.Delete(Path.Combine(folderPath, fileName)); diff --git a/SimpleVolumeMixer/FodyWeavers.xml b/SimpleVolumeMixer/FodyWeavers.xml index 5029e70..baf768d 100644 --- a/SimpleVolumeMixer/FodyWeavers.xml +++ b/SimpleVolumeMixer/FodyWeavers.xml @@ -1,3 +1,3 @@  - + \ No newline at end of file diff --git a/SimpleVolumeMixer/NLog.config b/SimpleVolumeMixer/NLog.config index 2d5339f..9e03c84 100644 --- a/SimpleVolumeMixer/NLog.config +++ b/SimpleVolumeMixer/NLog.config @@ -1,29 +1,32 @@  - + - + value="${longdate}\t[t${threadid}]\t[${logger}]\t[${callsite:includeNamespace=false}]\t[${level:upperCase=true}]] ${message} ${exception:format=message,stacktrace} ${event-properties:item=ir-objects}"/> + - + layout="${Layout}"/> - ${longdate} [t${threadid}] [${logger}] [${callsite:includeNamespace=false}] [${level:upperCase=true}] ${message} ${exception:format=message,stacktrace} ${event-properties:item=ir-objects} + ${longdate} [t${threadid}] [${logger}] [${callsite:includeNamespace=false}] + [${level:upperCase=true}] ${message} ${exception:format=message,stacktrace} + ${event-properties:item=ir-objects} + - + \ No newline at end of file diff --git a/SimpleVolumeMixer/Properties/Resources.resx b/SimpleVolumeMixer/Properties/Resources.resx index b7f1732..2e9e7ee 100644 --- a/SimpleVolumeMixer/Properties/Resources.resx +++ b/SimpleVolumeMixer/Properties/Resources.resx @@ -33,8 +33,8 @@ https://github.com/samunohito/SimpleVolumeMixer - - + + Dark diff --git a/SimpleVolumeMixer/SimpleVolumeMixer.csproj b/SimpleVolumeMixer/SimpleVolumeMixer.csproj index 434153b..701fd0a 100644 --- a/SimpleVolumeMixer/SimpleVolumeMixer.csproj +++ b/SimpleVolumeMixer/SimpleVolumeMixer.csproj @@ -13,32 +13,32 @@ - all - runtime; compile; build; native; contentfiles; analyzers; buildtransitive + all + runtime; compile; build; native; contentfiles; analyzers; buildtransitive - + - all - runtime; compile; build; native; contentfiles; analyzers; buildtransitive + all + runtime; compile; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - + + + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - + + + + + + @@ -63,7 +63,7 @@ - + @@ -73,22 +73,22 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + - + diff --git a/SimpleVolumeMixer/UI/Helpers/Components/DisposableComponentLifetimeManager.cs b/SimpleVolumeMixer/UI/Helpers/Components/DisposableComponentLifetimeManager.cs index 9212760..373e256 100644 --- a/SimpleVolumeMixer/UI/Helpers/Components/DisposableComponentLifetimeManager.cs +++ b/SimpleVolumeMixer/UI/Helpers/Components/DisposableComponentLifetimeManager.cs @@ -1,5 +1,4 @@ - -using System; +using System; using SimpleVolumeMixer.Core.Helper.Component; using Unity.Lifetime; @@ -8,7 +7,7 @@ namespace SimpleVolumeMixer.UI.Helpers.Components; public class DisposableComponentLifetimeManager : ContainerControlledLifetimeManager { private IDisposableComponent? _disposableComponent = null; - + protected override LifetimeManager OnCreateLifetimeManager() { return new DisposableComponentLifetimeManager(); @@ -20,16 +19,16 @@ public override void SetValue(object newValue, ILifetimeContainer? container = n { return; } - + if (newValue is IDisposableComponent dc) { _disposableComponent = dc; dc.Disposed += OnTargetDisposed; } - + base.SetValue(newValue, container); } - + private void OnTargetDisposed(object? sender, EventArgs e) { if (_disposableComponent != null) diff --git a/SimpleVolumeMixer/UI/Models/UseCase/AudioSessionsPageUseCase.cs b/SimpleVolumeMixer/UI/Models/UseCase/AudioSessionsPageUseCase.cs index 46e8163..8acd1c6 100644 --- a/SimpleVolumeMixer/UI/Models/UseCase/AudioSessionsPageUseCase.cs +++ b/SimpleVolumeMixer/UI/Models/UseCase/AudioSessionsPageUseCase.cs @@ -19,12 +19,12 @@ public AudioSessionsPageUseCase(ICoreAudioService coreAudioService) Devices = coreAudioService.Devices .ToReadOnlyReactiveCollection(disposeElement: false) .AddTo(Disposable); - + // マルチメディアロールのデバイスを初期表示にしたい. SelectedDevice = coreAudioService.MultimediaRoleDevice .ToReactiveProperty() .AddTo(Disposable); - + // デバイスの選択変更時にセッションの開け締めを行うため通知を購読する. // 前回値が出来るまで待ち合わせるので、下記の購読開始処理を実行しただけでは動作しない. SelectedDevice diff --git a/SimpleVolumeMixer/UI/TemplateSelectors/MenuItemTemplateSelector.cs b/SimpleVolumeMixer/UI/TemplateSelectors/MenuItemTemplateSelector.cs index 1b7f258..4a9bf5c 100644 --- a/SimpleVolumeMixer/UI/TemplateSelectors/MenuItemTemplateSelector.cs +++ b/SimpleVolumeMixer/UI/TemplateSelectors/MenuItemTemplateSelector.cs @@ -13,11 +13,11 @@ public MenuItemTemplateSelector() ImageDataTemplate = null; PackIconTemplate = null; } - + public DataTemplate? GlyphDataTemplate { get; set; } public DataTemplate? ImageDataTemplate { get; set; } - + public DataTemplate? PackIconTemplate { get; set; } public override DataTemplate? SelectTemplate(object item, DependencyObject container) diff --git a/SimpleVolumeMixer/UI/ViewModels/AudioSessionsPageViewModel.cs b/SimpleVolumeMixer/UI/ViewModels/AudioSessionsPageViewModel.cs index 865d5d0..4c875c7 100644 --- a/SimpleVolumeMixer/UI/ViewModels/AudioSessionsPageViewModel.cs +++ b/SimpleVolumeMixer/UI/ViewModels/AudioSessionsPageViewModel.cs @@ -62,7 +62,7 @@ public AudioSessionsPageViewModel(IRegionManager regionManager, AudioSessionsPag SelectedDeviceForPanel.Clear(); if (x != null) { - SelectedDeviceForPanel.Add(x); + SelectedDeviceForPanel.Add(x); } }) .AddTo(Disposable); @@ -84,7 +84,7 @@ public AudioSessionsPageViewModel(IRegionManager regionManager, AudioSessionsPag /// この選択値はUseCaseを通じて子ページ側のセッション一覧にも影響する. /// public IReactiveProperty SelectedDevice { get; } - + /// /// 現在、メインの表示対象として設定されているデバイス. /// 内容はSelectedDeviceの値が1つだけで、複数入ることはない. diff --git a/SimpleVolumeMixer/UI/ViewModels/SettingsPageViewModel.cs b/SimpleVolumeMixer/UI/ViewModels/SettingsPageViewModel.cs index 4a88d26..0ea401c 100644 --- a/SimpleVolumeMixer/UI/ViewModels/SettingsPageViewModel.cs +++ b/SimpleVolumeMixer/UI/ViewModels/SettingsPageViewModel.cs @@ -44,7 +44,8 @@ IApplicationInfoService applicationInfoService public void OnNavigatedTo(NavigationContext navigationContext) { - VersionDescription.Value = $"{Resources.AppDisplayName} - {_applicationInfoService.GetAssemblyProductVersion()}"; + VersionDescription.Value = + $"{Resources.AppDisplayName} - {_applicationInfoService.GetAssemblyProductVersion()}"; Theme.Value = _themeSelectorService.GetCurrentTheme(); } diff --git a/SimpleVolumeMixer/UI/Views/AudioDevicesPage.xaml.cs b/SimpleVolumeMixer/UI/Views/AudioDevicesPage.xaml.cs index b8d75d0..26b4ab4 100644 --- a/SimpleVolumeMixer/UI/Views/AudioDevicesPage.xaml.cs +++ b/SimpleVolumeMixer/UI/Views/AudioDevicesPage.xaml.cs @@ -23,4 +23,4 @@ public AudioDevicesPage() InitializeComponent(); } } -} +} \ No newline at end of file diff --git a/SimpleVolumeMixer/UI/Views/Controls/AudioSessionsSubHorizontalPage.xaml b/SimpleVolumeMixer/UI/Views/Controls/AudioSessionsSubHorizontalPage.xaml index 6593220..e2be6ae 100644 --- a/SimpleVolumeMixer/UI/Views/Controls/AudioSessionsSubHorizontalPage.xaml +++ b/SimpleVolumeMixer/UI/Views/Controls/AudioSessionsSubHorizontalPage.xaml @@ -10,7 +10,7 @@ (PackIconKind)GetValue(KindProperty); set => SetValue(KindProperty, value); } - + protected override Freezable CreateInstanceCore() { return new HamburgerMenuPackIconItem(); diff --git a/SimpleVolumeMixer/UI/Views/Controls/PeakBar.xaml b/SimpleVolumeMixer/UI/Views/Controls/PeakBar.xaml index 57f9112..4f6f755 100644 --- a/SimpleVolumeMixer/UI/Views/Controls/PeakBar.xaml +++ b/SimpleVolumeMixer/UI/Views/Controls/PeakBar.xaml @@ -233,7 +233,7 @@ - (double)GetValue(LargeChangeProperty); set => SetValue(LargeChangeProperty, value); } - + public Orientation Orientation { get => (Orientation)GetValue(OrientationProperty); set => SetValue(OrientationProperty, value); } - + public IPeakBarHandler PeakBarHandler { get => (IPeakBarHandler)GetValue(PeakBarHandlerProperty); @@ -147,7 +147,7 @@ public event EventHandler? Ready { add { value?.Invoke(this, new PeakBarReadyEventArgs(_handler)); } // ReSharper disable once ValueParameterNotUsed - remove{} + remove { } } private static void MeterMaximumPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) @@ -155,7 +155,7 @@ private static void MeterMaximumPropertyChanged(DependencyObject d, DependencyPr var peakBar = (PeakBar)d; peakBar.UpdateMeterArea(peakBar.MeterValue); } - + private static void PeakBarHandlerPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { var peakBar = (PeakBar)d; @@ -225,6 +225,7 @@ private void SetAreaSize(double newMeterValue) GrayArea.Height = _originHeight; GreenArea.Height = _originHeight; } + break; case Orientation.Vertical: GrayArea.Height = newMeterValue; @@ -234,6 +235,7 @@ private void SetAreaSize(double newMeterValue) GrayArea.Width = _originWidth; GreenArea.Width = _originWidth; } + break; } } diff --git a/SimpleVolumeMixer/UI/Views/SettingsPage.xaml b/SimpleVolumeMixer/UI/Views/SettingsPage.xaml index 64c7c2a..28628c9 100644 --- a/SimpleVolumeMixer/UI/Views/SettingsPage.xaml +++ b/SimpleVolumeMixer/UI/Views/SettingsPage.xaml @@ -13,7 +13,7 @@ d:DataContext="{d:DesignInstance Type=viewModels:SettingsPageViewModel}" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"> - + @@ -87,7 +87,7 @@ Text="{Binding VersionDescription.Value, Mode=OneWay}" Margin="{StaticResource XSmallTopMargin}" Style="{StaticResource BodyTextStyle}" /> - + - + Kind="{Binding Kind}" /> - + \ No newline at end of file