Make experimental feature to show note length configurable in settings

This makes testing easier and the feature doesn't look too bad at this
point.
This commit is contained in:
Martchus 2024-01-21 21:46:27 +01:00
parent 0183938e48
commit 568ee40c1b
3 changed files with 92 additions and 74 deletions

View File

@ -133,6 +133,8 @@ void GuiPreferencesOptionPage::init(CSong* song, CSettings* settings, CGLView *
bool GuiPreferencesOptionPage::apply()
{
Cfg::experimentalNoteLength = ui()->showNoteLengthCheck->isChecked();
m_settings->setValue("Score/ShowNoteLength", Cfg::experimentalNoteLength);
m_song->cfg_timingMarkersFlag = ui()->timingMarkersCheck->isChecked();
m_settings->setValue("Score/TimingMarkers", m_song->cfg_timingMarkersFlag );
m_settings->setNoteNamesEnabled( ui()->showNoteNamesCheck->isChecked());
@ -149,6 +151,7 @@ bool GuiPreferencesOptionPage::apply()
void GuiPreferencesOptionPage::reset()
{
ui()->showNoteLengthCheck->setChecked(Cfg::experimentalNoteLength);
ui()->timingMarkersCheck->setChecked(m_song->cfg_timingMarkersFlag);
ui()->showNoteNamesCheck->setChecked(m_settings->isNoteNamesEnabled());
ui()->courtesyAccidentalsCheck->setChecked(m_settings->displayCourtesyAccidentals());

View File

@ -26,37 +26,17 @@
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<widget class="QCheckBox" name="courtesyAccidentalsCheck">
<item row="0" column="0">
<widget class="QCheckBox" name="showNoteNamesCheck">
<property name="text">
<string>Courtesy Accidentals</string>
<string>Show Note Names</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="followStopPointCombo">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Follow stop point:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<spacer name="horizontalSpacer_4">
<item row="6" column="1">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@ -66,10 +46,40 @@
</property>
</spacer>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="followThroughErrorsCheck">
<property name="text">
<string>Follow Through Errors</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QCheckBox" name="showColoredNotesCheck">
<property name="toolTip">
<string>Show color coded notes on the score</string>
</property>
<property name="text">
<string>Color Coded Notes</string>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@ -92,68 +102,72 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="showNoteNamesCheck">
<item row="1" column="1">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="1">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Show Note Names</string>
<string>Follow stop point:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="1">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="followThroughErrorsCheck">
<item row="1" column="0">
<widget class="QCheckBox" name="courtesyAccidentalsCheck">
<property name="text">
<string>Follow Through Errors</string>
<string>Courtesy Accidentals</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QComboBox" name="followStopPointCombo">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::SizeAdjustPolicy::AdjustToContents</enum>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="showColoredNotesCheck">
<property name="toolTip">
<string>Show color coded notes on the score</string>
</property>
<widget class="QCheckBox" name="showNoteLengthCheck">
<property name="text">
<string>Color Coded Notes</string>
<string>Show note length</string>
</property>
</widget>
</item>
<item row="4" column="1">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<widget class="QLabel" name="experimentalLabel">
<property name="text">
<string>(experimental)</string>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</widget>
</item>
</layout>
</item>

View File

@ -155,6 +155,7 @@ QtWindow::QtWindow(CSettings *settings, QtUtilities::QtSettings *qtSettings, QWi
m_song->setLatencyFix(m_settings->value("Midi/Latency", 0).toInt());
Cfg::experimentalNoteLength = m_settings->value("Score/ShowNoteLength", Cfg::experimentalNoteLength).toBool();
m_song->cfg_timingMarkersFlag = m_settings->value("Score/TimingMarkers", m_song->cfg_timingMarkersFlag ).toBool();
m_song->cfg_stopPointMode = static_cast<stopPointMode_t> (m_settings->value("Score/StopPointMode", m_song->cfg_stopPointMode ).toInt());
m_song->cfg_rhythmTapping = static_cast<rhythmTapping_t> (m_settings->value("Score/RtyhemTappingMode", m_song->cfg_rhythmTapping ).toInt());