From 897921b4f3462f0a43466df79a06b89662a0f5c3 Mon Sep 17 00:00:00 2001 From: llornkcor Date: Sat, 20 Apr 2002 02:56:33 +0000 Subject: added location combo, default samplerate is now 22050 --- (limited to 'noncore') diff --git a/noncore/settings/sound/main.cpp b/noncore/settings/sound/main.cpp index 5d28a8c..33b0523 100644 --- a/noncore/settings/sound/main.cpp +++ b/noncore/settings/sound/main.cpp @@ -26,11 +26,8 @@ int main(int argc, char** argv) { QPEApplication a(argc,argv); - SoundSettings dlg; - a.showMainWidget(&dlg); - return a.exec(); } diff --git a/noncore/settings/sound/opie-sound.control b/noncore/settings/sound/opie-sound.control index b14105c..3d42ca0 100644 --- a/noncore/settings/sound/opie-sound.control +++ b/noncore/settings/sound/opie-sound.control @@ -1,7 +1,7 @@ Files: bin/sound apps/Settings/Sound.desktop Priority: optional Section: opie/settings -Maintainer: Warwick Allison +Maintainer: L.J. Potter Architecture: arm Arch: iPAQ Version: $QPE_VERSION-$SUB_VERSION.2 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 @@ -21,6 +21,8 @@ #include #include +#include + #include #include #include @@ -39,7 +41,7 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) 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) @@ -49,34 +51,38 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) 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(); } @@ -91,12 +97,12 @@ void SoundSettings::accept() 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(); } @@ -134,3 +140,27 @@ void SoundSettings::micChanged( bool ) config.setGroup( "System" ); mic->setValue(100-config.readNumEntry("Mic")); } + +void SoundSettings::updateStorageCombo() { + + StorageInfo storageInfo; + QString sName, sPath; + QStringList list; + const QList &fs = storageInfo.fileSystems(); + QListIterator 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); + +} diff --git a/noncore/settings/sound/soundsettings.h b/noncore/settings/sound/soundsettings.h index 7679c1e..aec7614 100644 --- a/noncore/settings/sound/soundsettings.h +++ b/noncore/settings/sound/soundsettings.h @@ -27,15 +27,18 @@ class SoundSettings : public SoundSettingsBase { Q_OBJECT - + public: SoundSettings( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); protected: void accept(); void reject(); + void updateStorageCombo(); private slots: + void setLocation(const QString &); + void setVolume(int); void setMic(int); diff --git a/noncore/settings/sound/soundsettingsbase.ui b/noncore/settings/sound/soundsettingsbase.ui index 97bea2d..aec55be 100644 --- a/noncore/settings/sound/soundsettingsbase.ui +++ b/noncore/settings/sound/soundsettingsbase.ui @@ -11,8 +11,8 @@ 0 0 - 286 - 338 + 255 + 301 @@ -34,185 +34,6 @@ spacing 6 - - QLayoutWidget - - name - Layout9 - - - - margin - 0 - - - spacing - 6 - - - QLayoutWidget - - name - Layout8 - - - - margin - 0 - - - spacing - 6 - - - QGroupBox - - name - GroupBox1 - - - title - Vmemo - - - - margin - 11 - - - spacing - 6 - - - QLayoutWidget - - name - Layout15 - - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - sampleRateLabel - - - text - Sample Rate - - - - QComboBox - - - text - 11025 - - - - - text - 22050 - - - - - text - 32000 - - - - - text - 44100 - - - - name - sampleRate - - - - QCheckBox - - name - stereoCheckBox - - - text - Stereo - - - - QCheckBox - - name - sixteenBitCheckBox - - - text - 16 bit - - - - - - - - QCheckBox - - name - touchsound - - - text - Screen sounds - - - - QCheckBox - - name - keysound - - - text - Keyboard sounds - - - - - - - name - Spacer10 - - - orientation - Vertical - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QGroupBox @@ -220,6 +41,14 @@ GroupBox3 + frameShape + Box + + + frameShadow + Sunken + + title Levels @@ -615,6 +444,196 @@ + + QLayoutWidget + + name + Layout12 + + + + margin + 0 + + + spacing + 6 + + + QGroupBox + + name + GroupBox1 + + + title + Vmemo + + + QLayoutWidget + + name + Layout11 + + + geometry + + 5 + 16 + 96 + 169 + + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + sampleRateLabel + + + text + Sample Rate + + + + QComboBox + + + text + 11025 + + + + + text + 22050 + + + + + text + 32000 + + + + + text + 44100 + + + + name + sampleRate + + + + QCheckBox + + name + stereoCheckBox + + + text + Stereo + + + + QCheckBox + + name + sixteenBitCheckBox + + + text + 16 bit + + + + QCheckBox + + name + AlertCheckBox + + + text + Visual Alerts + + + + QLabel + + name + TextLabel1 + + + text + Location + + + + QComboBox + + name + LocationComboBox + + + + + + + QCheckBox + + name + touchsound + + + text + Screen sounds + + + + QCheckBox + + name + keysound + + + text + Keyboard sounds + + + + + name + Spacer10 + + + orientation + Vertical + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + -- cgit v0.9.0.2