Skip to content

Commit 576b897

Browse files
committed
1.7.6
[New] - Audio action (select audio devices) - Last actions overwiew on status page - Logs window (see status bar) [Bug fixes] German support are broken #41
1 parent d9397fb commit 576b897

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1084
-276
lines changed
13 KB
Binary file not shown.
14.5 KB
Binary file not shown.
32 KB
Binary file not shown.

Source/Externals/CodectoryCore.dll

20.5 KB
Binary file not shown.
File renamed without changes.

Source/HDRProfile/App.xaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@
1414

1515
<Application.Resources>
1616

17+
18+
19+
<system:String x:Key="DonateLink">https://paypal.me/HeikoH89</system:String>
20+
<system:String x:Key="GitHubRepoLink">https://github.com/Codectory/AutoHDR</system:String>
21+
22+
23+
24+
1725
<Color x:Key="ActiveColor">#2ac987</Color>
1826
<Color x:Key="AccentColor">#ff6666</Color>
1927

@@ -102,9 +110,6 @@
102110

103111

104112

105-
106-
<system:String x:Key="DonateLink">https://paypal.me/HeikoH89</system:String>
107-
<system:String x:Key="GitHubRepoLink">https://github.com/Codectory/AutoHDR</system:String>
108113
<!--<Color x:Key="AccentColor">#5d9ac7</Color> -->
109114
<SolidColorBrush x:Key="ButtonForegroundBrush">White</SolidColorBrush>
110115

@@ -421,15 +426,6 @@
421426
</Border.BorderBrush>
422427
<Border.Background>
423428
<SolidColorBrush Color="Transparent"/>
424-
425-
426-
</Border.Background>
427-
</Border>
428-
<Border Grid.Column="0"
429-
CornerRadius="2,0,0,2"
430-
Margin="1" >
431-
<Border.Background>
432-
<SolidColorBrush Color="Transparent"/>
433429
</Border.Background>
434430
</Border>
435431
<Path x:Name="Arrow"
@@ -453,6 +449,7 @@
453449

454450
<Style x:Key="DefaultComboBox"
455451
TargetType="{x:Type ComboBox}">
452+
456453
<Setter Property="SnapsToDevicePixels"
457454
Value="true" />
458455
<Setter Property="OverridesDefaultStyle"
@@ -468,7 +465,6 @@
468465
<Setter Property="MinHeight"
469466
Value="20" />
470467

471-
472468
<Setter Property="Template">
473469
<Setter.Value>
474470
<ControlTemplate TargetType="{x:Type ComboBox}">
@@ -584,6 +580,7 @@
584580
</ControlTemplate>
585581
</Setter.Value>
586582
</Setter>
583+
587584
</Style>
588585

589586
<Style x:Key="{x:Type ComboBoxItem}"
@@ -778,7 +775,7 @@
778775
<corewpf:IsNotNullConverter />
779776
<corewpf:VisibilityBooleanConverter />
780777
</corewpf:ConverterChain>
781-
778+
<corewpf:TupleConverter x:Key="TupleConverter"/>
782779
<DataTemplate DataType="{x:Type local:ApplicationAdder}">
783780
<views:ApplicationAdderView></views:ApplicationAdderView>
784781
</DataTemplate>
@@ -791,6 +788,9 @@
791788
<DataTemplate DataType="{x:Type info:AutoHDRInfo}">
792789
<views:AutoHDRInfoView></views:AutoHDRInfoView>
793790
</DataTemplate>
791+
<DataTemplate DataType="{x:Type info:LogsStorage}">
792+
<views:AutoHDRLogsView></views:AutoHDRLogsView>
793+
</DataTemplate>
794794
</Application.Resources>
795795

796796
</Application>

