From b8b82af613b7ee24db2c6649656bd5838816667b Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Fri, 12 Jan 2024 13:41:46 +0100 Subject: [PATCH 1/8] New translations strings.resx (Portuguese) (#1897) --- app/Properties/Strings.pt-PT.resx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Properties/Strings.pt-PT.resx b/app/Properties/Strings.pt-PT.resx index df0af47c..bdf98858 100644 --- a/app/Properties/Strings.pt-PT.resx +++ b/app/Properties/Strings.pt-PT.resx @@ -124,10 +124,10 @@ Não foi possível conectar ao ASUS ACPI. O programa não funciona sem esse serviço. Tente instalar Asus System Control Interface - Restart your device to apply changes + Reinicie o dispositivo para aplicar as alterações - Restart now? + Reiniciar agora? Parece que o GPU está em uso pesado, desativá-lo? @@ -169,7 +169,7 @@ Ajuste automático dos modos de energia do Windows - Memory Assigned to GPU + Memória Alocada à GPU Serviços da Asus em execução @@ -250,10 +250,10 @@ Tempo limite ligado à corrente / na bateria (0 - ON) - Backlight Timeout when on battery + Desligar o ecrã após (em Bateria) - Backlight Timeout when plugged + Desligar o ecrã após (ligado à corrente) Equilibrado From c6f3f734053f9a9b5cea3b8214632b2f02d6ead0 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Fri, 12 Jan 2024 14:32:32 +0100 Subject: [PATCH 2/8] Create bug_report.yml --- .github/ISSUE_TEMPLATE/bug_report.yml | 83 +++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 00000000..0b9f8fbd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,83 @@ +name: Bug Report +description: Something isn't working correctly +labels: ["bug"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report. The more information you provide, the easier it will be for me to fix it! + - type: checkboxes + id: rules + attributes: + label: Rules + options: + - label: I made myself familiar with the Readme and FAQ. + - label: I checked closed issues for similar ones and did not find a similar problem mentioned before. + - label: I understand that, if insufficient information was provided, my issue will be closed without an answer. + validations: + required: true + - type: input + id: version + attributes: + label: Version + description: G-Helper version? + placeholder: e.g. 0.146 + validations: + required: true + - type: input + id: os + attributes: + label: OS + description: Which operating system do you use? + placeholder: e.g. Windows 11 21H2 build 22000 + validations: + required: true + - type: input + id: device + attributes: + label: Device Model + description: Which laptop do you use? + placeholder: e.g. Asus Zephyrus G14 GA404RK + validations: + required: true + - type: textarea + id: description + attributes: + label: What's wrong? + description: Provide detailed description of what is wrong or does not work as expected. + placeholder: Provide detailed description of what is wrong or does not work as expected. + validations: + required: true + - type: textarea + id: reproduce + attributes: + label: How to reproduce the bug? + description: Describe how to reproduce the behavior. Be as specific as possible and provide as many details as possible. + placeholder: | + 1. Go to '...' + 2. Click on '....' + 3. Scroll down to '....' + 4. See error + validations: + required: true + - type: textarea + id: expected-behaviour + attributes: + label: What is the behavior that you expected? + description: Describe what did you expect would happen. + placeholder: Describe what did you expect would happen. + validations: + required: true + - type: textarea + id: logs + attributes: + label: Logs + placeholder: Please drag and drop complete log file from ``%APPDATA%\GHelper\log.txt`` + description: Please drag and drop complete log file from ``%APPDATA%\GHelper\log.txt`` + validations: + required: true + - type: textarea + id: additional + attributes: + label: Additional information + description: If applicable, add screenshots or other relevant information to help explain your problem. From 9ced493821982090e37d33aa73a837a90d70da0c Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Fri, 12 Jan 2024 14:34:24 +0100 Subject: [PATCH 3/8] Delete .github/ISSUE_TEMPLATE/bug_report.md --- .github/ISSUE_TEMPLATE/bug_report.md | 39 ---------------------------- 1 file changed, 39 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index c4b8c8fe..00000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve - ---- - -## NOTE -Bug reports without clear information or scenario to reproduce and logs from ``%AppData%\GHelper`` will be closed without answer. Please respect the time of the developer. Thanks. - -**Describe the bug** -A clear and concise description of what the bug is. - -**Clear scenario to Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. Explanation of an error or a bug - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**App Logs** -Please include and attach log.txt from ``%AppData%\GHelper`` - -**Screenshots or screencasts** -If applicable, add screenshots to help explain your problem. - -**Desktop (please complete the following information):** - - OS: [e.g. Windows 11] - - Laptop model - -**Asus software** -- Armoury Crate (or it's services installed) -- MyASUS installed -- Other Asus services running in background - -**Additional context** -Add any other context about the problem here. From 2a9b9735d58c3094beafde8f1b2e3eba728eb4a1 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Fri, 12 Jan 2024 14:39:53 +0100 Subject: [PATCH 4/8] Update bug_report.yml --- .github/ISSUE_TEMPLATE/bug_report.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 0b9f8fbd..e497392c 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -79,5 +79,15 @@ body: - type: textarea id: additional attributes: - label: Additional information + label: Additional information. description: If applicable, add screenshots or other relevant information to help explain your problem. + - type: checkboxes + id: asus + attributes: + label: Armoury Crate or Asus software running + description: Please check what Asus/Armoury Services do you have running + options: + - label: Armoury Crate + - label: MyAsus + - label: Other Asus Services + From aba4ab7742eaa0b1d9a51c4378966b1923d320f7 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Fri, 12 Jan 2024 14:45:04 +0100 Subject: [PATCH 5/8] Update bug_report.yml --- .github/ISSUE_TEMPLATE/bug_report.yml | 44 ++++++++++++--------------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index e497392c..c06c6aa7 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -16,30 +16,6 @@ body: - label: I understand that, if insufficient information was provided, my issue will be closed without an answer. validations: required: true - - type: input - id: version - attributes: - label: Version - description: G-Helper version? - placeholder: e.g. 0.146 - validations: - required: true - - type: input - id: os - attributes: - label: OS - description: Which operating system do you use? - placeholder: e.g. Windows 11 21H2 build 22000 - validations: - required: true - - type: input - id: device - attributes: - label: Device Model - description: Which laptop do you use? - placeholder: e.g. Asus Zephyrus G14 GA404RK - validations: - required: true - type: textarea id: description attributes: @@ -81,6 +57,14 @@ body: attributes: label: Additional information. description: If applicable, add screenshots or other relevant information to help explain your problem. + - type: input + id: device + attributes: + label: Device Model + description: Which laptop do you use? + placeholder: e.g. Asus Zephyrus G14 GA404RK + validations: + required: true - type: checkboxes id: asus attributes: @@ -90,4 +74,16 @@ body: - label: Armoury Crate - label: MyAsus - label: Other Asus Services + - type: input + id: version + attributes: + label: Version + description: G-Helper version? + placeholder: e.g. 0.146 + - type: input + id: os + attributes: + label: OS + description: Which operating system do you use? + placeholder: e.g. Windows 11 21H2 build 22000 From becb71b69bd3eaad287be101568593e86e11b801 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Fri, 12 Jan 2024 14:49:18 +0100 Subject: [PATCH 6/8] Update bug_report.yml --- .github/ISSUE_TEMPLATE/bug_report.yml | 33 ++++++++++----------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index c06c6aa7..14c3a9b5 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -11,8 +11,7 @@ body: attributes: label: Rules options: - - label: I made myself familiar with the Readme and FAQ. - - label: I checked closed issues for similar ones and did not find a similar problem mentioned before. + - label: I made myself familiar with the Readme, FAQ and Troubleshooting. - label: I understand that, if insufficient information was provided, my issue will be closed without an answer. validations: required: true @@ -36,14 +35,6 @@ body: 4. See error validations: required: true - - type: textarea - id: expected-behaviour - attributes: - label: What is the behavior that you expected? - description: Describe what did you expect would happen. - placeholder: Describe what did you expect would happen. - validations: - required: true - type: textarea id: logs attributes: @@ -52,24 +43,24 @@ body: description: Please drag and drop complete log file from ``%APPDATA%\GHelper\log.txt`` validations: required: true + - type: input + id: device + attributes: + label: Device and Model + description: Which laptop do you use? + placeholder: e.g. Asus Zephyrus G14 GA404RK + validations: + required: true - type: textarea id: additional attributes: label: Additional information. description: If applicable, add screenshots or other relevant information to help explain your problem. - - type: input - id: device - attributes: - label: Device Model - description: Which laptop do you use? - placeholder: e.g. Asus Zephyrus G14 GA404RK - validations: - required: true - type: checkboxes id: asus attributes: - label: Armoury Crate or Asus software running - description: Please check what Asus/Armoury Services do you have running + label: Asus Software + description: Please check what Asus/Armoury Services do you have installed and running options: - label: Armoury Crate - label: MyAsus @@ -85,5 +76,5 @@ body: attributes: label: OS description: Which operating system do you use? - placeholder: e.g. Windows 11 21H2 build 22000 + placeholder: e.g. Windows 11 21H2 From df35a576dfa772b3f99e3c669dee1e827cbdeabe Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Fri, 12 Jan 2024 14:51:00 +0100 Subject: [PATCH 7/8] Update bug_report.yml --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 14c3a9b5..37d95fcd 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -12,7 +12,9 @@ body: label: Rules options: - label: I made myself familiar with the Readme, FAQ and Troubleshooting. + required: true - label: I understand that, if insufficient information was provided, my issue will be closed without an answer. + required: true validations: required: true - type: textarea From 765c03815ea7e039e431fa7549dd67d0d29d79c7 Mon Sep 17 00:00:00 2001 From: IceStormNG Date: Fri, 12 Jan 2024 18:55:52 +0100 Subject: [PATCH 8/8] Automatically restart audio capture when device changes. (#1903) --- app/AnimeMatrix/AniMatrixControl.cs | 56 +++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 3 deletions(-) diff --git a/app/AnimeMatrix/AniMatrixControl.cs b/app/AnimeMatrix/AniMatrixControl.cs index 025f0f53..d5d4b1b9 100644 --- a/app/AnimeMatrix/AniMatrixControl.cs +++ b/app/AnimeMatrix/AniMatrixControl.cs @@ -10,7 +10,7 @@ using System.Timers; namespace GHelper.AnimeMatrix { - public class AniMatrixControl + public class AniMatrixControl : NAudio.CoreAudioApi.Interfaces.IMMNotificationClient { SettingsForm settings; @@ -20,6 +20,8 @@ namespace GHelper.AnimeMatrix double[]? AudioValues; WasapiCapture? AudioDevice; + string? AudioDeviceId; + private MMDeviceEnumerator? AudioDeviceEnum; public bool IsValid => device != null; @@ -167,6 +169,9 @@ namespace GHelper.AnimeMatrix Logger.WriteLine(ex.ToString()); } } + + AudioDeviceId = null; + AudioDeviceEnum?.Dispose(); } void SetMatrixAudio() @@ -179,10 +184,13 @@ namespace GHelper.AnimeMatrix try { - using (var enumerator = new MMDeviceEnumerator()) - using (MMDevice device = enumerator.GetDefaultAudioEndpoint(DataFlow.Render, Role.Console)) + AudioDeviceEnum = new MMDeviceEnumerator(); + AudioDeviceEnum.RegisterEndpointNotificationCallback(this); + + using (MMDevice device = AudioDeviceEnum.GetDefaultAudioEndpoint(DataFlow.Render, Role.Console)) { AudioDevice = new WasapiLoopbackCapture(device); + AudioDeviceId = device.ID; WaveFormat fmt = AudioDevice.WaveFormat; AudioValues = new double[fmt.SampleRate / 1000]; @@ -397,6 +405,48 @@ namespace GHelper.AnimeMatrix } + public void OnDeviceStateChanged(string deviceId, DeviceState newState) + { + } + + public void OnDeviceAdded(string pwstrDeviceId) + { + + } + + public void OnDeviceRemoved(string deviceId) + { + + } + + public void OnDefaultDeviceChanged(DataFlow flow, Role role, string defaultDeviceId) + { + if (AudioDeviceId == defaultDeviceId) + { + //We already caputre this device. No need to re-initialize + return; + } + + int running = AppConfig.Get("matrix_running"); + if (flow != DataFlow.Render || role != Role.Console || running != 4) + { + return; + } + + //Restart audio if default audio changed + Logger.WriteLine("Matrix Audio: Default Output changed to " + defaultDeviceId); + + //Already set the device here. Otherwise this will be called multiple times in a short succession and causes a crash due to dispose during initalization. + AudioDeviceId = defaultDeviceId; + + //Delay is required or it will deadlock on dispose. + Task.Delay(50).ContinueWith(t => SetMatrixAudio()); + } + + public void OnPropertyValueChanged(string pwstrDeviceId, PropertyKey key) + { + + } } }