-rw-r--r-- | noncore/multimedia/powerchord/powerchordbase.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/noncore/multimedia/powerchord/powerchordbase.cpp b/noncore/multimedia/powerchord/powerchordbase.cpp index 0694ba3..92198bf 100644 --- a/noncore/multimedia/powerchord/powerchordbase.cpp +++ b/noncore/multimedia/powerchord/powerchordbase.cpp | |||
@@ -387,25 +387,26 @@ PowerchordBase::PowerchordBase( QWidget* parent, const char* name, WFlags fl ) | |||
387 | connect( frets, SIGNAL( s4nameChanged(const QString&) ), s1_4, SLOT( setText(const QString&) ) ); | 387 | connect( frets, SIGNAL( s4nameChanged(const QString&) ), s1_4, SLOT( setText(const QString&) ) ); |
388 | connect( frets, SIGNAL( s5nameChanged(const QString&) ), s1_5, SLOT( setText(const QString&) ) ); | 388 | connect( frets, SIGNAL( s5nameChanged(const QString&) ), s1_5, SLOT( setText(const QString&) ) ); |
389 | connect( frets, SIGNAL( s6nameChanged(const QString&) ), s1_6, SLOT( setText(const QString&) ) ); | 389 | connect( frets, SIGNAL( s6nameChanged(const QString&) ), s1_6, SLOT( setText(const QString&) ) ); |
390 | connect( frets, SIGNAL( nameChanged(const QString&) ), chordname, SLOT( setText(const QString&) ) ); | 390 | connect( frets, SIGNAL( nameChanged(const QString&) ), chordname, SLOT( setText(const QString&) ) ); |
391 | } | 391 | } |
392 | 392 | ||
393 | 393 | ||
394 | static int known=0; | 394 | static int known=0; |
395 | #include <qmessagebox.h> | 395 | #include <qmessagebox.h> |
396 | void PowerchordBase::transport_rec_cb(){ | 396 | void PowerchordBase::transport_rec_cb(){ |
397 | chordlist->insertItem(chordname->text(),-1); | 397 | chordlist->insertItem(chordname->text(),-1); |
398 | if (!known){ | 398 | if (!known){ |
399 | QMessageBox::information(this, "Powerchord", "This chord has been saved\ninto the list of chords,\nfor later playback."); | 399 | QMessageBox::information(this, tr("Powerchord"), |
400 | tr("<P>This chord has been saved into the list of chords, for later playback.<P>"); | ||
400 | known = 1; | 401 | known = 1; |
401 | } | 402 | } |
402 | } | 403 | } |
403 | void PowerchordBase::list_remove_cb(){ | 404 | void PowerchordBase::list_remove_cb(){ |
404 | if (chordlist->count() > 0){ | 405 | if (chordlist->count() > 0){ |
405 | chordlist->removeItem(0); | 406 | chordlist->removeItem(0); |
406 | } | 407 | } |
407 | } | 408 | } |
408 | void PowerchordBase::play_chord_cb(){ | 409 | void PowerchordBase::play_chord_cb(){ |
409 | // QMessageBox::information(this, "Coming soon!", "This button plays\nthe chord by synthesizing\nthe sound of the notes."); | 410 | // QMessageBox::information(this, "Coming soon!", "This button plays\nthe chord by synthesizing\nthe sound of the notes."); |
410 | 411 | ||
411 | 412 | ||
@@ -430,25 +431,26 @@ void PowerchordBase::play_chord_cb(){ | |||
430 | }else{ | 431 | }else{ |
431 | // subtle bug here - replay second note if 1st one muted | 432 | // subtle bug here - replay second note if 1st one muted |
432 | note = frets->ce.noteindex(1); | 433 | note = frets->ce.noteindex(1); |
433 | base = note % 12; | 434 | base = note % 12; |
434 | octave = note / 12; | 435 | octave = note / 12; |
435 | synth->note_start(1, base, octave); | 436 | synth->note_start(1, base, octave); |
436 | 437 | ||
437 | } | 438 | } |
438 | 439 | ||
439 | // init synth | 440 | // init synth |
440 | if (synth->Play()){ | 441 | if (synth->Play()){ |
441 | // error | 442 | // error |
442 | QMessageBox::information(this, "Powerchord", "Unable to open device for sound playback - check that no other application is using it."); | 443 | QMessageBox::information(this, tr("Powerchord"), |
444 | tr("<P>Unable to open device for sound playback - check that no other application is using it.</P>")); | ||
443 | return; | 445 | return; |
444 | } | 446 | } |
445 | synth->fill_buffer(); | 447 | synth->fill_buffer(); |
446 | 448 | ||
447 | // start timer | 449 | // start timer |
448 | audio_timer = new QTimer(); | 450 | audio_timer = new QTimer(); |
449 | connect(audio_timer, SIGNAL( timeout() ), this, SLOT( audio_cb() )); | 451 | connect(audio_timer, SIGNAL( timeout() ), this, SLOT( audio_cb() )); |
450 | // set pixmap on player? | 452 | // set pixmap on player? |
451 | audio_timer->start(19); // 19 msec (fudge factor!!) | 453 | audio_timer->start(19); // 19 msec (fudge factor!!) |
452 | } | 454 | } |
453 | } | 455 | } |
454 | 456 | ||
@@ -521,25 +523,27 @@ void PowerchordBase::tuner_cb(){ | |||
521 | // do something with the note: tuner->Note() | 523 | // do something with the note: tuner->Note() |
522 | emit frequency_change(tuner->Tuning()); | 524 | emit frequency_change(tuner->Tuning()); |
523 | 525 | ||
524 | }else{ | 526 | }else{ |
525 | simulation_timer->stop(); | 527 | simulation_timer->stop(); |
526 | tuner->Stop(); | 528 | tuner->Stop(); |
527 | tuner_pic1->setPixmap( image6 ); | 529 | tuner_pic1->setPixmap( image6 ); |
528 | } | 530 | } |
529 | } | 531 | } |
530 | 532 | ||
531 | 533 | ||
532 | void PowerchordBase::tuner_start_cb(){ | 534 | void PowerchordBase::tuner_start_cb(){ |
533 | if (0 == QMessageBox::information(this, "Powerchord", "Using the microphone,\nthe note's frequency\nis analysed. This\nis a simulation.", "OK", "Cancel", 0, 1)){ | 535 | if (0 == QMessageBox::information(this, tr("Powerchord"), |
536 | tr("<P>Using the microphone, the note's frequency is analysed. This is a simulation.</P>"), | ||
537 | tr("OK"), tr("Cancel"), 0, 1)){ | ||
534 | if (simulation_timer){ | 538 | if (simulation_timer){ |
535 | simulation_timer->stop(); | 539 | simulation_timer->stop(); |
536 | }else{ | 540 | }else{ |
537 | simulation_timer = new QTimer(); | 541 | simulation_timer = new QTimer(); |
538 | connect(simulation_timer, SIGNAL( timeout() ), this, SLOT( tuner_simulation_cb() )); | 542 | connect(simulation_timer, SIGNAL( timeout() ), this, SLOT( tuner_simulation_cb() )); |
539 | 543 | ||
540 | } | 544 | } |
541 | simulation_x = -45; | 545 | simulation_x = -45; |
542 | simulation_v = 0; | 546 | simulation_v = 0; |
543 | simulation_iter = 0; | 547 | simulation_iter = 0; |
544 | 548 | ||
545 | tuner_pic1->setPixmap( image_open ); | 549 | tuner_pic1->setPixmap( image_open ); |