-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index 63ee0b8..84d53e0 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp | |||
@@ -230,14 +230,14 @@ VMemo::VMemo( QWidget *parent, const char *_name ) | |||
230 | // e << 4096; // Key_Escape | 230 | // e << 4096; // Key_Escape |
231 | // e << Key_F5; //4148 | 231 | // e << Key_F5; //4148 |
232 | e << toggleKey; | 232 | e << toggleKey; |
233 | e << QString("QPE/VMemo"); | 233 | e << QString("QPE/VMemo"); |
234 | e << QString("toggleRecord()"); | 234 | e << QString("toggleRecord()"); |
235 | } | 235 | } |
236 | // if( vmCfg.readNumEntry("hideIcon",0) == 1 || toggleKey > 0) | 236 | if( vmCfg.readNumEntry("hideIcon",0) == 1 || toggleKey > 0) |
237 | // hide(); | 237 | hide(); |
238 | } | 238 | } |
239 | } | 239 | } |
240 | 240 | ||
241 | VMemo::~VMemo() | 241 | VMemo::~VMemo() |
242 | { | 242 | { |
243 | } | 243 | } |
@@ -360,12 +360,13 @@ bool VMemo::startRecording() { | |||
360 | } | 360 | } |
361 | 361 | ||
362 | void VMemo::stopRecording() { | 362 | void VMemo::stopRecording() { |
363 | recording = FALSE; | 363 | recording = FALSE; |
364 | if(useAlerts) | 364 | if(useAlerts) |
365 | if( msgLabel) delete msgLabel; | 365 | if( msgLabel) delete msgLabel; |
366 | t_timer->stop(); | ||
366 | } | 367 | } |
367 | 368 | ||
368 | int VMemo::openDSP() | 369 | int VMemo::openDSP() |
369 | { | 370 | { |
370 | Config cfg("Vmemo"); | 371 | Config cfg("Vmemo"); |
371 | cfg.setGroup("Record"); | 372 | cfg.setGroup("Record"); |
@@ -453,14 +454,17 @@ int VMemo::openWAV(const char *filename) | |||
453 | void VMemo::record(void) | 454 | void VMemo::record(void) |
454 | { | 455 | { |
455 | int length=0, result, value; | 456 | int length=0, result, value; |
456 | QString msg; | 457 | QString msg; |
457 | msg.sprintf("Recording format %d", format); | 458 | msg.sprintf("Recording format %d", format); |
458 | qDebug(msg); | 459 | qDebug(msg); |
460 | Config config("Vmemo"); | ||
461 | config.setGroup("Record"); | ||
462 | int sRate=config.readNumEntry("SizeLimit", 30); | ||
459 | 463 | ||
460 | t_timer->start( 30 * 1000+1000, TRUE); | 464 | t_timer->start( sRate * 1000+1000, TRUE); |
461 | 465 | ||
462 | if(systemZaurus) { | 466 | if(systemZaurus) { |
463 | 467 | ||
464 | msg.sprintf("Recording format zaurus"); | 468 | msg.sprintf("Recording format zaurus"); |
465 | qDebug(msg); | 469 | qDebug(msg); |
466 | signed short sound[512], monoBuffer[512]; | 470 | signed short sound[512], monoBuffer[512]; |
@@ -469,13 +473,13 @@ void VMemo::record(void) | |||
469 | 473 | ||
470 | 474 | ||
471 | 475 | ||
472 | while(recording) { | 476 | while(recording) { |
473 | 477 | ||
474 | result = read(dsp, sound, 512); // 8192 | 478 | result = read(dsp, sound, 512); // 8192 |
475 | int j=0; | 479 | // int j=0; |
476 | 480 | ||
477 | for (int i = 0; i < result; i++) { //since Z is mono do normally | 481 | for (int i = 0; i < result; i++) { //since Z is mono do normally |
478 | monoBuffer[i] = sound[i]; | 482 | monoBuffer[i] = sound[i]; |
479 | } | 483 | } |
480 | 484 | ||
481 | length+=write(wav, monoBuffer, result); | 485 | length+=write(wav, monoBuffer, result); |
@@ -495,13 +499,13 @@ void VMemo::record(void) | |||
495 | 499 | ||
496 | } else { //AFMT_U8 | 500 | } else { //AFMT_U8 |
497 | // 8bit unsigned | 501 | // 8bit unsigned |
498 | unsigned short sound[512], monoBuffer[512]; | 502 | unsigned short sound[512], monoBuffer[512]; |
499 | while(recording) { | 503 | while(recording) { |
500 | result = read(dsp, sound, 512); // 8192 | 504 | result = read(dsp, sound, 512); // 8192 |
501 | int j=0; | 505 | // int j=0; |
502 | 506 | ||
503 | // if(systemZaurus) { | 507 | // if(systemZaurus) { |
504 | 508 | ||
505 | for (int i = 0; i < result; i++) { //since Z is mono do normally | 509 | for (int i = 0; i < result; i++) { //since Z is mono do normally |
506 | monoBuffer[i] = sound[i]; | 510 | monoBuffer[i] = sound[i]; |
507 | } | 511 | } |
@@ -524,13 +528,13 @@ void VMemo::record(void) | |||
524 | } else { // 16 bit only capabilities | 528 | } else { // 16 bit only capabilities |
525 | 529 | ||
526 | 530 | ||
527 | msg.sprintf("Recording format other"); | 531 | msg.sprintf("Recording format other"); |
528 | qDebug(msg); | 532 | qDebug(msg); |
529 | 533 | ||
530 | signed short sound[512], monoBuffer[512]; | 534 | signed short sound[512];//, monoBuffer[512]; |
531 | 535 | ||
532 | while(recording) { | 536 | while(recording) { |
533 | 537 | ||
534 | result = read(dsp, sound, 512); // 8192 | 538 | result = read(dsp, sound, 512); // 8192 |
535 | 539 | ||
536 | write(wav, sound, result); | 540 | write(wav, sound, result); |