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.cpp76
1 files changed, 53 insertions, 23 deletions
diff --git a/noncore/settings/sound/soundsettings.cpp b/noncore/settings/sound/soundsettings.cpp
index 467f23e..51522b3 100644
--- a/noncore/settings/sound/soundsettings.cpp
+++ b/noncore/settings/sound/soundsettings.cpp
@@ -23,2 +23,4 @@
23#include <qpe/qcopenvelope_qws.h> 23#include <qpe/qcopenvelope_qws.h>
24#include <qpe/storage.h>
25
24#include <qapplication.h> 26#include <qapplication.h>
@@ -41,3 +43,3 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl )
41 config.setGroup("Record"); 43 config.setGroup("Record");
42 int rate=config.readNumEntry("SampleRate", 11025); 44 int rate=config.readNumEntry("SampleRate", 22050);
43 if(rate == 11025) 45 if(rate == 11025)
@@ -51,5 +53,6 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl )
51 53
52 stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); 54 stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0));
53 sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 1)); 55 sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 1));
54 56
57 updateStorageCombo();
55 connect(volume, SIGNAL(valueChanged(int)), this, SLOT(setVolume(int))); 58 connect(volume, SIGNAL(valueChanged(int)), this, SLOT(setVolume(int)));
@@ -57,3 +60,5 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl )
57 connect(qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); 60 connect(qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) );
58 connect(qApp, SIGNAL( micChanged(bool) ), this, SLOT ( micChanged(bool) ) ); 61 connect(qApp, SIGNAL( micChanged(bool) ), this, SLOT ( micChanged(bool) ) );
62 connect( LocationComboBox,SIGNAL(activated(const QString &)),this,SLOT( setLocation(const QString &)));
63// connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
59} 64}
@@ -64,17 +69,18 @@ void SoundSettings::reject()
64 config.setGroup( "System" ); 69 config.setGroup( "System" );
65 setVolume(100-config.readNumEntry("Volume"));
66 setMic(100-config.readNumEntry("Mic"));
67 70
68 config.setGroup("Record"); 71 setVolume(100-config.readNumEntry("Volume"));
69 int rate=config.readNumEntry("SampleRate", 11025); 72 setMic(100-config.readNumEntry("Mic"));
70 if(rate == 11025) 73
71 sampleRate->setCurrentItem(0); 74// config.setGroup("Record");
72 else if(rate == 22050) 75// int rate=config.readNumEntry("SampleRate", 11025);
73 sampleRate->setCurrentItem(1); 76// if(rate == 11025)
74 else if(rate == 32000) 77// sampleRate->setCurrentItem(0);
75 sampleRate->setCurrentItem(2); 78// else if(rate == 22050)
76 else if(rate==44100) 79// sampleRate->setCurrentItem(1);
77 sampleRate->setCurrentItem(3); 80// else if(rate == 32000)
78 stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); 81// sampleRate->setCurrentItem(2);
79 sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 0)); 82// else if(rate==44100)
83// sampleRate->setCurrentItem(3);
84// stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0));
85// sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 0));
80 86
@@ -93,8 +99,8 @@ void SoundSettings::accept()
93 setVolume(volume->value()); 99 setVolume(volume->value());
94 setMic(mic->value()); 100 setMic(mic->value());
95 101
96 config.setGroup("Record"); 102 config.setGroup("Record");
97 config.writeEntry("SampleRate",sampleRate->currentText()); 103 config.writeEntry("SampleRate",sampleRate->currentText());
98 config.writeEntry("Stereo",stereoCheckBox->isChecked()); 104 config.writeEntry("Stereo",stereoCheckBox->isChecked());
99 config.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); 105 config.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked());
100 106
@@ -136 +142,25 @@ void SoundSettings::micChanged( bool )
136} 142}
143
144void SoundSettings::updateStorageCombo() {
145
146 StorageInfo storageInfo;
147 QString sName, sPath;
148 QStringList list;
149 const QList<FileSystem> &fs = storageInfo.fileSystems();
150 QListIterator<FileSystem> it ( fs );
151 for( ; it.current(); ++it ){
152 const QString name = (*it)->name();
153 const QString path = (*it)->path();
154 qDebug("storage name "+name +" storage path is "+path);
155 list << name + ": " +path;
156// if(dit.current()->file().find(path) != -1 ) storage=name;
157 }
158 LocationComboBox->insertStringList(list);
159}
160
161void SoundSettings::setLocation(const QString & string) {
162 Config config( "Sound" );
163 config.setGroup( "System" );
164 config.writeEntry("RecLocation",string);
165
166}