-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 36 |
1 files changed, 3 insertions, 33 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index c5d0a5b..4c07b3a 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp | |||
@@ -212,6 +212,4 @@ VMemo::VMemo( QWidget *parent, const char *_name ) | |||
212 | setFixedWidth( 14 ); | 212 | setFixedWidth( 14 ); |
213 | 213 | ||
214 | recording = FALSE; | ||
215 | |||
216 | t_timer = new QTimer( this ); | 214 | t_timer = new QTimer( this ); |
217 | connect( t_timer, SIGNAL( timeout() ), SLOT( timerBreak() ) ); | 215 | connect( t_timer, SIGNAL( timeout() ), SLOT( timerBreak() ) ); |
@@ -238,5 +236,4 @@ VMemo::VMemo( QWidget *parent, const char *_name ) | |||
238 | 236 | ||
239 | if( toggleKey != -1 ) { | 237 | if( toggleKey != -1 ) { |
240 | // QPEApplication::grabKeyboard(); | ||
241 | QCopEnvelope e("QPE/Desktop", "keyRegister(int key, QString channel, QString message)"); | 238 | QCopEnvelope e("QPE/Desktop", "keyRegister(int key, QString channel, QString message)"); |
242 | // e << 4096; // Key_Escape | 239 | // e << 4096; // Key_Escape |
@@ -252,4 +249,5 @@ VMemo::VMemo( QWidget *parent, const char *_name ) | |||
252 | if( vmCfg.readNumEntry("hideIcon",0) == 1) | 249 | if( vmCfg.readNumEntry("hideIcon",0) == 1) |
253 | hide(); | 250 | hide(); |
251 | recording = FALSE; | ||
254 | } | 252 | } |
255 | } | 253 | } |
@@ -263,12 +261,9 @@ void VMemo::receive( const QCString &msg, const QByteArray &data ) { | |||
263 | 261 | ||
264 | if (msg == "toggleRecord()") { | 262 | if (msg == "toggleRecord()") { |
265 | |||
266 | if (recording) { | 263 | if (recording) { |
267 | fromToggle = TRUE; | 264 | fromToggle = TRUE; |
268 | mouseReleaseEvent(NULL); | ||
269 | stopRecording(); | 265 | stopRecording(); |
270 | } else { | 266 | } else { |
271 | fromToggle = TRUE; | 267 | fromToggle = TRUE; |
272 | // mousePressEvent(NULL); | ||
273 | startRecording(); | 268 | startRecording(); |
274 | } | 269 | } |
@@ -282,14 +277,8 @@ void VMemo::paintEvent( QPaintEvent* ) { | |||
282 | 277 | ||
283 | void VMemo::mousePressEvent( QMouseEvent * me) { | 278 | void VMemo::mousePressEvent( QMouseEvent * me) { |
284 | // just to be safe | ||
285 | // if (recording) { | ||
286 | // recording = FALSE; | ||
287 | // return; | ||
288 | // } | ||
289 | /* No mousePress/mouseRelease recording on the iPAQ. The REC button on the iPAQ calls these functions | 279 | /* No mousePress/mouseRelease recording on the iPAQ. The REC button on the iPAQ calls these functions |
290 | mousePressEvent and mouseReleaseEvent with a NULL parameter. */ | 280 | mousePressEvent and mouseReleaseEvent with a NULL parameter. */ |
291 | // if ( me->button() != LeftButton && me != NULL /*&& !systemZaurus*/) { | ||
292 | 281 | ||
293 | // if (!systemZaurus && me != NULL) | 282 | // if (!systemZaurus && me != NULL) |
294 | // return; | 283 | // return; |
295 | // } | 284 | // } |
@@ -302,13 +291,7 @@ void VMemo::mousePressEvent( QMouseEvent * me) { | |||
302 | 291 | ||
303 | void VMemo::mouseReleaseEvent( QMouseEvent * ) { | 292 | void VMemo::mouseReleaseEvent( QMouseEvent * ) { |
304 | // if(usingIcon && !recording) | ||
305 | // stopRecording(); | ||
306 | } | 293 | } |
307 | 294 | ||
308 | bool VMemo::startRecording() { | 295 | bool VMemo::startRecording() { |
309 | |||
310 | if ( recording) | ||
311 | return FALSE; | ||
312 | |||
313 | Config config( "Vmemo" ); | 296 | Config config( "Vmemo" ); |
314 | config.setGroup( "System" ); | 297 | config.setGroup( "System" ); |
@@ -322,17 +305,8 @@ bool VMemo::startRecording() { | |||
322 | } | 305 | } |
323 | 306 | ||
324 | // if(useAlerts) | ||
325 | // QMessageBox::message("VMemo","Really Record?");//) ==1) | ||
326 | // return; | ||
327 | // } else { | ||
328 | // if (!systemZaurus ) | ||
329 | // QSound::play(Resource::findSound("vmemob")); | ||
330 | // } | ||
331 | qDebug("Start recording engines"); | 307 | qDebug("Start recording engines"); |
332 | recording = TRUE; | 308 | recording = TRUE; |
333 | 309 | ||
334 | if (openDSP() == -1) { | 310 | if (openDSP() == -1) { |
335 | // QMessageBox::critical(0, "vmemo", "Could not open dsp device.\n"+errorMsg, "Abort"); | ||
336 | // delete msgLabel; | ||
337 | recording = FALSE; | 311 | recording = FALSE; |
338 | msgLabel=0; | 312 | msgLabel=0; |
@@ -577,5 +551,5 @@ bool VMemo::record() { | |||
577 | recording=false; | 551 | recording=false; |
578 | perror("dev/dsp's is a lookin' messy"); | 552 | perror("dev/dsp's is a lookin' messy"); |
579 | QMessageBox::message("Vmemo"," Done1 recording\n"+ fileName); | 553 | QMessageBox::message("Vmemo","Error writing to file\n"+ fileName); |
580 | break; | 554 | break; |
581 | return FALSE; | 555 | return FALSE; |
@@ -607,10 +581,6 @@ bool VMemo::record() { | |||
607 | ::close(dsp); | 581 | ::close(dsp); |
608 | 582 | ||
609 | // if(useAlerts) | ||
610 | // QMessageBox::message("Vmemo"," Done1 recording\n"+ fileName); | ||
611 | qDebug("done recording "+fileName); | 583 | qDebug("done recording "+fileName); |
612 | 584 | ||
613 | // QSound::play(Resource::findSound("vmemoe")); | ||
614 | |||
615 | Config cfg("qpe"); | 585 | Config cfg("qpe"); |
616 | cfg.setGroup("Volume"); | 586 | cfg.setGroup("Volume"); |