~ubuntu-branches/ubuntu/saucy/muse/saucy

« back to all changes in this revision

Viewing changes to muse/midiedit/ecanvas.cpp

  • Committer: Package Import Robot
  • Author(s): Alessio Treglia
  • Date: 2013-01-07 10:27:14 UTC
  • mfrom: (1.1.14)
  • Revision ID: package-import@ubuntu.com-20130107102714-fajkwjbz02aqupbh
Tags: 2.1-1
* New upstream release.
* Refresh 1001-buildsystem.patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
 
47
47
namespace MusEGui {
48
48
 
 
49
 
49
50
//---------------------------------------------------------
50
51
//   EventCanvas
51
52
//---------------------------------------------------------
476
477
      redraw();
477
478
      }
478
479
 
 
480
//---------------------------------------------------------
 
481
//   startPlayEvent
 
482
//---------------------------------------------------------
 
483
 
 
484
void EventCanvas::startPlayEvent(int note, int velocity, int port, int channel)
 
485
      {
 
486
      if (MusEGlobal::debugMsg)
 
487
        printf("EventCanvas::startPlayEvent %d %d %d %d\n", note, velocity, port, channel);
 
488
      playedPitch      = note + track()->transposition;
 
489
 
 
490
      // play note:
 
491
      MusECore::MidiPlayEvent e(0, port, channel, 0x90, playedPitch, velocity);
 
492
      MusEGlobal::audio->msgPlayMidiEvent(&e);
 
493
      }
 
494
 
 
495
void EventCanvas::startPlayEvent(int note, int velocity)
 
496
      {
 
497
      int port         = track()->outPort();
 
498
      int channel      = track()->outChannel();
 
499
      startPlayEvent(note, velocity, port, channel);
 
500
}
 
501
 
 
502
//---------------------------------------------------------
 
503
//   stopPlayEvent
 
504
//---------------------------------------------------------
 
505
 
 
506
void EventCanvas::stopPlayEvent()
 
507
      {
 
508
      int port    = track()->outPort();
 
509
      int channel = track()->outChannel();
 
510
 
 
511
      // release note:
 
512
      MusECore::MidiPlayEvent ev(0, port, channel, 0x90, playedPitch, 0);
 
513
      MusEGlobal::audio->msgPlayMidiEvent(&ev);
 
514
      playedPitch = -1;
 
515
      }
 
516
 
479
517
} // namespace MusEGui