@@ -35,6 +35,8 @@ namespace VisualEditor::Internal {
3535 EditorPreference::NoteEditPitchCurveDisplayMode noteEditPitchCurveDisplayMode{};
3636 double autoPitchCurveDisplayPixelDensityThreshold{kDefaultAutoPitchCurveDisplayPixelDensityThreshold };
3737 bool displayPronunciationBelowNote{};
38+ bool showLyricOverlay{};
39+ int lyricPhraseGapThreshold{240 };
3840 bool warnOfOverlappingNotes{true };
3941 bool trackCursorPosition{true };
4042 bool showSingerBackground{true };
@@ -108,6 +110,8 @@ namespace VisualEditor::Internal {
108110 Q_EMIT autoPitchCurveDisplayPixelDensityThresholdChanged ();
109111 d->displayPronunciationBelowNote = settings->value (" displayPronunciationBelowNote" , false ).toBool ();
110112 emit displayPronunciationBelowNoteChanged ();
113+ setLyricPhraseGapThreshold (settings->value (" lyricPhraseGapThreshold" , 240 ).toInt ());
114+ setShowLyricOverlay (settings->value (" showLyricOverlay" , false ).toBool ());
111115 d->warnOfOverlappingNotes = settings->value (" warnOfOverlappingNotes" , true ).toBool ();
112116 emit warnOfOverlappingNotesChanged ();
113117 d->trackCursorPosition = settings->value (" trackCursorPosition" , true ).toBool ();
@@ -157,6 +161,8 @@ namespace VisualEditor::Internal {
157161 settings->setValue (" noteEditPitchCurveDisplayMode" , static_cast <int >(d->noteEditPitchCurveDisplayMode ));
158162 settings->setValue (" autoPitchCurveDisplayPixelDensityThreshold" , d->autoPitchCurveDisplayPixelDensityThreshold );
159163 settings->setValue (" displayPronunciationBelowNote" , d->displayPronunciationBelowNote );
164+ settings->setValue (" showLyricOverlay" , d->showLyricOverlay );
165+ settings->setValue (" lyricPhraseGapThreshold" , d->lyricPhraseGapThreshold );
160166 settings->setValue (" warnOfOverlappingNotes" , d->warnOfOverlappingNotes );
161167 settings->setValue (" trackCursorPosition" , d->trackCursorPosition );
162168 settings->setValue (" showSingerBackground" , d->showSingerBackground );
@@ -413,6 +419,33 @@ namespace VisualEditor::Internal {
413419 emit m_instance->displayPronunciationBelowNoteChanged ();
414420 }
415421
422+ bool EditorPreference::showLyricOverlay () {
423+ M_INSTANCE_D ;
424+ return d->showLyricOverlay ;
425+ }
426+
427+ void EditorPreference::setShowLyricOverlay (bool showLyricOverlay) {
428+ M_INSTANCE_D ;
429+ if (d->showLyricOverlay == showLyricOverlay)
430+ return ;
431+ d->showLyricOverlay = showLyricOverlay;
432+ Q_EMIT m_instance->showLyricOverlayChanged ();
433+ }
434+
435+ int EditorPreference::lyricPhraseGapThreshold () {
436+ M_INSTANCE_D ;
437+ return d->lyricPhraseGapThreshold ;
438+ }
439+
440+ void EditorPreference::setLyricPhraseGapThreshold (int lyricPhraseGapThreshold) {
441+ M_INSTANCE_D ;
442+ lyricPhraseGapThreshold = qBound (1 , lyricPhraseGapThreshold, 1920 );
443+ if (d->lyricPhraseGapThreshold == lyricPhraseGapThreshold)
444+ return ;
445+ d->lyricPhraseGapThreshold = lyricPhraseGapThreshold;
446+ Q_EMIT m_instance->lyricPhraseGapThresholdChanged ();
447+ }
448+
416449 bool EditorPreference::warnOfOverlappingNotes () {
417450 M_INSTANCE_D ;
418451 return d->warnOfOverlappingNotes ;
0 commit comments