author | llornkcor <llornkcor> | 2002-07-02 17:11:46 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-07-02 17:11:46 (UTC) |
commit | c418781fac36feb2f392e0642ed50065bb4ef99c (patch) (unidiff) | |
tree | 1a841245d0fc5e2b09231b73378e220947db9410 /core | |
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 | ||||
-rw-r--r-- | core/applets/vmemo/vmemo.h | 2 |
2 files changed, 25 insertions, 17 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 ) | |||
236 | } | 236 | } |
237 | 237 | if(toggleKey == 1) | |
238 | usingIcon=TRUE; | ||
239 | else | ||
240 | usingIcon=FALSE; | ||
238 | if( vmCfg.readNumEntry("hideIcon",0) == 1) | 241 | if( vmCfg.readNumEntry("hideIcon",0) == 1) |
@@ -269,3 +272,6 @@ void VMemo::mousePressEvent( QMouseEvent * ) | |||
269 | { | 272 | { |
273 | if(!recording) | ||
270 | startRecording(); | 274 | startRecording(); |
275 | else | ||
276 | stopRecording(); | ||
271 | } | 277 | } |
@@ -274,3 +280,4 @@ void VMemo::mouseReleaseEvent( QMouseEvent * ) | |||
274 | { | 280 | { |
275 | stopRecording(); | 281 | // if(usingIcon && !recording) |
282 | // stopRecording(); | ||
276 | } | 283 | } |
@@ -362,5 +369,4 @@ bool VMemo::startRecording() { | |||
362 | 369 | ||
363 | |||
364 | record(); | 370 | record(); |
365 | // delete msgLabel; | 371 | |
366 | return TRUE; | 372 | return TRUE; |
@@ -372,4 +378,7 @@ show(); | |||
372 | recording = FALSE; | 378 | recording = FALSE; |
373 | if(useAlerts) | 379 | if(useAlerts) { |
374 | if( msgLabel) delete msgLabel; | 380 | msgLabel->close(); |
381 | msgLabel=0; | ||
382 | delete msgLabel; | ||
383 | } | ||
375 | t_timer->stop(); | 384 | t_timer->stop(); |
@@ -482,3 +491,3 @@ void VMemo::record(void) | |||
482 | qDebug(msg); | 491 | qDebug(msg); |
483 | signed short sound[512], monoBuffer[512]; | 492 | signed short sound[1024], monoBuffer[1024]; |
484 | 493 | ||
@@ -490,3 +499,3 @@ void VMemo::record(void) | |||
490 | 499 | ||
491 | result = read(dsp, sound, 512); // 8192 | 500 | result = read(dsp, sound, 1024); // 8192 |
492 | // int j=0; | 501 | // int j=0; |
@@ -500,3 +509,2 @@ void VMemo::record(void) | |||
500 | recording=false; | 509 | recording=false; |
501 | |||
502 | // for (int i = 0; i < result; i+=2) { | 510 | // for (int i = 0; i < result; i+=2) { |
@@ -514,5 +522,5 @@ void VMemo::record(void) | |||
514 | // 8bit unsigned | 522 | // 8bit unsigned |
515 | unsigned short sound[512], monoBuffer[512]; | 523 | unsigned short sound[1024], monoBuffer[1024]; |
516 | while(recording) { | 524 | while(recording) { |
517 | result = read(dsp, sound, 512); // 8192 | 525 | result = read(dsp, sound, 1024); // 8192 |
518 | // int j=0; | 526 | // int j=0; |
@@ -546,3 +554,3 @@ void VMemo::record(void) | |||
546 | 554 | ||
547 | signed short sound[512];//, monoBuffer[512]; | 555 | signed short sound[1024];//, monoBuffer[512]; |
548 | 556 | ||
@@ -550,3 +558,3 @@ void VMemo::record(void) | |||
550 | 558 | ||
551 | result = read(dsp, sound, 512); // 8192 | 559 | result = read(dsp, sound, 1024); // 8192 |
552 | 560 | ||
@@ -554,2 +562,3 @@ void VMemo::record(void) | |||
554 | length += result; | 562 | length += result; |
563 | |||
555 | if(length<0) { | 564 | if(length<0) { |
@@ -591,3 +600,3 @@ void VMemo::record(void) | |||
591 | 600 | ||
592 | QSound::play(Resource::findSound("vmemoe")); | 601 | // QSound::play(Resource::findSound("vmemoe")); |
593 | 602 | ||
@@ -639,4 +648,3 @@ void VMemo::timerBreak() { | |||
639 | //stop | 648 | //stop |
640 | recording=false; | 649 | stopRecording(); |
641 | |||
642 | QMessageBox::message("Vmemo","Vmemo recording has \ntimed out"); | 650 | QMessageBox::message("Vmemo","Vmemo recording has \ntimed out"); |
diff --git a/core/applets/vmemo/vmemo.h b/core/applets/vmemo/vmemo.h index 51ace35..823c7b8 100644 --- a/core/applets/vmemo/vmemo.h +++ b/core/applets/vmemo/vmemo.h | |||
@@ -38,3 +38,3 @@ public: | |||
38 | QTimer *t_timer; | 38 | QTimer *t_timer; |
39 | 39 | bool usingIcon; | |
40 | public slots: | 40 | public slots: |