summaryrefslogtreecommitdiff
path: root/noncore/settings/sound/soundsettings.cpp
Unidiff
Diffstat (limited to 'noncore/settings/sound/soundsettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sound/soundsettings.cpp84
1 files changed, 46 insertions, 38 deletions
diff --git a/noncore/settings/sound/soundsettings.cpp b/noncore/settings/sound/soundsettings.cpp
index c1918de..cdee87c 100644
--- a/noncore/settings/sound/soundsettings.cpp
+++ b/noncore/settings/sound/soundsettings.cpp
@@ -14,12 +14,13 @@
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20
20#include "soundsettings.h" 21#include "soundsettings.h"
21 22
22#include <qpe/config.h> 23#include <qpe/config.h>
23#include <qpe/qcopenvelope_qws.h> 24#include <qpe/qcopenvelope_qws.h>
24#include <qpe/storage.h> 25#include <qpe/storage.h>
25 26
@@ -30,49 +31,52 @@
30#include <qcombobox.h> 31#include <qcombobox.h>
31 32
32 33
33SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) 34SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl )
34 : SoundSettingsBase( parent, name, TRUE, fl ) 35 : SoundSettingsBase( parent, name, TRUE, fl )
35{ 36{
36 Config config( "Sound" ); 37 Config config( "qpe");
37 config.setGroup( "System" ); 38 config.setGroup( "Volume" );
38 volume->setValue(100-config.readNumEntry("Volume")); 39 volume->setValue(100-config.readNumEntry("VolumePercent"));
39 mic->setValue(100-config.readNumEntry("Mic")); 40 mic->setValue(100-config.readNumEntry("Mic"));
40 touchsound->setChecked(config.readBoolEntry("Touch")); 41// touchsound->setChecked(config.readBoolEntry("TouchSound"));
41 keysound->setChecked(config.readBoolEntry("Key")); 42// keysound->setChecked(config.readBoolEntry("KeySound"));
42 AlertCheckBox->setChecked(config.readBoolEntry("Alert")); 43 Config cfg("Vmemo");
44 AlertCheckBox->setChecked(cfg.readBoolEntry("Alert"));
43 45
44 config.setGroup("Record"); 46 cfg.setGroup("Record");
45 int rate=config.readNumEntry("SampleRate", 22050); 47 int rate=config.readNumEntry("SampleRate", 22050);
46 if(rate == 11025) 48 if(rate == 8000)
47 sampleRate->setCurrentItem(0); 49 sampleRate->setCurrentItem(0);
48 else if(rate == 22050) 50 else if(rate == 11025)
49 sampleRate->setCurrentItem(1); 51 sampleRate->setCurrentItem(1);
50 else if(rate == 32000) 52 else if(rate == 22050)
51 sampleRate->setCurrentItem(2); 53 sampleRate->setCurrentItem(2);
54 else if(rate == 33075)
55 sampleRate->setCurrentItem(3);
52 else if(rate==44100) 56 else if(rate==44100)
53 sampleRate->setCurrentItem(2); 57 sampleRate->setCurrentItem(4);
54 58
55 stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); 59 stereoCheckBox->setChecked(cfg.readNumEntry("Stereo", 0));
56 sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 1)); 60 sixteenBitCheckBox->setChecked(cfg.readNumEntry("SixteenBit", 1));
57 61
58 updateStorageCombo(); 62 updateStorageCombo();
59 connect(volume, SIGNAL(valueChanged(int)), this, SLOT(setVolume(int))); 63 connect(volume, SIGNAL(valueChanged(int)), this, SLOT(setVolume(int)));
60 connect(mic, SIGNAL(valueChanged(int)), this, SLOT(setMic(int))); 64 connect(mic, SIGNAL(valueChanged(int)), this, SLOT(setMic(int)));
61 connect(qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); 65 connect(qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) );
62 connect(qApp, SIGNAL( micChanged(bool) ), this, SLOT ( micChanged(bool) ) ); 66 connect(qApp, SIGNAL( micChanged(bool) ), this, SLOT ( micChanged(bool) ) );
63 connect( LocationComboBox,SIGNAL(activated(const QString &)),this,SLOT( setLocation(const QString &))); 67 connect( LocationComboBox,SIGNAL(activated(const QString &)),this,SLOT( setLocation(const QString &)));
64// connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); 68// connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
65} 69}
66 70
67void SoundSettings::reject() 71void SoundSettings::reject()
68{ 72{
69 Config config( "Sound" ); 73 Config config( "qpe");
70 config.setGroup( "System" ); 74 config.setGroup( "Volume");
71 75
72 setVolume(100-config.readNumEntry("Volume")); 76 setVolume(100-config.readNumEntry("VolumePercent"));
73 setMic(100-config.readNumEntry("Mic")); 77 setMic(100-config.readNumEntry("Mic"));
74 78
75// config.setGroup("Record"); 79// config.setGroup("Record");
76// int rate=config.readNumEntry("SampleRate", 11025); 80// int rate=config.readNumEntry("SampleRate", 11025);
77// if(rate == 11025) 81// if(rate == 11025)
78// sampleRate->setCurrentItem(0); 82// sampleRate->setCurrentItem(0);
@@ -87,61 +91,65 @@ void SoundSettings::reject()
87 91
88 QDialog::reject(); 92 QDialog::reject();
89} 93}
90 94
91void SoundSettings::accept() 95void SoundSettings::accept()
92{ 96{
93 Config config( "Sound" ); 97 Config config( "qpe" );
94 config.setGroup( "System" ); 98 config.setGroup( "Volume" );
95 config.writeEntry("Volume",100-volume->value()); 99 config.writeEntry("VolumePercent",100-volume->value());
96 config.writeEntry("Mic",100-mic->value()); 100 config.writeEntry("Mic",100-mic->value());
97 config.writeEntry("Touch",touchsound->isChecked()); 101// config.writeEntry("TouchSound",touchsound->isChecked());
98 config.writeEntry("Key",keysound->isChecked()); 102// config.writeEntry("KeySound",keysound->isChecked());
99 config.writeEntry("Alert",AlertCheckBox->isChecked()); 103
104 Config cfg("Vmemo");
105 cfg.writeEntry("Alert",AlertCheckBox->isChecked());
100 setVolume(volume->value()); 106 setVolume(volume->value());
101 setMic(mic->value()); 107 setMic(mic->value());
102 108
103 config.setGroup("Record"); 109 cfg.setGroup("Record");
104 config.writeEntry("SampleRate",sampleRate->currentText()); 110 cfg.writeEntry("SampleRate",sampleRate->currentText());
105 config.writeEntry("Stereo",stereoCheckBox->isChecked()); 111 cfg.writeEntry("Stereo",stereoCheckBox->isChecked());
106 config.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); 112 cfg.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked());
107 113// Config cfg( "VMemo" );
114// cfg.setGroup( "Defaults" );
115// cfg.writeEntry( "hideIcon", HideIcon_CheckBox->isChecked());
108 QDialog::accept(); 116 QDialog::accept();
109} 117}
110 118
111void SoundSettings::setVolume(int v) 119void SoundSettings::setVolume(int v)
112{ 120{
113 Config config( "Sound" ); 121 Config config( "qpe" );
114 config.setGroup( "System" ); 122 config.setGroup( "Volume" );
115 config.writeEntry("Volume",100-v); 123 config.writeEntry("VolumePercent",100-v);
116#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) 124#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP)
117 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE; 125 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE;
118#endif 126#endif
119} 127}
120 128
121void SoundSettings::setMic(int m) 129void SoundSettings::setMic(int m)
122{ 130{
123 Config config( "Sound" ); 131 Config config( "qpe" );
124 config.setGroup( "System" ); 132 config.setGroup( "Volume" );
125 config.writeEntry("Mic",100-m); 133 config.writeEntry("Mic",100-m);
126#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) 134#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP)
127 QCopEnvelope( "QPE/System", "micChange(bool)" ) << FALSE; 135 QCopEnvelope( "QPE/System", "micChange(bool)" ) << FALSE;
128#endif 136#endif
129} 137}
130 138
131void SoundSettings::volumeChanged( bool ) 139void SoundSettings::volumeChanged( bool )
132{ 140{
133 Config config( "Sound" ); 141 Config config( "qpe" );
134 config.setGroup( "System" ); 142 config.setGroup( "Volume" );
135 volume->setValue(100-config.readNumEntry("Volume")); 143 volume->setValue(100-config.readNumEntry("VolumePercent"));
136} 144}
137 145
138void SoundSettings::micChanged( bool ) 146void SoundSettings::micChanged( bool )
139{ 147{
140 Config config( "Sound" ); 148 Config config( "qpe" );
141 config.setGroup( "System" ); 149 config.setGroup( "Volume" );
142 mic->setValue(100-config.readNumEntry("Mic")); 150 mic->setValue(100-config.readNumEntry("Mic"));
143} 151}
144 152
145void SoundSettings::updateStorageCombo() { 153void SoundSettings::updateStorageCombo() {
146 154
147 StorageInfo storageInfo; 155 StorageInfo storageInfo;
@@ -157,11 +165,11 @@ void SoundSettings::updateStorageCombo() {
157// if(dit.current()->file().find(path) != -1 ) storage=name; 165// if(dit.current()->file().find(path) != -1 ) storage=name;
158 } 166 }
159 LocationComboBox->insertStringList(list); 167 LocationComboBox->insertStringList(list);
160} 168}
161 169
162void SoundSettings::setLocation(const QString & string) { 170void SoundSettings::setLocation(const QString & string) {
163 Config config( "Sound" ); 171 Config config( "Vmemo" );
164 config.setGroup( "System" ); 172 config.setGroup( "System" );
165 config.writeEntry("RecLocation",string); 173 config.writeEntry("RecLocation",string);
166 174
167} 175}