-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index cfa07b4..63ee0b8 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp | |||
@@ -26,8 +26,9 @@ | |||
26 | 26 | ||
27 | #include <string.h> | 27 | #include <string.h> |
28 | #include <stdlib.h> | 28 | #include <stdlib.h> |
29 | #include <errno.h> | 29 | #include <errno.h> |
30 | #include <qtimer.h> | ||
30 | 31 | ||
31 | typedef struct _waveheader { | 32 | typedef struct _waveheader { |
32 | u_long main_chunk; /* 'RIFF' */ | 33 | u_long main_chunk; /* 'RIFF' */ |
33 | u_long length; /* filelen */ | 34 | u_long length; /* filelen */ |
@@ -201,8 +202,11 @@ VMemo::VMemo( QWidget *parent, const char *_name ) | |||
201 | setFixedWidth( 14 ); | 202 | setFixedWidth( 14 ); |
202 | 203 | ||
203 | recording = FALSE; | 204 | recording = FALSE; |
204 | 205 | ||
206 | t_timer = new QTimer( this ); | ||
207 | connect( t_timer, SIGNAL( timeout() ), SLOT( timerBreak() ) ); | ||
208 | |||
205 | struct utsname name; /* check for embedix kernel running on the zaurus*/ | 209 | struct utsname name; /* check for embedix kernel running on the zaurus*/ |
206 | if (uname(&name) != -1) { | 210 | if (uname(&name) != -1) { |
207 | QString release=name.release; | 211 | QString release=name.release; |
208 | Config vmCfg("Vmemo"); | 212 | Config vmCfg("Vmemo"); |
@@ -452,8 +456,10 @@ void VMemo::record(void) | |||
452 | QString msg; | 456 | QString msg; |
453 | msg.sprintf("Recording format %d", format); | 457 | msg.sprintf("Recording format %d", format); |
454 | qDebug(msg); | 458 | qDebug(msg); |
455 | 459 | ||
460 | t_timer->start( 30 * 1000+1000, TRUE); | ||
461 | |||
456 | if(systemZaurus) { | 462 | if(systemZaurus) { |
457 | 463 | ||
458 | msg.sprintf("Recording format zaurus"); | 464 | msg.sprintf("Recording format zaurus"); |
459 | qDebug(msg); | 465 | qDebug(msg); |
@@ -467,9 +473,8 @@ void VMemo::record(void) | |||
467 | 473 | ||
468 | result = read(dsp, sound, 512); // 8192 | 474 | result = read(dsp, sound, 512); // 8192 |
469 | int j=0; | 475 | int j=0; |
470 | 476 | ||
471 | // if(systemZaurus) { | ||
472 | for (int i = 0; i < result; i++) { //since Z is mono do normally | 477 | for (int i = 0; i < result; i++) { //since Z is mono do normally |
473 | monoBuffer[i] = sound[i]; | 478 | monoBuffer[i] = sound[i]; |
474 | } | 479 | } |
475 | 480 | ||
@@ -610,4 +615,11 @@ int VMemo::setToggleButton(int tog) { | |||
610 | }; | 615 | }; |
611 | } | 616 | } |
612 | return -1; | 617 | return -1; |
613 | } | 618 | } |
619 | |||
620 | void VMemo::timerBreak() { | ||
621 | //stop | ||
622 | recording=false; | ||
623 | |||
624 | QMessageBox::message("Vmemo","Vmemo recording has \ntimed out"); | ||
625 | } | ||