本文整理汇总了C++中MidiDevice::getIPBControlParameters方法的典型用法代码示例。如果您正苦于以下问题:C++ MidiDevice::getIPBControlParameters方法的具体用法?C++ MidiDevice::getIPBControlParameters怎么用?C++ MidiDevice::getIPBControlParameters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MidiDevice
的用法示例。
在下文中一共展示了MidiDevice::getIPBControlParameters方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: instrumentParametersChanged
void
MidiMixerWindow::slotControllerDeviceEventReceived(MappedEvent *e,
const void *preferredCustomer)
{
if (preferredCustomer != this)
return ;
RG_DEBUG << "MidiMixerWindow::slotControllerDeviceEventReceived: this one's for me" << endl;
raise();
// get channel number n from event
// get nth instrument on current tab
if (e->getType() != MappedEvent::MidiController)
return ;
unsigned int channel = e->getRecordedChannel();
MidiByte controller = e->getData1();
MidiByte value = e->getData2();
int tabIndex = m_tabWidget->currentIndex();
int i = 0;
for (DeviceList::const_iterator it = m_studio->begin();
it != m_studio->end(); ++it) {
MidiDevice *dev =
dynamic_cast<MidiDevice*>(*it);
if (!dev)
continue;
if (i != tabIndex) {
++i;
continue;
}
InstrumentList instruments = dev->getPresentationInstruments();
for (InstrumentList::const_iterator iIt =
instruments.begin(); iIt != instruments.end(); ++iIt) {
Instrument *instrument = *iIt;
if (instrument->getNaturalChannel() != channel)
continue;
ControlList cl = dev->getIPBControlParameters();
for (ControlList::const_iterator i = cl.begin();
i != cl.end(); ++i) {
if ((*i).getControllerValue() == controller) {
RG_DEBUG << "Setting controller " << controller << " for instrument " << instrument->getId() << " to " << value << endl;
instrument->setControllerValue(controller, value);
break;
}
}
slotUpdateInstrument(instrument->getId());
emit instrumentParametersChanged(instrument->getId());
}
break;
}
}