本文整理汇总了C++中MidiTrack::addManagedTrack方法的典型用法代码示例。如果您正苦于以下问题:C++ MidiTrack::addManagedTrack方法的具体用法?C++ MidiTrack::addManagedTrack怎么用?C++ MidiTrack::addManagedTrack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MidiTrack
的用法示例。
在下文中一共展示了MidiTrack::addManagedTrack方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: importMidi
//.........这里部分代码省略.........
for (i = el->begin(); i != el->end(); ++i)
{
MidiPlayEvent ev = *i;
if (ev.type() != ME_SYSEX && ev.type() != ME_META && ev.channel() == channel)
break;
}
if (i == el->end())
continue;
MidiTrack* track = new MidiTrack();
track->setDefaultName();
track->setMasterFlag(true);
track->setOutChannel(channel);
track->setOutPort(mPort);
MidiPort* mport = &midiPorts[track->outPort()];
// this overwrites any instrument set for this port:
mport->setInstrument(instr);
EventList* mel = track->events();
buildMidiEventList(mel, el, track, division, first, false, false);
first = false;
processTrack(track);
song->insertTrack(track, -1);
//Create the Audio input side of the track
Track* input = song->addTrackByName(QString("i").append(track->name()), Track::AUDIO_INPUT, -1, false, false);
if(input)
{
input->setMasterFlag(false);
input->setChainMaster(track->id());
track->addManagedTrack(input->id());
}
}
}
if (first)
{
//
// track does only contain non-channel messages
// (SYSEX or META)
//
MidiTrack* track = new MidiTrack();
track->setDefaultName();
track->setMasterFlag(true);
track->setOutChannel(0);
track->setOutPort(mPort);
EventList* mel = track->events();
//buildMidiEventList(mel, el, track, division, true);
// Do SysexMeta. Don't do loops.
buildMidiEventList(mel, el, track, division, true, false, false);
processTrack(track);
song->insertTrack(track, -1);
//Create the Audio input side of the track
Track* input = song->addTrackByName(QString("i").append(track->name()), Track::AUDIO_INPUT, -1, false, false);
if(input)
{
input->setMasterFlag(false);
input->setChainMaster(track->id());
track->addManagedTrack(input->id());
}
}
mPort++;
//FIXME: Provice a non-iterative way to do this using the new losMidiPorts hash
//Or maintain a list of configured or inuse ports