author | llornkcor <llornkcor> | 2002-06-23 13:46:45 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-06-23 13:46:45 (UTC) |
commit | 6563867791664113808d1b287510ca52b5f840e0 (patch) (unidiff) | |
tree | 643d1a90c0df95095b721b2f4c50af6627eec1a1 | |
parent | f9c5bf03ae5a89ef5cda69e37cc2732f4e4f2808 (diff) | |
download | opie-6563867791664113808d1b287510ca52b5f840e0.zip opie-6563867791664113808d1b287510ca52b5f840e0.tar.gz opie-6563867791664113808d1b287510ca52b5f840e0.tar.bz2 |
automute and unmute
-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 58 |
1 files changed, 35 insertions, 23 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index 10a947e..b29ee62 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp | |||
@@ -410,4 +410,6 @@ int VMemo::openDSP() | |||
410 | } | 410 | } |
411 | 411 | ||
412 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE; //mute | ||
413 | |||
412 | return 1; | 414 | return 1; |
413 | } | 415 | } |
@@ -460,4 +462,6 @@ void VMemo::record(void) | |||
460 | if(format==AFMT_S16_LE) { | 462 | if(format==AFMT_S16_LE) { |
461 | 463 | ||
464 | |||
465 | |||
462 | while(recording) { | 466 | while(recording) { |
463 | 467 | ||
@@ -465,5 +469,5 @@ void VMemo::record(void) | |||
465 | int j=0; | 469 | int j=0; |
466 | 470 | ||
467 | if(systemZaurus) { | 471 | // if(systemZaurus) { |
468 | for (int i = 0; i < result; i++) { //since Z is mono do normally | 472 | for (int i = 0; i < result; i++) { //since Z is mono do normally |
469 | monoBuffer[i] = sound[i]; | 473 | monoBuffer[i] = sound[i]; |
@@ -474,19 +478,19 @@ void VMemo::record(void) | |||
474 | recording=false; | 478 | recording=false; |
475 | 479 | ||
476 | } else { //ipaq /stereo inputs | 480 | // } else { //ipaq /stereo inputs |
477 | 481 | ||
478 | 482 | ||
479 | for (int i = 0; i < result; i+=2) { | 483 | // for (int i = 0; i < result; i+=2) { |
480 | monoBuffer[j] = sound[i]; | 484 | // monoBuffer[j] = sound[i]; |
481 | // monoBuffer[j] = (sound[i]+sound[i+1])/2; | 485 | // // monoBuffer[j] = (sound[i]+sound[i+1])/2; |
482 | 486 | ||
483 | j++; | 487 | // j++; |
484 | } | 488 | // } |
485 | 489 | ||
486 | length+=write(wav, monoBuffer, result); | 490 | // length+=write(wav, monoBuffer, result); |
487 | if(length<0) | 491 | // if(length<0) |
488 | recording=false; | 492 | // recording=false; |
489 | // length+=write(wav, monoBuffer, result/2); | 493 | // // length+=write(wav, monoBuffer, result/2); |
490 | } | 494 | // } |
491 | qApp->processEvents(); | 495 | qApp->processEvents(); |
492 | // printf("%d\r",length); | 496 | // printf("%d\r",length); |
@@ -501,5 +505,5 @@ void VMemo::record(void) | |||
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 |
@@ -509,17 +513,17 @@ void VMemo::record(void) | |||
509 | length+=write(wav, monoBuffer, result); | 513 | length+=write(wav, monoBuffer, result); |
510 | 514 | ||
511 | } else { //ipaq /stereo inputs | 515 | // } else { //ipaq /stereo inputs |
512 | 516 | ||
513 | for (int i = 0; i < result; i+=2) { | 517 | // for (int i = 0; i < result; i+=2) { |
514 | monoBuffer[j] = (sound[i]+sound[i+1])/2; | 518 | // monoBuffer[j] = (sound[i]+sound[i+1])/2; |
515 | j++; | 519 | // j++; |
516 | } | 520 | // } |
517 | 521 | ||
518 | length+=write(wav, monoBuffer, result/2); | 522 | // length+=write(wav, monoBuffer, result/2); |
519 | 523 | ||
520 | if(length<0) | 524 | // if(length<0) |
521 | recording=false; | 525 | // recording=false; |
522 | 526 | ||
523 | } | 527 | // } |
524 | length += result; | 528 | length += result; |
525 | // printf("%d\r",length); | 529 | // printf("%d\r",length); |
@@ -530,5 +534,6 @@ void VMemo::record(void) | |||
530 | } | 534 | } |
531 | 535 | ||
532 | } else { // this is specific for ipaqs that do not have 8 bit capabilities | 536 | } else { // 16 bit only capabilities |
537 | |||
533 | 538 | ||
534 | msg.sprintf("Recording format other"); | 539 | msg.sprintf("Recording format other"); |
@@ -580,4 +585,11 @@ void VMemo::record(void) | |||
580 | qDebug("done recording "+fileName); | 585 | qDebug("done recording "+fileName); |
581 | QSound::play(Resource::findSound("vmemoe")); | 586 | QSound::play(Resource::findSound("vmemoe")); |
587 | |||
588 | Config cfg("qpe"); | ||
589 | cfg.setGroup("Volume"); | ||
590 | QString foo = cfg.readEntry("Mute","TRUE"); | ||
591 | if(foo.find("TRUE",0,TRUE) != -1) | ||
592 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; //mute | ||
593 | |||
582 | } | 594 | } |
583 | 595 | ||