author | llornkcor <llornkcor> | 2002-07-26 01:14:13 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-07-26 01:14:13 (UTC) |
commit | 630a8f6e4ff5eddaee0089e383c42cc198c68ced (patch) (side-by-side diff) | |
tree | 7d743e08c5964eb96f0fb5090d977fdf702c3f44 | |
parent | f3678966b4f08e9cc99b5f625c028e6f2d29a8ae (diff) | |
download | opie-630a8f6e4ff5eddaee0089e383c42cc198c68ced.zip opie-630a8f6e4ff5eddaee0089e383c42cc198c68ced.tar.gz opie-630a8f6e4ff5eddaee0089e383c42cc198c68ced.tar.bz2 |
made 2nd button release stop recording, and fixed umlimited time recording
-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 44 | ||||
-rw-r--r-- | core/applets/vmemo/vmemo.h | 2 |
2 files changed, 27 insertions, 19 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index b5239eb..035965e 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp @@ -261,14 +261,16 @@ void VMemo::receive( const QCString &msg, const QByteArray &data ) { qDebug("receive"); QDataStream stream( data, IO_ReadOnly ); + if (msg == "toggleRecord()") { - if (recording) { - fromToggle = TRUE; - mouseReleaseEvent(NULL); -// stopRecording(); - } else { - fromToggle = TRUE; - // mousePressEvent(NULL); - startRecording(); - } + + if (recording) { + fromToggle = TRUE; + mouseReleaseEvent(NULL); + stopRecording(); + } else { + fromToggle = TRUE; + // mousePressEvent(NULL); + startRecording(); + } } } @@ -360,5 +362,4 @@ bool VMemo::startRecording() { fileName+=fName; - qDebug("filename is "+fileName); // No spaces in the filename fileName.replace(QRegExp("'"),""); @@ -367,4 +368,5 @@ bool VMemo::startRecording() { fileName.replace(QRegExp(","),""); + qDebug("filename is "+fileName); // open tmp file here char *pointer; @@ -381,5 +383,5 @@ bool VMemo::startRecording() { return FALSE; } - record(); + if( record() ) { QString cmd; @@ -399,6 +401,8 @@ bool VMemo::startRecording() { l.setCategories(cats); l.writeLink(); - return TRUE; + } else + return FALSE; + } @@ -505,6 +509,7 @@ int VMemo::openWAV(const char *filename) { } -void VMemo::record(void) { - int length=0, result, value; +bool VMemo::record() { + + int length=0, result, value; QString msg; msg.sprintf("Recording format %d", format); @@ -513,6 +518,6 @@ void VMemo::record(void) { config.setGroup("Record"); int sRate=config.readNumEntry("SizeLimit", 30); - - t_timer->start( sRate * 1000+1000, TRUE); + if(sRate > 0) + t_timer->start( sRate * 1000+1000, TRUE); // if(systemZaurus) { @@ -538,6 +543,7 @@ void VMemo::record(void) { // qDebug(currentFileName); QMessageBox::message(tr("Note"),tr("error recording")); - recording=FALSE;; + recording=FALSE; break; + return FALSE; } @@ -559,4 +565,6 @@ void VMemo::record(void) { perror("dev/dsp's is a lookin' messy"); QMessageBox::message("Vmemo"," Done1 recording\n"+ fileName); + break; + return FALSE; } // printf("%d\r",length); @@ -598,5 +606,5 @@ void VMemo::record(void) { if(foo.find("TRUE",0,TRUE) != -1) QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; //mute - +return TRUE; } diff --git a/core/applets/vmemo/vmemo.h b/core/applets/vmemo/vmemo.h index 167af2a..9ee08ff 100644 --- a/core/applets/vmemo/vmemo.h +++ b/core/applets/vmemo/vmemo.h @@ -39,5 +39,5 @@ public: bool usingIcon, useADPCM; public slots: - void record(); + bool record(); void mousePressEvent( QMouseEvent * ); void mouseReleaseEvent( QMouseEvent * ); |