summaryrefslogtreecommitdiff
Unidiff
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
@@ -26,11 +26,8 @@
26int main(int argc, char** argv) 26int main(int argc, char** argv)
27{ 27{
28 QPEApplication a(argc,argv); 28 QPEApplication a(argc,argv);
29
30 SoundSettings dlg; 29 SoundSettings dlg;
31
32 a.showMainWidget(&dlg); 30 a.showMainWidget(&dlg);
33
34 return a.exec(); 31 return a.exec();
35} 32}
36 33
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 @@
1Files: bin/sound apps/Settings/Sound.desktop 1Files: bin/sound apps/Settings/Sound.desktop
2Priority: optional 2Priority: optional
3Section: opie/settings 3Section: opie/settings
4Maintainer: Warwick Allison <warwick@trolltech.com> 4Maintainer: L.J. Potter
5Architecture: arm 5Architecture: arm
6Arch: iPAQ 6Arch: iPAQ
7Version: $QPE_VERSION-$SUB_VERSION.2 7Version: $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 @@
21 21
22#include <qpe/config.h> 22#include <qpe/config.h>
23#include <qpe/qcopenvelope_qws.h> 23#include <qpe/qcopenvelope_qws.h>
24#include <qpe/storage.h>
25
24#include <qapplication.h> 26#include <qapplication.h>
25#include <qslider.h> 27#include <qslider.h>
26#include <qcheckbox.h> 28#include <qcheckbox.h>
@@ -39,7 +41,7 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl )
39 keysound->setChecked(config.readBoolEntry("Key")); 41 keysound->setChecked(config.readBoolEntry("Key"));
40 42
41 config.setGroup("Record"); 43 config.setGroup("Record");
42 int rate=config.readNumEntry("SampleRate", 11025); 44 int rate=config.readNumEntry("SampleRate", 22050);
43 if(rate == 11025) 45 if(rate == 11025)
44 sampleRate->setCurrentItem(0); 46 sampleRate->setCurrentItem(0);
45 else if(rate == 22050) 47 else if(rate == 22050)
@@ -49,34 +51,38 @@ SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl )
49 else if(rate==44100) 51 else if(rate==44100)
50 sampleRate->setCurrentItem(2); 52 sampleRate->setCurrentItem(2);
51 53
52 stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); 54 stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0));
53 sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 1)); 55 sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 1));
54 56
57 updateStorageCombo();
55 connect(volume, SIGNAL(valueChanged(int)), this, SLOT(setVolume(int))); 58 connect(volume, SIGNAL(valueChanged(int)), this, SLOT(setVolume(int)));
56 connect(mic, SIGNAL(valueChanged(int)), this, SLOT(setMic(int))); 59 connect(mic, SIGNAL(valueChanged(int)), this, SLOT(setMic(int)));
57 connect(qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); 60 connect(qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) );
58 connect(qApp, SIGNAL( micChanged(bool) ), this, SLOT ( micChanged(bool) ) ); 61 connect(qApp, SIGNAL( micChanged(bool) ), this, SLOT ( micChanged(bool) ) );
62 connect( LocationComboBox,SIGNAL(activated(const QString &)),this,SLOT( setLocation(const QString &)));
63// connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
59} 64}
60 65
61void SoundSettings::reject() 66void SoundSettings::reject()
62{ 67{
63 Config config( "Sound" ); 68 Config config( "Sound" );
64 config.setGroup( "System" ); 69 config.setGroup( "System" );
65 setVolume(100-config.readNumEntry("Volume"));
66 setMic(100-config.readNumEntry("Mic"));
67 70
68 config.setGroup("Record"); 71 setVolume(100-config.readNumEntry("Volume"));
69 int rate=config.readNumEntry("SampleRate", 11025); 72 setMic(100-config.readNumEntry("Mic"));
70 if(rate == 11025) 73
71 sampleRate->setCurrentItem(0); 74// config.setGroup("Record");
72 else if(rate == 22050) 75// int rate=config.readNumEntry("SampleRate", 11025);
73 sampleRate->setCurrentItem(1); 76// if(rate == 11025)
74 else if(rate == 32000) 77// sampleRate->setCurrentItem(0);
75 sampleRate->setCurrentItem(2); 78// else if(rate == 22050)
76 else if(rate==44100) 79// sampleRate->setCurrentItem(1);
77 sampleRate->setCurrentItem(3); 80// else if(rate == 32000)
78 stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); 81// sampleRate->setCurrentItem(2);
79 sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 0)); 82// else if(rate==44100)
83// sampleRate->setCurrentItem(3);
84// stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0));
85// sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 0));
80 86
81 QDialog::reject(); 87 QDialog::reject();
82} 88}
@@ -91,12 +97,12 @@ void SoundSettings::accept()
91 config.writeEntry("Key",keysound->isChecked()); 97 config.writeEntry("Key",keysound->isChecked());
92 98
93 setVolume(volume->value()); 99 setVolume(volume->value());
94 setMic(mic->value()); 100 setMic(mic->value());
95 101
96 config.setGroup("Record"); 102 config.setGroup("Record");
97 config.writeEntry("SampleRate",sampleRate->currentText()); 103 config.writeEntry("SampleRate",sampleRate->currentText());
98 config.writeEntry("Stereo",stereoCheckBox->isChecked()); 104 config.writeEntry("Stereo",stereoCheckBox->isChecked());
99 config.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); 105 config.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked());
100 106
101 QDialog::accept(); 107 QDialog::accept();
102} 108}
@@ -134,3 +140,27 @@ void SoundSettings::micChanged( bool )
134 config.setGroup( "System" ); 140 config.setGroup( "System" );
135 mic->setValue(100-config.readNumEntry("Mic")); 141 mic->setValue(100-config.readNumEntry("Mic"));
136} 142}
143
144void SoundSettings::updateStorageCombo() {
145
146 StorageInfo storageInfo;
147 QString sName, sPath;
148 QStringList list;
149 const QList<FileSystem> &fs = storageInfo.fileSystems();
150 QListIterator<FileSystem> it ( fs );
151 for( ; it.current(); ++it ){
152 const QString name = (*it)->name();
153 const QString path = (*it)->path();
154 qDebug("storage name "+name +" storage path is "+path);
155 list << name + ": " +path;
156// if(dit.current()->file().find(path) != -1 ) storage=name;
157 }
158 LocationComboBox->insertStringList(list);
159}
160
161void SoundSettings::setLocation(const QString & string) {
162 Config config( "Sound" );
163 config.setGroup( "System" );
164 config.writeEntry("RecLocation",string);
165
166}
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 @@
27class SoundSettings : public SoundSettingsBase 27class SoundSettings : public SoundSettingsBase
28{ 28{
29Q_OBJECT 29Q_OBJECT
30 30
31public: 31public:
32 SoundSettings( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 32 SoundSettings( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
33 33
34protected: 34protected:
35 void accept(); 35 void accept();
36 void reject(); 36 void reject();
37 void updateStorageCombo();
37 38
38private slots: 39private slots:
40 void setLocation(const QString &);
41
39 void setVolume(int); 42 void setVolume(int);
40 void setMic(int); 43 void setMic(int);
41 44
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 @@
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>286</width> 14 <width>255</width>
15 <height>338</height> 15 <height>301</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
18 <property stdset="1"> 18 <property stdset="1">
@@ -34,185 +34,6 @@
34 <name>spacing</name> 34 <name>spacing</name>
35 <number>6</number> 35 <number>6</number>
36 </property> 36 </property>
37 <widget row="0" column="1" >
38 <class>QLayoutWidget</class>
39 <property stdset="1">
40 <name>name</name>
41 <cstring>Layout9</cstring>
42 </property>
43 <vbox>
44 <property stdset="1">
45 <name>margin</name>
46 <number>0</number>
47 </property>
48 <property stdset="1">
49 <name>spacing</name>
50 <number>6</number>
51 </property>
52 <widget>
53 <class>QLayoutWidget</class>
54 <property stdset="1">
55 <name>name</name>
56 <cstring>Layout8</cstring>
57 </property>
58 <vbox>
59 <property stdset="1">
60 <name>margin</name>
61 <number>0</number>
62 </property>
63 <property stdset="1">
64 <name>spacing</name>
65 <number>6</number>
66 </property>
67 <widget>
68 <class>QGroupBox</class>
69 <property stdset="1">
70 <name>name</name>
71 <cstring>GroupBox1</cstring>
72 </property>
73 <property stdset="1">
74 <name>title</name>
75 <string>Vmemo</string>
76 </property>
77 <grid>
78 <property stdset="1">
79 <name>margin</name>
80 <number>11</number>
81 </property>
82 <property stdset="1">
83 <name>spacing</name>
84 <number>6</number>
85 </property>
86 <widget row="0" column="0" >
87 <class>QLayoutWidget</class>
88 <property stdset="1">
89 <name>name</name>
90 <cstring>Layout15</cstring>
91 </property>
92 <vbox>
93 <property stdset="1">
94 <name>margin</name>
95 <number>0</number>
96 </property>
97 <property stdset="1">
98 <name>spacing</name>
99 <number>6</number>
100 </property>
101 <widget>
102 <class>QLabel</class>
103 <property stdset="1">
104 <name>name</name>
105 <cstring>sampleRateLabel</cstring>
106 </property>
107 <property stdset="1">
108 <name>text</name>
109 <string>Sample Rate</string>
110 </property>
111 </widget>
112 <widget>
113 <class>QComboBox</class>
114 <item>
115 <property>
116 <name>text</name>
117 <string>11025</string>
118 </property>
119 </item>
120 <item>
121 <property>
122 <name>text</name>
123 <string>22050</string>
124 </property>
125 </item>
126 <item>
127 <property>
128 <name>text</name>
129 <string>32000</string>
130 </property>
131 </item>
132 <item>
133 <property>
134 <name>text</name>
135 <string>44100</string>
136 </property>
137 </item>
138 <property stdset="1">
139 <name>name</name>
140 <cstring>sampleRate</cstring>
141 </property>
142 </widget>
143 <widget>
144 <class>QCheckBox</class>
145 <property stdset="1">
146 <name>name</name>
147 <cstring>stereoCheckBox</cstring>
148 </property>
149 <property stdset="1">
150 <name>text</name>
151 <string>Stereo</string>
152 </property>
153 </widget>
154 <widget>
155 <class>QCheckBox</class>
156 <property stdset="1">
157 <name>name</name>
158 <cstring>sixteenBitCheckBox</cstring>
159 </property>
160 <property stdset="1">
161 <name>text</name>
162 <string>16 bit</string>
163 </property>
164 </widget>
165 </vbox>
166 </widget>
167 </grid>
168 </widget>
169 <widget>
170 <class>QCheckBox</class>
171 <property stdset="1">
172 <name>name</name>
173 <cstring>touchsound</cstring>
174 </property>
175 <property stdset="1">
176 <name>text</name>
177 <string>Screen sounds</string>
178 </property>
179 </widget>
180 <widget>
181 <class>QCheckBox</class>
182 <property stdset="1">
183 <name>name</name>
184 <cstring>keysound</cstring>
185 </property>
186 <property stdset="1">
187 <name>text</name>
188 <string>Keyboard sounds</string>
189 </property>
190 </widget>
191 </vbox>
192 </widget>
193 <spacer>
194 <property>
195 <name>name</name>
196 <cstring>Spacer10</cstring>
197 </property>
198 <property stdset="1">
199 <name>orientation</name>
200 <enum>Vertical</enum>
201 </property>
202 <property stdset="1">
203 <name>sizeType</name>
204 <enum>Expanding</enum>
205 </property>
206 <property>
207 <name>sizeHint</name>
208 <size>
209 <width>20</width>
210 <height>20</height>
211 </size>
212 </property>
213 </spacer>
214 </vbox>
215 </widget>
216 <widget row="0" column="0" > 37 <widget row="0" column="0" >
217 <class>QGroupBox</class> 38 <class>QGroupBox</class>
218 <property stdset="1"> 39 <property stdset="1">
@@ -220,6 +41,14 @@
220 <cstring>GroupBox3</cstring> 41 <cstring>GroupBox3</cstring>
221 </property> 42 </property>
222 <property stdset="1"> 43 <property stdset="1">
44 <name>frameShape</name>
45 <enum>Box</enum>
46 </property>
47 <property stdset="1">
48 <name>frameShadow</name>
49 <enum>Sunken</enum>
50 </property>
51 <property stdset="1">
223 <name>title</name> 52 <name>title</name>
224 <string>Levels</string> 53 <string>Levels</string>
225 </property> 54 </property>
@@ -615,6 +444,196 @@
615 </widget> 444 </widget>
616 </vbox> 445 </vbox>
617 </widget> 446 </widget>
447 <widget row="0" column="1" >
448 <class>QLayoutWidget</class>
449 <property stdset="1">
450 <name>name</name>
451 <cstring>Layout12</cstring>
452 </property>
453 <vbox>
454 <property stdset="1">
455 <name>margin</name>
456 <number>0</number>
457 </property>
458 <property stdset="1">
459 <name>spacing</name>
460 <number>6</number>
461 </property>
462 <widget>
463 <class>QGroupBox</class>
464 <property stdset="1">
465 <name>name</name>
466 <cstring>GroupBox1</cstring>
467 </property>
468 <property stdset="1">
469 <name>title</name>
470 <string>Vmemo</string>
471 </property>
472 <widget>
473 <class>QLayoutWidget</class>
474 <property stdset="1">
475 <name>name</name>
476 <cstring>Layout11</cstring>
477 </property>
478 <property stdset="1">
479 <name>geometry</name>
480 <rect>
481 <x>5</x>
482 <y>16</y>
483 <width>96</width>
484 <height>169</height>
485 </rect>
486 </property>
487 <vbox>
488 <property stdset="1">
489 <name>margin</name>
490 <number>0</number>
491 </property>
492 <property stdset="1">
493 <name>spacing</name>
494 <number>6</number>
495 </property>
496 <widget>
497 <class>QLabel</class>
498 <property stdset="1">
499 <name>name</name>
500 <cstring>sampleRateLabel</cstring>
501 </property>
502 <property stdset="1">
503 <name>text</name>
504 <string>Sample Rate</string>
505 </property>
506 </widget>
507 <widget>
508 <class>QComboBox</class>
509 <item>
510 <property>
511 <name>text</name>
512 <string>11025</string>
513 </property>
514 </item>
515 <item>
516 <property>
517 <name>text</name>
518 <string>22050</string>
519 </property>
520 </item>
521 <item>
522 <property>
523 <name>text</name>
524 <string>32000</string>
525 </property>
526 </item>
527 <item>
528 <property>
529 <name>text</name>
530 <string>44100</string>
531 </property>
532 </item>
533 <property stdset="1">
534 <name>name</name>
535 <cstring>sampleRate</cstring>
536 </property>
537 </widget>
538 <widget>
539 <class>QCheckBox</class>
540 <property stdset="1">
541 <name>name</name>
542 <cstring>stereoCheckBox</cstring>
543 </property>
544 <property stdset="1">
545 <name>text</name>
546 <string>Stereo</string>
547 </property>
548 </widget>
549 <widget>
550 <class>QCheckBox</class>
551 <property stdset="1">
552 <name>name</name>
553 <cstring>sixteenBitCheckBox</cstring>
554 </property>
555 <property stdset="1">
556 <name>text</name>
557 <string>16 bit</string>
558 </property>
559 </widget>
560 <widget>
561 <class>QCheckBox</class>
562 <property stdset="1">
563 <name>name</name>
564 <cstring>AlertCheckBox</cstring>
565 </property>
566 <property stdset="1">
567 <name>text</name>
568 <string>Visual Alerts</string>
569 </property>
570 </widget>
571 <widget>
572 <class>QLabel</class>
573 <property stdset="1">
574 <name>name</name>
575 <cstring>TextLabel1</cstring>
576 </property>
577 <property stdset="1">
578 <name>text</name>
579 <string>Location</string>
580 </property>
581 </widget>
582 <widget>
583 <class>QComboBox</class>
584 <property stdset="1">
585 <name>name</name>
586 <cstring>LocationComboBox</cstring>
587 </property>
588 </widget>
589 </vbox>
590 </widget>
591 </widget>
592 <widget>
593 <class>QCheckBox</class>
594 <property stdset="1">
595 <name>name</name>
596 <cstring>touchsound</cstring>
597 </property>
598 <property stdset="1">
599 <name>text</name>
600 <string>Screen sounds</string>
601 </property>
602 </widget>
603 <widget>
604 <class>QCheckBox</class>
605 <property stdset="1">
606 <name>name</name>
607 <cstring>keysound</cstring>
608 </property>
609 <property stdset="1">
610 <name>text</name>
611 <string>Keyboard sounds</string>
612 </property>
613 </widget>
614 <spacer>
615 <property>
616 <name>name</name>
617 <cstring>Spacer10</cstring>
618 </property>
619 <property stdset="1">
620 <name>orientation</name>
621 <enum>Vertical</enum>
622 </property>
623 <property stdset="1">
624 <name>sizeType</name>
625 <enum>Expanding</enum>
626 </property>
627 <property>
628 <name>sizeHint</name>
629 <size>
630 <width>20</width>
631 <height>20</height>
632 </size>
633 </property>
634 </spacer>
635 </vbox>
636 </widget>
618 </grid> 637 </grid>
619</widget> 638</widget>
620<images> 639<images>