From 3ae158b1a4f06de17a99ac17d63706eeebbb3f80 Mon Sep 17 00:00:00 2001 From: routersys Date: Mon, 7 Sep 2026 14:33:08 +0900 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E5=85=B7=E5=90=88=E3=81=AE=E5=A0=B1?= =?UTF-8?q?=E5=91=8A=E3=81=ABTelemetry=E3=82=92=E5=8F=96=E3=82=8A=E8=BE=BC?= =?UTF-8?q?=E3=82=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitmodules | 3 +++ UTAU/UTAU.csproj | 2 ++ UTAU/UTAUVoicePlugin.cs | 19 +++++++++++++++++-- UTAU/UTAUVoiceSpeaker.cs | 14 ++++++++++++++ UTAU/ViewModels/UTAUSettingsViewModel.cs | 2 ++ YMM4-Telemetry | 1 + 6 files changed, 39 insertions(+), 2 deletions(-) create mode 160000 YMM4-Telemetry diff --git a/.gitmodules b/.gitmodules index b763b31..0eb3bb3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "YMM4-GitHubUpdateNotifier"] path = YMM4-GitHubUpdateNotifier url = https://github.com/routersys/YMM4-GitHubUpdateNotifier.git +[submodule "YMM4-Telemetry"] + path = YMM4-Telemetry + url = https://github.com/routersys/YMM4-Telemetry.git diff --git a/UTAU/UTAU.csproj b/UTAU/UTAU.csproj index 0cca76d..bdfd005 100644 --- a/UTAU/UTAU.csproj +++ b/UTAU/UTAU.csproj @@ -77,6 +77,8 @@ + + diff --git a/UTAU/UTAUVoicePlugin.cs b/UTAU/UTAUVoicePlugin.cs index e8c5b72..d64da99 100644 --- a/UTAU/UTAUVoicePlugin.cs +++ b/UTAU/UTAUVoicePlugin.cs @@ -1,3 +1,4 @@ +using Telemetry; using UTAU.Models; using YukkuriMovieMaker.Plugin; using YukkuriMovieMaker.Plugin.Voice; @@ -18,16 +19,30 @@ internal sealed class UTAUVoicePlugin : IVoicePlugin public bool IsVoicesCached => VoiceBankRepository.IsLoaded; - public Task UpdateVoicesAsync() => Task.Run(VoiceBankRepository.Reload); + public Task UpdateVoicesAsync() => Task.Run(Reload); static IEnumerable GetVoices() { + TelemetryReporter.Start(); UTAUUpdateNotifier.EnsureCheckedOnce(); if (!VoiceBankRepository.IsLoaded) - VoiceBankRepository.Reload(); + Reload(); foreach (var bank in VoiceBankRepository.Banks) yield return new UTAUVoiceSpeaker(bank); } + + static void Reload() + { + try + { + VoiceBankRepository.Reload(); + } + catch (Exception exception) + { + TelemetryReporter.Report(exception); + throw; + } + } } diff --git a/UTAU/UTAUVoiceSpeaker.cs b/UTAU/UTAUVoiceSpeaker.cs index 0693474..a4bdd0b 100644 --- a/UTAU/UTAUVoiceSpeaker.cs +++ b/UTAU/UTAUVoiceSpeaker.cs @@ -1,3 +1,4 @@ +using Telemetry; using UTAU.Models; using UTAU.Notes; using UTAU.Phonemes; @@ -48,6 +49,19 @@ internal sealed class UTAUVoiceSpeaker(VoiceBank bank) : IVoiceSpeaker => currentParameter is UTAUVoiceParameter ? currentParameter : CreateVoiceParameter(); public async Task CreateVoiceAsync(string text, IVoicePronounce? pronounce, IVoiceParameter? parameter, string filePath) + { + try + { + return await CreateAsync(text, pronounce, parameter, filePath).ConfigureAwait(false); + } + catch (Exception exception) when (exception is not InvalidOperationException) + { + TelemetryReporter.Report(exception); + throw; + } + } + + async Task CreateAsync(string text, IVoicePronounce? pronounce, IVoiceParameter? parameter, string filePath) { var param = parameter as UTAUVoiceParameter ?? new UTAUVoiceParameter(); var isUst = UstSource.TryGetPath(text, out var ustPath); diff --git a/UTAU/ViewModels/UTAUSettingsViewModel.cs b/UTAU/ViewModels/UTAUSettingsViewModel.cs index a6e4a12..da40a37 100644 --- a/UTAU/ViewModels/UTAUSettingsViewModel.cs +++ b/UTAU/ViewModels/UTAUSettingsViewModel.cs @@ -1,6 +1,7 @@ using System.Collections.ObjectModel; using System.IO; using System.Windows.Input; +using Telemetry; using UTAU.Models; using UTAU.Synthesis; using YukkuriMovieMaker.Commons; @@ -78,6 +79,7 @@ internal sealed class UTAUSettingsViewModel : Bindable } catch (Exception exception) { + TelemetryReporter.Report(exception); StatusText = exception.Message; } finally diff --git a/YMM4-Telemetry b/YMM4-Telemetry new file mode 160000 index 0000000..0401090 --- /dev/null +++ b/YMM4-Telemetry @@ -0,0 +1 @@ +Subproject commit 04010903ca3ad740c3d182cb861262252cb5fdf0