Mercurial > hg > sonic-visualiser
comparison main/PreferencesDialog.cpp @ 1097:df73c834764c 3.0-integration
Make colour 3d plot layer colour a preference as well
author | Chris Cannam |
---|---|
date | Thu, 21 Jan 2016 09:28:57 +0000 |
parents | 11ef2f95ea15 |
children | bd3cb9d6db66 |
comparison
equal
deleted
inserted
replaced
1096:11ef2f95ea15 | 1097:df73c834764c |
---|---|
128 settings.beginGroup("Preferences"); | 128 settings.beginGroup("Preferences"); |
129 m_spectrogramGColour = (settings.value("spectrogram-colour", | 129 m_spectrogramGColour = (settings.value("spectrogram-colour", |
130 int(ColourMapper::Green)).toInt()); | 130 int(ColourMapper::Green)).toInt()); |
131 m_spectrogramMColour = (settings.value("spectrogram-melodic-colour", | 131 m_spectrogramMColour = (settings.value("spectrogram-melodic-colour", |
132 int(ColourMapper::Sunset)).toInt()); | 132 int(ColourMapper::Sunset)).toInt()); |
133 m_colour3DColour = (settings.value("colour-3d-plot-colour", | |
134 int(ColourMapper::Green)).toInt()); | |
133 settings.endGroup(); | 135 settings.endGroup(); |
134 QComboBox *spectrogramGColour = new QComboBox; | 136 QComboBox *spectrogramGColour = new QComboBox; |
135 QComboBox *spectrogramMColour = new QComboBox; | 137 QComboBox *spectrogramMColour = new QComboBox; |
138 QComboBox *colour3DColour = new QComboBox; | |
136 for (i = 0; i < ColourMapper::getColourMapCount(); ++i) { | 139 for (i = 0; i < ColourMapper::getColourMapCount(); ++i) { |
137 spectrogramGColour->addItem(ColourMapper::getColourMapName(i)); | 140 spectrogramGColour->addItem(ColourMapper::getColourMapName(i)); |
138 spectrogramMColour->addItem(ColourMapper::getColourMapName(i)); | 141 spectrogramMColour->addItem(ColourMapper::getColourMapName(i)); |
142 colour3DColour->addItem(ColourMapper::getColourMapName(i)); | |
139 if (i == m_spectrogramGColour) spectrogramGColour->setCurrentIndex(i); | 143 if (i == m_spectrogramGColour) spectrogramGColour->setCurrentIndex(i); |
140 if (i == m_spectrogramMColour) spectrogramMColour->setCurrentIndex(i); | 144 if (i == m_spectrogramMColour) spectrogramMColour->setCurrentIndex(i); |
145 if (i == m_colour3DColour) colour3DColour->setCurrentIndex(i); | |
141 } | 146 } |
142 connect(spectrogramGColour, SIGNAL(currentIndexChanged(int)), | 147 connect(spectrogramGColour, SIGNAL(currentIndexChanged(int)), |
143 this, SLOT(spectrogramGColourChanged(int))); | 148 this, SLOT(spectrogramGColourChanged(int))); |
144 connect(spectrogramMColour, SIGNAL(currentIndexChanged(int)), | 149 connect(spectrogramMColour, SIGNAL(currentIndexChanged(int)), |
145 this, SLOT(spectrogramMColourChanged(int))); | 150 this, SLOT(spectrogramMColourChanged(int))); |
151 connect(colour3DColour, SIGNAL(currentIndexChanged(int)), | |
152 this, SLOT(colour3DColourChanged(int))); | |
146 | 153 |
147 m_tuningFrequency = prefs->getTuningFrequency(); | 154 m_tuningFrequency = prefs->getTuningFrequency(); |
148 | 155 |
149 QDoubleSpinBox *frequency = new QDoubleSpinBox; | 156 QDoubleSpinBox *frequency = new QDoubleSpinBox; |
150 frequency->setMinimum(100.0); | 157 frequency->setMinimum(100.0); |
401 | 408 |
402 subgrid->addWidget(new QLabel(tr("Default melodic spectrogram color:")), | 409 subgrid->addWidget(new QLabel(tr("Default melodic spectrogram color:")), |
403 row, 0); | 410 row, 0); |
404 subgrid->addWidget(spectrogramMColour, row++, 1, 1, 2); | 411 subgrid->addWidget(spectrogramMColour, row++, 1, 1, 2); |
405 | 412 |
413 subgrid->addWidget(new QLabel(tr("Default color 3D plot color:")), | |
414 row, 0); | |
415 subgrid->addWidget(colour3DColour, row++, 1, 1, 2); | |
416 | |
406 #ifdef NOT_DEFINED // see earlier | 417 #ifdef NOT_DEFINED // see earlier |
407 subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel | 418 subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel |
408 ("Background Mode"))), | 419 ("Background Mode"))), |
409 row, 0); | 420 row, 0); |
410 subgrid->addWidget(bgMode, row++, 1, 1, 2); | 421 subgrid->addWidget(bgMode, row++, 1, 1, 2); |
572 | 583 |
573 void | 584 void |
574 PreferencesDialog::spectrogramMColourChanged(int colour) | 585 PreferencesDialog::spectrogramMColourChanged(int colour) |
575 { | 586 { |
576 m_spectrogramMColour = colour; | 587 m_spectrogramMColour = colour; |
588 m_applyButton->setEnabled(true); | |
589 } | |
590 | |
591 void | |
592 PreferencesDialog::colour3DColourChanged(int colour) | |
593 { | |
594 m_colour3DColour = colour; | |
577 m_applyButton->setEnabled(true); | 595 m_applyButton->setEnabled(true); |
578 } | 596 } |
579 | 597 |
580 void | 598 void |
581 PreferencesDialog::propertyLayoutChanged(int layout) | 599 PreferencesDialog::propertyLayoutChanged(int layout) |
750 #ifdef Q_OS_MAC | 768 #ifdef Q_OS_MAC |
751 settings.setValue("scaledHiDpi", m_retina); | 769 settings.setValue("scaledHiDpi", m_retina); |
752 #endif | 770 #endif |
753 settings.setValue("spectrogram-colour", m_spectrogramGColour); | 771 settings.setValue("spectrogram-colour", m_spectrogramGColour); |
754 settings.setValue("spectrogram-melodic-colour", m_spectrogramMColour); | 772 settings.setValue("spectrogram-melodic-colour", m_spectrogramMColour); |
773 settings.setValue("colour-3d-plot-colour", m_colour3DColour); | |
755 settings.endGroup(); | 774 settings.endGroup(); |
756 | 775 |
757 settings.beginGroup("MainWindow"); | 776 settings.beginGroup("MainWindow"); |
758 settings.setValue("sessiontemplate", m_currentTemplate); | 777 settings.setValue("sessiontemplate", m_currentTemplate); |
759 settings.endGroup(); | 778 settings.endGroup(); |