Diffstat (limited to 'noncore/settings/sound/soundsettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/sound/soundsettings.cpp | 51 |
1 files changed, 33 insertions, 18 deletions
diff --git a/noncore/settings/sound/soundsettings.cpp b/noncore/settings/sound/soundsettings.cpp index 17dbdc0..c2bf405 100644 --- a/noncore/settings/sound/soundsettings.cpp +++ b/noncore/settings/sound/soundsettings.cpp | |||
@@ -27,2 +27,4 @@ | |||
27 | #include <qlineedit.h> | 27 | #include <qlineedit.h> |
28 | #include <qcombobox.h> | ||
29 | |||
28 | 30 | ||
@@ -34,3 +36,3 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) | |||
34 | volume->setValue(100-config.readNumEntry("Volume")); | 36 | volume->setValue(100-config.readNumEntry("Volume")); |
35 | mic->setValue(100-config.readNumEntry("Mic")); | 37 | mic->setValue(100-config.readNumEntry("Mic")); |
36 | touchsound->setChecked(config.readBoolEntry("Touch")); | 38 | touchsound->setChecked(config.readBoolEntry("Touch")); |
@@ -38,6 +40,13 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) | |||
38 | 40 | ||
39 | config.setGroup("Record"); | 41 | config.setGroup("Record"); |
40 | sampleRate->setText(config.readEntry("SampleRate", "11025")); | 42 | int rate=config.readNumEntry("SampleRate", 11025); |
41 | stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); | 43 | if(rate == 11025) |
42 | sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 0)); | 44 | sampleRate->setCurrentItem(0); |
45 | else if(rate == 22050) | ||
46 | sampleRate->setCurrentItem(1); | ||
47 | else if(rate==44100) | ||
48 | sampleRate->setCurrentItem(2); | ||
49 | |||
50 | stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); | ||
51 | sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 0)); | ||
43 | 52 | ||
@@ -46,3 +55,3 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) | |||
46 | connect(qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); | 55 | connect(qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); |
47 | connect(qApp, SIGNAL( micChanged(bool) ), this, SLOT ( micChanged(bool) ) ); | 56 | connect(qApp, SIGNAL( micChanged(bool) ), this, SLOT ( micChanged(bool) ) ); |
48 | } | 57 | } |
@@ -54,8 +63,14 @@ void SoundSettings::reject() | |||
54 | setVolume(100-config.readNumEntry("Volume")); | 63 | setVolume(100-config.readNumEntry("Volume")); |
55 | setMic(100-config.readNumEntry("Mic")); | 64 | setMic(100-config.readNumEntry("Mic")); |
56 | 65 | ||
57 | config.setGroup("Record"); | 66 | config.setGroup("Record"); |
58 | sampleRate->setText(config.readEntry("SampleRate", "11025")); | 67 | int rate=config.readNumEntry("SampleRate", 11025); |
59 | stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); | 68 | if(rate == 11025) |
60 | sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 0)); | 69 | sampleRate->setCurrentItem(0); |
70 | else if(rate == 22050) | ||
71 | sampleRate->setCurrentItem(1); | ||
72 | else if(rate==44100) | ||
73 | sampleRate->setCurrentItem(2); | ||
74 | stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); | ||
75 | sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 0)); | ||
61 | 76 | ||
@@ -74,9 +89,9 @@ void SoundSettings::accept() | |||
74 | setVolume(volume->value()); | 89 | setVolume(volume->value()); |
75 | setMic(mic->value()); | 90 | setMic(mic->value()); |
76 | 91 | ||
77 | config.setGroup("Record"); | 92 | config.setGroup("Record"); |
78 | config.writeEntry("SampleRate",sampleRate->text()); | 93 | config.writeEntry("SampleRate",sampleRate->currentText()); |
79 | config.writeEntry("Stereo",stereoCheckBox->isChecked()); | 94 | config.writeEntry("Stereo",stereoCheckBox->isChecked()); |
80 | config.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); | 95 | config.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); |
81 | 96 | ||
82 | QDialog::accept(); | 97 | QDialog::accept(); |
@@ -90,3 +105,3 @@ void SoundSettings::setVolume(int v) | |||
90 | #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) | 105 | #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) |
91 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE; | 106 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE; |
92 | #endif | 107 | #endif |