summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2003-08-10 23:02:47 (UTC)
committer llornkcor <llornkcor>2003-08-10 23:02:47 (UTC)
commit44bb1f23dcd0bea4775ba4b48fb370ad651290cc (patch) (unidiff)
tree83028d0b3af21790e9e69dd83ce495a020bea948
parent41b3267ce7142a62ac3d3d6eef3feb33f00deda5 (diff)
downloadopie-44bb1f23dcd0bea4775ba4b48fb370ad651290cc.zip
opie-44bb1f23dcd0bea4775ba4b48fb370ad651290cc.tar.gz
opie-44bb1f23dcd0bea4775ba4b48fb370ad651290cc.tar.bz2
add adpcm checkbox
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sound/soundsettings.cpp17
-rw-r--r--noncore/settings/sound/soundsettings.h1
-rw-r--r--noncore/settings/sound/soundsettingsbase.cpp8
-rw-r--r--noncore/settings/sound/soundsettingsbase.h2
4 files changed, 24 insertions, 4 deletions
diff --git a/noncore/settings/sound/soundsettings.cpp b/noncore/settings/sound/soundsettings.cpp
index 09d2e92..4bc86fa 100644
--- a/noncore/settings/sound/soundsettings.cpp
+++ b/noncore/settings/sound/soundsettings.cpp
@@ -93,41 +93,49 @@ SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl )
93 timeLimitComboBox->setCurrentItem(1); 93 timeLimitComboBox->setCurrentItem(1);
94 else if(sRate == 15) 94 else if(sRate == 15)
95 timeLimitComboBox->setCurrentItem(2); 95 timeLimitComboBox->setCurrentItem(2);
96 else if(sRate == 10) 96 else if(sRate == 10)
97 timeLimitComboBox->setCurrentItem(3); 97 timeLimitComboBox->setCurrentItem(3);
98 else if(sRate == 5) 98 else if(sRate == 5)
99 timeLimitComboBox->setCurrentItem(4); 99 timeLimitComboBox->setCurrentItem(4);
100 else 100 else
101 timeLimitComboBox->setCurrentItem(5); 101 timeLimitComboBox->setCurrentItem(5);
102 102
103 sixteenBitCheckBox->setChecked(cfg.readNumEntry("SixteenBit", 1)); 103 sixteenBitCheckBox->setChecked(cfg.readNumEntry("SixteenBit", 1));
104 104
105 cfg.setGroup("Defaults"); 105 cfg.setGroup("Defaults");
106 keyComboBox->setCurrentItem(cfg.readNumEntry("toggleKey") ); 106 keyComboBox->setCurrentItem(cfg.readNumEntry("toggleKey") );
107 107
108 updateStorageCombo(); 108 updateStorageCombo();
109
110 Config vmCfg("Vmemo");
111 vmCfg.setGroup("Defaults");
112 adpcmCheckBox->setChecked( vmCfg.readBoolEntry("use_ADPCM", 0));
113
109 connect( LocationComboBox,SIGNAL(activated(const QString &)), this, 114 connect( LocationComboBox,SIGNAL(activated(const QString &)), this,
110 SLOT( setLocation(const QString &))); 115 SLOT( setLocation(const QString &)));
111 connect( keyComboBox,SIGNAL(activated( int)), this, 116 connect( keyComboBox,SIGNAL(activated( int)), this,
112 SLOT( setKeyButton( int))); 117 SLOT( setKeyButton( int)));
113 connect( timeLimitComboBox,SIGNAL(activated( const QString &)), this, 118 connect( timeLimitComboBox,SIGNAL(activated( const QString &)), this,
114 SLOT( setSizeLimitButton(const QString &))); 119 SLOT( setSizeLimitButton(const QString &)));
115 connect( restartCheckBox,SIGNAL( toggled( bool)), this, 120 connect( restartCheckBox,SIGNAL( toggled( bool)), this,
116 SLOT( restartOpie( bool))); 121 SLOT( restartOpie( bool)));
117// connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); 122 connect( adpcmCheckBox,SIGNAL( toggled( bool)), this,
123 SLOT( slotAdpcm( bool)));
124
125 // connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) );
118} 126}
119 127
120void SoundSettings::updateStorageCombo() { 128void SoundSettings::updateStorageCombo() {
121 129
122 Config config( "Vmemo" ); 130 Config config( "Vmemo" );
123 config.setGroup( "System" ); 131 config.setGroup( "System" );
124 QString loc = config.readEntry("RecLocation","/"); 132 QString loc = config.readEntry("RecLocation","/");
125 int i=0; 133 int i=0;
126 int set=0; 134 int set=0;
127 StorageInfo storageInfo; 135 StorageInfo storageInfo;
128 QString sName, sPath; 136 QString sName, sPath;
129 QStringList list; 137 QStringList list;
130 list << "Documents : "+QPEApplication::documentDir(); 138 list << "Documents : "+QPEApplication::documentDir();
131 list << "tmp : /tmp"; 139 list << "tmp : /tmp";
132 140
133 const QList<FileSystem> &fs = storageInfo.fileSystems(); 141 const QList<FileSystem> &fs = storageInfo.fileSystems();
@@ -151,33 +159,32 @@ void SoundSettings::updateStorageCombo() {
151void SoundSettings::setLocation(const QString & string) { 159void SoundSettings::setLocation(const QString & string) {
152 Config config( "Vmemo" ); 160 Config config( "Vmemo" );
153 config.setGroup( "System" ); 161 config.setGroup( "System" );
154 config.writeEntry("RecLocation",string); 162 config.writeEntry("RecLocation",string);
155 qDebug("set location "+string); 163 qDebug("set location "+string);
156 config.write(); 164 config.write();
157} 165}
158 166
159void SoundSettings::cleanUp() { 167void SoundSettings::cleanUp() {
160 Config cfg("Vmemo"); 168 Config cfg("Vmemo");
161 cfg.writeEntry("Alert",AlertCheckBox->isChecked()); 169 cfg.writeEntry("Alert",AlertCheckBox->isChecked());
162 170
163 cfg.setGroup("Record"); 171 cfg.setGroup("Record");
164 cfg.writeEntry("SampleRate",sampleRate->currentText()); 172 cfg.writeEntry("SampleRate",sampleRate->currentText());
165 cfg.writeEntry("Stereo",stereoCheckBox->isChecked()); 173 cfg.writeEntry("Stereo",stereoCheckBox->isChecked());
166 cfg.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked()); 174 cfg.writeEntry("SixteenBit",sixteenBitCheckBox->isChecked());
167
168 if(keyReset && noWarning) { 175 if(keyReset && noWarning) {
169 QCopEnvelope ("QPE/System", "restart()"); 176 QCopEnvelope ("QPE/System", "restart()");
170 } 177 }
171} 178}
172 179
173void SoundSettings::setKeyButton( int index) { 180void SoundSettings::setKeyButton( int index) {
174 Config cfg("Vmemo"); 181 Config cfg("Vmemo");
175 cfg.setGroup("Defaults"); 182 cfg.setGroup("Defaults");
176 cfg.writeEntry( "toggleKey", index ); 183 cfg.writeEntry( "toggleKey", index );
177 keyReset = TRUE; 184 keyReset = TRUE;
178 if( index == 1) { 185 if( index == 1) {
179 cfg.writeEntry( "hideIcon", 0 ); 186 cfg.writeEntry( "hideIcon", 0 );
180 keyLabel->setText(tr("Shows icon")); 187 keyLabel->setText(tr("Shows icon"));
181 } 188 }
182 else { 189 else {
183 cfg.writeEntry( "hideIcon", 1); 190 cfg.writeEntry( "hideIcon", 1);
@@ -192,16 +199,22 @@ void SoundSettings::updateLocationCombo() {
192 199
193void SoundSettings::setSizeLimitButton(const QString &index) { 200void SoundSettings::setSizeLimitButton(const QString &index) {
194 201
195 Config cfg("Vmemo"); 202 Config cfg("Vmemo");
196 cfg.setGroup("Record"); 203 cfg.setGroup("Record");
197 if(index.find("Unlimited",0,TRUE) != -1) 204 if(index.find("Unlimited",0,TRUE) != -1)
198 cfg.writeEntry("SizeLimit", -1); 205 cfg.writeEntry("SizeLimit", -1);
199 else 206 else
200 cfg.writeEntry("SizeLimit", index); 207 cfg.writeEntry("SizeLimit", index);
201 cfg.write(); 208 cfg.write();
202} 209}
203 210
204void SoundSettings::restartOpie(bool b) { 211void SoundSettings::restartOpie(bool b) {
205 noWarning=b; 212 noWarning=b;
206} 213}
207 214
215void SoundSettings::slotAdpcm(bool b) {
216 Config vmCfg("Vmemo");
217 vmCfg.setGroup("Defaults");
218 vmCfg.writeEntry("use_ADPCM", b);
219 vmCfg.write();
220}
diff --git a/noncore/settings/sound/soundsettings.h b/noncore/settings/sound/soundsettings.h
index 0f3605e..71ce6f5 100644
--- a/noncore/settings/sound/soundsettings.h
+++ b/noncore/settings/sound/soundsettings.h
@@ -31,21 +31,22 @@ Q_OBJECT
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 bool noWarning; 35 bool noWarning;
36/* void accept(); */ 36/* void accept(); */
37/* void reject(); */ 37/* void reject(); */
38 void updateStorageCombo(); 38 void updateStorageCombo();
39 void updateLocationCombo(); 39 void updateLocationCombo();
40 40
41private slots: 41private slots:
42 void setKeyButton( int); 42 void setKeyButton( int);
43 void setSizeLimitButton(const QString &); 43 void setSizeLimitButton(const QString &);
44 void setLocation(const QString &); 44 void setLocation(const QString &);
45 void cleanUp(); 45 void cleanUp();
46 void restartOpie(bool); 46 void restartOpie(bool);
47 void slotAdpcm(bool);
47}; 48};
48 49
49 50
50#endif // SOUNDSETTINGS_H 51#endif // SOUNDSETTINGS_H
51 52
diff --git a/noncore/settings/sound/soundsettingsbase.cpp b/noncore/settings/sound/soundsettingsbase.cpp
index af794ba..f283119 100644
--- a/noncore/settings/sound/soundsettingsbase.cpp
+++ b/noncore/settings/sound/soundsettingsbase.cpp
@@ -148,29 +148,33 @@ SoundSettingsBase::SoundSettingsBase( QWidget* parent, const char* name, bool m
148 148
149 timeLimitComboBox = new QComboBox( FALSE, this, "timeLimitComboBox" ); 149 timeLimitComboBox = new QComboBox( FALSE, this, "timeLimitComboBox" );
150 timeLimitComboBox->insertItem( tr( "30" ) ); 150 timeLimitComboBox->insertItem( tr( "30" ) );
151 timeLimitComboBox->insertItem( tr( "20" ) ); 151 timeLimitComboBox->insertItem( tr( "20" ) );
152 timeLimitComboBox->insertItem( tr( "15" ) ); 152 timeLimitComboBox->insertItem( tr( "15" ) );
153 timeLimitComboBox->insertItem( tr( "10" ) ); 153 timeLimitComboBox->insertItem( tr( "10" ) );
154 timeLimitComboBox->insertItem( tr( "5" ) ); 154 timeLimitComboBox->insertItem( tr( "5" ) );
155 timeLimitComboBox->insertItem( tr( "Unlimited" ) ); 155 timeLimitComboBox->insertItem( tr( "Unlimited" ) );
156 156
157 SoundSettingsBaseLayout->addMultiCellWidget(timeLimitComboBox , 8, 8, 0, 0, 1); 157 SoundSettingsBaseLayout->addMultiCellWidget(timeLimitComboBox , 8, 8, 0, 0, 1);
158 158
159 159
160 restartCheckBox= new QCheckBox( this, "restartCheck" ); 160 restartCheckBox= new QCheckBox( this, "restartCheck" );
161 restartCheckBox->setText( tr( "Restart Opie if needed" ) ); 161 restartCheckBox->setText( tr( "Restart Opie if needed" ) );
162 162
163 SoundSettingsBaseLayout->addMultiCellWidget( restartCheckBox , 9, 9, 0, 0, 1); 163 SoundSettingsBaseLayout->addMultiCellWidget( restartCheckBox , 9, 9, 0, 0, 1);
164 164
165 adpcmCheckBox = new QCheckBox( this, "adpcmCheck" );
166 adpcmCheckBox->setText( tr( "Use ADPCM compression" ) );
167
168 SoundSettingsBaseLayout->addMultiCellWidget( adpcmCheckBox , 10, 10, 0, 0, 1);
165 169
166 QSpacerItem* spacer4 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding ); 170 QSpacerItem* spacer4 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding );
167 SoundSettingsBaseLayout->addItem( spacer4, 9, 0 ); 171 SoundSettingsBaseLayout->addItem( spacer4, 10, 0 );
168} 172}
169 173
170/* 174/*
171 * Destroys the object and frees any allocated resources 175 * Destroys the object and frees any allocated resources
172 */ 176 */
173SoundSettingsBase::~SoundSettingsBase() 177SoundSettingsBase::~SoundSettingsBase()
174{ 178{
175 // no need to delete child widgets, Qt does it all for us 179 // no need to delete child widgets, Qt does it all for us
176} 180}
diff --git a/noncore/settings/sound/soundsettingsbase.h b/noncore/settings/sound/soundsettingsbase.h
index e6bc186..48c31e8 100644
--- a/noncore/settings/sound/soundsettingsbase.h
+++ b/noncore/settings/sound/soundsettingsbase.h
@@ -37,24 +37,26 @@ public:
37/* QLabel* micLabel; */ 37/* QLabel* micLabel; */
38/* QSlider* volume; */ 38/* QSlider* volume; */
39/* QSlider* mic; */ 39/* QSlider* mic; */
40/* QLabel* PixmapLabel2_2; */ 40/* QLabel* PixmapLabel2_2; */
41/* QLabel* TextLabel2_2; */ 41/* QLabel* TextLabel2_2; */
42/* QGroupBox* GroupBox1; */ 42/* QGroupBox* GroupBox1; */
43 QLabel* sampleRateLabel; 43 QLabel* sampleRateLabel;
44 QComboBox* sampleRate; 44 QComboBox* sampleRate;
45 QCheckBox* stereoCheckBox; 45 QCheckBox* stereoCheckBox;
46 QCheckBox* sixteenBitCheckBox; 46 QCheckBox* sixteenBitCheckBox;
47 QCheckBox* AlertCheckBox; 47 QCheckBox* AlertCheckBox;
48 QLabel* TextLabel1; 48 QLabel* TextLabel1;
49 QComboBox* LocationComboBox; 49 QComboBox* LocationComboBox;
50 QComboBox* keyComboBox; 50 QComboBox* keyComboBox;
51 QComboBox* timeLimitComboBox; 51 QComboBox* timeLimitComboBox;
52 QCheckBox *restartCheckBox; 52 QCheckBox *restartCheckBox;
53 QCheckBox *adpcmCheckBox;
54
53 bool keyReset; 55 bool keyReset;
54protected: 56protected:
55 QGridLayout* SoundSettingsBaseLayout; 57 QGridLayout* SoundSettingsBaseLayout;
56protected slots: 58protected slots:
57 59
58}; 60};
59 61
60#endif // SOUNDSETTINGSBASE_H 62#endif // SOUNDSETTINGSBASE_H