author | jeremy <jeremy> | 2002-02-19 20:44:24 (UTC) |
---|---|---|
committer | jeremy <jeremy> | 2002-02-19 20:44:24 (UTC) |
commit | 4532d74ad882dc3c14cf1c42931e5cedf31cba05 (patch) (unidiff) | |
tree | 728e3e2c0924f9e11bc9e0f27eb974589ca37e2b | |
parent | 3ed313993ab9fa0f6a8c8ca2b2fe0f5c8cf39dc6 (diff) | |
download | opie-4532d74ad882dc3c14cf1c42931e5cedf31cba05.zip opie-4532d74ad882dc3c14cf1c42931e5cedf31cba05.tar.gz opie-4532d74ad882dc3c14cf1c42931e5cedf31cba05.tar.bz2 |
Temporarly disabled the mousePress and Release events on the iPAQ only due
to the sticky keyboard problem.
-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 71 |
1 files changed, 25 insertions, 46 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index aa23ba7..48dd193 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp | |||
@@ -153,5 +153,4 @@ VMemo::VMemo( QWidget *parent, const char *name ) | |||
153 | QString release=name.release; | 153 | QString release=name.release; |
154 | qWarning("System release: %s\n", name.release); | ||
155 | if(release.find("embedix",0,TRUE) !=-1) | 154 | if(release.find("embedix",0,TRUE) !=-1) |
156 | systemZaurus=TRUE; | 155 | systemZaurus=TRUE; |
157 | else | 156 | else |
@@ -167,3 +166,2 @@ VMemo::VMemo( QWidget *parent, const char *name ) | |||
167 | } | 166 | } |
168 | qWarning("VMemo done init"); | ||
169 | } | 167 | } |
@@ -176,11 +174,10 @@ void VMemo::receive( const QCString &msg, const QByteArray &data ) | |||
176 | { | 174 | { |
177 | QDataStream stream( data, IO_ReadOnly ); | 175 | QDataStream stream( data, IO_ReadOnly ); |
178 | qWarning("VMemo::receive: %s", (const char *)msg); | 176 | if (msg == "toggleRecord()") |
179 | if (msg == "toggleRecord()") | 177 | { |
180 | { | 178 | if (recording) |
181 | if (recording) | 179 | mouseReleaseEvent(NULL); |
182 | mouseReleaseEvent(NULL); | 180 | else |
183 | else | 181 | mousePressEvent(NULL); |
184 | mousePressEvent(NULL); | 182 | } |
185 | } | ||
186 | } | 183 | } |
@@ -193,3 +190,3 @@ void VMemo::paintEvent( QPaintEvent* ) | |||
193 | 190 | ||
194 | void VMemo::mousePressEvent( QMouseEvent * ) | 191 | void VMemo::mousePressEvent( QMouseEvent *me ) |
195 | { | 192 | { |
@@ -201,4 +198,10 @@ void VMemo::mousePressEvent( QMouseEvent * ) | |||
201 | } | 198 | } |
199 | |||
200 | /* | ||
201 | No mousePress/mouseRelease recording on the iPAQ. The REC button on the iPAQ calls these functions | ||
202 | mousePressEvent and mouseReleaseEvent with a NULL parameter. | ||
203 | */ | ||
204 | if (!systemZaurus && me != NULL) | ||
205 | return; | ||
202 | 206 | ||
203 | qWarning("VMemo::mousePress()"); | ||
204 | QSound::play(Resource::findSound("vmemob")); | 207 | QSound::play(Resource::findSound("vmemob")); |
@@ -206,6 +209,4 @@ void VMemo::mousePressEvent( QMouseEvent * ) | |||
206 | recording = TRUE; | 209 | recording = TRUE; |
207 | qWarning("VMemo::mousePress() -> Starting to record"); | ||
208 | if (openDSP() == -1) | 210 | if (openDSP() == -1) |
209 | { | 211 | { |
210 | // ### Display an error box | ||
211 | QMessageBox::critical(0, "VMemo", "Could not open dsp device.", "Abort"); | 212 | QMessageBox::critical(0, "VMemo", "Could not open dsp device.", "Abort"); |
@@ -220,2 +221,3 @@ void VMemo::mousePressEvent( QMouseEvent * ) | |||
220 | QString fileName; | 221 | QString fileName; |
222 | |||
221 | if(systemZaurus) | 223 | if(systemZaurus) |
@@ -237,4 +239,6 @@ void VMemo::mousePressEvent( QMouseEvent * ) | |||
237 | { | 239 | { |
238 | // ### Display an error box | 240 | QString err("Could not open the output file: "); |
239 | qWarning("VMemo::mousePress() -> WAV error"); | 241 | err += fileName; |
242 | |||
243 | QMessageBox::critical(0, "VMemo", err, "Abort"); | ||
240 | close(dsp); | 244 | close(dsp); |
@@ -260,3 +264,2 @@ void VMemo::mouseReleaseEvent( QMouseEvent * ) | |||
260 | { | 264 | { |
261 | qWarning("VMemo::mouseRelese() -> Done recording"); | ||
262 | recording = FALSE; | 265 | recording = FALSE; |
@@ -322,9 +325,6 @@ int VMemo::openWAV(const char *filename) | |||
322 | { | 325 | { |
323 | qDebug("Creating %s ",filename); | ||
324 | track.setName(filename); | 326 | track.setName(filename); |
325 | if(!track.open(IO_WriteOnly|IO_Truncate|IO_Raw)) | 327 | if(!track.open(IO_WriteOnly|IO_Truncate|IO_Raw)) |
326 | { | ||
327 | qDebug("Could not open file"); | ||
328 | return -1; | 328 | return -1; |
329 | } | 329 | |
330 | wav=track.handle(); | 330 | wav=track.handle(); |
@@ -355,6 +355,4 @@ void VMemo::record(void) | |||
355 | { | 355 | { |
356 | int length=0, result, value; //, i; | 356 | int length=0, result, value; |
357 | char sound[512]; //, leftBuffer[256], rightBuffer[256]; | 357 | char sound[512]; |
358 | |||
359 | qWarning("VMemo::record()"); | ||
360 | 358 | ||
@@ -365,15 +363,2 @@ void VMemo::record(void) | |||
365 | 363 | ||
366 | /* attempt to write only one channel...didnt work. | ||
367 | for (i = 0; i < result; i++) { | ||
368 | leftBuffer[i] = sound[2*i]; | ||
369 | rightBuffer[i] = sound[2*i+1]; | ||
370 | } | ||
371 | */ | ||
372 | qApp->processEvents(); | ||
373 | |||
374 | /* needed to only write one channel. comment out above "write/length" code. | ||
375 | write(wav, leftBuffer, result / 2); | ||
376 | length += result/2; | ||
377 | */ | ||
378 | |||
379 | write(wav, sound, result); | 364 | write(wav, sound, result); |
@@ -384,5 +369,2 @@ void VMemo::record(void) | |||
384 | 369 | ||
385 | qWarning("VMemo::record() -> Done recording"); | ||
386 | qWarning("VMemo::record() -> Closing dsp"); | ||
387 | |||
388 | value = length+36; | 370 | value = length+36; |
@@ -398,6 +380,3 @@ void VMemo::record(void) | |||
398 | 380 | ||
399 | qWarning("VMemo::record() -> playing done recording sound"); | ||
400 | QSound::play(Resource::findSound("vmemoe")); | 381 | QSound::play(Resource::findSound("vmemoe")); |
401 | qWarning("VMemo::record() -> terminating"); | ||
402 | //QMessageBox::information(0, "VMemo", "Recording Done", 1); | ||
403 | } | 382 | } |