author | llornkcor <llornkcor> | 2002-07-29 12:30:16 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-07-29 12:30:16 (UTC) |
commit | a7064f7b9a6515cc1e26823a2f969d90feb855a2 (patch) (unidiff) | |
tree | dc3809cff5a147edb1186de689ae9184a99a4209 | |
parent | 0868e96b1737d121733c898ae92348a279e5b53f (diff) | |
download | opie-a7064f7b9a6515cc1e26823a2f969d90feb855a2.zip opie-a7064f7b9a6515cc1e26823a2f969d90feb855a2.tar.gz opie-a7064f7b9a6515cc1e26823a2f969d90feb855a2.tar.bz2 |
fix
-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index 577db75..4b398ad 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp | |||
@@ -366,7 +366,7 @@ bool VMemo::startRecording() { | |||
366 | fileName.replace(QRegExp(" "),"_"); | 366 | fileName.replace(QRegExp(" "),"_"); |
367 | fileName.replace(QRegExp(":"),"."); | 367 | fileName.replace(QRegExp(":"),"."); |
368 | fileName.replace(QRegExp(","),""); | 368 | fileName.replace(QRegExp(","),""); |
369 | fileName += ".wav"; | 369 | |
370 | 370 | ||
371 | qDebug("filename is "+fileName); | 371 | qDebug("filename is "+fileName); |
372 | // open tmp file here | 372 | // open tmp file here |
@@ -386,8 +386,12 @@ bool VMemo::startRecording() { | |||
386 | if( record() ) { | 386 | if( record() ) { |
387 | 387 | ||
388 | QString cmd; | 388 | QString cmd; |
389 | if( fileName.find(".wav",0,TRUE) == -1) | ||
390 | fileName += ".wav"; | ||
391 | |||
389 | cmd.sprintf("mv %s "+fileName, pointer); | 392 | cmd.sprintf("mv %s "+fileName, pointer); |
390 | // move tmp file to regular file here | 393 | // move tmp file to regular file here |
394 | |||
391 | system(cmd.latin1()); | 395 | system(cmd.latin1()); |
392 | 396 | ||
393 | QArray<int> cats(1); | 397 | QArray<int> cats(1); |
@@ -483,6 +487,8 @@ int VMemo::openWAV(const char *filename) { | |||
483 | } | 487 | } |
484 | 488 | ||
485 | wav=track.handle(); | 489 | wav=track.handle(); |
490 | Config vmCfg("Vmemo"); | ||
491 | vmCfg.setGroup("Defaults"); | ||
486 | useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0); | 492 | useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0); |
487 | 493 | ||
488 | WaveHeader wh; | 494 | WaveHeader wh; |
@@ -533,6 +539,8 @@ bool VMemo::record() { | |||
533 | signed short sound[1024], monoBuffer[1024]; | 539 | signed short sound[1024], monoBuffer[1024]; |
534 | char abuf[bufsize/2]; | 540 | char abuf[bufsize/2]; |
535 | short sbuf[bufsize]; | 541 | short sbuf[bufsize]; |
542 | Config vmCfg("Vmemo"); | ||
543 | vmCfg.setGroup("Defaults"); | ||
536 | useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0); | 544 | useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0); |
537 | 545 | ||
538 | while(recording) { | 546 | while(recording) { |
@@ -595,7 +603,7 @@ bool VMemo::record() { | |||
595 | perror("ioctl(\"SNDCTL_DSP_RESET\")"); | 603 | perror("ioctl(\"SNDCTL_DSP_RESET\")"); |
596 | 604 | ||
597 | ::close(dsp); | 605 | ::close(dsp); |
598 | fileName = fileName.left(fileName.length()-4); | 606 | |
599 | // if(useAlerts) | 607 | // if(useAlerts) |
600 | // QMessageBox::message("Vmemo"," Done1 recording\n"+ fileName); | 608 | // QMessageBox::message("Vmemo"," Done1 recording\n"+ fileName); |
601 | qDebug("done recording "+fileName); | 609 | qDebug("done recording "+fileName); |