Mercurial > hg > sonic-visualiser
comparison main/PreferencesDialog.cpp @ 1035:28ccb621d1af bqaudioio
Initial work toward switching to bqaudioio library (so as to get I/O, not just O)
author | Chris Cannam |
---|---|
date | Tue, 04 Aug 2015 13:27:42 +0100 |
parents | 6de549288477 |
children | 1f4e40be5aa2 |
comparison
equal
deleted
inserted
replaced
1031:2d524c9eee33 | 1035:28ccb621d1af |
---|---|
37 #include <set> | 37 #include <set> |
38 | 38 |
39 #include "widgets/WindowTypeSelector.h" | 39 #include "widgets/WindowTypeSelector.h" |
40 #include "widgets/IconLoader.h" | 40 #include "widgets/IconLoader.h" |
41 #include "base/Preferences.h" | 41 #include "base/Preferences.h" |
42 #include "audioio/AudioTargetFactory.h" | |
43 #include "base/ResourceFinder.h" | 42 #include "base/ResourceFinder.h" |
43 | |
44 //#include "audioio/AudioTargetFactory.h" | |
44 | 45 |
45 #include "version.h" | 46 #include "version.h" |
46 | 47 |
47 PreferencesDialog::PreferencesDialog(QWidget *parent) : | 48 PreferencesDialog::PreferencesDialog(QWidget *parent) : |
48 QDialog(parent), | 49 QDialog(parent), |
147 octaveSystem->setCurrentIndex(oct); | 148 octaveSystem->setCurrentIndex(oct); |
148 | 149 |
149 connect(octaveSystem, SIGNAL(currentIndexChanged(int)), | 150 connect(octaveSystem, SIGNAL(currentIndexChanged(int)), |
150 this, SLOT(octaveSystemChanged(int))); | 151 this, SLOT(octaveSystemChanged(int))); |
151 | 152 |
153 QSettings settings; | |
154 | |
155 /*!!! restore | |
152 QComboBox *audioDevice = new QComboBox; | 156 QComboBox *audioDevice = new QComboBox; |
153 std::vector<QString> devices = | 157 std::vector<QString> devices = |
154 AudioTargetFactory::getInstance()->getCallbackTargetNames(); | 158 AudioTargetFactory::getInstance()->getCallbackTargetNames(); |
155 | 159 |
156 QSettings settings; | |
157 settings.beginGroup("Preferences"); | 160 settings.beginGroup("Preferences"); |
158 QString targetName = settings.value("audio-target", "").toString(); | 161 QString targetName = settings.value("audio-target", "").toString(); |
159 settings.endGroup(); | 162 settings.endGroup(); |
160 | 163 |
161 for (int i = 0; i < (int)devices.size(); ++i) { | 164 for (int i = 0; i < (int)devices.size(); ++i) { |
164 if (targetName == devices[i]) audioDevice->setCurrentIndex(i); | 167 if (targetName == devices[i]) audioDevice->setCurrentIndex(i); |
165 } | 168 } |
166 | 169 |
167 connect(audioDevice, SIGNAL(currentIndexChanged(int)), | 170 connect(audioDevice, SIGNAL(currentIndexChanged(int)), |
168 this, SLOT(audioDeviceChanged(int))); | 171 this, SLOT(audioDeviceChanged(int))); |
169 | 172 */ |
170 QComboBox *resampleQuality = new QComboBox; | 173 QComboBox *resampleQuality = new QComboBox; |
171 | 174 |
172 int rsq = prefs->getPropertyRangeAndValue("Resample Quality", &min, &max, | 175 int rsq = prefs->getPropertyRangeAndValue("Resample Quality", &min, &max, |
173 &deflt); | 176 &deflt); |
174 m_resampleQuality = rsq; | 177 m_resampleQuality = rsq; |
326 subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel | 329 subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel |
327 ("Resample On Load"))), | 330 ("Resample On Load"))), |
328 row, 0); | 331 row, 0); |
329 subgrid->addWidget(resampleOnLoad, row++, 1, 1, 1); | 332 subgrid->addWidget(resampleOnLoad, row++, 1, 1, 1); |
330 | 333 |
331 subgrid->addWidget(new QLabel(tr("Playback audio device:")), row, 0); | 334 //!!! subgrid->addWidget(new QLabel(tr("Playback audio device:")), row, 0); |
332 subgrid->addWidget(audioDevice, row++, 1, 1, 2); | 335 //!!! subgrid->addWidget(audioDevice, row++, 1, 1, 2); |
333 | 336 |
334 subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel | 337 subgrid->addWidget(new QLabel(tr("%1:").arg(prefs->getPropertyLabel |
335 ("Resample Quality"))), | 338 ("Resample Quality"))), |
336 row, 0); | 339 row, 0); |
337 subgrid->addWidget(resampleQuality, row++, 1, 1, 2); | 340 subgrid->addWidget(resampleQuality, row++, 1, 1, 2); |
669 prefs->setShowHMS(m_showHMS); | 672 prefs->setShowHMS(m_showHMS); |
670 prefs->setViewFontSize(m_viewFontSize); | 673 prefs->setViewFontSize(m_viewFontSize); |
671 | 674 |
672 prefs->setProperty("Octave Numbering System", m_octaveSystem); | 675 prefs->setProperty("Octave Numbering System", m_octaveSystem); |
673 | 676 |
674 std::vector<QString> devices = | 677 //!!! std::vector<QString> devices = |
675 AudioTargetFactory::getInstance()->getCallbackTargetNames(); | 678 //!!! AudioTargetFactory::getInstance()->getCallbackTargetNames(); |
676 | 679 |
677 QSettings settings; | 680 QSettings settings; |
678 settings.beginGroup("Preferences"); | 681 settings.beginGroup("Preferences"); |
679 QString permishTag = QString("network-permission-%1").arg(SV_VERSION); | 682 QString permishTag = QString("network-permission-%1").arg(SV_VERSION); |
680 settings.setValue(permishTag, m_networkPermission); | 683 settings.setValue(permishTag, m_networkPermission); |
681 settings.setValue("audio-target", devices[m_audioDevice]); | 684 //!!! settings.setValue("audio-target", devices[m_audioDevice]); |
682 settings.setValue("locale", m_currentLocale); | 685 settings.setValue("locale", m_currentLocale); |
683 settings.endGroup(); | 686 settings.endGroup(); |
684 | 687 |
685 settings.beginGroup("MainWindow"); | 688 settings.beginGroup("MainWindow"); |
686 settings.setValue("sessiontemplate", m_currentTemplate); | 689 settings.setValue("sessiontemplate", m_currentTemplate); |