Source/HDRProfile/ApplicationItem.cs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
using CodectoryCore.UI.Wpf;
2+
using CodectoryCore.Windows;
3+
using CodectoryCore.Windows.FileSystem;
4+
using CodectoryCore.Windows.Icons;
25
using Newtonsoft.Json;
36
using System;
47
using System.Collections.Generic;
@@ -32,7 +35,7 @@ public class ApplicationItem : BaseViewModel, IEquatable<ApplicationItem>
3235
[JsonProperty]
3336
public string ApplicationName { get => _applicationName; set { _applicationName = value; OnPropertyChanged(); } }
3437
[JsonProperty]
35-
public string ApplicationFilePath { get => _applicationFilePath; set { _applicationFilePath = value; try { Icon = Tools.GetFileIcon(value); } catch { } OnPropertyChanged(); } }
38+
public string ApplicationFilePath { get => _applicationFilePath; set { _applicationFilePath = value; try { Icon = IconHelper.GetFileIcon(value); } catch { } OnPropertyChanged(); } }
3639
// public bool RestartProcess { get => _restartProcess; set { _restartProcess = value; OnPropertyChanged(); } }
3740
[JsonProperty]
3841
public bool IsUWP { get => _isUWP; set { _isUWP = value; OnPropertyChanged(); } }
@@ -72,7 +75,7 @@ public ApplicationItem(string displayName, string applicationFilePath, string uw
7275
//private void UpdateRestartAppStates(IDictionary<ApplicationItem, ApplicationState> applicationStates, bool restartApps)
7376
//{
7477
// Dictionary<ApplicationItem, ApplicationState> newLastAppStates = new Dictionary<ApplicationItem, ApplicationState>();
75-
// Tools.Logs.Add($"Updating application states...", false);
78+
// Globals.Logs.Add($"Updating application states...", false);
7679
// foreach (var applicationState in applicationStates)
7780
// {
7881
// newLastAppStates.Add(applicationState.Key, applicationState.Value);
@@ -93,11 +96,11 @@ public void Restart()
9396
{
9497
try
9598
{
96-
Tools.Logs.Add($"Restarting application {ApplicationName}", false);
99+
Globals.Logs.Add($"Restarting application {ApplicationName}", false);
97100
foreach (Process process in Process.GetProcessesByName(ApplicationName).ToList())
98101
if (process.StartTime < Process.GetCurrentProcess().StartTime)
99102
{
100-
Tools.Logs.Add($"Won't restart application {ApplicationName} as it was running before { ProjectResources.Locale_Texts.AutoHDR}.", false);
103+
Globals.Logs.Add($"Won't restart application {ApplicationName} as it was running before { ProjectResources.Locale_Texts.AutoHDR}.", false);
101104

102105
return;
103106
}
@@ -107,14 +110,14 @@ public void Restart()
107110
}
108111
catch (Exception ex)
109112
{
110-
Tools.Logs.AddException($"Failed to restart process {DisplayName} ({ApplicationFilePath}).", ex);
113+
Globals.Logs.AddException($"Failed to restart process {DisplayName} ({ApplicationFilePath}).", ex);
111114
throw;
112115
}
113116
}
114117

115118
public void StartApplication()
116119
{
117-
Tools.Logs.Add($"Start application {ApplicationName}", false);
120+
Globals.Logs.Add($"Start application {ApplicationName}", false);
118121
try
119122
{
120123
if (IsUWP)
@@ -132,18 +135,18 @@ public void StartApplication()
132135
if (processes.Count > 0)
133136
{
134137
Process foundProcess = new Process();
135-
Tools.Logs.Add($"Bring application to front: {ApplicationName}", false);
138+
Globals.Logs.Add($"Bring application to front: {ApplicationName}", false);
136139
foundProcess = processes[0];
137140
if (!foundProcess.HasExited && foundProcess.Responding)
138-
Tools.BringMainWindowToFront(foundProcess.ProcessName);
141+
Window.BringMainWindowToFront(foundProcess.ProcessName);
139142
}
140143
else
141-
Tools.Logs.Add($"No started application found: {ApplicationName}", false);
144+
Globals.Logs.Add($"No started application found: {ApplicationName}", false);
142145

143146
}
144147
catch (Exception ex)
145148
{
146-
Tools.Logs.AddException(ex);
149+
Globals.Logs.AddException(ex);
147150
}
148151
}
149152

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
using AudioSwitcher.AudioApi;
2+
using AudioSwitcher.AudioApi.CoreAudio;
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Collections.ObjectModel;
6+
using System.Collections.Concurrent;
7+
using System.Linq;
8+
using System.Text;
9+
using System.Threading;
10+
using System.Threading.Tasks;
11+
using CodectoryCore.UI.Wpf;
12+
13+
namespace AutoHDR.Audio
14+
{
15+
public static class AudioManager
16+
{
17+
static readonly object _lockInitialize = new object();
18+
19+
20+
public static bool AudioDeviceUpdatesRunning { get; private set; } = false;
21+
22+
public static CoreAudioController Controller { get; private set; } =null;
23+
24+
public static IReadOnlyList<CoreAudioDevice> OutputAudioDevices { get; private set; }
25+
26+
public static IReadOnlyList<CoreAudioDevice> InputAudioDevices { get; private set;}
27+
28+
public static bool Initialized { get; private set; } = false;
29+
30+
public static void Initialize()
31+
{
32+
lock (_lockInitialize)
33+
{
34+
if (Initialized)
35+
return;
36+
Controller = new CoreAudioController();
37+
OutputAudioDevices = Controller.GetPlaybackDevices().ToList().AsReadOnly();
38+
InputAudioDevices = Controller.GetCaptureDevices().ToList().AsReadOnly();
39+
Initialized = true;
40+
}
41+
}
42+
43+
44+
}
45+
}

0 commit comments

Comments
 (0)