Mercurial > hg > sonic-visualiser
comparison main/PreferencesDialog.cpp @ 702:c7945dad2f49
Make octave numbering configurable, and change default to C4 = middle C
author | Chris Cannam |
---|---|
date | Thu, 27 Mar 2014 13:32:56 +0000 |
parents | 7f7fba33b7de |
children | fbd2534d17f8 |
comparison
equal
deleted
inserted
replaced
700:4ee8f295997b | 702:c7945dad2f49 |
---|---|
120 propertyLayout->setCurrentIndex(pl); | 120 propertyLayout->setCurrentIndex(pl); |
121 | 121 |
122 connect(propertyLayout, SIGNAL(currentIndexChanged(int)), | 122 connect(propertyLayout, SIGNAL(currentIndexChanged(int)), |
123 this, SLOT(propertyLayoutChanged(int))); | 123 this, SLOT(propertyLayoutChanged(int))); |
124 | 124 |
125 | |
126 | |
125 m_tuningFrequency = prefs->getTuningFrequency(); | 127 m_tuningFrequency = prefs->getTuningFrequency(); |
126 | 128 |
127 QDoubleSpinBox *frequency = new QDoubleSpinBox; | 129 QDoubleSpinBox *frequency = new QDoubleSpinBox; |
128 frequency->setMinimum(100.0); | 130 frequency->setMinimum(100.0); |
129 frequency->setMaximum(5000.0); | 131 frequency->setMaximum(5000.0); |
132 frequency->setValue(m_tuningFrequency); | 134 frequency->setValue(m_tuningFrequency); |
133 frequency->setDecimals(2); | 135 frequency->setDecimals(2); |
134 | 136 |
135 connect(frequency, SIGNAL(valueChanged(double)), | 137 connect(frequency, SIGNAL(valueChanged(double)), |
136 this, SLOT(tuningFrequencyChanged(double))); | 138 this, SLOT(tuningFrequencyChanged(double))); |
139 | |
140 QComboBox *octaveSystem = new QComboBox; | |
141 int oct = prefs->getPropertyRangeAndValue | |
142 ("Octave Numbering System", &min, &max, &deflt); | |
143 m_octaveSystem = oct; | |
144 for (i = min; i <= max; ++i) { | |
145 octaveSystem->addItem(prefs->getPropertyValueLabel | |
146 ("Octave Numbering System", i)); | |
147 } | |
148 octaveSystem->setCurrentIndex(oct); | |
149 | |
150 connect(octaveSystem, SIGNAL(currentIndexChanged(int)), | |
151 this, SLOT(octaveSystemChanged(int))); | |
137 | 152 |
138 QComboBox *audioDevice = new QComboBox; | 153 QComboBox *audioDevice = new QComboBox; |
139 std::vector<QString> devices = | 154 std::vector<QString> devices = |
140 AudioTargetFactory::getInstance()->getCallbackTargetNames(); | 155 AudioTargetFactory::getInstance()->getCallbackTargetNames(); |
141 | 156 |
368 subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel | 383 subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel |
369 ("Tuning Frequency"))), | 384 ("Tuning Frequency"))), |
370 row, 0); | 385 row, 0); |
371 subgrid->addWidget(frequency, row++, 1, 1, 2); | 386 subgrid->addWidget(frequency, row++, 1, 1, 2); |
372 | 387 |
388 subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel | |
389 ("Octave Numbering System"))), | |
390 row, 0); | |
391 subgrid->addWidget(octaveSystem, row++, 1, 1, 2); | |
392 | |
373 subgrid->addWidget(new QLabel(prefs->getPropertyLabel | 393 subgrid->addWidget(new QLabel(prefs->getPropertyLabel |
374 ("Spectrogram Y Smoothing")), | 394 ("Spectrogram Y Smoothing")), |
375 row, 0); | 395 row, 0); |
376 subgrid->addWidget(smoothing, row++, 1, 1, 2); | 396 subgrid->addWidget(smoothing, row++, 1, 1, 2); |
377 | 397 |
583 | 603 |
584 void | 604 void |
585 PreferencesDialog::timeToTextModeChanged(int mode) | 605 PreferencesDialog::timeToTextModeChanged(int mode) |
586 { | 606 { |
587 m_timeToTextMode = mode; | 607 m_timeToTextMode = mode; |
608 m_applyButton->setEnabled(true); | |
609 } | |
610 | |
611 void | |
612 PreferencesDialog::octaveSystemChanged(int system) | |
613 { | |
614 m_octaveSystem = system; | |
588 m_applyButton->setEnabled(true); | 615 m_applyButton->setEnabled(true); |
589 } | 616 } |
590 | 617 |
591 void | 618 void |
592 PreferencesDialog::viewFontSizeChanged(int sz) | 619 PreferencesDialog::viewFontSizeChanged(int sz) |
620 prefs->setTemporaryDirectoryRoot(m_tempDirRoot); | 647 prefs->setTemporaryDirectoryRoot(m_tempDirRoot); |
621 prefs->setBackgroundMode(Preferences::BackgroundMode(m_backgroundMode)); | 648 prefs->setBackgroundMode(Preferences::BackgroundMode(m_backgroundMode)); |
622 prefs->setTimeToTextMode(Preferences::TimeToTextMode(m_timeToTextMode)); | 649 prefs->setTimeToTextMode(Preferences::TimeToTextMode(m_timeToTextMode)); |
623 prefs->setViewFontSize(m_viewFontSize); | 650 prefs->setViewFontSize(m_viewFontSize); |
624 | 651 |
652 prefs->setProperty("Octave Numbering System", m_octaveSystem); | |
653 | |
625 std::vector<QString> devices = | 654 std::vector<QString> devices = |
626 AudioTargetFactory::getInstance()->getCallbackTargetNames(); | 655 AudioTargetFactory::getInstance()->getCallbackTargetNames(); |
627 | 656 |
628 QSettings settings; | 657 QSettings settings; |
629 settings.beginGroup("Preferences"); | 658 settings.beginGroup("Preferences"); |