author | mickeyl <mickeyl> | 2004-04-05 12:48:49 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-05 12:48:49 (UTC) |
commit | f1708be741dfb73ceaffb633b44093f2cb2b3d57 (patch) (unidiff) | |
tree | 0bdcab2ac6c5f0e5cac67eb58807a50bb79d82e0 /core/applets/vmemo/vmemo.cpp | |
parent | 0b481957a2eebf28b05d9803780d05ad4232aa00 (diff) | |
download | opie-f1708be741dfb73ceaffb633b44093f2cb2b3d57.zip opie-f1708be741dfb73ceaffb633b44093f2cb2b3d57.tar.gz opie-f1708be741dfb73ceaffb633b44093f2cb2b3d57.tar.bz2 |
convert core/applets/* to Opie debug framework
-rw-r--r-- | core/applets/vmemo/vmemo.cpp | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index 7dd5b4b..622b1df 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp | |||
@@ -3,24 +3,28 @@ | |||
3 | ** This file may be distributed and/or modified under the terms of the | 3 | ** This file may be distributed and/or modified under the terms of the |
4 | ** GNU General Public License version 2 as published by the Free Software | 4 | ** GNU General Public License version 2 as published by the Free Software |
5 | ** Foundation and appearing in the file LICENSE.GPL included in the | 5 | ** Foundation and appearing in the file LICENSE.GPL included in the |
6 | ** packaging of this file. | 6 | ** packaging of this file. |
7 | ** | 7 | ** |
8 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 8 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
9 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 9 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
10 | ** | 10 | ** |
11 | ************************************************************************************/ | 11 | ************************************************************************************/ |
12 | // copyright 2002 Jeremy Cowgar <jc@cowgar.com> | 12 | // copyright 2002 Jeremy Cowgar <jc@cowgar.com> |
13 | // copyright 2002 and 2003 L.J.Potter <ljp@llornkcor.com> | 13 | // copyright 2002 and 2003 L.J.Potter <ljp@llornkcor.com> |
14 | 14 | ||
15 | /* OPIE */ | ||
16 | #include <opie2/odebug.h> | ||
17 | using namespace Opie::Core; | ||
18 | |||
15 | extern "C" { | 19 | extern "C" { |
16 | #include "adpcm.h" | 20 | #include "adpcm.h" |
17 | } | 21 | } |
18 | 22 | ||
19 | #include <unistd.h> | 23 | #include <unistd.h> |
20 | #include <stdio.h> | 24 | #include <stdio.h> |
21 | #include <fcntl.h> | 25 | #include <fcntl.h> |
22 | #include <sys/ioctl.h> | 26 | #include <sys/ioctl.h> |
23 | #include <linux/soundcard.h> | 27 | #include <linux/soundcard.h> |
24 | 28 | ||
25 | #include <errno.h> | 29 | #include <errno.h> |
26 | 30 | ||
@@ -198,25 +202,25 @@ VMemo::VMemo( QWidget *parent, const char *_name ) | |||
198 | : QWidget( parent, _name ) { | 202 | : QWidget( parent, _name ) { |
199 | setFixedHeight( 18 ); | 203 | setFixedHeight( 18 ); |
200 | setFixedWidth( 14 ); | 204 | setFixedWidth( 14 ); |
201 | 205 | ||
202 | t_timer = new QTimer( this ); | 206 | t_timer = new QTimer( this ); |
203 | connect( t_timer, SIGNAL( timeout() ), SLOT( timerBreak() ) ); | 207 | connect( t_timer, SIGNAL( timeout() ), SLOT( timerBreak() ) ); |
204 | 208 | ||
205 | Config vmCfg("Vmemo"); | 209 | Config vmCfg("Vmemo"); |
206 | vmCfg.setGroup("Defaults"); | 210 | vmCfg.setGroup("Defaults"); |
207 | int toggleKey = setToggleButton(vmCfg.readNumEntry("toggleKey", -1)); | 211 | int toggleKey = setToggleButton(vmCfg.readNumEntry("toggleKey", -1)); |
208 | useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0); | 212 | useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0); |
209 | 213 | ||
210 | qDebug("toggleKey %d", toggleKey); | 214 | odebug << "toggleKey " << toggleKey << "" << oendl; |
211 | if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" )) | 215 | if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" )) |
212 | systemZaurus=TRUE; | 216 | systemZaurus=TRUE; |
213 | else | 217 | else |
214 | systemZaurus=FALSE; | 218 | systemZaurus=FALSE; |
215 | 219 | ||
216 | myChannel = new QCopChannel( "QPE/VMemo", this ); | 220 | myChannel = new QCopChannel( "QPE/VMemo", this ); |
217 | connect( myChannel, SIGNAL(received(const QCString&,const QByteArray&)), | 221 | connect( myChannel, SIGNAL(received(const QCString&,const QByteArray&)), |
218 | this, SLOT(receive(const QCString&,const QByteArray&)) ); | 222 | this, SLOT(receive(const QCString&,const QByteArray&)) ); |
219 | 223 | ||
220 | if( toggleKey != -1 ) { | 224 | if( toggleKey != -1 ) { |
221 | // keyRegister(key, channel, message) | 225 | // keyRegister(key, channel, message) |
222 | QCopEnvelope e("QPE/Launcher", "keyRegister(int,QCString,QCString)"); | 226 | QCopEnvelope e("QPE/Launcher", "keyRegister(int,QCString,QCString)"); |
@@ -236,25 +240,25 @@ VMemo::VMemo( QWidget *parent, const char *_name ) | |||
236 | // } | 240 | // } |
237 | } | 241 | } |
238 | 242 | ||
239 | VMemo::~VMemo() { | 243 | VMemo::~VMemo() { |
240 | } | 244 | } |
241 | 245 | ||
242 | int VMemo::position() | 246 | int VMemo::position() |
243 | { | 247 | { |
244 | return 6; | 248 | return 6; |
245 | } | 249 | } |
246 | 250 | ||
247 | void VMemo::receive( const QCString &msg, const QByteArray &data ) { | 251 | void VMemo::receive( const QCString &msg, const QByteArray &data ) { |
248 | qDebug("receive"); | 252 | odebug << "receive" << oendl; |
249 | QDataStream stream( data, IO_ReadOnly ); | 253 | QDataStream stream( data, IO_ReadOnly ); |
250 | 254 | ||
251 | if (msg == "toggleRecord()") { | 255 | if (msg == "toggleRecord()") { |
252 | if (recording) { | 256 | if (recording) { |
253 | fromToggle = TRUE; | 257 | fromToggle = TRUE; |
254 | stopRecording(); | 258 | stopRecording(); |
255 | } else { | 259 | } else { |
256 | fromToggle = TRUE; | 260 | fromToggle = TRUE; |
257 | startRecording(); | 261 | startRecording(); |
258 | } | 262 | } |
259 | } | 263 | } |
260 | } | 264 | } |
@@ -284,63 +288,63 @@ void VMemo::mouseReleaseEvent( QMouseEvent * ) { | |||
284 | bool VMemo::startRecording() { | 288 | bool VMemo::startRecording() { |
285 | Config config( "Vmemo" ); | 289 | Config config( "Vmemo" ); |
286 | config.setGroup( "System" ); | 290 | config.setGroup( "System" ); |
287 | 291 | ||
288 | useAlerts = config.readBoolEntry("Alert",1); | 292 | useAlerts = config.readBoolEntry("Alert",1); |
289 | if(useAlerts) { | 293 | if(useAlerts) { |
290 | 294 | ||
291 | msgLabel = new QLabel( 0, "alertLabel" ); | 295 | msgLabel = new QLabel( 0, "alertLabel" ); |
292 | msgLabel->setText("<B><P><font size=+2>VMemo-Recording</font></B>"); | 296 | msgLabel->setText("<B><P><font size=+2>VMemo-Recording</font></B>"); |
293 | msgLabel->show(); | 297 | msgLabel->show(); |
294 | } | 298 | } |
295 | 299 | ||
296 | qDebug("Start recording engines"); | 300 | odebug << "Start recording engines" << oendl; |
297 | recording = TRUE; | 301 | recording = TRUE; |
298 | 302 | ||
299 | if (openDSP() == -1) { | 303 | if (openDSP() == -1) { |
300 | recording = FALSE; | 304 | recording = FALSE; |
301 | return FALSE; | 305 | return FALSE; |
302 | } | 306 | } |
303 | 307 | ||
304 | config.setGroup("Defaults"); | 308 | config.setGroup("Defaults"); |
305 | 309 | ||
306 | date = TimeString::dateString( QDateTime::currentDateTime(),false,true); | 310 | date = TimeString::dateString( QDateTime::currentDateTime(),false,true); |
307 | date.replace(QRegExp("'"),""); | 311 | date.replace(QRegExp("'"),""); |
308 | date.replace(QRegExp(" "),"_"); | 312 | date.replace(QRegExp(" "),"_"); |
309 | date.replace(QRegExp(":"),"."); | 313 | date.replace(QRegExp(":"),"."); |
310 | date.replace(QRegExp(","),""); | 314 | date.replace(QRegExp(","),""); |
311 | 315 | ||
312 | QString fName; | 316 | QString fName; |
313 | config.setGroup( "System" ); | 317 | config.setGroup( "System" ); |
314 | fName = QPEApplication::documentDir() ; | 318 | fName = QPEApplication::documentDir() ; |
315 | fileName = config.readEntry("RecLocation", fName); | 319 | fileName = config.readEntry("RecLocation", fName); |
316 | 320 | ||
317 | int s; | 321 | int s; |
318 | s=fileName.find(':'); | 322 | s=fileName.find(':'); |
319 | if(s) | 323 | if(s) |
320 | fileName=fileName.right(fileName.length()-s-2); | 324 | fileName=fileName.right(fileName.length()-s-2); |
321 | qDebug("pathname will be "+fileName); | 325 | odebug << "pathname will be "+fileName << oendl; |
322 | 326 | ||
323 | if( fileName.left(1).find('/') == -1) | 327 | if( fileName.left(1).find('/') == -1) |
324 | fileName="/"+fileName; | 328 | fileName="/"+fileName; |
325 | if( fileName.right(1).find('/') == -1) | 329 | if( fileName.right(1).find('/') == -1) |
326 | fileName+="/"; | 330 | fileName+="/"; |
327 | fName = "vm_"+ date+ ".wav"; | 331 | fName = "vm_"+ date+ ".wav"; |
328 | 332 | ||
329 | fileName+=fName; | 333 | fileName+=fName; |
330 | qDebug("filename is "+fileName); | 334 | odebug << "filename is "+fileName << oendl; |
331 | // open tmp file here | 335 | // open tmp file here |
332 | char *pointer; | 336 | char *pointer; |
333 | pointer=tmpnam(NULL); | 337 | pointer=tmpnam(NULL); |
334 | qDebug("Opening tmp file %s",pointer); | 338 | odebug << "Opening tmp file " << pointer << "" << oendl; |
335 | 339 | ||
336 | if(openWAV(pointer ) == -1) { | 340 | if(openWAV(pointer ) == -1) { |
337 | 341 | ||
338 | QString err("Could not open the temp file\n"); | 342 | QString err("Could not open the temp file\n"); |
339 | err += fileName; | 343 | err += fileName; |
340 | QMessageBox::critical(0, "vmemo", err, "Abort"); | 344 | QMessageBox::critical(0, "vmemo", err, "Abort"); |
341 | ::close(dsp); | 345 | ::close(dsp); |
342 | return FALSE; | 346 | return FALSE; |
343 | } | 347 | } |
344 | if( record() ) { | 348 | if( record() ) { |
345 | 349 | ||
346 | QString cmd; | 350 | QString cmd; |
@@ -362,25 +366,25 @@ bool VMemo::startRecording() { | |||
362 | l.setName(dlName); | 366 | l.setName(dlName); |
363 | l.setType("audio/x-wav"); | 367 | l.setType("audio/x-wav"); |
364 | l.setCategories(cats); | 368 | l.setCategories(cats); |
365 | l.writeLink(); | 369 | l.writeLink(); |
366 | return TRUE; | 370 | return TRUE; |
367 | } else | 371 | } else |
368 | return FALSE; | 372 | return FALSE; |
369 | 373 | ||
370 | } | 374 | } |
371 | 375 | ||
372 | void VMemo::stopRecording() { | 376 | void VMemo::stopRecording() { |
373 | show(); | 377 | show(); |
374 | qDebug("Stopped recording"); | 378 | odebug << "Stopped recording" << oendl; |
375 | recording = FALSE; | 379 | recording = FALSE; |
376 | if(useAlerts) { | 380 | if(useAlerts) { |
377 | msgLabel->close(); | 381 | msgLabel->close(); |
378 | msgLabel=0; | 382 | msgLabel=0; |
379 | delete msgLabel; | 383 | delete msgLabel; |
380 | } | 384 | } |
381 | t_timer->stop(); | 385 | t_timer->stop(); |
382 | Config cfg("Vmemo"); | 386 | Config cfg("Vmemo"); |
383 | cfg.setGroup("Defaults"); | 387 | cfg.setGroup("Defaults"); |
384 | if( cfg.readNumEntry("hideIcon",0) == 1 ) | 388 | if( cfg.readNumEntry("hideIcon",0) == 1 ) |
385 | hide(); | 389 | hide(); |
386 | } | 390 | } |
@@ -390,25 +394,25 @@ int VMemo::openDSP() { | |||
390 | cfg.setGroup("Record"); | 394 | cfg.setGroup("Record"); |
391 | 395 | ||
392 | speed = cfg.readNumEntry("SampleRate", 22050); | 396 | speed = cfg.readNumEntry("SampleRate", 22050); |
393 | channels = cfg.readNumEntry("Stereo", 1) ? 2 : 1; // 1 = stereo(2), 0 = mono(1) | 397 | channels = cfg.readNumEntry("Stereo", 1) ? 2 : 1; // 1 = stereo(2), 0 = mono(1) |
394 | if (cfg.readNumEntry("SixteenBit", 1)==1) { | 398 | if (cfg.readNumEntry("SixteenBit", 1)==1) { |
395 | format = AFMT_S16_LE; | 399 | format = AFMT_S16_LE; |
396 | resolution = 16; | 400 | resolution = 16; |
397 | } else { | 401 | } else { |
398 | format = AFMT_U8; | 402 | format = AFMT_U8; |
399 | resolution = 8; | 403 | resolution = 8; |
400 | } | 404 | } |
401 | 405 | ||
402 | qDebug("samplerate: %d, channels %d, resolution %d", speed, channels, resolution); | 406 | odebug << "samplerate: " << speed << ", channels " << channels << ", resolution " << resolution << "" << oendl; |
403 | 407 | ||
404 | if(systemZaurus) { | 408 | if(systemZaurus) { |
405 | dsp = open("/dev/dsp1", O_RDONLY); //Zaurus needs /dev/dsp1 | 409 | dsp = open("/dev/dsp1", O_RDONLY); //Zaurus needs /dev/dsp1 |
406 | channels=1; //zaurus has one input channel | 410 | channels=1; //zaurus has one input channel |
407 | } else { | 411 | } else { |
408 | dsp = open("/dev/dsp", O_RDONLY); | 412 | dsp = open("/dev/dsp", O_RDONLY); |
409 | } | 413 | } |
410 | 414 | ||
411 | if(dsp == -1) { | 415 | if(dsp == -1) { |
412 | msgLabel->close(); | 416 | msgLabel->close(); |
413 | msgLabel=0; | 417 | msgLabel=0; |
414 | delete msgLabel; | 418 | delete msgLabel; |
@@ -474,55 +478,55 @@ int VMemo::openWAV(const char *filename) { | |||
474 | // qDebug("Write header channels %d, speed %d, b/s %d, blockalign %d, bitrate %d" | 478 | // qDebug("Write header channels %d, speed %d, b/s %d, blockalign %d, bitrate %d" |
475 | // , wh.modus, wh.sample_fq, wh.byte_p_sec, wh.byte_p_spl, wh.bit_p_spl ); | 479 | // , wh.modus, wh.sample_fq, wh.byte_p_sec, wh.byte_p_spl, wh.bit_p_spl ); |
476 | write (wav, &wh, sizeof(WaveHeader)); | 480 | write (wav, &wh, sizeof(WaveHeader)); |
477 | 481 | ||
478 | return 1; | 482 | return 1; |
479 | } | 483 | } |
480 | 484 | ||
481 | bool VMemo::record() { | 485 | bool VMemo::record() { |
482 | length=0; | 486 | length=0; |
483 | int result, value; | 487 | int result, value; |
484 | QString msg; | 488 | QString msg; |
485 | msg.sprintf("Recording format %d", format); | 489 | msg.sprintf("Recording format %d", format); |
486 | qDebug(msg); | 490 | odebug << msg << oendl; |
487 | Config config("Vmemo"); | 491 | Config config("Vmemo"); |
488 | config.setGroup("Record"); | 492 | config.setGroup("Record"); |
489 | int sRate=config.readNumEntry("SizeLimit", 30); | 493 | int sRate=config.readNumEntry("SizeLimit", 30); |
490 | if(sRate > 0) | 494 | if(sRate > 0) |
491 | t_timer->start( sRate * 1000+1000, TRUE); | 495 | t_timer->start( sRate * 1000+1000, TRUE); |
492 | 496 | ||
493 | // if(systemZaurus) { | 497 | // if(systemZaurus) { |
494 | // } else { // 16 bit only capabilities | 498 | // } else { // 16 bit only capabilities |
495 | 499 | ||
496 | msg.sprintf("Recording format other"); | 500 | msg.sprintf("Recording format other"); |
497 | qDebug(msg); | 501 | odebug << msg << oendl; |
498 | 502 | ||
499 | int bufsize=1024; | 503 | int bufsize=1024; |
500 | int bytesWritten=0; | 504 | int bytesWritten=0; |
501 | signed short sound[1024], monoBuffer[1024]; | 505 | signed short sound[1024], monoBuffer[1024]; |
502 | char abuf[bufsize/2]; | 506 | char abuf[bufsize/2]; |
503 | short sbuf[bufsize]; | 507 | short sbuf[bufsize]; |
504 | Config vmCfg("Vmemo"); | 508 | Config vmCfg("Vmemo"); |
505 | vmCfg.setGroup("Defaults"); | 509 | vmCfg.setGroup("Defaults"); |
506 | useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0); | 510 | useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0); |
507 | 511 | ||
508 | while(recording) { | 512 | while(recording) { |
509 | 513 | ||
510 | if(useADPCM) | 514 | if(useADPCM) |
511 | result = read( dsp, sbuf, bufsize); // 8192 | 515 | result = read( dsp, sbuf, bufsize); // 8192 |
512 | else | 516 | else |
513 | result = read(dsp, sound, 1024); // 8192 | 517 | result = read(dsp, sound, 1024); // 8192 |
514 | if( result <= 0) { | 518 | if( result <= 0) { |
515 | perror("recording error "); | 519 | perror("recording error "); |
516 | // qDebug(currentFileName); | 520 | // odebug << currentFileName << oendl; |
517 | QMessageBox::message(tr("Note"),tr("error recording")); | 521 | QMessageBox::message(tr("Note"),tr("error recording")); |
518 | recording=FALSE; | 522 | recording=FALSE; |
519 | break; | 523 | break; |
520 | return FALSE; | 524 | return FALSE; |
521 | } | 525 | } |
522 | 526 | ||
523 | if(useADPCM) { | 527 | if(useADPCM) { |
524 | adpcm_coder( sbuf, abuf, result/2, &encoder_state); | 528 | adpcm_coder( sbuf, abuf, result/2, &encoder_state); |
525 | bytesWritten = ::write(wav, abuf, result/4); | 529 | bytesWritten = ::write(wav, abuf, result/4); |
526 | 530 | ||
527 | } else { | 531 | } else { |
528 | for (int i = 0; i < result; i++) { //since Z is mono do normally | 532 | for (int i = 0; i < result; i++) { //since Z is mono do normally |
@@ -531,72 +535,72 @@ bool VMemo::record() { | |||
531 | 535 | ||
532 | length+=write(wav, monoBuffer, result); | 536 | length+=write(wav, monoBuffer, result); |
533 | } | 537 | } |
534 | length +=bytesWritten; | 538 | length +=bytesWritten; |
535 | 539 | ||
536 | if(length<0) { | 540 | if(length<0) { |
537 | recording=false; | 541 | recording=false; |
538 | perror("dev/dsp's is a lookin' messy"); | 542 | perror("dev/dsp's is a lookin' messy"); |
539 | QMessageBox::message("Vmemo","Error writing to file\n"+ fileName); | 543 | QMessageBox::message("Vmemo","Error writing to file\n"+ fileName); |
540 | break; | 544 | break; |
541 | return FALSE; | 545 | return FALSE; |
542 | } | 546 | } |
543 | // printf("%d\r",length); | 547 | // odebug << "" << length << "\r" << oendl; |
544 | // fflush(stdout); | 548 | // fflush(stdout); |
545 | qApp->processEvents(); | 549 | qApp->processEvents(); |
546 | } | 550 | } |
547 | // qDebug("file has length of %d lasting %d seconds", | 551 | // qDebug("file has length of %d lasting %d seconds", |
548 | // length, (( length / speed) / channels) / 2 ); | 552 | // length, (( length / speed) / channels) / 2 ); |
549 | // } | 553 | // } |
550 | 554 | ||
551 | //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<// | 555 | //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<// |
552 | 556 | ||
553 | value = length+36; | 557 | value = length+36; |
554 | 558 | ||
555 | lseek(wav, 4, SEEK_SET); | 559 | lseek(wav, 4, SEEK_SET); |
556 | write(wav, &value, 4); | 560 | write(wav, &value, 4); |
557 | lseek(wav, 40, SEEK_SET); | 561 | lseek(wav, 40, SEEK_SET); |
558 | 562 | ||
559 | write(wav, &length, 4); | 563 | write(wav, &length, 4); |
560 | 564 | ||
561 | track.close(); | 565 | track.close(); |
562 | qDebug("Track closed"); | 566 | odebug << "Track closed" << oendl; |
563 | 567 | ||
564 | if( ioctl( dsp, SNDCTL_DSP_RESET,0) == -1) | 568 | if( ioctl( dsp, SNDCTL_DSP_RESET,0) == -1) |
565 | perror("ioctl(\"SNDCTL_DSP_RESET\")"); | 569 | perror("ioctl(\"SNDCTL_DSP_RESET\")"); |
566 | 570 | ||
567 | ::close(dsp); | 571 | ::close(dsp); |
568 | 572 | ||
569 | Config cfgO("OpieRec"); | 573 | Config cfgO("OpieRec"); |
570 | cfgO.setGroup("Sounds"); | 574 | cfgO.setGroup("Sounds"); |
571 | 575 | ||
572 | int nFiles = cfgO.readNumEntry( "NumberofFiles",0); | 576 | int nFiles = cfgO.readNumEntry( "NumberofFiles",0); |
573 | 577 | ||
574 | QString currentFileName = fileName; | 578 | QString currentFileName = fileName; |
575 | QString currentFile = "vm_"+ date; | 579 | QString currentFile = "vm_"+ date; |
576 | 580 | ||
577 | float numberOfRecordedSeconds=(float) length / (float)speed * (float)2; | 581 | float numberOfRecordedSeconds=(float) length / (float)speed * (float)2; |
578 | 582 | ||
579 | cfgO.writeEntry( "NumberofFiles", nFiles + 1); | 583 | cfgO.writeEntry( "NumberofFiles", nFiles + 1); |
580 | cfgO.writeEntry( QString::number( nFiles + 1), currentFile); | 584 | cfgO.writeEntry( QString::number( nFiles + 1), currentFile); |
581 | cfgO.writeEntry( currentFile, currentFileName); | 585 | cfgO.writeEntry( currentFile, currentFileName); |
582 | 586 | ||
583 | QString time; | 587 | QString time; |
584 | time.sprintf("%.2f", numberOfRecordedSeconds); | 588 | time.sprintf("%.2f", numberOfRecordedSeconds); |
585 | cfgO.writeEntry( currentFileName, time ); | 589 | cfgO.writeEntry( currentFileName, time ); |
586 | // qDebug("writing config numberOfRecordedSeconds "+time); | 590 | // odebug << "writing config numberOfRecordedSeconds "+time << oendl; |
587 | 591 | ||
588 | cfgO.write(); | 592 | cfgO.write(); |
589 | 593 | ||
590 | qDebug("done recording "+fileName); | 594 | odebug << "done recording "+fileName << oendl; |
591 | 595 | ||
592 | Config cfg("qpe"); | 596 | Config cfg("qpe"); |
593 | cfg.setGroup("Volume"); | 597 | cfg.setGroup("Volume"); |
594 | QString foo = cfg.readEntry("Mute","TRUE"); | 598 | QString foo = cfg.readEntry("Mute","TRUE"); |
595 | if(foo.find("TRUE",0,TRUE) != -1) | 599 | if(foo.find("TRUE",0,TRUE) != -1) |
596 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; //mute | 600 | QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; //mute |
597 | return TRUE; | 601 | return TRUE; |
598 | } | 602 | } |
599 | 603 | ||
600 | int VMemo::setToggleButton(int tog) { | 604 | int VMemo::setToggleButton(int tog) { |
601 | 605 | ||
602 | for( int i=0; i < 10;i++) { | 606 | for( int i=0; i < 10;i++) { |