コミットを比較
| 作成者 | SHA1 | 日付 | |
|---|---|---|---|
|
|
5171590bff
|
||
|
|
6ce77748d5
|
||
|
|
4e301ef503
|
||
|
|
815f88c2ab
|
||
|
|
6c2c419de5
|
||
|
|
8043d5cfca
|
||
|
|
84a6e58fd3
|
||
|
|
61a3805c23
|
||
|
|
61d7ef99fe
|
||
|
|
852c33d066
|
||
|
|
3127791ae2
|
||
|
|
f1d68e637c
|
||
|
|
c8c16aafd5
|
||
|
|
b52a81ea61
|
検索条件に一致するファイルはありません
+11
-3
@@ -1,5 +1,5 @@
|
||||
========================================
|
||||
UTAU for YMM4 v1.0.0
|
||||
UTAU for YMM4 v1.1.1
|
||||
========================================
|
||||
YukkuriMovieMaker4(YMM4)上で動作する、UTAU 音源から歌声を合成する
|
||||
音声合成プラグインです。
|
||||
@@ -31,6 +31,11 @@ WorldNet で分析して合成し直します。
|
||||
|
||||
- セリフか発音に .ust ファイルのパスを書くと、その UST を読み込みます。
|
||||
|
||||
- 歌詞は、かなのほか a か のような連続音の形とローマ字でも書けます。歌詞の
|
||||
最後の空白より後ろをかなへ戻して照合するため、連続音の譜面を単独音の音源で
|
||||
歌わせたり、ローマ字の譜面をかなの音源で歌わせたりできます。ローマ字は
|
||||
ヘボン式と訓令式のどちらでも読みます。
|
||||
|
||||
- アイテムの編集画面の「ノートを編集」から、音程・長さ・ビブラート・
|
||||
ポルタメント・表現曲線を編集できます。
|
||||
--------------------------------------------------------------------------------
|
||||
@@ -49,8 +54,11 @@ WorldNet で分析して合成し直します。
|
||||
設定画面の説明書タブと、アイテムの編集画面の利用規約から読めます。
|
||||
使用する前に必ず確認してください。
|
||||
|
||||
- 漢字は読みへ変換しません。セリフはかなで書いてください。原音設定に一致する
|
||||
エイリアスがない歌詞は合成できません。
|
||||
- 漢字は読みへ変換しません。セリフはかなで書いてください。
|
||||
|
||||
- 原音設定に一致するエイリアスがない歌詞は無音のノートになります。見つからな
|
||||
かった歌詞はノートエディターの工具列に警告として並び、他のノートはそのまま
|
||||
合成します。どのノートも合成できないときだけエラーになります。
|
||||
|
||||
- 初回の合成: 音声ファイルの分析に時間がかかります。分析結果はメモリへ
|
||||
キャッシュするため、2 回目以降は速くなります。上限は既定で 512MB で、
|
||||
|
||||
@@ -86,9 +86,13 @@ YukkuriMovieMaker4(YMM4)上で動作する、UTAU 音源から歌声を合
|
||||
|
||||
セリフのかなを 1 モーラずつノートにします。拗音は前のかなとまとめ、「ー」は直前のノートを伸ばし、「っ」は短いノートにします。読点や中点や空白は短い休符に、句点や疑問符や感嘆符や改行は長い休符になります。既定では 1 モーラが 240 ティック、短い休符が 120 ティック、長い休符が 480 ティックです。
|
||||
|
||||
歌詞から原音設定のエイリアスを探すときは、直前の母音を付けた形を先に試し、続いて歌詞そのもの、ひらがな、カタカナ、ローマ字の順に試します。それぞれについて、声色と音域に合う接頭辞と接尾辞、`prefix.map` の接頭辞と接尾辞、接頭辞と接尾辞なしの順に照合します。
|
||||
歌詞から原音設定のエイリアスを探すときは、直前の母音を付けた形を先に試し、続いて歌詞そのもの、ひらがな、カタカナ、モーラ、モーラのカタカナ、ローマ字の順に試します。それぞれについて、声色と音域に合う接頭辞と接尾辞、`prefix.map` の接頭辞と接尾辞、接頭辞と接尾辞なしの順に照合します。
|
||||
|
||||
隣り合うノートの間には、前の母音と次の子音をつないだエイリアスがあれば差し込みます。長さは原音設定の先行発声に 30 ミリ秒を足した値で、前のノートの半分を上限とし、20 ミリ秒に満たないときは差し込みません。最後の母音には、母音と `-` をつないだエイリアスがあれば 120 ミリ秒だけ足します。
|
||||
モーラは、歌詞の最後の空白より後ろを取り出してかなへ寄せた形です。`a か` のような連続音の歌詞からは `か` を、`ka` のようなローマ字の歌詞からは `か` を取り出します。これにより、連続音で書かれた譜面を単独音の音源で歌わせたり、ローマ字で書かれた譜面をかなの音源で歌わせたりできます。ローマ字はヘボン式と訓令式のどちらでも読み、`si`・`ti`・`tu`・`zi`・`hu`・`wo` や `sya`・`tya`・`zya` のような綴りも対応するかなへ戻します。
|
||||
|
||||
連続音の歌詞に書かれた接頭辞よりも、実際の直前のノートの母音を優先します。`a あ` と書かれていても直前が `い` なら `i あ` を先に試します。
|
||||
|
||||
隣り合うノートの間には、前の母音と次の子音をつないだエイリアスがあれば差し込みます。長さは原音設定の先行発声に 30 ミリ秒を足した値で、前のノートの半分を上限とし、20 ミリ秒に満たないときは差し込みません。次のノートが `a か` のように前の母音を含むエイリアスへ解決したときは、そのエイリアスが渡りを含んでいるため差し込みません。最後の母音には、母音と `-` をつないだエイリアスがあれば 120 ミリ秒だけ足します。
|
||||
|
||||
### 3. UST ファイルの読み込み
|
||||
|
||||
@@ -111,7 +115,8 @@ YukkuriMovieMaker4(YMM4)上で動作する、UTAU 音源から歌声を合
|
||||
- 下の帯では、子音速度・音量・モジュレーションをノートごとの棒として、フォルマントと息の量を曲線として引いて編集できます。
|
||||
- 休符の挿入、ノートの削除、すべてのノートの選択、表示範囲に合わせる操作をボタンから行えます。
|
||||
- ノートは隙間なく並びます。間を空けるときは休符を挿入します。
|
||||
- 編集内容は YMM4 の取り消しとやり直しに対応します。
|
||||
- 原音設定に見つからなかった歌詞があるときは、工具列の右端に警告として並びます。ノートエディターを開いたときの内容を表示します。
|
||||
- 編集内容は YMM4 の取り消しとやり直しに対応します。合成の結果として作られる情報は取り消しの対象になりません。
|
||||
|
||||
### 5. WORLD による合成
|
||||
|
||||
@@ -221,7 +226,7 @@ YMM4 の設定画面の「音声」に「UTAU」として表示されます。
|
||||
## 制限事項
|
||||
|
||||
- 漢字は読みへ変換しません。セリフはかなで書いてください。
|
||||
- 原音設定に一致するエイリアスがない歌詞は合成できません。見つからなかった歌詞を挙げてエラーになります。
|
||||
- 原音設定に一致するエイリアスがない歌詞は無音のノートになります。見つからなかった歌詞はノートエディターの工具列に警告として並び、他のノートはそのまま合成します。どのノートも合成できないときだけ、見つからなかった歌詞を挙げてエラーになります。
|
||||
- UST の `Flags` は反映しません。
|
||||
- UST の旧式の音程には対応していません。`PBS`・`PBW`・`PBY`・`PBM` で書かれた音程だけを取り込みます。
|
||||
- UST のエンベロープは 3 つの時間だけを使い、音量の点は使いません。
|
||||
|
||||
@@ -5,6 +5,7 @@ using UTAU.ViewModels;
|
||||
|
||||
namespace UTAU.Tests;
|
||||
|
||||
[Collection("Wpf")]
|
||||
public sealed class CanvasAlignmentTests
|
||||
{
|
||||
static T RunSta<T>(Func<T> action)
|
||||
@@ -117,6 +118,7 @@ public sealed class CanvasAlignmentTests
|
||||
}
|
||||
}
|
||||
|
||||
[Collection("Wpf")]
|
||||
public sealed class KeyboardRowAlignmentTests
|
||||
{
|
||||
const int RowCount = 60;
|
||||
|
||||
@@ -8,6 +8,7 @@ using YukkuriMovieMaker.Controls;
|
||||
|
||||
namespace UTAU.Tests;
|
||||
|
||||
[Collection("Wpf")]
|
||||
public sealed class ExpressionStripAlignmentTests
|
||||
{
|
||||
const double PopupWidth = 980.0;
|
||||
@@ -40,7 +41,7 @@ public sealed class ExpressionStripAlignmentTests
|
||||
{
|
||||
var editor = new NoteEditor();
|
||||
var button = (PopupButton)editor.Content;
|
||||
var root = (Grid)button.PopupContent;
|
||||
var root = (Grid)button.PopupContent!;
|
||||
button.PopupContent = null;
|
||||
|
||||
var pronounce = new UTAUVoicePronounce();
|
||||
|
||||
@@ -296,6 +296,88 @@ public sealed class KanaRomanizationTests
|
||||
Assert.Equal("アヴヶ", KanaRomanization.ToKatakana("あゔゖ"));
|
||||
Assert.Equal("ー", KanaRomanization.ToHiragana("ー"));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("ka", "か")]
|
||||
[InlineData("KA", "か")]
|
||||
[InlineData("shi", "し")]
|
||||
[InlineData("n", "ん")]
|
||||
[InlineData("kya", "きゃ")]
|
||||
public void RomajiIsReadAsTheKanaMora(string lyric, string expected)
|
||||
=> Assert.Equal(expected, KanaRomanization.ToMora(lyric));
|
||||
|
||||
[Theory]
|
||||
[InlineData("ji", "じ")]
|
||||
[InlineData("zu", "ず")]
|
||||
[InlineData("o", "お")]
|
||||
[InlineData("ja", "じゃ")]
|
||||
public void AmbiguousRomajiPicksTheCommonKana(string lyric, string expected)
|
||||
=> Assert.Equal(expected, KanaRomanization.ToMora(lyric));
|
||||
|
||||
[Theory]
|
||||
[InlineData("si", "し")]
|
||||
[InlineData("ti", "ち")]
|
||||
[InlineData("tu", "つ")]
|
||||
[InlineData("zi", "じ")]
|
||||
[InlineData("hu", "ふ")]
|
||||
[InlineData("di", "ぢ")]
|
||||
[InlineData("du", "づ")]
|
||||
[InlineData("wo", "を")]
|
||||
[InlineData("sya", "しゃ")]
|
||||
[InlineData("tyo", "ちょ")]
|
||||
[InlineData("zyu", "じゅ")]
|
||||
[InlineData("jya", "じゃ")]
|
||||
[InlineData("cyo", "ちょ")]
|
||||
public void KunreiRomajiReadsAsItsOwnKana(string lyric, string expected)
|
||||
=> Assert.Equal(expected, KanaRomanization.ToMora(lyric));
|
||||
|
||||
[Theory]
|
||||
[InlineData("すぃ", "si")]
|
||||
[InlineData("てぃ", "ti")]
|
||||
[InlineData("とぅ", "tu")]
|
||||
[InlineData("うぉ", "wo")]
|
||||
public void ExtendedKanaKeepsItsOwnRomaji(string mora, string expected)
|
||||
{
|
||||
Assert.True(KanaRomanization.TryGetRomaji(mora, out var romaji));
|
||||
Assert.Equal(expected, romaji);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("si", "sh", "i")]
|
||||
[InlineData("ti", "ch", "i")]
|
||||
[InlineData("tu", "ts", "u")]
|
||||
[InlineData("hu", "f", "u")]
|
||||
[InlineData("wo", null, "o")]
|
||||
public void KunreiRomajiExposesTheKanaVowelAndConsonant(string lyric, string? consonant, string vowel)
|
||||
{
|
||||
Assert.Equal(consonant, KanaRomanization.GetConsonant(lyric));
|
||||
Assert.Equal(vowel, KanaRomanization.GetVowel(lyric));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("a あ", "あ")]
|
||||
[InlineData("- あ", "あ")]
|
||||
[InlineData("a カ", "か")]
|
||||
[InlineData("a ka", "か")]
|
||||
public void TheContinuousPrefixIsDropped(string lyric, string expected)
|
||||
=> Assert.Equal(expected, KanaRomanization.ToMora(lyric));
|
||||
|
||||
[Fact]
|
||||
public void RomajiAndContinuousLyricsExposeTheirVowelAndConsonant()
|
||||
{
|
||||
Assert.Equal("a", KanaRomanization.GetVowel("ka"));
|
||||
Assert.Equal("k", KanaRomanization.GetConsonant("ka"));
|
||||
Assert.Equal("a", KanaRomanization.GetVowel("a か"));
|
||||
Assert.Equal("k", KanaRomanization.GetConsonant("a か"));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("漢", "漢")]
|
||||
[InlineData("", "")]
|
||||
[InlineData("a k", "k")]
|
||||
[InlineData("あ ", "")]
|
||||
public void TextWithoutAKnownMoraIsLeftAsItIs(string lyric, string expected)
|
||||
=> Assert.Equal(expected, KanaRomanization.ToMora(lyric));
|
||||
}
|
||||
|
||||
public sealed class TempoNotationTests
|
||||
|
||||
@@ -8,6 +8,7 @@ using YukkuriMovieMaker.Controls;
|
||||
|
||||
namespace UTAU.Tests;
|
||||
|
||||
[Collection("Wpf")]
|
||||
public sealed class NoteEditorMeasuredLayoutTests
|
||||
{
|
||||
const double PopupWidth = 980.0;
|
||||
@@ -41,7 +42,7 @@ public sealed class NoteEditorMeasuredLayoutTests
|
||||
{
|
||||
var editor = new NoteEditor();
|
||||
var button = (PopupButton)editor.Content;
|
||||
var root = (Grid)button.PopupContent;
|
||||
var root = (Grid)button.PopupContent!;
|
||||
button.PopupContent = null;
|
||||
|
||||
var pronounce = new UTAUVoicePronounce();
|
||||
@@ -202,16 +203,41 @@ public sealed class NoteEditorMeasuredLayoutTests
|
||||
Assert.Equal(0.0, worst, 6);
|
||||
}
|
||||
|
||||
static StackPanel Toolbar(Border host)
|
||||
=> Descend(host)
|
||||
.OfType<StackPanel>()
|
||||
.First(x => x.Orientation == Orientation.Horizontal
|
||||
&& x.Children.OfType<ComboBox>().Any());
|
||||
|
||||
[Fact]
|
||||
public void TheToolbarComboBoxTextIsCentredInItsRow()
|
||||
{
|
||||
var gaps = RunSta(() =>
|
||||
{
|
||||
var (_, _, host) = Build();
|
||||
return Toolbar(host).Children
|
||||
.OfType<ComboBox>()
|
||||
.Select(combo =>
|
||||
{
|
||||
var text = Descend(combo).OfType<TextBlock>().First();
|
||||
var above = TopOf(text, combo);
|
||||
return (Above: above, Below: combo.ActualHeight - above - text.ActualHeight);
|
||||
})
|
||||
.ToArray();
|
||||
});
|
||||
|
||||
Assert.NotEmpty(gaps);
|
||||
Assert.All(gaps, x => Assert.True(x.Above > 0.0, $"above={x.Above}"));
|
||||
Assert.All(gaps, x => Assert.Equal(x.Above, x.Below, 6));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TheToolbarControlsAllFillTheToolbarRow()
|
||||
{
|
||||
var boxes = RunSta(() =>
|
||||
{
|
||||
var (_, _, host) = Build();
|
||||
var toolbar = Descend(host)
|
||||
.OfType<StackPanel>()
|
||||
.First(x => x.Orientation == Orientation.Horizontal
|
||||
&& x.Children.OfType<ComboBox>().Any());
|
||||
var toolbar = Toolbar(host);
|
||||
|
||||
return toolbar.Children
|
||||
.OfType<Control>()
|
||||
|
||||
@@ -123,6 +123,33 @@ public sealed class AliasResolverTests
|
||||
[Fact]
|
||||
public void UnknownMoraeStillOfferTheLiteralAlias()
|
||||
=> Assert.Contains("漢", AliasResolver.EnumerateCandidates("漢", "-"));
|
||||
|
||||
[Fact]
|
||||
public void RomajiLyricsAlsoOfferTheKanaForms()
|
||||
{
|
||||
var candidates = AliasResolver.EnumerateCandidates("ka", "a").ToArray();
|
||||
Assert.Equal("a ka", candidates[0]);
|
||||
Assert.Contains("a か", candidates);
|
||||
Assert.Contains("か", candidates);
|
||||
Assert.Contains("カ", candidates);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ContinuousLyricsAlsoOfferTheSingleForms()
|
||||
{
|
||||
var candidates = AliasResolver.EnumerateCandidates("a あ", "-").ToArray();
|
||||
Assert.Contains("a あ", candidates);
|
||||
Assert.Contains("- あ", candidates);
|
||||
Assert.Contains("あ", candidates);
|
||||
Assert.Contains("a", candidates);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AddedCandidatesStayDistinct()
|
||||
{
|
||||
var candidates = AliasResolver.EnumerateCandidates("a カ", "i").ToArray();
|
||||
Assert.Equal(candidates.Length, candidates.Distinct(StringComparer.Ordinal).Count());
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class PhonemizerTests : IDisposable
|
||||
@@ -206,6 +233,65 @@ public sealed class PhonemizerTests : IDisposable
|
||||
Assert.DoesNotContain("a -", units.Select(x => x.Alias));
|
||||
}
|
||||
|
||||
static IReadOnlyList<UTAUNote> Lyrics(params string[] lyrics)
|
||||
=> [.. lyrics.Select(x => new UTAUNote { Lyric = x, LengthTicks = TimeBase.TicksPerQuarterNote, Tone = 60 })];
|
||||
|
||||
[Fact]
|
||||
public void SingleKanaBankAcceptsRomajiLyrics()
|
||||
{
|
||||
var bank = TestVoiceBank.CreateSingleKanaBank(directory);
|
||||
var units = Phonemize(bank, Lyrics("a", "ka", "sa"));
|
||||
|
||||
Assert.Equal(["あ", "か", "さ"], units.Select(x => x.Alias));
|
||||
Assert.All(units, x => Assert.False(x.IsUnresolved));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SingleKanaBankAcceptsContinuousLyrics()
|
||||
{
|
||||
var bank = TestVoiceBank.CreateSingleKanaBank(directory);
|
||||
var units = Phonemize(bank, Lyrics("- あ", "a か"));
|
||||
|
||||
Assert.Equal(["あ", "か"], units.Select(x => x.Alias));
|
||||
Assert.All(units, x => Assert.False(x.IsUnresolved));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ContinuousBankAcceptsRomajiLyrics()
|
||||
{
|
||||
var bank = TestVoiceBank.CreateVcvBank(directory);
|
||||
var units = Phonemize(bank, Lyrics("a", "ka"));
|
||||
|
||||
Assert.Equal(["- あ", "a か"], units.Select(x => x.Alias));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ContinuousLyricsFollowTheActualPreviousVowel()
|
||||
{
|
||||
var bank = TestVoiceBank.CreateVcvBank(directory);
|
||||
var units = Phonemize(bank, Lyrics("i あ", "e か"));
|
||||
|
||||
Assert.Equal(["- あ", "a か"], units.Select(x => x.Alias));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ContinuousAliasesDoNotTakeAnExtraTransition()
|
||||
{
|
||||
var bank = TestVoiceBank.CreateVcvAndCvvcBank(directory);
|
||||
var units = Phonemize(bank, Lyrics("- あ", "a か"));
|
||||
|
||||
Assert.Equal(["- あ", "a か", "a -"], units.Select(x => x.Alias));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SingleLyricsPreferTheContinuousAliasInTheSameBank()
|
||||
{
|
||||
var bank = TestVoiceBank.CreateVcvAndCvvcBank(directory);
|
||||
var units = Phonemize(bank, Lyrics("あ", "か"));
|
||||
|
||||
Assert.Equal(["- あ", "a か", "a -"], units.Select(x => x.Alias));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void UnresolvedLyricsAreReportedWithoutAnEntry()
|
||||
{
|
||||
|
||||
@@ -115,11 +115,28 @@ public sealed class PronounceChangeNotificationTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SourceTextChangesNotifyTheHost()
|
||||
public void SynthesisOutputsDoNotReachTheUndoHistory()
|
||||
{
|
||||
var (pronounce, count) = CreateObserved();
|
||||
pronounce.SourceText = "あ";
|
||||
Assert.True(count() > 0);
|
||||
pronounce.ImportMessage = "取り込みました";
|
||||
pronounce.RenderMessage = "見つかりません";
|
||||
pronounce.LipSyncFrames = [];
|
||||
Assert.Equal(0, count());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SynthesisOutputsStillRaisePropertyChanged()
|
||||
{
|
||||
var pronounce = new UTAUVoicePronounce();
|
||||
var changed = new List<string>();
|
||||
pronounce.PropertyChanged += (_, e) => changed.Add(e.PropertyName ?? string.Empty);
|
||||
|
||||
pronounce.SourceText = "あ";
|
||||
pronounce.RenderMessage = "見つかりません";
|
||||
|
||||
Assert.Contains(nameof(UTAUVoicePronounce.SourceText), changed);
|
||||
Assert.Contains(nameof(UTAUVoicePronounce.RenderMessage), changed);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Threading;
|
||||
using UTAU.Notes;
|
||||
using UTAU.ViewModels;
|
||||
using UTAU.Views;
|
||||
using YukkuriMovieMaker.Controls;
|
||||
|
||||
namespace UTAU.Tests;
|
||||
|
||||
[Collection("Wpf")]
|
||||
public sealed class RenderMessageDisplayTests
|
||||
{
|
||||
const double PopupWidth = 980.0;
|
||||
const double PopupHeight = 480.0;
|
||||
const string Warning = "見つからない歌詞";
|
||||
const string LongWarning = "原音設定に ぱ, ぴ, ぷ, ぺ, ぽ, ざ, じ, ず ... が見つかりません。";
|
||||
const string LongImport = "44個のノートを取り込みました 前後の休符を480ティック除きました";
|
||||
|
||||
static T RunSta<T>(Func<T> action)
|
||||
{
|
||||
var result = default(T)!;
|
||||
Exception? error = null;
|
||||
var thread = new Thread(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
result = action();
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
error = exception;
|
||||
}
|
||||
});
|
||||
thread.SetApartmentState(ApartmentState.STA);
|
||||
thread.Start();
|
||||
thread.Join();
|
||||
if (error is not null)
|
||||
throw new InvalidOperationException(error.Message, error);
|
||||
return result;
|
||||
}
|
||||
|
||||
static IEnumerable<DependencyObject> Descend(DependencyObject root)
|
||||
{
|
||||
var count = VisualTreeHelper.GetChildrenCount(root);
|
||||
for (var index = 0; index < count; index++)
|
||||
{
|
||||
var child = VisualTreeHelper.GetChild(root, index);
|
||||
yield return child;
|
||||
foreach (var descendant in Descend(child))
|
||||
yield return descendant;
|
||||
}
|
||||
}
|
||||
|
||||
static Border Build(NoteEditorViewModel viewModel)
|
||||
{
|
||||
var editor = new NoteEditor();
|
||||
var button = (PopupButton)editor.Content;
|
||||
var root = (Grid)button.PopupContent!;
|
||||
button.PopupContent = null;
|
||||
root.DataContext = viewModel;
|
||||
|
||||
var host = new Border { Width = PopupWidth, Height = PopupHeight, Child = root };
|
||||
host.Measure(new Size(PopupWidth, PopupHeight));
|
||||
host.Arrange(new Rect(0.0, 0.0, PopupWidth, PopupHeight));
|
||||
host.UpdateLayout();
|
||||
return host;
|
||||
}
|
||||
|
||||
static TextBlock WarningBlock(Border host)
|
||||
=> Descend(host)
|
||||
.OfType<DockPanel>()
|
||||
.SelectMany(x => x.Children.OfType<TextBlock>())
|
||||
.First(x => DockPanel.GetDock(x) == Dock.Right);
|
||||
|
||||
[Fact]
|
||||
public void TheWarningReachesTheToolbarFromTheSynthesisThread()
|
||||
{
|
||||
var shown = RunSta(() =>
|
||||
{
|
||||
var pronounce = new UTAUVoicePronounce();
|
||||
pronounce.Notes.Add(new UTAUNote { Lyric = "あ" });
|
||||
using var viewModel = new NoteEditorViewModel(pronounce);
|
||||
var host = Build(viewModel);
|
||||
|
||||
Task.Run(() => pronounce.RenderMessage = Warning).GetAwaiter().GetResult();
|
||||
viewModel.InvalidateMessages();
|
||||
Dispatcher.CurrentDispatcher.Invoke(() => { }, DispatcherPriority.Background);
|
||||
|
||||
return WarningBlock(host).Text;
|
||||
});
|
||||
|
||||
Assert.Equal(Warning, shown);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TheWarningStaysInsideTheToolbarWhenEveryMessageIsLong()
|
||||
{
|
||||
var right = RunSta(() =>
|
||||
{
|
||||
var pronounce = new UTAUVoicePronounce
|
||||
{
|
||||
ImportMessage = LongImport,
|
||||
RenderMessage = LongWarning,
|
||||
};
|
||||
pronounce.Notes.Add(new UTAUNote { Lyric = "あ" });
|
||||
using var viewModel = new NoteEditorViewModel(pronounce);
|
||||
var host = Build(viewModel);
|
||||
|
||||
var warning = WarningBlock(host);
|
||||
return warning.TranslatePoint(new Point(0.0, 0.0), host).X + warning.ActualWidth;
|
||||
});
|
||||
|
||||
Assert.True(right <= PopupWidth, $"right={right}");
|
||||
}
|
||||
}
|
||||
@@ -281,6 +281,16 @@ public sealed class UtauRendererTests : IDisposable
|
||||
Assert.True(Peak(result.Samples) > 0.01);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void UnknownLyricsAreSkippedWithoutStoppingTheRest()
|
||||
{
|
||||
var bank = TestVoiceBank.CreateSingleKanaBank(directory);
|
||||
var result = Render(bank, "<!C4:1/4>あ<!C4:1/4>ぱ<!C4:1/4>あ");
|
||||
|
||||
Assert.Equal(2, result.Timings.Count);
|
||||
Assert.True(Peak(result.Samples) > 0.01);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void UnitsWithoutAnyRenderableEntryProduceAnEmptyResult()
|
||||
{
|
||||
|
||||
@@ -105,6 +105,30 @@ internal static class TestVoiceBank
|
||||
return VoiceBankLoader.Load("vcv", directory);
|
||||
}
|
||||
|
||||
public static VoiceBank CreateVcvAndCvvcBank(string directory)
|
||||
{
|
||||
WriteText(directory, VoiceBankLoader.CharacterFileName, "name=連続音CVVC\r\n");
|
||||
WriteText(
|
||||
directory,
|
||||
VoiceBankLoader.OtoFileName,
|
||||
string.Join("\r\n",
|
||||
[
|
||||
"a.wav=あ,50,80,-500,100,40",
|
||||
"ka.wav=か,50,120,-500,140,50",
|
||||
"start.wav=- あ,50,80,-500,100,40",
|
||||
"aka.wav=a か,50,120,-500,140,50",
|
||||
"ak.wav=a k,50,40,-200,60,20",
|
||||
"aend.wav=a -,50,40,-200,60,20",
|
||||
]));
|
||||
WriteSample(directory, "a.wav");
|
||||
WriteSample(directory, "ka.wav");
|
||||
WriteSample(directory, "start.wav");
|
||||
WriteSample(directory, "aka.wav");
|
||||
WriteSample(directory, "ak.wav");
|
||||
WriteSample(directory, "aend.wav");
|
||||
return VoiceBankLoader.Load("vcvcvvc", directory);
|
||||
}
|
||||
|
||||
public static VoiceBank CreateCvvcBank(string directory)
|
||||
{
|
||||
WriteText(directory, VoiceBankLoader.CharacterFileName, "name=CVVC\r\n");
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Windows.Controls;
|
||||
|
||||
namespace UTAU.Tests;
|
||||
|
||||
[Collection("Wpf")]
|
||||
public sealed class ToolbarHeightTests
|
||||
{
|
||||
const double RowHeight = 26.0;
|
||||
|
||||
@@ -31,6 +31,8 @@ internal static class AliasResolver
|
||||
{
|
||||
var hiragana = KanaRomanization.ToHiragana(lyric);
|
||||
var katakana = KanaRomanization.ToKatakana(lyric);
|
||||
var mora = KanaRomanization.ToMora(lyric);
|
||||
var moraKatakana = KanaRomanization.ToKatakana(mora);
|
||||
KanaRomanization.TryGetRomaji(lyric, out var romaji);
|
||||
|
||||
if (previousVowel.Length > 0)
|
||||
@@ -38,6 +40,8 @@ internal static class AliasResolver
|
||||
yield return previousVowel + " " + lyric;
|
||||
yield return previousVowel + " " + hiragana;
|
||||
yield return previousVowel + " " + katakana;
|
||||
yield return previousVowel + " " + mora;
|
||||
yield return previousVowel + " " + moraKatakana;
|
||||
if (romaji is not null)
|
||||
yield return previousVowel + " " + romaji;
|
||||
}
|
||||
@@ -45,6 +49,8 @@ internal static class AliasResolver
|
||||
yield return lyric;
|
||||
yield return hiragana;
|
||||
yield return katakana;
|
||||
yield return mora;
|
||||
yield return moraKatakana;
|
||||
if (romaji is not null)
|
||||
yield return romaji;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ internal static class KanaRomanization
|
||||
{
|
||||
public const string StartVowel = "-";
|
||||
public const string SilenceConsonant = "-";
|
||||
public const char AliasSeparator = ' ';
|
||||
|
||||
static readonly Dictionary<string, string> Table = new(StringComparer.Ordinal)
|
||||
{
|
||||
@@ -47,10 +48,51 @@ internal static class KanaRomanization
|
||||
["ぐぁ"] = "gwa", ["ぐぃ"] = "gwi", ["ぐぇ"] = "gwe", ["ぐぉ"] = "gwo",
|
||||
};
|
||||
|
||||
static readonly Dictionary<string, string> RomajiAliases = new(StringComparer.Ordinal)
|
||||
{
|
||||
["si"] = "し", ["ti"] = "ち", ["tu"] = "つ", ["zi"] = "じ", ["hu"] = "ふ",
|
||||
["di"] = "ぢ", ["du"] = "づ", ["wo"] = "を",
|
||||
["sya"] = "しゃ", ["syu"] = "しゅ", ["syo"] = "しょ", ["sye"] = "しぇ",
|
||||
["shya"] = "しゃ", ["shyu"] = "しゅ", ["shyo"] = "しょ", ["shye"] = "しぇ",
|
||||
["tya"] = "ちゃ", ["tyu"] = "ちゅ", ["tyo"] = "ちょ", ["tye"] = "ちぇ",
|
||||
["cya"] = "ちゃ", ["cyu"] = "ちゅ", ["cyo"] = "ちょ", ["cye"] = "ちぇ",
|
||||
["chya"] = "ちゃ", ["chyu"] = "ちゅ", ["chyo"] = "ちょ", ["chye"] = "ちぇ",
|
||||
["zya"] = "じゃ", ["zyu"] = "じゅ", ["zyo"] = "じょ", ["zye"] = "じぇ",
|
||||
["jya"] = "じゃ", ["jyu"] = "じゅ", ["jyo"] = "じょ", ["jye"] = "じぇ",
|
||||
["dya"] = "ぢゃ", ["dyu"] = "ぢゅ", ["dyo"] = "ぢょ",
|
||||
};
|
||||
|
||||
static readonly char[] Vowels = ['a', 'i', 'u', 'e', 'o'];
|
||||
|
||||
static readonly Dictionary<string, string> Kana = BuildKana();
|
||||
|
||||
public static bool TryGetRomaji(string mora, out string romaji)
|
||||
=> Table.TryGetValue(ToHiragana(mora), out romaji!);
|
||||
=> Table.TryGetValue(ToMora(mora), out romaji!);
|
||||
|
||||
public static string ToMora(string lyric)
|
||||
{
|
||||
var separator = lyric.LastIndexOf(AliasSeparator);
|
||||
var hiragana = ToHiragana(separator >= 0 ? lyric[(separator + 1)..] : lyric);
|
||||
if (Table.ContainsKey(hiragana))
|
||||
return hiragana;
|
||||
|
||||
return Kana.TryGetValue(hiragana, out var mapped) ? mapped : hiragana;
|
||||
}
|
||||
|
||||
static Dictionary<string, string> BuildKana()
|
||||
{
|
||||
var kana = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||
foreach (var pair in Table)
|
||||
{
|
||||
if (kana.TryGetValue(pair.Value, out var existing) && string.CompareOrdinal(existing, pair.Key) <= 0)
|
||||
continue;
|
||||
kana[pair.Value] = pair.Key;
|
||||
}
|
||||
|
||||
foreach (var pair in RomajiAliases)
|
||||
kana[pair.Key] = pair.Value;
|
||||
return kana;
|
||||
}
|
||||
|
||||
public static string? GetVowel(string mora)
|
||||
{
|
||||
|
||||
@@ -64,6 +64,8 @@ internal static class Phonemizer
|
||||
var next = units[i + 1];
|
||||
if (current.IsSilent || next.IsSilent)
|
||||
continue;
|
||||
if (next.Alias.Contains(KanaRomanization.AliasSeparator))
|
||||
continue;
|
||||
|
||||
var vowel = KanaRomanization.GetVowel(current.Note.Lyric);
|
||||
var consonant = KanaRomanization.GetConsonant(next.Note.Lyric);
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
<UseWPF>true</UseWPF>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>1.0.0</Version>
|
||||
<Version>1.1.1</Version>
|
||||
<Platforms>AnyCPU;x64;x64</Platforms>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
|
||||
@@ -13,6 +13,7 @@ internal sealed class UTAUVoicePronounce : UndoRedoable, IVoicePronounce
|
||||
{
|
||||
string sourceText = string.Empty;
|
||||
string importMessage = string.Empty;
|
||||
string renderMessage = string.Empty;
|
||||
double tempo = TimeBase.DefaultTempo;
|
||||
double speed = 1.0;
|
||||
LipSyncFrame[]? lipSyncFrames;
|
||||
@@ -55,21 +56,28 @@ internal sealed class UTAUVoicePronounce : UndoRedoable, IVoicePronounce
|
||||
public string SourceText
|
||||
{
|
||||
get => sourceText;
|
||||
set => Set(ref sourceText, value ?? string.Empty);
|
||||
set => SetWithoutUndoRedo(ref sourceText, value ?? string.Empty);
|
||||
}
|
||||
|
||||
[Browsable(false)]
|
||||
public string ImportMessage
|
||||
{
|
||||
get => importMessage;
|
||||
set => Set(ref importMessage, value ?? string.Empty);
|
||||
set => SetWithoutUndoRedo(ref importMessage, value ?? string.Empty);
|
||||
}
|
||||
|
||||
[Browsable(false)]
|
||||
public string RenderMessage
|
||||
{
|
||||
get => renderMessage;
|
||||
set => SetWithoutUndoRedo(ref renderMessage, value ?? string.Empty);
|
||||
}
|
||||
|
||||
[Browsable(false)]
|
||||
public LipSyncFrame[]? LipSyncFrames
|
||||
{
|
||||
get => lipSyncFrames;
|
||||
set => Set(ref lipSyncFrames, value);
|
||||
set => SetWithoutUndoRedo(ref lipSyncFrames, value);
|
||||
}
|
||||
|
||||
public void BeginEdit()
|
||||
|
||||
@@ -79,7 +79,8 @@ internal sealed class UTAUVoiceSpeaker(VoiceBank bank) : IVoiceSpeaker
|
||||
void Render(string source, UTAUVoicePronounce pronounce, UTAUVoiceParameter parameter, TempoMap tempoMap, string filePath)
|
||||
{
|
||||
var units = Phonemizer.Phonemize(bank, tempoMap, parameter.Color, PhonemizeOptions.Default);
|
||||
ThrowIfUnresolved(units);
|
||||
var unresolved = DescribeUnresolved(units);
|
||||
pronounce.RenderMessage = unresolved;
|
||||
|
||||
var settings = new RenderSettings(
|
||||
UTAUSettings.Default.F0Estimator,
|
||||
@@ -93,7 +94,7 @@ internal sealed class UTAUVoiceSpeaker(VoiceBank bank) : IVoiceSpeaker
|
||||
var renderer = new UtauRenderer(settings, BuildCurves(pronounce, tempoMap), AnalysisCache.Shared);
|
||||
var result = renderer.Render(units, arena);
|
||||
if (result.Samples.Length == 0)
|
||||
throw new InvalidOperationException(Texts.NoRenderableNoteMessage);
|
||||
throw new InvalidOperationException(unresolved.Length > 0 ? unresolved : Texts.NoRenderableNoteMessage);
|
||||
|
||||
WaveIo.Write(filePath, result.Samples, result.SampleRate);
|
||||
pronounce.SourceText = source;
|
||||
@@ -109,7 +110,7 @@ internal sealed class UTAUVoiceSpeaker(VoiceBank bank) : IVoiceSpeaker
|
||||
return new RenderCurves(resampled.Formant, resampled.Breathiness, resampled.IntervalMilliseconds);
|
||||
}
|
||||
|
||||
static void ThrowIfUnresolved(IReadOnlyList<PhonemeUnit> units)
|
||||
static string DescribeUnresolved(IReadOnlyList<PhonemeUnit> units)
|
||||
{
|
||||
var unresolved = units
|
||||
.Where(x => x.IsUnresolved)
|
||||
@@ -117,12 +118,12 @@ internal sealed class UTAUVoiceSpeaker(VoiceBank bank) : IVoiceSpeaker
|
||||
.Distinct(StringComparer.Ordinal)
|
||||
.ToArray();
|
||||
if (unresolved.Length == 0)
|
||||
return;
|
||||
return string.Empty;
|
||||
|
||||
var listed = string.Join(", ", unresolved.Take(MaximumReportedUnresolvedLyrics));
|
||||
if (unresolved.Length > MaximumReportedUnresolvedLyrics)
|
||||
listed += " ...";
|
||||
throw new InvalidOperationException(string.Format(Texts.AliasNotFoundMessage, listed));
|
||||
return string.Format(Texts.AliasNotFoundMessage, listed);
|
||||
}
|
||||
|
||||
static LipSyncFrame[] BuildLipSyncFrames(TempoMap tempoMap, double offsetMilliseconds)
|
||||
|
||||
@@ -117,6 +117,8 @@ internal sealed class NoteEditorViewModel : Bindable, IDisposable
|
||||
|
||||
public string ImportMessage => pronounce.ImportMessage;
|
||||
|
||||
public string RenderMessage => pronounce.RenderMessage;
|
||||
|
||||
public ICommand AddPitchPointCommand { get; }
|
||||
|
||||
public ICommand RemovePitchPointCommand { get; }
|
||||
@@ -405,6 +407,12 @@ internal sealed class NoteEditorViewModel : Bindable, IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
public void InvalidateMessages()
|
||||
{
|
||||
OnPropertyChanged(nameof(ImportMessage));
|
||||
OnPropertyChanged(nameof(RenderMessage));
|
||||
}
|
||||
|
||||
public void InvalidateTones()
|
||||
{
|
||||
UpdateToneRange();
|
||||
|
||||
+47
-34
@@ -7,6 +7,7 @@
|
||||
xmlns:vm="clr-namespace:UTAU.ViewModels"
|
||||
xmlns:c="clr-namespace:YukkuriMovieMaker.Controls;assembly=YukkuriMovieMaker.Controls"
|
||||
xmlns:icons="clr-namespace:YukkuriMovieMaker.Resources.Icons;assembly=YukkuriMovieMaker.Plugin"
|
||||
xmlns:theme="clr-namespace:YukkuriMovieMaker.Theme;assembly=YukkuriMovieMaker.Plugin"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="440" d:DesignWidth="960"
|
||||
d:DataContext="{d:DesignInstance Type={x:Type vm:NoteEditorViewModel}}">
|
||||
@@ -35,40 +36,52 @@
|
||||
<RowDefinition Height="14"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0" Grid.ColumnSpan="2" Orientation="Horizontal">
|
||||
<Button Width="26" Height="26" Command="{Binding ZoomOutCommand}" ToolTip="{x:Static root:Texts.ZoomOut}"
|
||||
Content="{DynamicResource {x:Static icons:IconKeys.MagnifyMinusOutline}}"/>
|
||||
<Button Width="26" Height="26" Command="{Binding ZoomInCommand}" ToolTip="{x:Static root:Texts.ZoomIn}"
|
||||
Content="{DynamicResource {x:Static icons:IconKeys.MagnifyPlusOutline}}"/>
|
||||
<Button Width="26" Height="26" Command="{Binding ZoomVerticalOutCommand}" ToolTip="{x:Static root:Texts.ZoomVerticalOut}"
|
||||
Content="{DynamicResource {x:Static icons:IconKeys.ArrowCollapseVertical}}"/>
|
||||
<Button Width="26" Height="26" Command="{Binding ZoomVerticalInCommand}" ToolTip="{x:Static root:Texts.ZoomVerticalIn}"
|
||||
Content="{DynamicResource {x:Static icons:IconKeys.ArrowExpandVertical}}"/>
|
||||
<Button Width="26" Height="26" Command="{Binding FitCommand}" ToolTip="{x:Static root:Texts.FitToWindow}"
|
||||
Content="{DynamicResource {x:Static icons:IconKeys.FitToScreenOutline}}"/>
|
||||
<Button Width="26" Height="26" Command="{Binding InsertRestCommand}" ToolTip="{x:Static root:Texts.InsertRest}"
|
||||
Content="{DynamicResource {x:Static icons:IconKeys.Plus}}"/>
|
||||
<Button Width="26" Height="26" Command="{Binding RemoveNoteCommand}" ToolTip="{x:Static root:Texts.RemoveNote}"
|
||||
Content="{DynamicResource {x:Static icons:IconKeys.Delete}}"/>
|
||||
<Button Width="26" Height="26" Command="{Binding SelectAllCommand}" ToolTip="{x:Static root:Texts.SelectAllNotes}"
|
||||
Content="{DynamicResource {x:Static icons:IconKeys.SelectAll}}"/>
|
||||
<TextBlock Text="{x:Static root:Texts.SnapLabel}" VerticalAlignment="Center" Margin="6,0,3,0"/>
|
||||
<ComboBox Width="88" Height="26"
|
||||
ItemsSource="{Binding SnapDivisions}"
|
||||
SelectedItem="{Binding SnapDivision}"
|
||||
DisplayMemberPath="Name"/>
|
||||
<TextBlock Text="{x:Static root:Texts.ExpressionLabel}" VerticalAlignment="Center" Margin="12,0,3,0"/>
|
||||
<ComboBox Width="110" Height="26"
|
||||
ItemsSource="{Binding Expressions}"
|
||||
SelectedItem="{Binding SelectedExpression}"
|
||||
DisplayMemberPath="Name"/>
|
||||
<Button Width="26" Height="26" Command="{Binding ResetExpressionCommand}" ToolTip="{x:Static root:Texts.ResetExpression}"
|
||||
Content="{DynamicResource {x:Static icons:IconKeys.Restore}}"/>
|
||||
<TextBlock Text="{Binding SelectionText}" VerticalAlignment="Center" Margin="12,0,0,0" Opacity="0.75"/>
|
||||
<TextBlock Text="{Binding GuideText}" VerticalAlignment="Center" Margin="12,0,0,0" Opacity="0.75"/>
|
||||
<TextBlock Text="{Binding ImportMessage}" VerticalAlignment="Center" Margin="12,0,0,0" Opacity="0.75"
|
||||
TextTrimming="CharacterEllipsis"/>
|
||||
</StackPanel>
|
||||
<Grid Grid.Row="0" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.Column="0" Orientation="Horizontal">
|
||||
<Button Width="26" Height="26" Command="{Binding ZoomOutCommand}" ToolTip="{x:Static root:Texts.ZoomOut}"
|
||||
Content="{DynamicResource {x:Static icons:IconKeys.MagnifyMinusOutline}}"/>
|
||||
<Button Width="26" Height="26" Command="{Binding ZoomInCommand}" ToolTip="{x:Static root:Texts.ZoomIn}"
|
||||
Content="{DynamicResource {x:Static icons:IconKeys.MagnifyPlusOutline}}"/>
|
||||
<Button Width="26" Height="26" Command="{Binding ZoomVerticalOutCommand}" ToolTip="{x:Static root:Texts.ZoomVerticalOut}"
|
||||
Content="{DynamicResource {x:Static icons:IconKeys.ArrowCollapseVertical}}"/>
|
||||
<Button Width="26" Height="26" Command="{Binding ZoomVerticalInCommand}" ToolTip="{x:Static root:Texts.ZoomVerticalIn}"
|
||||
Content="{DynamicResource {x:Static icons:IconKeys.ArrowExpandVertical}}"/>
|
||||
<Button Width="26" Height="26" Command="{Binding FitCommand}" ToolTip="{x:Static root:Texts.FitToWindow}"
|
||||
Content="{DynamicResource {x:Static icons:IconKeys.FitToScreenOutline}}"/>
|
||||
<Button Width="26" Height="26" Command="{Binding InsertRestCommand}" ToolTip="{x:Static root:Texts.InsertRest}"
|
||||
Content="{DynamicResource {x:Static icons:IconKeys.Plus}}"/>
|
||||
<Button Width="26" Height="26" Command="{Binding RemoveNoteCommand}" ToolTip="{x:Static root:Texts.RemoveNote}"
|
||||
Content="{DynamicResource {x:Static icons:IconKeys.Delete}}"/>
|
||||
<Button Width="26" Height="26" Command="{Binding SelectAllCommand}" ToolTip="{x:Static root:Texts.SelectAllNotes}"
|
||||
Content="{DynamicResource {x:Static icons:IconKeys.SelectAll}}"/>
|
||||
<TextBlock Text="{x:Static root:Texts.SnapLabel}" VerticalAlignment="Center" Margin="6,0,3,0"/>
|
||||
<ComboBox Width="88" Height="26" VerticalContentAlignment="Center"
|
||||
ItemsSource="{Binding SnapDivisions}"
|
||||
SelectedItem="{Binding SnapDivision}"
|
||||
DisplayMemberPath="Name"/>
|
||||
<TextBlock Text="{x:Static root:Texts.ExpressionLabel}" VerticalAlignment="Center" Margin="12,0,3,0"/>
|
||||
<ComboBox Width="110" Height="26" VerticalContentAlignment="Center"
|
||||
ItemsSource="{Binding Expressions}"
|
||||
SelectedItem="{Binding SelectedExpression}"
|
||||
DisplayMemberPath="Name"/>
|
||||
<Button Width="26" Height="26" Command="{Binding ResetExpressionCommand}" ToolTip="{x:Static root:Texts.ResetExpression}"
|
||||
Content="{DynamicResource {x:Static icons:IconKeys.Restore}}"/>
|
||||
<TextBlock Text="{Binding SelectionText}" VerticalAlignment="Center" Margin="12,0,0,0" Opacity="0.75"/>
|
||||
<TextBlock Text="{Binding GuideText}" VerticalAlignment="Center" Margin="12,0,0,0" Opacity="0.75"/>
|
||||
</StackPanel>
|
||||
|
||||
<DockPanel Grid.Column="1">
|
||||
<TextBlock DockPanel.Dock="Right" Text="{Binding RenderMessage}" VerticalAlignment="Center" Margin="12,0,0,0"
|
||||
Foreground="{DynamicResource {x:Static theme:YMM4Colors.WarningBannerForegroundBrushKey}}"
|
||||
TextTrimming="CharacterEllipsis"/>
|
||||
<TextBlock Text="{Binding ImportMessage}" VerticalAlignment="Center" Margin="12,0,0,0" Opacity="0.75"
|
||||
TextTrimming="CharacterEllipsis"/>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
|
||||
<ScrollViewer x:Name="VerticalScroller" Grid.Row="1" Grid.Column="0"
|
||||
VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"
|
||||
|
||||
@@ -80,7 +80,11 @@ public partial class NoteEditor : UserControl, IPropertyEditorControl
|
||||
|
||||
void Scroller_SizeChanged(object sender, SizeChangedEventArgs e) => UpdateFit();
|
||||
|
||||
void PopupButton_BeginEdit(object sender, EventArgs e) => BeginEdit?.Invoke(this, e);
|
||||
void PopupButton_BeginEdit(object sender, EventArgs e)
|
||||
{
|
||||
ViewModel?.InvalidateMessages();
|
||||
BeginEdit?.Invoke(this, e);
|
||||
}
|
||||
|
||||
void PopupButton_EndEdit(object sender, EventArgs e) => EndEdit?.Invoke(this, e);
|
||||
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする