本文整理汇总了C++中MidiDevice::selectWfd方法的典型用法代码示例。如果您正苦于以下问题:C++ MidiDevice::selectWfd方法的具体用法?C++ MidiDevice::selectWfd怎么用?C++ MidiDevice::selectWfd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MidiDevice
的用法示例。
在下文中一共展示了MidiDevice::selectWfd方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updatePollFd
void MidiSeq::updatePollFd()
{
if (!isRunning())
return;
clearPollFd();
addPollFd(timerFd, POLLIN, midiTick, this, 0);
if (timerFd == -1) {
fprintf(stderr, "updatePollFd: no timer fd\n");
if (!MusEGlobal::debugMode)
exit(-1);
}
addPollFd(toThreadFdr, POLLIN, MusECore::readMsg, this, 0);
//---------------------------------------------------
// midi ports
//---------------------------------------------------
for (iMidiDevice imd = MusEGlobal::midiDevices.begin(); imd != MusEGlobal::midiDevices.end(); ++imd) {
MidiDevice* dev = *imd;
int port = dev->midiPort();
if (port == -1)
continue;
if ((dev->rwFlags() & 0x2) || (MusEGlobal::extSyncFlag.value()
&& (MusEGlobal::midiPorts[port].syncInfo().MCIn())))
addPollFd(dev->selectRfd(), POLLIN, MusECore::midiRead, this, dev);
if (dev->bytesToWrite())
addPollFd(dev->selectWfd(), POLLOUT, MusECore::midiWrite, this, dev);
}
// special handling for alsa midi:
// (one fd for all devices)
// this allows for processing of some alsa events
// even if no alsa driver is active (assigned to a port)
addPollFd(alsaSelectRfd(), POLLIN, MusECore::alsaMidiRead, this, 0);
}