author | llornkcor <llornkcor> | 2002-07-02 17:11:46 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-07-02 17:11:46 (UTC) |
commit | c418781fac36feb2f392e0642ed50065bb4ef99c (patch) (side-by-side diff) | |
tree | 1a841245d0fc5e2b09231b73378e220947db9410 /core/applets/vmemo/vmemo.cpp | |
parent | 78172d2d23543992605e273770692b5a0a84ed32 (diff) | |
download | opie-c418781fac36feb2f392e0642ed50065bb4ef99c.zip opie-c418781fac36feb2f392e0642ed50065bb4ef99c.tar.gz opie-c418781fac36feb2f392e0642ed50065bb4ef99c.tar.bz2 |
changed default icon action from hold to tap to record
-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index cb3e45e..2c3edf1 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp @@ -236,3 +236,6 @@ VMemo::VMemo( QWidget *parent, const char *_name ) } - + if(toggleKey == 1) + usingIcon=TRUE; + else + usingIcon=FALSE; if( vmCfg.readNumEntry("hideIcon",0) == 1) @@ -269,3 +272,6 @@ void VMemo::mousePressEvent( QMouseEvent * ) { + if(!recording) startRecording(); + else + stopRecording(); } @@ -274,3 +280,4 @@ void VMemo::mouseReleaseEvent( QMouseEvent * ) { - stopRecording(); +// if(usingIcon && !recording) +// stopRecording(); } @@ -362,5 +369,4 @@ bool VMemo::startRecording() { - record(); - // delete msgLabel; + return TRUE; @@ -372,4 +378,7 @@ show(); recording = FALSE; - if(useAlerts) - if( msgLabel) delete msgLabel; + if(useAlerts) { + msgLabel->close(); + msgLabel=0; + delete msgLabel; + } t_timer->stop(); @@ -482,3 +491,3 @@ void VMemo::record(void) qDebug(msg); - signed short sound[512], monoBuffer[512]; + signed short sound[1024], monoBuffer[1024]; @@ -490,3 +499,3 @@ void VMemo::record(void) - result = read(dsp, sound, 512); // 8192 + result = read(dsp, sound, 1024); // 8192 // int j=0; @@ -500,3 +509,2 @@ void VMemo::record(void) recording=false; - // for (int i = 0; i < result; i+=2) { @@ -514,5 +522,5 @@ void VMemo::record(void) // 8bit unsigned - unsigned short sound[512], monoBuffer[512]; + unsigned short sound[1024], monoBuffer[1024]; while(recording) { - result = read(dsp, sound, 512); // 8192 + result = read(dsp, sound, 1024); // 8192 // int j=0; @@ -546,3 +554,3 @@ void VMemo::record(void) - signed short sound[512];//, monoBuffer[512]; + signed short sound[1024];//, monoBuffer[512]; @@ -550,3 +558,3 @@ void VMemo::record(void) - result = read(dsp, sound, 512); // 8192 + result = read(dsp, sound, 1024); // 8192 @@ -554,2 +562,3 @@ void VMemo::record(void) length += result; + if(length<0) { @@ -591,3 +600,3 @@ void VMemo::record(void) - QSound::play(Resource::findSound("vmemoe")); +// QSound::play(Resource::findSound("vmemoe")); @@ -639,4 +648,3 @@ void VMemo::timerBreak() { //stop - recording=false; - + stopRecording(); QMessageBox::message("Vmemo","Vmemo recording has \ntimed out"); |