summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/vmemo/vmemo.cpp2
-rw-r--r--noncore/settings/sound/soundsettingsbase.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp
index 226f058..d6128a6 100644
--- a/core/applets/vmemo/vmemo.cpp
+++ b/core/applets/vmemo/vmemo.cpp
@@ -221,414 +221,414 @@ VMemo::VMemo( QWidget *parent, const char *_name )
221 Config vmCfg("Vmemo"); 221 Config vmCfg("Vmemo");
222 vmCfg.setGroup("Defaults"); 222 vmCfg.setGroup("Defaults");
223 int toggleKey = setToggleButton(vmCfg.readNumEntry("toggleKey", -1)); 223 int toggleKey = setToggleButton(vmCfg.readNumEntry("toggleKey", -1));
224 useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0); 224 useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0);
225 225
226 qDebug("toggleKey %d", toggleKey); 226 qDebug("toggleKey %d", toggleKey);
227 227
228 if(release.find("embedix",0,TRUE) !=-1) 228 if(release.find("embedix",0,TRUE) !=-1)
229 systemZaurus=TRUE; 229 systemZaurus=TRUE;
230 else 230 else
231 systemZaurus=FALSE; 231 systemZaurus=FALSE;
232 232
233 myChannel = new QCopChannel( "QPE/VMemo", this ); 233 myChannel = new QCopChannel( "QPE/VMemo", this );
234 connect( myChannel, SIGNAL(received(const QCString&, const QByteArray&)), 234 connect( myChannel, SIGNAL(received(const QCString&, const QByteArray&)),
235 this, SLOT(receive(const QCString&, const QByteArray&)) ); 235 this, SLOT(receive(const QCString&, const QByteArray&)) );
236 236
237 if( toggleKey != -1 ) { 237 if( toggleKey != -1 ) {
238 QCopEnvelope e("QPE/Desktop", "keyRegister(int key, QString channel, QString message)"); 238 QCopEnvelope e("QPE/Desktop", "keyRegister(int key, QString channel, QString message)");
239 // e << 4096; // Key_Escape 239 // e << 4096; // Key_Escape
240 // e << Key_F5; //4148 240 // e << Key_F5; //4148
241 e << toggleKey; 241 e << toggleKey;
242 e << QString("QPE/VMemo"); 242 e << QString("QPE/VMemo");
243 e << QString("toggleRecord()"); 243 e << QString("toggleRecord()");
244 } 244 }
245 if(toggleKey == 1) 245 if(toggleKey == 1)
246 usingIcon=TRUE; 246 usingIcon=TRUE;
247 else 247 else
248 usingIcon=FALSE; 248 usingIcon=FALSE;
249 if( vmCfg.readNumEntry("hideIcon",0) == 1) 249 if( vmCfg.readNumEntry("hideIcon",0) == 1)
250 hide(); 250 hide();
251 recording = FALSE; 251 recording = FALSE;
252 } 252 }
253} 253}
254 254
255VMemo::~VMemo() { 255VMemo::~VMemo() {
256} 256}
257 257
258void VMemo::receive( const QCString &msg, const QByteArray &data ) { 258void VMemo::receive( const QCString &msg, const QByteArray &data ) {
259 qDebug("receive"); 259 qDebug("receive");
260 QDataStream stream( data, IO_ReadOnly ); 260 QDataStream stream( data, IO_ReadOnly );
261 261
262 if (msg == "toggleRecord()") { 262 if (msg == "toggleRecord()") {
263 if (recording) { 263 if (recording) {
264 fromToggle = TRUE; 264 fromToggle = TRUE;
265 stopRecording(); 265 stopRecording();
266 } else { 266 } else {
267 fromToggle = TRUE; 267 fromToggle = TRUE;
268 startRecording(); 268 startRecording();
269 } 269 }
270 } 270 }
271} 271}
272 272
273void VMemo::paintEvent( QPaintEvent* ) { 273void VMemo::paintEvent( QPaintEvent* ) {
274 QPainter p(this); 274 QPainter p(this);
275 p.drawPixmap( 0, 1,( const char** ) vmemo_xpm ); 275 p.drawPixmap( 0, 1,( const char** ) vmemo_xpm );
276} 276}
277 277
278void VMemo::mousePressEvent( QMouseEvent * me) { 278void VMemo::mousePressEvent( QMouseEvent * me) {
279 /* 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
280 mousePressEvent and mouseReleaseEvent with a NULL parameter. */ 280 mousePressEvent and mouseReleaseEvent with a NULL parameter. */
281 281
282// if (!systemZaurus && me != NULL) 282// if (!systemZaurus && me != NULL)
283// return; 283// return;
284// } 284// }
285 285
286 if(!recording) 286 if(!recording)
287 startRecording(); 287 startRecording();
288 else 288 else
289 stopRecording(); 289 stopRecording();
290} 290}
291 291
292void VMemo::mouseReleaseEvent( QMouseEvent * ) { 292void VMemo::mouseReleaseEvent( QMouseEvent * ) {
293} 293}
294 294
295bool VMemo::startRecording() { 295bool VMemo::startRecording() {
296 Config config( "Vmemo" ); 296 Config config( "Vmemo" );
297 config.setGroup( "System" ); 297 config.setGroup( "System" );
298 298
299 useAlerts = config.readBoolEntry("Alert",1); 299 useAlerts = config.readBoolEntry("Alert",1);
300 if(useAlerts) { 300 if(useAlerts) {
301 301
302 msgLabel = new QLabel( 0, "alertLabel" ); 302 msgLabel = new QLabel( 0, "alertLabel" );
303 msgLabel->setText("<B><P><font size=+2>VMemo-Recording</font></B>"); 303 msgLabel->setText("<B><P><font size=+2>VMemo-Recording</font></B>");
304 msgLabel->show(); 304 msgLabel->show();
305 } 305 }
306 306
307 qDebug("Start recording engines"); 307 qDebug("Start recording engines");
308 recording = TRUE; 308 recording = TRUE;
309 309
310 if (openDSP() == -1) { 310 if (openDSP() == -1) {
311 recording = FALSE; 311 recording = FALSE;
312 return FALSE; 312 return FALSE;
313 } 313 }
314 314
315 config.setGroup("Defaults"); 315 config.setGroup("Defaults");
316 316
317 QDateTime dt = QDateTime::currentDateTime(); 317 QDateTime dt = QDateTime::currentDateTime();
318 318
319 QString fName; 319 QString fName;
320 config.setGroup( "System" ); 320 config.setGroup( "System" );
321 fName = QPEApplication::documentDir() ; 321 fName = QPEApplication::documentDir() ;
322 fileName = config.readEntry("RecLocation", fName); 322 fileName = config.readEntry("RecLocation", fName);
323 323
324 int s; 324 int s;
325 s=fileName.find(':'); 325 s=fileName.find(':');
326 if(s) 326 if(s)
327 fileName=fileName.right(fileName.length()-s-2); 327 fileName=fileName.right(fileName.length()-s-2);
328 qDebug("pathname will be "+fileName); 328 qDebug("pathname will be "+fileName);
329 329
330 if( fileName.left(1).find('/') == -1) 330 if( fileName.left(1).find('/') == -1)
331 fileName="/"+fileName; 331 fileName="/"+fileName;
332 if( fileName.right(1).find('/') == -1) 332 if( fileName.right(1).find('/') == -1)
333 fileName+="/"; 333 fileName+="/";
334 fName = "vm_"+ dt.toString()+ ".wav"; 334 fName = "vm_"+ dt.toString()+ ".wav";
335 335
336 fileName+=fName; 336 fileName+=fName;
337 // No spaces in the filename 337 // No spaces in the filename
338 fileName.replace(QRegExp("'"),""); 338 fileName.replace(QRegExp("'"),"");
339 fileName.replace(QRegExp(" "),"_"); 339 fileName.replace(QRegExp(" "),"_");
340 fileName.replace(QRegExp(":"),"."); 340 fileName.replace(QRegExp(":"),".");
341 fileName.replace(QRegExp(","),""); 341 fileName.replace(QRegExp(","),"");
342 342
343 343
344 qDebug("filename is "+fileName); 344 qDebug("filename is "+fileName);
345// open tmp file here 345// open tmp file here
346 char *pointer; 346 char *pointer;
347 pointer=tmpnam(NULL); 347 pointer=tmpnam(NULL);
348 qDebug("Opening tmp file %s",pointer); 348 qDebug("Opening tmp file %s",pointer);
349 349
350 if(openWAV(pointer ) == -1) { 350 if(openWAV(pointer ) == -1) {
351 351
352// if(openWAV(fileName.latin1()) == -1) { 352// if(openWAV(fileName.latin1()) == -1) {
353 QString err("Could not open the temp file\n"); 353 QString err("Could not open the temp file\n");
354 err += fileName; 354 err += fileName;
355 QMessageBox::critical(0, "vmemo", err, "Abort"); 355 QMessageBox::critical(0, "vmemo", err, "Abort");
356 ::close(dsp); 356 ::close(dsp);
357 return FALSE; 357 return FALSE;
358 } 358 }
359 if( record() ) { 359 if( record() ) {
360 360
361 QString cmd; 361 QString cmd;
362 if( fileName.find(".wav",0,TRUE) == -1) 362 if( fileName.find(".wav",0,TRUE) == -1)
363 fileName += ".wav"; 363 fileName += ".wav";
364 364
365 cmd.sprintf("mv %s "+fileName, pointer); 365 cmd.sprintf("mv %s "+fileName, pointer);
366// move tmp file to regular file here 366// move tmp file to regular file here
367 367
368 system(cmd.latin1()); 368 system(cmd.latin1());
369 369
370 QArray<int> cats(1); 370 QArray<int> cats(1);
371 cats[0] = config.readNumEntry("Category", 0); 371 cats[0] = config.readNumEntry("Category", 0);
372 372
373 QString dlName("vm_"); 373 QString dlName("vm_");
374 dlName += dt.toString(); 374 dlName += dt.toString();
375 DocLnk l; 375 DocLnk l;
376 l.setFile(fileName); 376 l.setFile(fileName);
377 l.setName(dlName); 377 l.setName(dlName);
378 l.setType("audio/x-wav"); 378 l.setType("audio/x-wav");
379 l.setCategories(cats); 379 l.setCategories(cats);
380 l.writeLink(); 380 l.writeLink();
381 return TRUE; 381 return TRUE;
382 } else 382 } else
383 return FALSE; 383 return FALSE;
384 384
385} 385}
386 386
387void VMemo::stopRecording() { 387void VMemo::stopRecording() {
388 show(); 388 show();
389 qDebug("Stopped recording"); 389 qDebug("Stopped recording");
390 recording = FALSE; 390 recording = FALSE;
391 if(useAlerts) { 391 if(useAlerts) {
392 msgLabel->close(); 392 msgLabel->close();
393 msgLabel=0; 393 msgLabel=0;
394 delete msgLabel; 394 delete msgLabel;
395 } 395 }
396 t_timer->stop(); 396 t_timer->stop();
397 Config cfg("Vmemo"); 397 Config cfg("Vmemo");
398 cfg.setGroup("Defaults"); 398 cfg.setGroup("Defaults");
399 if( cfg.readNumEntry("hideIcon",0) == 1 ) 399 if( cfg.readNumEntry("hideIcon",0) == 1 )
400 hide(); 400 hide();
401} 401}
402 402
403int VMemo::openDSP() { 403int VMemo::openDSP() {
404 Config cfg("Vmemo"); 404 Config cfg("Vmemo");
405 cfg.setGroup("Record"); 405 cfg.setGroup("Record");
406 406
407 speed = cfg.readNumEntry("SampleRate", 22050); 407 speed = cfg.readNumEntry("SampleRate", 22050);
408 channels = cfg.readNumEntry("Stereo", 1) ? 2 : 1; // 1 = stereo(2), 0 = mono(1) 408 channels = cfg.readNumEntry("Stereo", 1) ? 2 : 1; // 1 = stereo(2), 0 = mono(1)
409 if (cfg.readNumEntry("SixteenBit", 1)==1) { 409 if (cfg.readNumEntry("SixteenBit", 1)==1) {
410 format = AFMT_S16_LE; 410 format = AFMT_S16_LE;
411 resolution = 16; 411 resolution = 16;
412 } else { 412 } else {
413 format = AFMT_U8; 413 format = AFMT_U8;
414 resolution = 8; 414 resolution = 8;
415 } 415 }
416 416
417 qDebug("samplerate: %d, channels %d, resolution %d", speed, channels, resolution); 417 qDebug("samplerate: %d, channels %d, resolution %d", speed, channels, resolution);
418 418
419 if(systemZaurus) { 419 if(systemZaurus) {
420 dsp = open("/dev/dsp1", O_RDONLY); //Zaurus needs /dev/dsp1 420 dsp = open("/dev/dsp1", O_RDONLY); //Zaurus needs /dev/dsp1
421 channels=1; //zaurus has one input channel 421 channels=1; //zaurus has one input channel
422 } else { 422 } else {
423 dsp = open("/dev/dsp", O_RDONLY); 423 dsp = open("/dev/dsp", O_RDONLY);
424 } 424 }
425 425
426 if(dsp == -1) { 426 if(dsp == -1) {
427 msgLabel->close(); 427 msgLabel->close();
428 msgLabel=0; 428 msgLabel=0;
429 delete msgLabel; 429 delete msgLabel;
430 430
431 perror("open(\"/dev/dsp\")"); 431 perror("open(\"/dev/dsp\")");
432 errorMsg="open(\"/dev/dsp\")\n "+(QString)strerror(errno); 432 errorMsg="open(\"/dev/dsp\")\n "+(QString)strerror(errno);
433 QMessageBox::critical(0, "vmemo", errorMsg, "Abort"); 433 QMessageBox::critical(0, "vmemo", errorMsg, "Abort");
434 return -1; 434 return -1;
435 } 435 }
436 436
437 if(ioctl(dsp, SNDCTL_DSP_SETFMT , &format)==-1) { 437 if(ioctl(dsp, SNDCTL_DSP_SETFMT , &format)==-1) {
438 perror("ioctl(\"SNDCTL_DSP_SETFMT\")"); 438 perror("ioctl(\"SNDCTL_DSP_SETFMT\")");
439 return -1; 439 return -1;
440 } 440 }
441 if(ioctl(dsp, SNDCTL_DSP_CHANNELS , &channels)==-1) { 441 if(ioctl(dsp, SNDCTL_DSP_CHANNELS , &channels)==-1) {
442 perror("ioctl(\"SNDCTL_DSP_CHANNELS\")"); 442 perror("ioctl(\"SNDCTL_DSP_CHANNELS\")");
443 return -1; 443 return -1;
444 } 444 }
445 if(ioctl(dsp, SNDCTL_DSP_SPEED , &speed)==-1) { 445 if(ioctl(dsp, SNDCTL_DSP_SPEED , &speed)==-1) {
446 perror("ioctl(\"SNDCTL_DSP_SPEED\")"); 446 perror("ioctl(\"SNDCTL_DSP_SPEED\")");
447 return -1; 447 return -1;
448 } 448 }
449 if(ioctl(dsp, SOUND_PCM_READ_RATE , &rate)==-1) { 449 if(ioctl(dsp, SOUND_PCM_READ_RATE , &rate)==-1) {
450 perror("ioctl(\"SOUND_PCM_READ_RATE\")"); 450 perror("ioctl(\"SOUND_PCM_READ_RATE\")");
451 return -1; 451 return -1;
452 } 452 }
453 453
454 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE; //mute 454 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << FALSE; //mute
455 455
456 return 1; 456 return 1;
457} 457}
458 458
459int VMemo::openWAV(const char *filename) { 459int VMemo::openWAV(const char *filename) {
460 track.setName(filename); 460 track.setName(filename);
461 if(!track.open(IO_WriteOnly|IO_Truncate|IO_Raw)) { 461 if(!track.open(IO_WriteOnly|IO_Truncate|IO_Raw)) {
462 errorMsg=filename; 462 errorMsg=filename;
463 return -1; 463 return -1;
464 } 464 }
465 465
466 wav=track.handle(); 466 wav=track.handle();
467 Config vmCfg("Vmemo"); 467 Config vmCfg("Vmemo");
468 vmCfg.setGroup("Defaults"); 468 vmCfg.setGroup("Defaults");
469 useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0); 469 useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0);
470 470
471 WaveHeader wh; 471 WaveHeader wh;
472 472
473 wh.main_chunk = RIFF; 473 wh.main_chunk = RIFF;
474 wh.length=0; 474 wh.length=0;
475 wh.chunk_type = WAVE; 475 wh.chunk_type = WAVE;
476 wh.sub_chunk = FMT; 476 wh.sub_chunk = FMT;
477 wh.sc_len = 16; 477 wh.sc_len = 16;
478 if(useADPCM) 478 if(useADPCM)
479 wh.format = WAVE_FORMAT_DVI_ADPCM;//PCM_CODE; 479 wh.format = WAVE_FORMAT_DVI_ADPCM;//PCM_CODE;
480 else 480 else
481 wh.format = PCM_CODE; 481 wh.format = PCM_CODE;
482 wh.modus = channels; 482 wh.modus = channels;
483 wh.sample_fq = speed; 483 wh.sample_fq = speed;
484 wh.byte_p_sec = speed * channels * resolution/8; 484 wh.byte_p_sec = speed * channels * resolution/8;
485 wh.byte_p_spl = channels * (resolution / 8); 485 wh.byte_p_spl = channels * (resolution / 8);
486 wh.bit_p_spl = resolution; 486 wh.bit_p_spl = resolution;
487 wh.data_chunk = DATA; 487 wh.data_chunk = DATA;
488 wh.data_length= 0; 488 wh.data_length= 0;
489 // qDebug("Write header channels %d, speed %d, b/s %d, blockalign %d, bitrate %d" 489 // qDebug("Write header channels %d, speed %d, b/s %d, blockalign %d, bitrate %d"
490 // , wh.modus, wh.sample_fq, wh.byte_p_sec, wh.byte_p_spl, wh.bit_p_spl ); 490 // , wh.modus, wh.sample_fq, wh.byte_p_sec, wh.byte_p_spl, wh.bit_p_spl );
491 write (wav, &wh, sizeof(WaveHeader)); 491 write (wav, &wh, sizeof(WaveHeader));
492 492
493 return 1; 493 return 1;
494} 494}
495 495
496bool VMemo::record() { 496bool VMemo::record() {
497 497
498 int length=0, result, value; 498 int length=0, result, value;
499 QString msg; 499 QString msg;
500 msg.sprintf("Recording format %d", format); 500 msg.sprintf("Recording format %d", format);
501 qDebug(msg); 501 qDebug(msg);
502 Config config("Vmemo"); 502 Config config("Vmemo");
503 config.setGroup("Record"); 503 config.setGroup("Record");
504 int sRate=config.readNumEntry("SizeLimit", 30); 504 int sRate=config.readNumEntry("SizeLimit", 30);
505 if(sRate > 0) 505 if(sRate > 0)
506 t_timer->start( sRate * 1000+1000, TRUE); 506 t_timer->start( sRate * 1000+1000, TRUE);
507 507
508// if(systemZaurus) { 508// if(systemZaurus) {
509// } else { // 16 bit only capabilities 509// } else { // 16 bit only capabilities
510 510
511 msg.sprintf("Recording format other"); 511 msg.sprintf("Recording format other");
512 qDebug(msg); 512 qDebug(msg);
513 513
514 int bufsize=1024; 514 int bufsize=1024;
515 int bytesWritten=0; 515 int bytesWritten=0;
516 signed short sound[1024], monoBuffer[1024]; 516 signed short sound[1024], monoBuffer[1024];
517 char abuf[bufsize/2]; 517 char abuf[bufsize/2];
518 short sbuf[bufsize]; 518 short sbuf[bufsize];
519 Config vmCfg("Vmemo"); 519 Config vmCfg("Vmemo");
520 vmCfg.setGroup("Defaults"); 520 vmCfg.setGroup("Defaults");
521 useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0); 521 useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0);
522 522
523 while(recording) { 523 while(recording) {
524 524
525 if(useADPCM) 525 if(useADPCM)
526 result = read( dsp, sbuf, bufsize); // 8192 526 result = read( dsp, sbuf, bufsize); // 8192
527 else 527 else
528 result = read(dsp, sound, 1024); // 8192 528 result = read(dsp, sound, 1024); // 8192
529 if( result <= 0) { 529 if( result <= 0) {
530 perror("recording error "); 530 perror("recording error ");
531// qDebug(currentFileName); 531// qDebug(currentFileName);
532 QMessageBox::message(tr("Note"),tr("error recording")); 532 QMessageBox::message(tr("Note"),tr("error recording"));
533 recording=FALSE; 533 recording=FALSE;
534 break; 534 break;
535 return FALSE; 535 return FALSE;
536 } 536 }
537 537
538 if(useADPCM) { 538 if(useADPCM) {
539 adpcm_coder( sbuf, abuf, result/2, &encoder_state); 539 adpcm_coder( sbuf, abuf, result/2, &encoder_state);
540 bytesWritten = ::write(wav, abuf, result/4); 540 bytesWritten = ::write(wav, abuf, result/4);
541 541
542 } else { 542 } else {
543 for (int i = 0; i < result; i++) { //since Z is mono do normally 543 for (int i = 0; i < result; i++) { //since Z is mono do normally
544 monoBuffer[i] = sound[i]; 544 monoBuffer[i] = sound[i];
545 } 545 }
546 546
547 length+=write(wav, monoBuffer, result); 547 length+=write(wav, monoBuffer, result);
548 } 548 }
549 length +=bytesWritten; 549 length +=bytesWritten;
550 550
551 if(length<0) { 551 if(length<0) {
552 recording=false; 552 recording=false;
553 perror("dev/dsp's is a lookin' messy"); 553 perror("dev/dsp's is a lookin' messy");
554 QMessageBox::message("Vmemo","Error writing to file\n"+ fileName); 554 QMessageBox::message("Vmemo","Error writing to file\n"+ fileName);
555 break; 555 break;
556 return FALSE; 556 return FALSE;
557 } 557 }
558 // printf("%d\r",length); 558 // printf("%d\r",length);
559 // fflush(stdout); 559 // fflush(stdout);
560 qApp->processEvents(); 560 qApp->processEvents();
561 } 561 }
562 // qDebug("file has length of %d lasting %d seconds", 562 // qDebug("file has length of %d lasting %d seconds",
563 // length, (( length / speed) / channels) / 2 ); 563 // length, (( length / speed) / channels) / 2 );
564 // } 564 // }
565 565
566 //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<// 566 //>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<//
567 567
568 value = length+36; 568 value = length+36;
569 569
570 lseek(wav, 4, SEEK_SET); 570 lseek(wav, 4, SEEK_SET);
571 write(wav, &value, 4); 571 write(wav, &value, 4);
572 lseek(wav, 40, SEEK_SET); 572 lseek(wav, 40, SEEK_SET);
573 573
574 write(wav, &length, 4); 574 write(wav, &length, 4);
575 575
576 track.close(); 576 track.close();
577 qDebug("Track closed"); 577 qDebug("Track closed");
578 578
579 if( ioctl( dsp, SNDCTL_DSP_RESET,0) == -1) 579 if( ioctl( dsp, SNDCTL_DSP_RESET,0) == -1)
580 perror("ioctl(\"SNDCTL_DSP_RESET\")"); 580 perror("ioctl(\"SNDCTL_DSP_RESET\")");
581 581
582 ::close(dsp); 582 ::close(dsp);
583 583
584 qDebug("done recording "+fileName); 584 qDebug("done recording "+fileName);
585 585
586 Config cfg("qpe"); 586 Config cfg("qpe");
587 cfg.setGroup("Volume"); 587 cfg.setGroup("Volume");
588 QString foo = cfg.readEntry("Mute","TRUE"); 588 QString foo = cfg.readEntry("Mute","TRUE");
589 if(foo.find("TRUE",0,TRUE) != -1) 589 if(foo.find("TRUE",0,TRUE) != -1)
590 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; //mute 590 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; //mute
591return TRUE; 591return TRUE;
592} 592}
593 593
594int VMemo::setToggleButton(int tog) { 594int VMemo::setToggleButton(int tog) {
595 595
596 for( int i=0; i < 10;i++) { 596 for( int i=0; i < 10;i++) {
597 switch (tog) { 597 switch (tog) {
598 case 0: 598 case 0:
599 return -1; 599 return -1;
600 break; 600 break;
601 case 1: 601 case 1:
602 return 0; 602 return 0;
603 break; 603 break;
604 case 2: 604 case 2:
605 return Key_Escape; 605 return Key_F24; //was Escape
606 break; 606 break;
607 case 3: 607 case 3:
608 return Key_Space; 608 return Key_Space;
609 break; 609 break;
610 case 4: 610 case 4:
611 return Key_F12; 611 return Key_F12;
612 break; 612 break;
613 case 5: 613 case 5:
614 return Key_F9; 614 return Key_F9;
615 break; 615 break;
616 case 6: 616 case 6:
617 return Key_F10; 617 return Key_F10;
618 break; 618 break;
619 case 7: 619 case 7:
620 return Key_F11; 620 return Key_F11;
621 break; 621 break;
622 case 8: 622 case 8:
623 return Key_F13; 623 return Key_F13;
624 break; 624 break;
625 }; 625 };
626 } 626 }
627 return -1; 627 return -1;
628} 628}
629 629
630void VMemo::timerBreak() { 630void VMemo::timerBreak() {
631 //stop 631 //stop
632 stopRecording(); 632 stopRecording();
633 QMessageBox::message("Vmemo","Vmemo recording has ended"); 633 QMessageBox::message("Vmemo","Vmemo recording has ended");
634} 634}
diff --git a/noncore/settings/sound/soundsettingsbase.cpp b/noncore/settings/sound/soundsettingsbase.cpp
index 1a60109..5421bb4 100644
--- a/noncore/settings/sound/soundsettingsbase.cpp
+++ b/noncore/settings/sound/soundsettingsbase.cpp
@@ -1,185 +1,185 @@
1/**************************************************************************** 1/****************************************************************************
2** Form implementation generated from reading ui file 'soundsettingsbase.ui' 2** Form implementation generated from reading ui file 'soundsettingsbase.ui'
3** 3**
4** Created: Sun May 19 12:11:35 2002 4** Created: Sun May 19 12:11:35 2002
5** by: The User Interface Compiler (uic) 5** by: The User Interface Compiler (uic)
6** 6**
7** WARNING! All changes made in this file will be lost! 7** WARNING! All changes made in this file will be lost!
8****************************************************************************/ 8****************************************************************************/
9#include "soundsettingsbase.h" 9#include "soundsettingsbase.h"
10 10
11#include <qcheckbox.h> 11#include <qcheckbox.h>
12#include <qcombobox.h> 12#include <qcombobox.h>
13#include <qgroupbox.h> 13#include <qgroupbox.h>
14#include <qmainwindow.h> 14#include <qmainwindow.h>
15 15
16#include <qpe/qpeapplication.h> 16#include <qpe/qpeapplication.h>
17#include <qlabel.h> 17#include <qlabel.h>
18#include <qpushbutton.h> 18#include <qpushbutton.h>
19#include <qslider.h> 19#include <qslider.h>
20#include <qlayout.h> 20#include <qlayout.h>
21#include <qvariant.h> 21#include <qvariant.h>
22#include <qtooltip.h> 22#include <qtooltip.h>
23#include <qwhatsthis.h> 23#include <qwhatsthis.h>
24#include <qimage.h> 24#include <qimage.h>
25#include <qpixmap.h> 25#include <qpixmap.h>
26 26
27static const char* const image0_data[] = { 27static const char* const image0_data[] = {
28"16 16 3 1", 28"16 16 3 1",
29". c None", 29". c None",
30"a c #000000", 30"a c #000000",
31"# c #ff0000", 31"# c #ff0000",
32"............#...", 32"............#...",
33"............##..", 33"............##..",
34"..........#..#..", 34"..........#..#..",
35".....a..#..#.#..", 35".....a..#..#.#..",
36"....aa..##.#..#.", 36"....aa..##.#..#.",
37"...aaa...#.##.#.", 37"...aaa...#.##.#.",
38"aaaaaa.#.#..#.##", 38"aaaaaa.#.#..#.##",
39"aaaaaa.#.##.#.##", 39"aaaaaa.#.##.#.##",
40"aaaaaa.#.##.#.##", 40"aaaaaa.#.##.#.##",
41"aaaaaa.#.##.#.##", 41"aaaaaa.#.##.#.##",
42"aaaaaa.#.#..#.##", 42"aaaaaa.#.#..#.##",
43"...aaa...#.##.#.", 43"...aaa...#.##.#.",
44"....aa..#..#..#.", 44"....aa..#..#..#.",
45".....a.....#.##.", 45".....a.....#.##.",
46"..........#..#..", 46"..........#..#..",
47"............##.."}; 47"............##.."};
48 48
49static const char* const image1_data[] = { 49static const char* const image1_data[] = {
50"16 16 3 1", 50"16 16 3 1",
51". c None", 51". c None",
52"# c #000000", 52"# c #000000",
53"a c #ff0000", 53"a c #ff0000",
54"................", 54"................",
55"................", 55"................",
56"................", 56"................",
57".....#..........", 57".....#..........",
58"....##..........", 58"....##..........",
59"...###...a...a..", 59"...###...a...a..",
60"######..aaa.aaa.", 60"######..aaa.aaa.",
61"######...aaaaa..", 61"######...aaaaa..",
62"######....aaa...", 62"######....aaa...",
63"######...aaaaa..", 63"######...aaaaa..",
64"######..aaa.aaa.", 64"######..aaa.aaa.",
65"...###...a...a..", 65"...###...a...a..",
66"....##..........", 66"....##..........",
67".....#..........", 67".....#..........",
68"................", 68"................",
69"................"}; 69"................"};
70 70
71 71
72/* 72/*
73 * Constructs a SoundSettingsBase which is a child of 'parent', with the 73 * Constructs a SoundSettingsBase which is a child of 'parent', with the
74 * name 'name' and widget flags set to 'f' 74 * name 'name' and widget flags set to 'f'
75 * 75 *
76 * The dialog will by default be modeless, unless you set 'modal' to 76 * The dialog will by default be modeless, unless you set 'modal' to
77 * TRUE to construct a modal dialog. 77 * TRUE to construct a modal dialog.
78 */ 78 */
79SoundSettingsBase::SoundSettingsBase( QWidget* parent, const char* name, bool modal, WFlags fl ) 79SoundSettingsBase::SoundSettingsBase( QWidget* parent, const char* name, bool modal, WFlags fl )
80 : QMainWindow( parent, name, fl ) 80 : QMainWindow( parent, name, fl )
81{ 81{
82 QPixmap image0( ( const char** ) image0_data ); 82 QPixmap image0( ( const char** ) image0_data );
83 QPixmap image1( ( const char** ) image1_data ); 83 QPixmap image1( ( const char** ) image1_data );
84 if ( !name ) 84 if ( !name )
85 setName( "SoundSettingsBase" ); 85 setName( "SoundSettingsBase" );
86 // resize(255,301); 86 // resize(255,301);
87 setCaption( tr( "Vmemo Settings" ) ); 87 setCaption( tr( "Vmemo Settings" ) );
88 88
89 SoundSettingsBaseLayout = new QGridLayout( this ); 89 SoundSettingsBaseLayout = new QGridLayout( this );
90 SoundSettingsBaseLayout->setSpacing( 4 ); 90 SoundSettingsBaseLayout->setSpacing( 4 );
91 SoundSettingsBaseLayout->setMargin( 4 ); 91 SoundSettingsBaseLayout->setMargin( 4 );
92 92
93 QHBoxLayout *Layout11; 93 QHBoxLayout *Layout11;
94 Layout11 = new QHBoxLayout; 94 Layout11 = new QHBoxLayout;
95 Layout11->setSpacing( 4 ); 95 Layout11->setSpacing( 4 );
96 Layout11->setMargin( 0 ); 96 Layout11->setMargin( 0 );
97 97
98 stereoCheckBox = new QCheckBox( this, "stereoCheckBox" ); 98 stereoCheckBox = new QCheckBox( this, "stereoCheckBox" );
99 stereoCheckBox->setText( tr( "Stereo" ) ); 99 stereoCheckBox->setText( tr( "Stereo" ) );
100 Layout11->addWidget( stereoCheckBox ); 100 Layout11->addWidget( stereoCheckBox );
101 101
102 sixteenBitCheckBox = new QCheckBox( this, "sixteenBitCheckBox" ); 102 sixteenBitCheckBox = new QCheckBox( this, "sixteenBitCheckBox" );
103 sixteenBitCheckBox->setText( tr( "16 bit" ) ); 103 sixteenBitCheckBox->setText( tr( "16 bit" ) );
104 Layout11->addWidget( sixteenBitCheckBox ); 104 Layout11->addWidget( sixteenBitCheckBox );
105 105
106 AlertCheckBox = new QCheckBox( this, "AlertCheckBox" ); 106 AlertCheckBox = new QCheckBox( this, "AlertCheckBox" );
107 AlertCheckBox->setText( tr( "Visual Alerts" ) ); 107 AlertCheckBox->setText( tr( "Visual Alerts" ) );
108 Layout11->addWidget( AlertCheckBox ); 108 Layout11->addWidget( AlertCheckBox );
109 109
110 SoundSettingsBaseLayout->addLayout( Layout11, 0, 0); 110 SoundSettingsBaseLayout->addLayout( Layout11, 0, 0);
111 111
112 sampleRateLabel = new QLabel(this, "sampleRateLabel" ); 112 sampleRateLabel = new QLabel(this, "sampleRateLabel" );
113 sampleRateLabel->setText( tr( "Sample Rate:" ) ); 113 sampleRateLabel->setText( tr( "Sample Rate:" ) );
114 SoundSettingsBaseLayout->addMultiCellWidget( sampleRateLabel , 1, 1, 0, 0, 1); 114 SoundSettingsBaseLayout->addMultiCellWidget( sampleRateLabel , 1, 1, 0, 0, 1);
115 115
116 sampleRate = new QComboBox( FALSE,this, "sampleRate" ); 116 sampleRate = new QComboBox( FALSE,this, "sampleRate" );
117 117
118 sampleRate->insertItem( tr( "8000" ) ); 118 sampleRate->insertItem( tr( "8000" ) );
119 sampleRate->insertItem( tr( "11025" ) ); 119 sampleRate->insertItem( tr( "11025" ) );
120 sampleRate->insertItem( tr( "22050" ) ); 120 sampleRate->insertItem( tr( "22050" ) );
121 sampleRate->insertItem( tr( "33075" ) ); 121 sampleRate->insertItem( tr( "33075" ) );
122 sampleRate->insertItem( tr( "44100" ) ); 122 sampleRate->insertItem( tr( "44100" ) );
123 SoundSettingsBaseLayout->addMultiCellWidget( sampleRate, 2, 2, 0, 0, 1 ); 123 SoundSettingsBaseLayout->addMultiCellWidget( sampleRate, 2, 2, 0, 0, 1 );
124 124
125 TextLabel1 = new QLabel( this, "TextLabel1" ); 125 TextLabel1 = new QLabel( this, "TextLabel1" );
126 TextLabel1->setText( tr( "Recording Directory:" ) ); 126 TextLabel1->setText( tr( "Recording Directory:" ) );
127 SoundSettingsBaseLayout->addMultiCellWidget( TextLabel1, 3, 3, 0, 0, 1); 127 SoundSettingsBaseLayout->addMultiCellWidget( TextLabel1, 3, 3, 0, 0, 1);
128 128
129 129
130 LocationComboBox = new QComboBox( FALSE, this, "LocationComboBox" ); 130 LocationComboBox = new QComboBox( FALSE, this, "LocationComboBox" );
131 SoundSettingsBaseLayout->addMultiCellWidget( LocationComboBox, 4, 4, 0, 8, 1); 131 SoundSettingsBaseLayout->addMultiCellWidget( LocationComboBox, 4, 4, 0, 8, 1);
132 132
133 QLabel *TextLabelKey; 133 QLabel *TextLabelKey;
134 TextLabelKey = new QLabel( this, "TextLabelKey" ); 134 TextLabelKey = new QLabel( this, "TextLabelKey" );
135 TextLabelKey->setText( tr( "Recording Key:" ) ); 135 TextLabelKey->setText( tr( "Recording Key:" ) );
136 SoundSettingsBaseLayout->addMultiCellWidget(TextLabelKey , 5, 5, 0, 0, 1); 136 SoundSettingsBaseLayout->addMultiCellWidget(TextLabelKey , 5, 5, 0, 0, 1);
137 137
138 keyComboBox = new QComboBox( FALSE, this, "keyComboBox" ); 138 keyComboBox = new QComboBox( FALSE, this, "keyComboBox" );
139 keyComboBox->insertItem( tr( "" ) ); 139 keyComboBox->insertItem( tr( "" ) );
140 keyComboBox->insertItem( tr( "Taskbar Icon" ) ); 140 keyComboBox->insertItem( tr( "Taskbar Icon" ) );
141 keyComboBox->insertItem( tr( "Key_Escape" ) ); 141 keyComboBox->insertItem( tr( "Key_Record" ) );
142 keyComboBox->insertItem( tr( "Key_Space" ) ); 142 keyComboBox->insertItem( tr( "Key_Space" ) );
143 keyComboBox->insertItem( tr( "Key_Home" ) ); 143 keyComboBox->insertItem( tr( "Key_Home" ) );
144 keyComboBox->insertItem( tr( "Key_Calender" ) ); 144 keyComboBox->insertItem( tr( "Key_Calender" ) );
145 keyComboBox->insertItem( tr( "Key_Contacts" ) ); 145 keyComboBox->insertItem( tr( "Key_Contacts" ) );
146 keyComboBox->insertItem( tr( "Key_Menu" ) ); 146 keyComboBox->insertItem( tr( "Key_Menu" ) );
147 keyComboBox->insertItem( tr( "Key_Mail" ) ); 147 keyComboBox->insertItem( tr( "Key_Mail" ) );
148 SoundSettingsBaseLayout->addMultiCellWidget( keyComboBox , 6, 6, 0, 0 ,1); 148 SoundSettingsBaseLayout->addMultiCellWidget( keyComboBox , 6, 6, 0, 0 ,1);
149 149
150 keyLabel= new QLabel( this, "keyLabel" ); 150 keyLabel= new QLabel( this, "keyLabel" );
151 SoundSettingsBaseLayout->addMultiCellWidget( keyLabel , 6, 6, 0, 2, 3); 151 SoundSettingsBaseLayout->addMultiCellWidget( keyLabel , 6, 6, 0, 2, 3);
152 152
153 QLabel *timeLimitLabel; 153 QLabel *timeLimitLabel;
154 timeLimitLabel= new QLabel( this, "timeLimitLabel" ); 154 timeLimitLabel= new QLabel( this, "timeLimitLabel" );
155 timeLimitLabel->setText( tr( "Recording Limit in seconds:" ) ); 155 timeLimitLabel->setText( tr( "Recording Limit in seconds:" ) );
156 SoundSettingsBaseLayout->addMultiCellWidget( timeLimitLabel , 7, 7, 0, 0, 1); 156 SoundSettingsBaseLayout->addMultiCellWidget( timeLimitLabel , 7, 7, 0, 0, 1);
157 157
158 timeLimitComboBox = new QComboBox( FALSE, this, "timeLimitComboBox" ); 158 timeLimitComboBox = new QComboBox( FALSE, this, "timeLimitComboBox" );
159 timeLimitComboBox->insertItem( tr( "30" ) ); 159 timeLimitComboBox->insertItem( tr( "30" ) );
160 timeLimitComboBox->insertItem( tr( "20" ) ); 160 timeLimitComboBox->insertItem( tr( "20" ) );
161 timeLimitComboBox->insertItem( tr( "15" ) ); 161 timeLimitComboBox->insertItem( tr( "15" ) );
162 timeLimitComboBox->insertItem( tr( "10" ) ); 162 timeLimitComboBox->insertItem( tr( "10" ) );
163 timeLimitComboBox->insertItem( tr( "5" ) ); 163 timeLimitComboBox->insertItem( tr( "5" ) );
164 timeLimitComboBox->insertItem( tr( "Unlimited" ) ); 164 timeLimitComboBox->insertItem( tr( "Unlimited" ) );
165 165
166 SoundSettingsBaseLayout->addMultiCellWidget(timeLimitComboBox , 8, 8, 0, 0, 1); 166 SoundSettingsBaseLayout->addMultiCellWidget(timeLimitComboBox , 8, 8, 0, 0, 1);
167 167
168 168
169 restartCheckBox= new QCheckBox( this, "restartCheck" ); 169 restartCheckBox= new QCheckBox( this, "restartCheck" );
170 restartCheckBox->setText( tr( "Restart Opie if needed" ) ); 170 restartCheckBox->setText( tr( "Restart Opie if needed" ) );
171 171
172 SoundSettingsBaseLayout->addMultiCellWidget( restartCheckBox , 9, 9, 0, 0, 1); 172 SoundSettingsBaseLayout->addMultiCellWidget( restartCheckBox , 9, 9, 0, 0, 1);
173 173
174 174
175 QSpacerItem* spacer4 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding ); 175 QSpacerItem* spacer4 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Expanding );
176 SoundSettingsBaseLayout->addItem( spacer4, 9, 0 ); 176 SoundSettingsBaseLayout->addItem( spacer4, 9, 0 );
177} 177}
178 178
179/* 179/*
180 * Destroys the object and frees any allocated resources 180 * Destroys the object and frees any allocated resources
181 */ 181 */
182SoundSettingsBase::~SoundSettingsBase() 182SoundSettingsBase::~SoundSettingsBase()
183{ 183{
184 // no need to delete child widgets, Qt does it all for us 184 // no need to delete child widgets, Qt does it all for us
185} 185}