summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/vmemo/vmemo.cpp16
-rw-r--r--core/applets/vmemo/vmemo.h4
2 files changed, 18 insertions, 2 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
@@ -27,6 +27,7 @@
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
31typedef struct _waveheader { 32typedef struct _waveheader {
32 u_long main_chunk; /* 'RIFF' */ 33 u_long main_chunk; /* 'RIFF' */
@@ -201,6 +202,9 @@ VMemo::VMemo( QWidget *parent, const char *_name )
201 setFixedWidth( 14 ); 202 setFixedWidth( 14 );
202 203
203 recording = FALSE; 204 recording = FALSE;
205
206 t_timer = new QTimer( this );
207 connect( t_timer, SIGNAL( timeout() ), SLOT( timerBreak() ) );
204 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) {
@@ -453,12 +457,14 @@ void VMemo::record(void)
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);
460 signed short sound[512], monoBuffer[512]; 466 signed short sound[512], monoBuffer[512];
461 467
462 if(format==AFMT_S16_LE) { 468 if(format==AFMT_S16_LE) {
463 469
464 470
@@ -468,7 +474,6 @@ void VMemo::record(void)
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 }
@@ -611,3 +616,10 @@ int VMemo::setToggleButton(int tog) {
611 } 616 }
612 return -1; 617 return -1;
613} 618}
619
620void VMemo::timerBreak() {
621 //stop
622 recording=false;
623
624 QMessageBox::message("Vmemo","Vmemo recording has \ntimed out");
625}
diff --git a/core/applets/vmemo/vmemo.h b/core/applets/vmemo/vmemo.h
index b33ab55..51ace35 100644
--- a/core/applets/vmemo/vmemo.h
+++ b/core/applets/vmemo/vmemo.h
@@ -24,6 +24,7 @@
24#include <qfile.h> 24#include <qfile.h>
25#include <qpe/qcopenvelope_qws.h> 25#include <qpe/qcopenvelope_qws.h>
26#include <qlabel.h> 26#include <qlabel.h>
27#include <qtimer.h>
27 28
28class VMemo : public QWidget 29class VMemo : public QWidget
29{ 30{
@@ -34,6 +35,8 @@ public:
34 QFile track; 35 QFile track;
35 QString fileName, errorMsg; 36 QString fileName, errorMsg;
36 QLabel* msgLabel; 37 QLabel* msgLabel;
38 QTimer *t_timer;
39
37public slots: 40public slots:
38 void record(); 41 void record();
39 void mousePressEvent( QMouseEvent * ); 42 void mousePressEvent( QMouseEvent * );
@@ -41,6 +44,7 @@ public slots:
41 void receive( const QCString &msg, const QByteArray &data ); 44 void receive( const QCString &msg, const QByteArray &data );
42 bool startRecording(); 45 bool startRecording();
43 void stopRecording(); 46 void stopRecording();
47 void timerBreak();
44private: 48private:
45 bool useAlerts; 49 bool useAlerts;
46 void paintEvent( QPaintEvent* ); 50 void paintEvent( QPaintEvent* );