From 7c22b9cbf92650c432a84537f4b9c3d810e7dc75 Mon Sep 17 00:00:00 2001 From: llornkcor Date: Sun, 23 Jun 2002 17:17:08 +0000 Subject: quick fix for ongoing recording --- (limited to 'core') 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 @@ #include #include #include +#include typedef struct _waveheader { u_long main_chunk; /* 'RIFF' */ @@ -201,6 +202,9 @@ VMemo::VMemo( QWidget *parent, const char *_name ) setFixedWidth( 14 ); recording = FALSE; + + t_timer = new QTimer( this ); + connect( t_timer, SIGNAL( timeout() ), SLOT( timerBreak() ) ); struct utsname name; /* check for embedix kernel running on the zaurus*/ if (uname(&name) != -1) { @@ -453,12 +457,14 @@ void VMemo::record(void) msg.sprintf("Recording format %d", format); qDebug(msg); + t_timer->start( 30 * 1000+1000, TRUE); + if(systemZaurus) { msg.sprintf("Recording format zaurus"); qDebug(msg); signed short sound[512], monoBuffer[512]; - + if(format==AFMT_S16_LE) { @@ -468,7 +474,6 @@ void VMemo::record(void) result = read(dsp, sound, 512); // 8192 int j=0; - // if(systemZaurus) { for (int i = 0; i < result; i++) { //since Z is mono do normally monoBuffer[i] = sound[i]; } @@ -611,3 +616,10 @@ int VMemo::setToggleButton(int tog) { } return -1; } + +void VMemo::timerBreak() { + //stop + recording=false; + + QMessageBox::message("Vmemo","Vmemo recording has \ntimed out"); +} 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 @@ #include #include #include +#include class VMemo : public QWidget { @@ -34,6 +35,8 @@ public: QFile track; QString fileName, errorMsg; QLabel* msgLabel; + QTimer *t_timer; + public slots: void record(); void mousePressEvent( QMouseEvent * ); @@ -41,6 +44,7 @@ public slots: void receive( const QCString &msg, const QByteArray &data ); bool startRecording(); void stopRecording(); + void timerBreak(); private: bool useAlerts; void paintEvent( QPaintEvent* ); -- cgit v0.9.0.2