本文整理汇总了C++中MidiDevice::recordEvents方法的典型用法代码示例。如果您正苦于以下问题:C++ MidiDevice::recordEvents方法的具体用法?C++ MidiDevice::recordEvents怎么用?C++ MidiDevice::recordEvents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MidiDevice
的用法示例。
在下文中一共展示了MidiDevice::recordEvents方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processMidi
//.........这里部分代码省略.........
// p3.3.50 Removed
//int channel = r->channel;
// NOTE: TODO: Special for input device sysex 'channel' marked as -1, ** IF we end up going with that method **.
// This would mean having a separate 'System' channel listed in the routing popups.
// The other alternative is to accept sysex from a device as long as ANY regular channel is routed from it,
// this does not require a 'System' channel listed in the routing popups.
// But that requires more code below... Done.
//if(channel == -1)
//channel = MIDI_CHANNELS; // Special channel '17'
// continue;
//int devport = dev->midiPort();
// record only from ports marked in portMask:
//if (devport == -1 || !(portMask & (1 << devport)))
//if (devport == -1)
// continue;
//MREventList* el = dev->recordEvents();
//MidiFifo& rf = dev->recordEvents();
int channelMask = r->channel; // p3.3.50
if (channelMask == -1 || channelMask == 0)
continue;
for (int channel = 0; channel < MIDI_CHANNELS; ++channel) // p3.3.50
{
if (!(channelMask & (1 << channel)))
continue;
if (!dev->sysexFIFOProcessed())
{
// Set to the sysex fifo at first.
MidiFifo& rf = dev->recordEvents(MIDI_CHANNELS);
// Get the frozen snapshot of the size.
int count = dev->tmpRecordCount(MIDI_CHANNELS);
for (int i = 0; i < count; ++i)
{
MidiPlayEvent event(rf.peek(i));
//unsigned time = event.time() + segmentSize*(segmentCount-1);
//unsigned time = event.time() + (extsync ? config.division/24 : segmentSize*(segmentCount-1));
//unsigned time = extsync ? curTickPos : (event.time() + segmentSize*(segmentCount-1));
//event.setTime(time);
//if(!extsync)
// event.setTime(event.time() + segmentSize*(segmentCount-1));
event.setPort(port);
// dont't echo controller changes back to software
// synthesizer:
if (!dev->isSynti() && md && track->recEcho())
playEvents->add(event);
// If syncing externally the event time is already in units of ticks, set above.
if (!extsync)
{
//time = tempomap.frame2tick(event.time());
//event.setTime(time); // set tick time
event.setTime(tempomap.frame2tick(event.time())); // set tick time
}
if (recording)
rl->add(event);
}