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 @@ -20,8 +20,10 @@ #include "soundsettings.h" #include <qpe/config.h> #include <qpe/qcopenvelope_qws.h> +#include <qpe/storage.h> + #include <qapplication.h> #include <qslider.h> #include <qcheckbox.h> #include <qlineedit.h> @@ -38,9 +40,9 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) touchsound->setChecked(config.readBoolEntry("Touch")); keysound->setChecked(config.readBoolEntry("Key")); config.setGroup("Record"); - int rate=config.readNumEntry("SampleRate", 11025); + int rate=config.readNumEntry("SampleRate", 22050); if(rate == 11025) sampleRate->setCurrentItem(0); else if(rate == 22050) sampleRate->setCurrentItem(1); @@ -48,36 +50,40 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) sampleRate->setCurrentItem(2); else if(rate==44100) sampleRate->setCurrentItem(2); - 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))); connect(mic, SIGNAL(valueChanged(int)), this, SLOT(setMic(int))); 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()) ); } void SoundSettings::reject() { Config config( "Sound" ); 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)); QDialog::reject(); } @@ -90,14 +96,14 @@ void SoundSettings::accept() config.writeEntry("Touch",touchsound->isChecked()); config.writeEntry("Key",keysound->isChecked()); 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()); QDialog::accept(); } @@ -133,4 +139,28 @@ void SoundSettings::micChanged( bool ) Config config( "Sound" ); config.setGroup( "System" ); mic->setValue(100-config.readNumEntry("Mic")); } + +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); + +} |