Skip to content

Commit

Permalink
Romaji should be the next of the time-tag.
Browse files Browse the repository at this point in the history
Because romaji has been moved inside the time-tag.
  • Loading branch information
andy840119 committed Sep 25, 2023
1 parent 30339b1 commit 0c7a3f6
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ private void updateModeWithEditStep()
LyricEditorMode.Reference => null,
LyricEditorMode.Language => throw new NotSupportedException(),
LyricEditorMode.EditRuby => throw new NotSupportedException(),
LyricEditorMode.EditRomaji => throw new NotSupportedException(),
LyricEditorMode.EditTimeTag => throw new NotSupportedException(),
LyricEditorMode.EditRomaji => throw new NotSupportedException(),
LyricEditorMode.EditNote => throw new NotSupportedException(),
LyricEditorMode.Singer => throw new NotSupportedException(),
_ => throw new ArgumentOutOfRangeException(nameof(mode), mode, null),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public LyricEditorModeMenu(Bindable<LyricEditorMode> config, string text)
LyricEditorMode.Reference,
LyricEditorMode.Language,
LyricEditorMode.EditRuby,
LyricEditorMode.EditRomaji,
LyricEditorMode.EditTimeTag,
LyricEditorMode.EditRomaji,
LyricEditorMode.EditNote,
LyricEditorMode.Singer,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ protected void InitializeBlueprint()
modeWithEditStep.Mode switch
{
LyricEditorMode.EditRuby => rubyTagEditMode == RubyTagEditMode.Create ? null : new RubyBlueprintContainer(lyric),
LyricEditorMode.EditRomaji => new RomajiBlueprintContainer(lyric),
LyricEditorMode.EditTimeTag => modeWithEditStep.EditStep is TimeTagEditStep.Adjust ? new TimeTagBlueprintContainer(lyric) : null,
LyricEditorMode.EditRomaji => new RomajiBlueprintContainer(lyric),
_ => null,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ private void triggerWritableVersionChanged()
LyricEditorMode.Reference => HitObjectWritableUtils.GetLyricPropertyLockedBy(lyric, nameof(Objects.Lyric.ReferenceLyric), nameof(Objects.Lyric.ReferenceLyricConfig)),
LyricEditorMode.Language => HitObjectWritableUtils.GetLyricPropertyLockedBy(lyric, nameof(Objects.Lyric.Language)),
LyricEditorMode.EditRuby => HitObjectWritableUtils.GetLyricPropertyLockedBy(lyric, nameof(Objects.Lyric.RubyTags)),
LyricEditorMode.EditRomaji => HitObjectWritableUtils.GetLyricPropertyLockedBy(lyric, nameof(Objects.Lyric.RomajiTags)),
LyricEditorMode.EditTimeTag => HitObjectWritableUtils.GetLyricPropertyLockedBy(lyric, nameof(Objects.Lyric.TimeTags)),
LyricEditorMode.EditRomaji => HitObjectWritableUtils.GetLyricPropertyLockedBy(lyric, nameof(Objects.Lyric.RomajiTags)),
LyricEditorMode.EditNote => HitObjectWritableUtils.GetCreateOrRemoveNoteLockedBy(lyric),
LyricEditorMode.Singer => HitObjectWritableUtils.GetLyricPropertyLockedBy(lyric, nameof(Objects.Lyric.SingerIds)),
_ => throw new ArgumentOutOfRangeException(nameof(mode), mode, null),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ private static IEnumerable<Drawable> createItemForEditMode(EditorModeWithEditSte
LyricEditorMode.Reference => Array.Empty<Drawable>(),
LyricEditorMode.Language => Array.Empty<Drawable>(),
LyricEditorMode.EditRuby => Array.Empty<Drawable>(),
LyricEditorMode.EditRomaji => Array.Empty<Drawable>(),
LyricEditorMode.EditTimeTag => createItemsForTimeTagEditStep(editorModeWithEditStep.GetEditStep<TimeTagEditStep>()),
LyricEditorMode.EditRomaji => Array.Empty<Drawable>(),
LyricEditorMode.EditNote => createItemsForNoteEditStep(editorModeWithEditStep.GetEditStep<NoteEditStep>()),
LyricEditorMode.Singer => Array.Empty<Drawable>(),
_ => throw new ArgumentOutOfRangeException(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ public void Navigate(Issue issue)
case CheckLyricRubyTag:
return LyricEditorMode.EditRuby;

case CheckLyricRomajiTag:
return LyricEditorMode.EditRomaji;

case CheckLyricTimeTag:
return LyricEditorMode.EditTimeTag;

case CheckLyricRomajiTag:
return LyricEditorMode.EditRomaji;

case CheckNoteReferenceLyric:
case CheckNoteText:
return LyricEditorMode.EditNote;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ private void updateModeWithEditStep()
LyricEditorMode.Reference => editReferenceLyricModeState.BindableEditStep.Value,
LyricEditorMode.Language => languageModeState.BindableEditStep.Value,
LyricEditorMode.EditRuby => editRubyModeState.BindableEditStep.Value,
LyricEditorMode.EditRomaji => editRomajiModeState.BindableEditStep.Value,
LyricEditorMode.EditTimeTag => timeTagModeState.BindableEditStep.Value,
LyricEditorMode.EditRomaji => editRomajiModeState.BindableEditStep.Value,
LyricEditorMode.EditNote => editNoteModeState.BindableEditStep.Value,
LyricEditorMode.Singer => null,
_ => throw new ArgumentOutOfRangeException(nameof(mode), mode, null),
Expand Down Expand Up @@ -258,8 +258,8 @@ private void initializeSettingsArea()
LyricEditorMode.Reference => new ReferenceSettings(),
LyricEditorMode.Language => new LanguageSettings(),
LyricEditorMode.EditRuby => new RubyTagSettings(),
LyricEditorMode.EditRomaji => new RomajiTagSettings(),
LyricEditorMode.EditTimeTag => new TimeTagSettings(),
LyricEditorMode.EditRomaji => new RomajiTagSettings(),
LyricEditorMode.EditNote => new NoteSettings(),
LyricEditorMode.Singer => new SingerSettings(),
_ => null,
Expand Down Expand Up @@ -293,8 +293,8 @@ static LyricEditorLayout getSupportedLayout(LyricEditorMode mode) =>
LyricEditorMode.Reference => LyricEditorLayout.Preview | LyricEditorLayout.Detail,
LyricEditorMode.Language => LyricEditorLayout.Preview | LyricEditorLayout.Detail,
LyricEditorMode.EditRuby => LyricEditorLayout.Preview | LyricEditorLayout.Detail,
LyricEditorMode.EditRomaji => LyricEditorLayout.Preview | LyricEditorLayout.Detail,
LyricEditorMode.EditTimeTag => LyricEditorLayout.Detail,
LyricEditorMode.EditRomaji => LyricEditorLayout.Preview | LyricEditorLayout.Detail,
LyricEditorMode.EditNote => LyricEditorLayout.Detail,
LyricEditorMode.Singer => LyricEditorLayout.Preview,
_ => throw new ArgumentOutOfRangeException(nameof(mode), mode, null),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,6 @@ private bool performCut()
lyricRubyTagsChangeHandler.RemoveRange(rubies);
return true;

case LyricEditorMode.EditRomaji:
var romajies = editRomajiModeState.SelectedItems;
if (!romajies.Any())
return false;

if (lyricRomajiTagsChangeHandler == null)
throw new NullDependencyException($"Missing {nameof(lyricRomajiTagsChangeHandler)}");

lyricRomajiTagsChangeHandler.RemoveRange(romajies);
return true;

case LyricEditorMode.EditTimeTag:
var timeTags = timeTagModeState.SelectedItems;
if (!timeTags.Any())
Expand All @@ -209,6 +198,17 @@ private bool performCut()
lyricTimeTagsChangeHandler.RemoveRange(timeTags);
return true;

case LyricEditorMode.EditRomaji:
var romajies = editRomajiModeState.SelectedItems;
if (!romajies.Any())
return false;

if (lyricRomajiTagsChangeHandler == null)
throw new NullDependencyException($"Missing {nameof(lyricRomajiTagsChangeHandler)}");

lyricRomajiTagsChangeHandler.RemoveRange(romajies);
return true;

case LyricEditorMode.EditNote:
return false;

Expand Down Expand Up @@ -270,15 +270,6 @@ private bool performCopy(Lyric lyric)
copyObjectToClipboard(rubies);
return true;

case LyricEditorMode.EditRomaji:
var romajies = editRomajiModeState.SelectedItems;
if (!romajies.Any())
return false;

saveObjectToTheClipboardContent(romajies);
copyObjectToClipboard(romajies);
return true;

case LyricEditorMode.EditTimeTag:
var timeTags = timeTagModeState.SelectedItems;
if (!timeTags.Any())
Expand All @@ -288,6 +279,15 @@ private bool performCopy(Lyric lyric)
copyObjectToClipboard(timeTags);
return true;

case LyricEditorMode.EditRomaji:
var romajies = editRomajiModeState.SelectedItems;
if (!romajies.Any())
return false;

saveObjectToTheClipboardContent(romajies);
copyObjectToClipboard(romajies);
return true;

case LyricEditorMode.EditNote:
return false;

Expand Down Expand Up @@ -360,17 +360,6 @@ private bool performPaste(Lyric lyric)
lyricRubyTagsChangeHandler.AddRange(pasteRubies);
return true;

case LyricEditorMode.EditRomaji:
var pasteRomajies = getObjectFromClipboardContent<RomajiTag[]>();
if (pasteRomajies == null)
return false;

if (lyricRomajiTagsChangeHandler == null)
throw new NullDependencyException($"Missing {nameof(lyricRomajiTagsChangeHandler)}");

lyricRomajiTagsChangeHandler.AddRange(pasteRomajies);
return true;

case LyricEditorMode.EditTimeTag:
var pasteTimeTags = getObjectFromClipboardContent<TimeTag[]>();
if (pasteTimeTags == null)
Expand All @@ -382,6 +371,17 @@ private bool performPaste(Lyric lyric)
lyricTimeTagsChangeHandler.AddRange(pasteTimeTags);
return true;

case LyricEditorMode.EditRomaji:
var pasteRomajies = getObjectFromClipboardContent<RomajiTag[]>();
if (pasteRomajies == null)
return false;

if (lyricRomajiTagsChangeHandler == null)
throw new NullDependencyException($"Missing {nameof(lyricRomajiTagsChangeHandler)}");

lyricRomajiTagsChangeHandler.AddRange(pasteRomajies);
return true;

case LyricEditorMode.EditNote:
return false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ private static float getBaseHue(LyricEditorMode mode)

case LyricEditorMode.Language:
case LyricEditorMode.EditRuby:
case LyricEditorMode.EditRomaji:
return 333 / 360f; // pink

case LyricEditorMode.EditTimeTag:
case LyricEditorMode.EditRomaji:
return 45 / 360f; // orange

case LyricEditorMode.EditNote:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ public enum LyricEditorMode
[Description("Edit ruby")]
EditRuby,

/// <summary>
/// Able to create/delete romaji.
/// </summary>
[Description("Edit romaji")]
EditRomaji,

/// <summary>
/// Enable to create/delete and reset time tag.
/// </summary>
[Description("Edit time tag")]
EditTimeTag,

/// <summary>
/// Able to edit the romaji from the time-tag.
/// </summary>
[Description("Edit romaji")]
EditRomaji,

/// <summary>
/// Enable to create/delete notes.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ protected override IEnumerable<ICheck> CreateChecks(LyricEditorMode type) =>
LyricEditorMode.Reference => new ICheck[] { new CheckLyricReferenceLyric() },
LyricEditorMode.Language => new ICheck[] { new CheckLyricLanguage() },
LyricEditorMode.EditRuby => new ICheck[] { new CheckLyricRubyTag() },
LyricEditorMode.EditRomaji => new ICheck[] { new CheckLyricRomajiTag() },
LyricEditorMode.EditTimeTag => new ICheck[] { new CheckLyricTimeTag() },
LyricEditorMode.EditRomaji => new ICheck[] { new CheckLyricRomajiTag() },
LyricEditorMode.EditNote => new ICheck[] { new CheckNoteReferenceLyric(), new CheckNoteText(), new CheckNoteTime() },
LyricEditorMode.Singer => Array.Empty<ICheck>(),
_ => throw new ArgumentOutOfRangeException(nameof(type), type, null),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,10 @@ private void initializeBadge(EditorModeWithEditStep editorMode)
return new LanguageInfo(Lyric);

case LyricEditorMode.EditRuby:
case LyricEditorMode.EditRomaji:
return new LanguageInfo(Lyric);

case LyricEditorMode.EditTimeTag:
case LyricEditorMode.EditRomaji:
return createTimeTagModeSubInfo(editorMode.GetEditStep<TimeTagEditStep>(), Lyric);

case LyricEditorMode.EditNote:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ private void refreshAlgorithmAndCaretPosition()
LyricEditorMode.Reference => new NavigateCaretPositionAlgorithm(lyrics),
LyricEditorMode.Language => new ClickingCaretPositionAlgorithm(lyrics),
LyricEditorMode.EditRuby => getRubyTagModeAlgorithm(),
LyricEditorMode.EditRomaji => new NavigateCaretPositionAlgorithm(lyrics),
LyricEditorMode.EditTimeTag => getTimeTagModeAlgorithm(editorModeWithEditStep.GetEditStep<TimeTagEditStep>()),
LyricEditorMode.EditRomaji => new NavigateCaretPositionAlgorithm(lyrics),
LyricEditorMode.EditNote => new NavigateCaretPositionAlgorithm(lyrics),
LyricEditorMode.Singer => new NavigateCaretPositionAlgorithm(lyrics),
_ => throw new InvalidOperationException(nameof(mode)),
Expand Down

0 comments on commit 0c7a3f6

Please sign in to comment.