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

« back to all changes in this revision

Viewing changes to muse/midiedit/dcanvas.cpp

  • Committer: Package Import Robot
  • Author(s): Alessio Treglia
  • Date: 2013-01-31 10:21:39 UTC
  • mfrom: (1.1.15)
  • Revision ID: package-import@ubuntu.com-20130131102139-3nzmsj7eoul58cp5
Tags: 2.1.1-1
* New upstream release.
* Refresh patches.
* Remove unnecessary debian/patches/0001-es_locale_fix.patch.
* Fix Vcs fields.
* Refresh debian/copyright.
* Elaborate public-domain licensed code.
* Fix doc-base control file.
* Bump debhelper requirements.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
 
59
59
using MusEGlobal::debugMsg;
60
60
using MusEGlobal::heavyDebugMsg;
 
61
using MusECore::Track;
61
62
using MusECore::MidiTrack;
62
63
 
63
64
namespace MusEGui {
415
416
  e.setLenTick(ourDrumMap[instrument].len);
416
417
  if(_playEvents)
417
418
  {
418
 
    int port = old_style_drummap_mode ? ourDrumMap[instrument].port : dynamic_cast<MidiTrack*>(*instrument_map[instrument].tracks.begin())->outPort();
419
 
    int channel = old_style_drummap_mode ? ourDrumMap[instrument].channel : dynamic_cast<MidiTrack*>(*instrument_map[instrument].tracks.begin())->outChannel();
420
 
    startPlayEvent(e.pitch(),e.velo(), port, channel);
 
419
    int pitch = old_style_drummap_mode ? ourDrumMap[instrument].anote : instrument_map[instrument].pitch;
 
420
    int port, channel;
 
421
    if(old_style_drummap_mode)
 
422
    {
 
423
      port = ourDrumMap[instrument].port;
 
424
      channel = ourDrumMap[instrument].channel;
 
425
    }
 
426
    else
 
427
    {
 
428
      Track* t = *instrument_map[instrument].tracks.begin();
 
429
      if(!t->isMidiTrack())
 
430
        return NULL;
 
431
      MidiTrack* mt = static_cast<MidiTrack*>(t);
 
432
      port = mt->outPort();
 
433
      channel = mt->outChannel();
 
434
    }
 
435
    startPlayEvent(pitch, e.velo(), port, channel);
421
436
  }
422
 
 
423
437
  return new DEvent(e, curPart, instrument);
424
438
}
425
439