-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index b80b378..e747a19 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp @@ -238,3 +238,4 @@ VMemo::VMemo( QWidget *parent, const char *_name ) // if( vmCfg.readNumEntry("hideIcon",0) == 1) -// hide(); + if (!usingIcon) + hide(); recording = FALSE; @@ -377,3 +378,3 @@ bool VMemo::startRecording() { void VMemo::stopRecording() { - show(); +// show(); odebug << "Stopped recording" << oendl; @@ -487,5 +488,6 @@ bool VMemo::record() { length = 0; - int bytesWritten = 0; + int bytesWritten = 0; int result = 0; int value = 0; + QString msg; @@ -493,2 +495,3 @@ bool VMemo::record() { odebug << msg << oendl; + Config config("Vmemo"); @@ -496,7 +499,10 @@ bool VMemo::record() { int sRate = config.readNumEntry("SizeLimit", 30); - if(sRate > 0) - t_timer->start( sRate * 1000+1000, TRUE); + odebug << "VMEMO rate" << sRate << oendl; - msg.sprintf("Recording format other"); - odebug << msg << oendl; + if(sRate > 0) { + t_timer->start( sRate * 1000+1000, TRUE); + } + + msg.sprintf("Recording format other"); + odebug << msg << oendl; @@ -505,8 +511,10 @@ bool VMemo::record() { - int bufsize = config.readNumEntry("BufferSize",1024); - unsigned short sound[bufsize]; //, monoBuffer[bufsize]; + int bufsize = config.readNumEntry("BufferSize",1024); + unsigned short sound[bufsize]; //, monoBuffer[bufsize]; char abuf[bufsize / 2]; short sbuf[bufsize]; - + odebug << "ready to record"<< oendl; if(useADPCM) { + odebug << "usr ADPCM" << oendl; + while(recording) { @@ -531,4 +539,4 @@ bool VMemo::record() { } - // printf("%d\r", length); - // fflush(stdout); + printf("%d\r", length); + fflush(stdout); qApp->processEvents(); @@ -536,2 +544,3 @@ bool VMemo::record() { } else { + odebug << "use regular wav" << oendl; while(recording) { @@ -544,2 +553,3 @@ bool VMemo::record() { return FALSE; + } @@ -555,9 +565,9 @@ bool VMemo::record() { } - // printf("%d\r", length); - // fflush(stdout); +// printf("%d\r", length); +// fflush(stdout); qApp->processEvents(); } +// odebug << "result is " << result << oendl; } - } - // odebug << "file has length of " << length << " lasting " << (( length / speed) / channels) / 2 ) << " seconds" << oendl; + odebug << "file has length of " << length << " lasting " << (( length / speed) / channels) / 2 << " seconds" << oendl; |