author | llornkcor <llornkcor> | 2002-04-20 02:56:33 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-04-20 02:56:33 (UTC) |
commit | 897921b4f3462f0a43466df79a06b89662a0f5c3 (patch) (side-by-side diff) | |
tree | e2dcb90d6d5692e7efca536ec83377dc9b21a0c0 /noncore/settings/sound/soundsettings.cpp | |
parent | 9dc836d915eb8160a104c5ea4d59ba8015e9fce0 (diff) | |
download | opie-897921b4f3462f0a43466df79a06b89662a0f5c3.zip opie-897921b4f3462f0a43466df79a06b89662a0f5c3.tar.gz opie-897921b4f3462f0a43466df79a06b89662a0f5c3.tar.bz2 |
added location combo, default samplerate is now 22050
Diffstat (limited to 'noncore/settings/sound/soundsettings.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/sound/soundsettings.cpp | 76 |
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 @@ #include <qpe/qcopenvelope_qws.h> +#include <qpe/storage.h> + #include <qapplication.h> @@ -41,3 +43,3 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) config.setGroup("Record"); - int rate=config.readNumEntry("SampleRate", 11025); + int rate=config.readNumEntry("SampleRate", 22050); if(rate == 11025) @@ -51,5 +53,6 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) - stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); - sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 1)); + stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); + sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 1)); + updateStorageCombo(); connect(volume, SIGNAL(valueChanged(int)), this, SLOT(setVolume(int))); @@ -57,3 +60,5 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) connect(qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); - connect(qApp, SIGNAL( micChanged(bool) ), this, SLOT ( micChanged(bool) ) ); + connect(qApp, SIGNAL( micChanged(bool) ), this, SLOT ( micChanged(bool) ) ); + connect( LocationComboBox,SIGNAL(activated(const QString &)),this,SLOT( setLocation(const QString &))); +// connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); } @@ -64,17 +69,18 @@ void SoundSettings::reject() config.setGroup( "System" ); - setVolume(100-config.readNumEntry("Volume")); - setMic(100-config.readNumEntry("Mic")); - config.setGroup("Record"); - int rate=config.readNumEntry("SampleRate", 11025); - if(rate == 11025) - sampleRate->setCurrentItem(0); - else if(rate == 22050) - sampleRate->setCurrentItem(1); - else if(rate == 32000) - sampleRate->setCurrentItem(2); - else if(rate==44100) - sampleRate->setCurrentItem(3); - stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); - sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 0)); + setVolume(100-config.readNumEntry("Volume")); + setMic(100-config.readNumEntry("Mic")); + +// config.setGroup("Record"); +// int rate=config.readNumEntry("SampleRate", 11025); +// if(rate == 11025) +// sampleRate->setCurrentItem(0); +// else if(rate == 22050) +// sampleRate->setCurrentItem(1); +// else if(rate == 32000) +// sampleRate->setCurrentItem(2); +// else if(rate==44100) +// sampleRate->setCurrentItem(3); +// stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); +// sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 0)); @@ -93,8 +99,8 @@ void SoundSettings::accept() setVolume(volume->value()); - setMic(mic->value()); + setMic(mic->value()); - config.setGroup("Record"); - config.writeEntry("SampleRate",sampleRate->currentText()); - config.writeEntry("Stereo",stereoCheckBox->isChecked()); - config.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); + config.setGroup("Record"); + config.writeEntry("SampleRate",sampleRate->currentText()); + config.writeEntry("Stereo",stereoCheckBox->isChecked()); + config.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); @@ -136 +142,25 @@ void SoundSettings::micChanged( bool ) } + +void SoundSettings::updateStorageCombo() { + + StorageInfo storageInfo; + QString sName, sPath; + QStringList list; + const QList<FileSystem> &fs = storageInfo.fileSystems(); + QListIterator<FileSystem> it ( fs ); + for( ; it.current(); ++it ){ + const QString name = (*it)->name(); + const QString path = (*it)->path(); + qDebug("storage name "+name +" storage path is "+path); + list << name + ": " +path; +// if(dit.current()->file().find(path) != -1 ) storage=name; + } + LocationComboBox->insertStringList(list); +} + +void SoundSettings::setLocation(const QString & string) { + Config config( "Sound" ); + config.setGroup( "System" ); + config.writeEntry("RecLocation",string); + +} |