author | llornkcor <llornkcor> | 2002-07-26 01:14:13 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-07-26 01:14:13 (UTC) |
commit | 630a8f6e4ff5eddaee0089e383c42cc198c68ced (patch) (unidiff) | |
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 | |||
@@ -262,12 +262,14 @@ void VMemo::receive( const QCString &msg, const QByteArray &data ) { | |||
262 | QDataStream stream( data, IO_ReadOnly ); | 262 | QDataStream stream( data, IO_ReadOnly ); |
263 | |||
263 | if (msg == "toggleRecord()") { | 264 | if (msg == "toggleRecord()") { |
264 | if (recording) { | 265 | |
265 | fromToggle = TRUE; | 266 | if (recording) { |
266 | mouseReleaseEvent(NULL); | 267 | fromToggle = TRUE; |
267 | // stopRecording(); | 268 | mouseReleaseEvent(NULL); |
268 | } else { | 269 | stopRecording(); |
269 | fromToggle = TRUE; | 270 | } else { |
270 | // mousePressEvent(NULL); | 271 | fromToggle = TRUE; |
271 | startRecording(); | 272 | // mousePressEvent(NULL); |
272 | } | 273 | startRecording(); |
274 | } | ||
273 | } | 275 | } |
@@ -361,3 +363,2 @@ bool VMemo::startRecording() { | |||
361 | fileName+=fName; | 363 | fileName+=fName; |
362 | qDebug("filename is "+fileName); | ||
363 | // No spaces in the filename | 364 | // No spaces in the filename |
@@ -368,2 +369,3 @@ bool VMemo::startRecording() { | |||
368 | 369 | ||
370 | qDebug("filename is "+fileName); | ||
369 | // open tmp file here | 371 | // open tmp file here |
@@ -382,3 +384,3 @@ bool VMemo::startRecording() { | |||
382 | } | 384 | } |
383 | record(); | 385 | if( record() ) { |
384 | 386 | ||
@@ -400,4 +402,6 @@ bool VMemo::startRecording() { | |||
400 | l.writeLink(); | 402 | l.writeLink(); |
401 | |||
402 | return TRUE; | 403 | return TRUE; |
404 | } else | ||
405 | return FALSE; | ||
406 | |||
403 | } | 407 | } |
@@ -506,4 +510,5 @@ int VMemo::openWAV(const char *filename) { | |||
506 | 510 | ||
507 | void VMemo::record(void) { | 511 | bool VMemo::record() { |
508 | int length=0, result, value; | 512 | |
513 | int length=0, result, value; | ||
509 | QString msg; | 514 | QString msg; |
@@ -514,4 +519,4 @@ void VMemo::record(void) { | |||
514 | int sRate=config.readNumEntry("SizeLimit", 30); | 519 | int sRate=config.readNumEntry("SizeLimit", 30); |
515 | 520 | if(sRate > 0) | |
516 | t_timer->start( sRate * 1000+1000, TRUE); | 521 | t_timer->start( sRate * 1000+1000, TRUE); |
517 | 522 | ||
@@ -539,4 +544,5 @@ void VMemo::record(void) { | |||
539 | QMessageBox::message(tr("Note"),tr("error recording")); | 544 | QMessageBox::message(tr("Note"),tr("error recording")); |
540 | recording=FALSE;; | 545 | recording=FALSE; |
541 | break; | 546 | break; |
547 | return FALSE; | ||
542 | } | 548 | } |
@@ -560,2 +566,4 @@ void VMemo::record(void) { | |||
560 | QMessageBox::message("Vmemo"," Done1 recording\n"+ fileName); | 566 | QMessageBox::message("Vmemo"," Done1 recording\n"+ fileName); |
567 | break; | ||
568 | return FALSE; | ||
561 | } | 569 | } |
@@ -599,3 +607,3 @@ void VMemo::record(void) { | |||
599 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; //mute | 607 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; //mute |
600 | 608 | return TRUE; | |
601 | } | 609 | } |
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 | |||
@@ -40,3 +40,3 @@ bool usingIcon, useADPCM; | |||
40 | public slots: | 40 | public slots: |
41 | void record(); | 41 | bool record(); |
42 | void mousePressEvent( QMouseEvent * ); | 42 | void mousePressEvent( QMouseEvent * ); |