summaryrefslogtreecommitdiff
path: root/core/applets/vmemo/vmemo.cpp
Side-by-side diff
Diffstat (limited to 'core/applets/vmemo/vmemo.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/applets/vmemo/vmemo.cpp14
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 @@
#include <string.h>
#include <stdlib.h>
#include <errno.h>
+#include <qtimer.h>
typedef struct _waveheader {
u_long main_chunk; /* 'RIFF' */
u_long length; /* filelen */
@@ -201,8 +202,11 @@ 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) {
QString release=name.release;
Config vmCfg("Vmemo");
@@ -452,8 +456,10 @@ void VMemo::record(void)
QString msg;
msg.sprintf("Recording format %d", format);
qDebug(msg);
+ t_timer->start( 30 * 1000+1000, TRUE);
+
if(systemZaurus) {
msg.sprintf("Recording format zaurus");
qDebug(msg);
@@ -467,9 +473,8 @@ 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];
}
@@ -610,4 +615,11 @@ int VMemo::setToggleButton(int tog) {
};
}
return -1;
}
+
+void VMemo::timerBreak() {
+ //stop
+ recording=false;
+
+ QMessageBox::message("Vmemo","Vmemo recording has \ntimed out");
+}