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) (show whitespace changes)
-rw-r--r-- | noncore/settings/sound/soundsettings.cpp | 56 |
1 files changed, 43 insertions, 13 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 @@ -22,4 +22,6 @@ #include <qpe/config.h> #include <qpe/qcopenvelope_qws.h> +#include <qpe/storage.h> + #include <qapplication.h> #include <qslider.h> @@ -40,5 +42,5 @@ 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) sampleRate->setCurrentItem(0); @@ -53,8 +55,11 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) 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( LocationComboBox,SIGNAL(activated(const QString &)),this,SLOT( setLocation(const QString &))); +// connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); } @@ -63,19 +68,20 @@ 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)); +// 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(); @@ -135,2 +141,26 @@ void SoundSettings::micChanged( bool ) 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); + +} |