void AudioPrefetch::start(int priority) { clearPollFd(); addPollFd(toThreadFdr, POLLIN, ::readMsgP, this, 0); //Thread::start(); Thread::start(priority); }
void MidiSeq::addAlsaPollFd() { // 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); }
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); }