summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-04-20 02:56:33 (UTC)
committer llornkcor <llornkcor>2002-04-20 02:56:33 (UTC)
commit897921b4f3462f0a43466df79a06b89662a0f5c3 (patch) (side-by-side diff)
treee2dcb90d6d5692e7efca536ec83377dc9b21a0c0
parent9dc836d915eb8160a104c5ea4d59ba8015e9fce0 (diff)
downloadopie-897921b4f3462f0a43466df79a06b89662a0f5c3.zip
opie-897921b4f3462f0a43466df79a06b89662a0f5c3.tar.gz
opie-897921b4f3462f0a43466df79a06b89662a0f5c3.tar.bz2
added location combo, default samplerate is now 22050
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sound/main.cpp3
-rw-r--r--noncore/settings/sound/opie-sound.control2
-rw-r--r--noncore/settings/sound/soundsettings.cpp76
-rw-r--r--noncore/settings/sound/soundsettings.h5
-rw-r--r--noncore/settings/sound/soundsettingsbase.ui381
5 files changed, 258 insertions, 209 deletions
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
@@ -27,9 +27,6 @@ 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
@@ -2,5 +2,5 @@ Files: bin/sound apps/Settings/Sound.desktop
Priority: optional
Section: opie/settings
-Maintainer: Warwick Allison <warwick@trolltech.com>
+Maintainer: L.J. Potter
Architecture: arm
Arch: iPAQ
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);
@@ -50,11 +52,14 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl )
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()) );
}
@@ -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));
+ 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();
@@ -92,10 +98,10 @@ 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());
QDialog::accept();
@@ -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);
+
+}
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
@@ -28,5 +28,5 @@ class SoundSettings : public SoundSettingsBase
{
Q_OBJECT
-
+
public:
SoundSettings( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
@@ -35,6 +35,9 @@ 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
@@ -12,6 +12,6 @@
<x>0</x>
<y>0</y>
- <width>286</width>
- <height>338</height>
+ <width>255</width>
+ <height>301</height>
</rect>
</property>
@@ -35,183 +35,4 @@
<number>6</number>
</property>
- <widget row="0" column="1" >
- <class>QLayoutWidget</class>
- <property stdset="1">
- <name>name</name>
- <cstring>Layout9</cstring>
- </property>
- <vbox>
- <property stdset="1">
- <name>margin</name>
- <number>0</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>6</number>
- </property>
- <widget>
- <class>QLayoutWidget</class>
- <property stdset="1">
- <name>name</name>
- <cstring>Layout8</cstring>
- </property>
- <vbox>
- <property stdset="1">
- <name>margin</name>
- <number>0</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>6</number>
- </property>
- <widget>
- <class>QGroupBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>GroupBox1</cstring>
- </property>
- <property stdset="1">
- <name>title</name>
- <string>Vmemo</string>
- </property>
- <grid>
- <property stdset="1">
- <name>margin</name>
- <number>11</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>6</number>
- </property>
- <widget row="0" column="0" >
- <class>QLayoutWidget</class>
- <property stdset="1">
- <name>name</name>
- <cstring>Layout15</cstring>
- </property>
- <vbox>
- <property stdset="1">
- <name>margin</name>
- <number>0</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>6</number>
- </property>
- <widget>
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>sampleRateLabel</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Sample Rate</string>
- </property>
- </widget>
- <widget>
- <class>QComboBox</class>
- <item>
- <property>
- <name>text</name>
- <string>11025</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>22050</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>32000</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>44100</string>
- </property>
- </item>
- <property stdset="1">
- <name>name</name>
- <cstring>sampleRate</cstring>
- </property>
- </widget>
- <widget>
- <class>QCheckBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>stereoCheckBox</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Stereo</string>
- </property>
- </widget>
- <widget>
- <class>QCheckBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>sixteenBitCheckBox</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>16 bit</string>
- </property>
- </widget>
- </vbox>
- </widget>
- </grid>
- </widget>
- <widget>
- <class>QCheckBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>touchsound</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Screen sounds</string>
- </property>
- </widget>
- <widget>
- <class>QCheckBox</class>
- <property stdset="1">
- <name>name</name>
- <cstring>keysound</cstring>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Keyboard sounds</string>
- </property>
- </widget>
- </vbox>
- </widget>
- <spacer>
- <property>
- <name>name</name>
- <cstring>Spacer10</cstring>
- </property>
- <property stdset="1">
- <name>orientation</name>
- <enum>Vertical</enum>
- </property>
- <property stdset="1">
- <name>sizeType</name>
- <enum>Expanding</enum>
- </property>
- <property>
- <name>sizeHint</name>
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </vbox>
- </widget>
<widget row="0" column="0" >
<class>QGroupBox</class>
@@ -221,4 +42,12 @@
</property>
<property stdset="1">
+ <name>frameShape</name>
+ <enum>Box</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Sunken</enum>
+ </property>
+ <property stdset="1">
<name>title</name>
<string>Levels</string>
@@ -616,4 +445,194 @@
</vbox>
</widget>
+ <widget row="0" column="1" >
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout12</cstring>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QGroupBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property stdset="1">
+ <name>title</name>
+ <string>Vmemo</string>
+ </property>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout11</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>5</x>
+ <y>16</y>
+ <width>96</width>
+ <height>169</height>
+ </rect>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>sampleRateLabel</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Sample Rate</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QComboBox</class>
+ <item>
+ <property>
+ <name>text</name>
+ <string>11025</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>22050</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>32000</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>44100</string>
+ </property>
+ </item>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>sampleRate</cstring>
+ </property>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>stereoCheckBox</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Stereo</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>sixteenBitCheckBox</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>16 bit</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>AlertCheckBox</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Visual Alerts</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Location</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QComboBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>LocationComboBox</cstring>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>touchsound</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Screen sounds</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>keysound</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Keyboard sounds</string>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer10</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Vertical</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
</grid>
</widget>