summaryrefslogtreecommitdiff
path: root/core/applets/vmemo/vmemo.cpp
Unidiff
Diffstat (limited to 'core/applets/vmemo/vmemo.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/applets/vmemo/vmemo.cpp24
1 files changed, 16 insertions, 8 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,9 +261,11 @@ void VMemo::receive( const QCString &msg, const QByteArray &data ) {
261 qDebug("receive"); 261 qDebug("receive");
262 QDataStream stream( data, IO_ReadOnly ); 262 QDataStream stream( data, IO_ReadOnly );
263
263 if (msg == "toggleRecord()") { 264 if (msg == "toggleRecord()") {
265
264 if (recording) { 266 if (recording) {
265 fromToggle = TRUE; 267 fromToggle = TRUE;
266 mouseReleaseEvent(NULL); 268 mouseReleaseEvent(NULL);
267// stopRecording(); 269 stopRecording();
268 } else { 270 } else {
269 fromToggle = TRUE; 271 fromToggle = TRUE;
@@ -360,5 +362,4 @@ bool VMemo::startRecording() {
360 362
361 fileName+=fName; 363 fileName+=fName;
362 qDebug("filename is "+fileName);
363 // No spaces in the filename 364 // No spaces in the filename
364 fileName.replace(QRegExp("'"),""); 365 fileName.replace(QRegExp("'"),"");
@@ -367,4 +368,5 @@ bool VMemo::startRecording() {
367 fileName.replace(QRegExp(","),""); 368 fileName.replace(QRegExp(","),"");
368 369
370 qDebug("filename is "+fileName);
369// open tmp file here 371// open tmp file here
370 char *pointer; 372 char *pointer;
@@ -381,5 +383,5 @@ bool VMemo::startRecording() {
381 return FALSE; 383 return FALSE;
382 } 384 }
383 record(); 385 if( record() ) {
384 386
385 QString cmd; 387 QString cmd;
@@ -399,6 +401,8 @@ bool VMemo::startRecording() {
399 l.setCategories(cats); 401 l.setCategories(cats);
400 l.writeLink(); 402 l.writeLink();
401
402 return TRUE; 403 return TRUE;
404 } else
405 return FALSE;
406
403} 407}
404 408
@@ -505,5 +509,6 @@ int VMemo::openWAV(const char *filename) {
505} 509}
506 510
507void VMemo::record(void) { 511bool VMemo::record() {
512
508 int length=0, result, value; 513 int length=0, result, value;
509 QString msg; 514 QString msg;
@@ -513,5 +518,5 @@ void VMemo::record(void) {
513 config.setGroup("Record"); 518 config.setGroup("Record");
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
@@ -538,6 +543,7 @@ void VMemo::record(void) {
538// qDebug(currentFileName); 543// qDebug(currentFileName);
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 }
543 549
@@ -559,4 +565,6 @@ void VMemo::record(void) {
559 perror("dev/dsp's is a lookin' messy"); 565 perror("dev/dsp's is a lookin' messy");
560 QMessageBox::message("Vmemo"," Done1 recording\n"+ fileName); 566 QMessageBox::message("Vmemo"," Done1 recording\n"+ fileName);
567 break;
568 return FALSE;
561 } 569 }
562 // printf("%d\r",length); 570 // printf("%d\r",length);
@@ -598,5 +606,5 @@ void VMemo::record(void) {
598 if(foo.find("TRUE",0,TRUE) != -1) 606 if(foo.find("TRUE",0,TRUE) != -1)
599 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; //mute 607 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; //mute
600 608return TRUE;
601} 609}
602 610