本文整理汇总了C++中RtMidiIn::isPortOpen方法的典型用法代码示例。如果您正苦于以下问题:C++ RtMidiIn::isPortOpen方法的具体用法?C++ RtMidiIn::isPortOpen怎么用?C++ RtMidiIn::isPortOpen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RtMidiIn
的用法示例。
在下文中一共展示了RtMidiIn::isPortOpen方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: start
void RtMidiDriver::start(const QList<bool> &deviceStatuses){
setInputDevicesStatus(deviceStatuses);
if(!hasInputDevices()){
return;
}
stop();
for(int deviceIndex=0; deviceIndex < inputDevicesEnabledStatuses.size(); deviceIndex++) {
if(deviceIndex < midiStreams.size()){
RtMidiIn* stream = midiStreams.at(deviceIndex);
if(stream && inputDevicesEnabledStatuses.at(deviceIndex)){//device is globally enabled?
if(!stream->isPortOpen()){
try{
qCInfo(jtMidi) << "Starting MIDI in " << QString::fromStdString(stream->getPortName(deviceIndex));
stream->openPort(deviceIndex);
}
catch(RtMidiError e){
qCCritical(jtMidi) << "Error opening midi port " << QString::fromStdString(e.getMessage());
}
}
else{
qCCritical(jtMidi) << "Port " << QString::fromStdString(stream->getPortName(deviceIndex)) << " already opened!";
}
}
}
}
}
示例2: closeInputDevice
FREObject closeInputDevice(FREContext ctx, void* funcData, uint32_t argc, FREObject argv[])
{
int pointer = 0;
FREGetObjectAsInt32(argv[0],&pointer);
try
{
RtMidiIn *in = (RtMidiIn *)pointer;
if(in->isPortOpen()) in->closePort();
removeDeviceIn(in);
delete in;
//printf("Num open midi devices %i\n",openMidiIn.size());
}catch(std::exception e)
{
printf("Error closing input device.\n");
}
FREObject result;
FRENewObjectFromBool(true,&result);
return result;
}