本文整理汇总了C++中OSCMessage::getMethod方法的典型用法代码示例。如果您正苦于以下问题:C++ OSCMessage::getMethod方法的具体用法?C++ OSCMessage::getMethod怎么用?C++ OSCMessage::getMethod使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OSCMessage
的用法示例。
在下文中一共展示了OSCMessage::getMethod方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ev
void
AudioPluginOSCGUIManager::dispatch()
{
if (!m_studio)
return ;
while (m_oscBuffer.getReadSpace() > 0) {
OSCMessage *message = 0;
m_oscBuffer.read(&message, 1);
int instrument = message->getTarget();
int position = message->getTargetData();
PluginContainer *container = m_studio->getContainerById(instrument);
if (!container) continue;
AudioPluginInstance *pluginInstance = container->getPlugin(position);
if (!pluginInstance) continue;
AudioPluginOSCGUI *gui = 0;
if (m_guis.find(instrument) == m_guis.end()) {
RG_DEBUG << "AudioPluginOSCGUIManager: no GUI for instrument "
<< instrument << endl;
} else if (m_guis[instrument].find(position) == m_guis[instrument].end()) {
RG_DEBUG << "AudioPluginOSCGUIManager: no GUI for instrument "
<< instrument << ", position " << position << endl;
} else {
gui = m_guis[instrument][position];
}
std::string method = message->getMethod();
char type;
const lo_arg *arg;
// These generally call back on the RosegardenMainWindow. We'd
// like to emit signals, but making AudioPluginOSCGUIManager a
// QObject is problematic if it's only conditionally compiled.
if (method == "control") {
if (message->getArgCount() != 2) {
RG_DEBUG << "AudioPluginOSCGUIManager: wrong number of args ("
<< message->getArgCount() << ") for control method"
<< endl;
goto done;
}
if (!(arg = message->getArg(0, type)) || type != 'i') {
RG_DEBUG << "AudioPluginOSCGUIManager: failed to get port number"
<< endl;
goto done;
}
int port = arg->i;
if (!(arg = message->getArg(1, type)) || type != 'f') {
RG_DEBUG << "AudioPluginOSCGUIManager: failed to get port value"
<< endl;
goto done;
}
float value = arg->f;
RG_DEBUG << "AudioPluginOSCGUIManager: setting port " << port
<< " to value " << value << endl;
m_mainWindow->slotChangePluginPort(instrument, position, port, value);
} else if (method == "program") {
if (message->getArgCount() != 2) {
RG_DEBUG << "AudioPluginOSCGUIManager: wrong number of args ("
<< message->getArgCount() << ") for program method"
<< endl;
goto done;
}
if (!(arg = message->getArg(0, type)) || type != 'i') {
RG_DEBUG << "AudioPluginOSCGUIManager: failed to get bank number"
<< endl;
goto done;
}
int bank = arg->i;
if (!(arg = message->getArg(1, type)) || type != 'i') {
RG_DEBUG << "AudioPluginOSCGUIManager: failed to get program number"
<< endl;
goto done;
}
int program = arg->i;
QString programName = StudioControl::getPluginProgram
(pluginInstance->getMappedId(), bank, program);
m_mainWindow->slotChangePluginProgram(instrument, position, programName);
} else if (method == "update") {
if (message->getArgCount() != 1) {
RG_DEBUG << "AudioPluginOSCGUIManager: wrong number of args ("
<< message->getArgCount() << ") for update method"
<< endl;
goto done;
//.........这里部分代码省略.........