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 | |
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 @@ -235,5 +235,8 @@ VMemo::VMemo( QWidget *parent, const char *_name ) e << QString("toggleRecord()"); } - + if(toggleKey == 1) + usingIcon=TRUE; + else + usingIcon=FALSE; if( vmCfg.readNumEntry("hideIcon",0) == 1) hide(); @@ -268,10 +271,14 @@ void VMemo::paintEvent( QPaintEvent* ) void VMemo::mousePressEvent( QMouseEvent * ) { + if(!recording) startRecording(); + else + stopRecording(); } void VMemo::mouseReleaseEvent( QMouseEvent * ) { - stopRecording(); +// if(usingIcon && !recording) +// stopRecording(); } @@ -361,7 +368,6 @@ bool VMemo::startRecording() { l.writeLink(); - record(); - // delete msgLabel; + return TRUE; } @@ -371,6 +377,9 @@ show(); qDebug("Stopped recording"); recording = FALSE; - if(useAlerts) - if( msgLabel) delete msgLabel; + if(useAlerts) { + msgLabel->close(); + msgLabel=0; + delete msgLabel; + } t_timer->stop(); Config cfg("Vmemo"); @@ -481,5 +490,5 @@ void VMemo::record(void) msg.sprintf("Recording format zaurus"); qDebug(msg); - signed short sound[512], monoBuffer[512]; + signed short sound[1024], monoBuffer[1024]; if(format==AFMT_S16_LE) { @@ -489,5 +498,5 @@ void VMemo::record(void) while(recording) { - result = read(dsp, sound, 512); // 8192 + result = read(dsp, sound, 1024); // 8192 // int j=0; @@ -499,5 +508,4 @@ void VMemo::record(void) if(length<0) recording=false; - // for (int i = 0; i < result; i+=2) { // monoBuffer[j] = sound[i]; @@ -513,7 +521,7 @@ void VMemo::record(void) } else { //AFMT_U8 // 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; @@ -545,12 +553,13 @@ void VMemo::record(void) qDebug(msg); - signed short sound[512];//, monoBuffer[512]; + signed short sound[1024];//, monoBuffer[512]; while(recording) { - result = read(dsp, sound, 512); // 8192 + result = read(dsp, sound, 1024); // 8192 write(wav, sound, result); length += result; + if(length<0) { @@ -590,5 +599,5 @@ void VMemo::record(void) qDebug("done recording "+fileName); - QSound::play(Resource::findSound("vmemoe")); +// QSound::play(Resource::findSound("vmemoe")); Config cfg("qpe"); @@ -638,6 +647,5 @@ int VMemo::setToggleButton(int tog) { void VMemo::timerBreak() { //stop - recording=false; - + stopRecording(); 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 @@ -37,5 +37,5 @@ public: QLabel* msgLabel; QTimer *t_timer; - +bool usingIcon; public slots: void record(); |