summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-03-19 00:58:28 (UTC)
committer llornkcor <llornkcor>2002-03-19 00:58:28 (UTC)
commitd9bbf6f090bd5e35bf2ec7782cf77de049634149 (patch) (unidiff)
tree9e3bd25584c24d1850d90fd474ebaf517e946d9a
parent7ac89ca47c72729aad8a5a91c8be6ce9c223ab9c (diff)
downloadopie-d9bbf6f090bd5e35bf2ec7782cf77de049634149.zip
opie-d9bbf6f090bd5e35bf2ec7782cf77de049634149.tar.gz
opie-d9bbf6f090bd5e35bf2ec7782cf77de049634149.tar.bz2
added 3200 samplerate to combo
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sound/sound.pro2
-rw-r--r--noncore/settings/sound/soundsettings.cpp6
-rw-r--r--noncore/settings/sound/soundsettingsbase.ui6
3 files changed, 12 insertions, 2 deletions
diff --git a/noncore/settings/sound/sound.pro b/noncore/settings/sound/sound.pro
index 8b33ff2..fa87b86 100644
--- a/noncore/settings/sound/sound.pro
+++ b/noncore/settings/sound/sound.pro
@@ -1,12 +1,12 @@
1 TEMPLATE= app 1 TEMPLATE= app
2 CONFIG += qt warn_on release 2 CONFIG += qt warn_on release
3 DESTDIR = ../../bin 3 DESTDIR = ../../bin
4 HEADERS = soundsettings.h 4 HEADERS = soundsettings.h
5 SOURCES = soundsettings.cpp main.cpp 5 SOURCES = soundsettings.cpp main.cpp
6 INTERFACES= soundsettingsbase.ui 6 INTERFACES= soundsettingsbase.ui
7INCLUDEPATH += $(OPIEDIR)/include 7INCLUDEPATH += $(OPIEDIR)/include
8 DEPENDPATH+= ../$(OPIEDIR)/include 8 DEPENDPATH+= ../$(OPIEDIR)/include
9LIBS += -lqpe 9LIBS += -lqpe
10 TARGET = sound 10 TARGET = sound
11 11
12TRANSLATIONS = ../../i18n/pt_BR/sound.ts 12TRANSLATIONS += ../../i18n/pt_BR/sound.ts
diff --git a/noncore/settings/sound/soundsettings.cpp b/noncore/settings/sound/soundsettings.cpp
index 55f6c99..467f23e 100644
--- a/noncore/settings/sound/soundsettings.cpp
+++ b/noncore/settings/sound/soundsettings.cpp
@@ -15,91 +15,95 @@
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#include "soundsettings.h" 20#include "soundsettings.h"
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 <qapplication.h> 24#include <qapplication.h>
25#include <qslider.h> 25#include <qslider.h>
26#include <qcheckbox.h> 26#include <qcheckbox.h>
27#include <qlineedit.h> 27#include <qlineedit.h>
28#include <qcombobox.h> 28#include <qcombobox.h>
29 29
30 30
31SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) 31SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl )
32 : SoundSettingsBase( parent, name, TRUE, fl ) 32 : SoundSettingsBase( parent, name, TRUE, fl )
33{ 33{
34 Config config( "Sound" ); 34 Config config( "Sound" );
35 config.setGroup( "System" ); 35 config.setGroup( "System" );
36 volume->setValue(100-config.readNumEntry("Volume")); 36 volume->setValue(100-config.readNumEntry("Volume"));
37 mic->setValue(100-config.readNumEntry("Mic")); 37 mic->setValue(100-config.readNumEntry("Mic"));
38 touchsound->setChecked(config.readBoolEntry("Touch")); 38 touchsound->setChecked(config.readBoolEntry("Touch"));
39 keysound->setChecked(config.readBoolEntry("Key")); 39 keysound->setChecked(config.readBoolEntry("Key"));
40 40
41 config.setGroup("Record"); 41 config.setGroup("Record");
42 int rate=config.readNumEntry("SampleRate", 11025); 42 int rate=config.readNumEntry("SampleRate", 11025);
43 if(rate == 11025) 43 if(rate == 11025)
44 sampleRate->setCurrentItem(0); 44 sampleRate->setCurrentItem(0);
45 else if(rate == 22050) 45 else if(rate == 22050)
46 sampleRate->setCurrentItem(1); 46 sampleRate->setCurrentItem(1);
47 else if(rate == 32000)
48 sampleRate->setCurrentItem(2);
47 else if(rate==44100) 49 else if(rate==44100)
48 sampleRate->setCurrentItem(2); 50 sampleRate->setCurrentItem(2);
49 51
50 stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); 52 stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0));
51 sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 1)); 53 sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 1));
52 54
53 connect(volume, SIGNAL(valueChanged(int)), this, SLOT(setVolume(int))); 55 connect(volume, SIGNAL(valueChanged(int)), this, SLOT(setVolume(int)));
54 connect(mic, SIGNAL(valueChanged(int)), this, SLOT(setMic(int))); 56 connect(mic, SIGNAL(valueChanged(int)), this, SLOT(setMic(int)));
55 connect(qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) ); 57 connect(qApp, SIGNAL( volumeChanged(bool) ), this, SLOT( volumeChanged(bool) ) );
56 connect(qApp, SIGNAL( micChanged(bool) ), this, SLOT ( micChanged(bool) ) ); 58 connect(qApp, SIGNAL( micChanged(bool) ), this, SLOT ( micChanged(bool) ) );
57} 59}
58 60
59void SoundSettings::reject() 61void SoundSettings::reject()
60{ 62{
61 Config config( "Sound" ); 63 Config config( "Sound" );
62 config.setGroup( "System" ); 64 config.setGroup( "System" );
63 setVolume(100-config.readNumEntry("Volume")); 65 setVolume(100-config.readNumEntry("Volume"));
64 setMic(100-config.readNumEntry("Mic")); 66 setMic(100-config.readNumEntry("Mic"));
65 67
66 config.setGroup("Record"); 68 config.setGroup("Record");
67 int rate=config.readNumEntry("SampleRate", 11025); 69 int rate=config.readNumEntry("SampleRate", 11025);
68 if(rate == 11025) 70 if(rate == 11025)
69 sampleRate->setCurrentItem(0); 71 sampleRate->setCurrentItem(0);
70 else if(rate == 22050) 72 else if(rate == 22050)
71 sampleRate->setCurrentItem(1); 73 sampleRate->setCurrentItem(1);
72 else if(rate==44100) 74 else if(rate == 32000)
73 sampleRate->setCurrentItem(2); 75 sampleRate->setCurrentItem(2);
76 else if(rate==44100)
77 sampleRate->setCurrentItem(3);
74 stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0)); 78 stereoCheckBox->setChecked(config.readNumEntry("Stereo", 0));
75 sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 0)); 79 sixteenBitCheckBox->setChecked(config.readNumEntry("SixteenBit", 0));
76 80
77 QDialog::reject(); 81 QDialog::reject();
78} 82}
79 83
80void SoundSettings::accept() 84void SoundSettings::accept()
81{ 85{
82 Config config( "Sound" ); 86 Config config( "Sound" );
83 config.setGroup( "System" ); 87 config.setGroup( "System" );
84 config.writeEntry("Volume",100-volume->value()); 88 config.writeEntry("Volume",100-volume->value());
85 config.writeEntry("Mic",100-mic->value()); 89 config.writeEntry("Mic",100-mic->value());
86 config.writeEntry("Touch",touchsound->isChecked()); 90 config.writeEntry("Touch",touchsound->isChecked());
87 config.writeEntry("Key",keysound->isChecked()); 91 config.writeEntry("Key",keysound->isChecked());
88 92
89 setVolume(volume->value()); 93 setVolume(volume->value());
90 setMic(mic->value()); 94 setMic(mic->value());
91 95
92 config.setGroup("Record"); 96 config.setGroup("Record");
93 config.writeEntry("SampleRate",sampleRate->currentText()); 97 config.writeEntry("SampleRate",sampleRate->currentText());
94 config.writeEntry("Stereo",stereoCheckBox->isChecked()); 98 config.writeEntry("Stereo",stereoCheckBox->isChecked());
95 config.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); 99 config.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked());
96 100
97 QDialog::accept(); 101 QDialog::accept();
98} 102}
99 103
100void SoundSettings::setVolume(int v) 104void SoundSettings::setVolume(int v)
101{ 105{
102 Config config( "Sound" ); 106 Config config( "Sound" );
103 config.setGroup( "System" ); 107 config.setGroup( "System" );
104 config.writeEntry("Volume",100-v); 108 config.writeEntry("Volume",100-v);
105#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) 109#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP)
diff --git a/noncore/settings/sound/soundsettingsbase.ui b/noncore/settings/sound/soundsettingsbase.ui
index 0351fd8..97bea2d 100644
--- a/noncore/settings/sound/soundsettingsbase.ui
+++ b/noncore/settings/sound/soundsettingsbase.ui
@@ -97,64 +97,70 @@
97 <property stdset="1"> 97 <property stdset="1">
98 <name>spacing</name> 98 <name>spacing</name>
99 <number>6</number> 99 <number>6</number>
100 </property> 100 </property>
101 <widget> 101 <widget>
102 <class>QLabel</class> 102 <class>QLabel</class>
103 <property stdset="1"> 103 <property stdset="1">
104 <name>name</name> 104 <name>name</name>
105 <cstring>sampleRateLabel</cstring> 105 <cstring>sampleRateLabel</cstring>
106 </property> 106 </property>
107 <property stdset="1"> 107 <property stdset="1">
108 <name>text</name> 108 <name>text</name>
109 <string>Sample Rate</string> 109 <string>Sample Rate</string>
110 </property> 110 </property>
111 </widget> 111 </widget>
112 <widget> 112 <widget>
113 <class>QComboBox</class> 113 <class>QComboBox</class>
114 <item> 114 <item>
115 <property> 115 <property>
116 <name>text</name> 116 <name>text</name>
117 <string>11025</string> 117 <string>11025</string>
118 </property> 118 </property>
119 </item> 119 </item>
120 <item> 120 <item>
121 <property> 121 <property>
122 <name>text</name> 122 <name>text</name>
123 <string>22050</string> 123 <string>22050</string>
124 </property> 124 </property>
125 </item> 125 </item>
126 <item> 126 <item>
127 <property> 127 <property>
128 <name>text</name> 128 <name>text</name>
129 <string>32000</string>
130 </property>
131 </item>
132 <item>
133 <property>
134 <name>text</name>
129 <string>44100</string> 135 <string>44100</string>
130 </property> 136 </property>
131 </item> 137 </item>
132 <property stdset="1"> 138 <property stdset="1">
133 <name>name</name> 139 <name>name</name>
134 <cstring>sampleRate</cstring> 140 <cstring>sampleRate</cstring>
135 </property> 141 </property>
136 </widget> 142 </widget>
137 <widget> 143 <widget>
138 <class>QCheckBox</class> 144 <class>QCheckBox</class>
139 <property stdset="1"> 145 <property stdset="1">
140 <name>name</name> 146 <name>name</name>
141 <cstring>stereoCheckBox</cstring> 147 <cstring>stereoCheckBox</cstring>
142 </property> 148 </property>
143 <property stdset="1"> 149 <property stdset="1">
144 <name>text</name> 150 <name>text</name>
145 <string>Stereo</string> 151 <string>Stereo</string>
146 </property> 152 </property>
147 </widget> 153 </widget>
148 <widget> 154 <widget>
149 <class>QCheckBox</class> 155 <class>QCheckBox</class>
150 <property stdset="1"> 156 <property stdset="1">
151 <name>name</name> 157 <name>name</name>
152 <cstring>sixteenBitCheckBox</cstring> 158 <cstring>sixteenBitCheckBox</cstring>
153 </property> 159 </property>
154 <property stdset="1"> 160 <property stdset="1">
155 <name>text</name> 161 <name>text</name>
156 <string>16 bit</string> 162 <string>16 bit</string>
157 </property> 163 </property>
158 </widget> 164 </widget>
159 </vbox> 165 </vbox>
160 </widget> 166 </widget>