Skip to content

Commit

Permalink
1.9.1
Browse files Browse the repository at this point in the history
[Bug fixes]
- Display action: Cannot changecolor depth when changing HDR was disabled
- Unclear label for changing HDR
- Backup settings file will no longer end with ".xml.bak"
  • Loading branch information
Codectory committed Jan 2, 2022
1 parent ddda4d9 commit 2e897b7
Show file tree
Hide file tree
Showing 12 changed files with 182 additions and 149 deletions.
117 changes: 63 additions & 54 deletions Source/AutoHDR.ProjectResources/ProjectLocales.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 21 additions & 18 deletions Source/AutoHDR.ProjectResources/ProjectLocales.de.resx
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,27 @@
<data name="BuyBeer" xml:space="preserve">
<value>Kauf mir ein Bier!</value>
</data>
<data name="ChangeColorDepth" xml:space="preserve">
<value>Farbtiefe ändern</value>
</data>
<data name="ChangeHDR" xml:space="preserve">
<value>HDR ändern</value>
</data>
<data name="Changelog" xml:space="preserve">
<value>Changelog</value>
</data>
<data name="ChangePlaybackDevice" xml:space="preserve">
<value>Wiedergabegerät ändern</value>
</data>
<data name="ChangeRecordDevice" xml:space="preserve">
<value>Aufnahmegerät ändern</value>
</data>
<data name="ChangeRefreshRate" xml:space="preserve">
<value>Bildwiederholrate ändern</value>
</data>
<data name="ChangeResolution" xml:space="preserve">
<value>Auflösung ändern</value>
</data>
<data name="CheckForNewVersion" xml:space="preserve">
<value>Beim Start auf neuere Version prüfen</value>
</data>
Expand Down Expand Up @@ -273,9 +291,6 @@
<data name="Info" xml:space="preserve">
<value>Info</value>
</data>
<data name="InputDevice" xml:space="preserve">
<value>Eingangsgerät</value>
</data>
<data name="IsPrimaryMonitor" xml:space="preserve">
<value>Hauptmonitor</value>
</data>
Expand All @@ -300,6 +315,9 @@
<data name="ManagedHDR" xml:space="preserve">
<value>Automatischer HDR-Modus</value>
</data>
<data name="MessageInvalidSettings" xml:space="preserve">
<value>Ungültige Einstellungen</value>
</data>
<data name="MessageMissingAudioDevice" xml:space="preserve">
<value>Audiogerät fehlt.</value>
</data>
Expand Down Expand Up @@ -342,9 +360,6 @@
<data name="Open" xml:space="preserve">
<value>Öffnen</value>
</data>
<data name="OutputDevice" xml:space="preserve">
<value>Ausgangsgerät</value>
</data>
<data name="Priority" xml:space="preserve">
<value>Priorität</value>
</data>
Expand Down Expand Up @@ -390,18 +405,6 @@
<data name="Save" xml:space="preserve">
<value>Speichern</value>
</data>
<data name="SetColorDepth" xml:space="preserve">
<value>Farbtiefe ändern</value>
</data>
<data name="SetHDR" xml:space="preserve">
<value>HDR ändern</value>
</data>
<data name="SetRefreshRate" xml:space="preserve">
<value>Bildwiederholrate ändern</value>
</data>
<data name="SetResolution" xml:space="preserve">
<value>Auflösung ändern</value>
</data>
<data name="Settings" xml:space="preserve">
<value>Einstellungen</value>
</data>
Expand Down
39 changes: 21 additions & 18 deletions Source/AutoHDR.ProjectResources/ProjectLocales.resx
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,27 @@
<data name="BuyBeer" xml:space="preserve">
<value>Buy me a beer!</value>
</data>
<data name="ChangeColorDepth" xml:space="preserve">
<value>Change color depth</value>
</data>
<data name="ChangeHDR" xml:space="preserve">
<value>Change HDR</value>
</data>
<data name="Changelog" xml:space="preserve">
<value>Changelog</value>
</data>
<data name="ChangePlaybackDevice" xml:space="preserve">
<value>Change playback device</value>
</data>
<data name="ChangeRecordDevice" xml:space="preserve">
<value>Change record device</value>
</data>
<data name="ChangeRefreshRate" xml:space="preserve">
<value>Change refresh rate</value>
</data>
<data name="ChangeResolution" xml:space="preserve">
<value>Change resolution</value>
</data>
<data name="CheckForNewVersion" xml:space="preserve">
<value>Check for new version on startup</value>
</data>
Expand Down Expand Up @@ -307,9 +325,6 @@
<data name="Info" xml:space="preserve">
<value>Info</value>
</data>
<data name="InputDevice" xml:space="preserve">
<value>Input device</value>
</data>
<data name="IsPrimaryMonitor" xml:space="preserve">
<value>Primary</value>
</data>
Expand Down Expand Up @@ -1016,6 +1031,9 @@ Public License instead of this License. But first, please read
<data name="ManagedHDR" xml:space="preserve">
<value>Automated HDR mode</value>
</data>
<data name="MessageInvalidSettings" xml:space="preserve">
<value>Invalid settings.</value>
</data>
<data name="MessageMissingAudioDevice" xml:space="preserve">
<value>Mssing audio device.</value>
</data>
Expand Down Expand Up @@ -1058,9 +1076,6 @@ Public License instead of this License. But first, please read
<data name="Open" xml:space="preserve">
<value>Open</value>
</data>
<data name="OutputDevice" xml:space="preserve">
<value>Output device</value>
</data>
<data name="Priority" xml:space="preserve">
<value>Priority</value>
</data>
Expand Down Expand Up @@ -1103,18 +1118,6 @@ Public License instead of this License. But first, please read
<data name="Save" xml:space="preserve">
<value>Save</value>
</data>
<data name="SetColorDepth" xml:space="preserve">
<value>Set color depth</value>
</data>
<data name="SetHDR" xml:space="preserve">
<value>Set HDR</value>
</data>
<data name="SetRefreshRate" xml:space="preserve">
<value>Set refresh rate</value>
</data>
<data name="SetResolution" xml:space="preserve">
<value>Set resolution</value>
</data>
<data name="Settings" xml:space="preserve">
<value>Settings</value>
</data>
Expand Down
2 changes: 1 addition & 1 deletion Source/AutoHDR/Globals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void LoadSettings()
}
catch (Exception ex)
{
string backupFile = $"{System.AppDomain.CurrentDomain.BaseDirectory}Backup_Settings_{DateTime.Now.ToString("yyyyMMddHHmmss")}.xml.bak";
string backupFile = $"{System.AppDomain.CurrentDomain.BaseDirectory}Backup_Settings_{DateTime.Now.ToString("yyyyMMddHHmmssfff")}.json";
if (File.Exists(SettingsPath))
{
File.Move(SettingsPath, backupFile);
Expand Down
32 changes: 16 additions & 16 deletions Source/AutoHDR/Profiles/Actions/AudioDeviceAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,43 +10,43 @@ namespace AutoHDR.Profiles.Actions
public class AudioDeviceAction : ProfileActionBase
{

public override bool CanSave => (SetOutput && OutputDevice!=null) || (SetInput && InputDevice != null);
public override bool CanSave => (ChangePlaybackDevice && PlaybackDevice!=null) || (ChangeRecordDevice && RecordDevice != null);
public override string CannotSaveMessage => ProjectLocales.MessageMissingAudioDevice;

public override string ActionTypeName => ProjectLocales.AudioAction;


private Guid _outputDeviceID = Guid.Empty;
private Guid _playbackDeviceID = Guid.Empty;

[JsonProperty]
public Guid OutputDeviceID { get => _outputDeviceID; set { _outputDeviceID = value; OnPropertyChanged(); OnPropertyChanged(nameof(OutputDevice)); } }
public Guid PlaybackDeviceID { get => _playbackDeviceID; set { _playbackDeviceID = value; OnPropertyChanged(); OnPropertyChanged(nameof(PlaybackDevice)); } }


public AudioDevice OutputDevice { get => AudioController.Instance.OutputAudioDevices.FirstOrDefault(d => d.ID.Equals(OutputDeviceID)); set { OutputDeviceID = value.ID; } }
public AudioDevice PlaybackDevice { get => AudioController.Instance.OutputAudioDevices.FirstOrDefault(d => d.ID.Equals(PlaybackDeviceID)); set { PlaybackDeviceID = value.ID; } }


private bool _setOutput = false;

[JsonProperty]
public bool SetOutput { get => _setOutput; set { _setOutput = value; OnPropertyChanged(); } }
public bool ChangePlaybackDevice { get => _setOutput; set { _setOutput = value; OnPropertyChanged(); } }


private Guid _inputDeviceID =Guid.Empty;
private Guid _recodDeviceID =Guid.Empty;

[JsonProperty]
public Guid InputDeviceID { get => _inputDeviceID; set { _inputDeviceID = value; OnPropertyChanged(); OnPropertyChanged(nameof(InputDevice)); } }
public Guid RecordDeviceID { get => _recodDeviceID; set { _recodDeviceID = value; OnPropertyChanged(); OnPropertyChanged(nameof(RecordDevice)); } }



public AudioDevice InputDevice { get => AudioController.Instance.InputAudioDevices.FirstOrDefault(d => d.ID.Equals(InputDeviceID)); set { InputDeviceID = value.ID; } }
public AudioDevice RecordDevice { get => AudioController.Instance.InputAudioDevices.FirstOrDefault(d => d.ID.Equals(RecordDeviceID)); set { RecordDeviceID = value.ID; } }

private bool _setInput = false;

[JsonProperty]
public bool SetInput { get => _setInput; set { _setInput = value; OnPropertyChanged(); } }
public bool ChangeRecordDevice { get => _setInput; set { _setInput = value; OnPropertyChanged(); } }


public override string ActionDescription => $"[{(OutputDevice != null && SetOutput ? OutputDevice.Name : string.Empty)} {(InputDevice != null && SetInput ? InputDevice.Name : string.Empty)}]";
public override string ActionDescription => $"[{(PlaybackDevice != null && ChangePlaybackDevice ? PlaybackDevice.Name : string.Empty)} {(RecordDevice != null && ChangeRecordDevice ? RecordDevice.Name : string.Empty)}]";


public AudioDeviceAction() : base()
Expand All @@ -57,15 +57,15 @@ public override ActionEndResult RunAction(ApplicationChangedType applicationChan
{
try
{
if (SetOutput)
if (ChangePlaybackDevice)
{
CallNewLog(new CodectoryCore.Logging.LogEntry($"Setting output audio device to {OutputDevice.Name}"));
OutputDevice.SetAsDefault();
CallNewLog(new CodectoryCore.Logging.LogEntry($"Setting playback device to {PlaybackDevice.Name}"));
PlaybackDevice.SetAsDefault();
}
if (SetInput)
if (ChangeRecordDevice)
{
CallNewLog(new CodectoryCore.Logging.LogEntry($"Setting input audio device to {InputDevice.Name}"));
InputDevice.SetAsDefault();
CallNewLog(new CodectoryCore.Logging.LogEntry($"Setting record audio device to {RecordDevice.Name}"));
RecordDevice.SetAsDefault();
}
return new ActionEndResult(true);
}
Expand Down
Loading

0 comments on commit 2e897b7

Please sign in to comment.