本文整理汇总了C++中Patch::addOperator方法的典型用法代码示例。如果您正苦于以下问题:C++ Patch::addOperator方法的具体用法?C++ Patch::addOperator怎么用?C++ Patch::addOperator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Patch
的用法示例。
在下文中一共展示了Patch::addOperator方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeOperatorData
void writeOperatorData(Operator* target, string data)
{
unsigned int pos = string::npos;
if((pos = data.find("id")) != string::npos)
{
char value[128];
sscanf(data.c_str(), "%*s %*c %s", value);
for(PatchIterator iter = patches.begin(); iter != patches.end(); ++iter)
{
Patch* patch = iter->second;
patch->addOperator(value, target);
}
}
else if((pos = data.find("key_follow")) != string::npos)
{
int value;
sscanf(data.c_str(), "%*s %*c %d", &value);
target->setKeyFollow(value);
}
else if((pos = data.find("key_offset")) != string::npos)
{
int value;
sscanf(data.c_str(), "%*s %*c %d", &value);
target->setKeyOffset(value);
}
else if((pos = data.find("octave_offset")) != string::npos)
{
int value;
sscanf(data.c_str(), "%*s %*c %d", &value);
target->setOctaveOffset(value);
}
else if((pos = data.find("modulator_type")) != string::npos)
{
int value;
sscanf(data.c_str(), "%*s %*c %d", &value);
target->setModulatorType(value);
}
else if((pos = data.find("oscillator_level")) != string::npos)
{
double value;
sscanf(data.c_str(), "%*s %*c %lf", &value);
target->setOscillatorLevel(value);
}
else if((pos = data.find("oscillator_frequency")) != string::npos)
{
double value;
sscanf(data.c_str(), "%*s %*c %lf", &value);
target->setOscillatorFrequency(value);
}
else if((pos = data.find("oscillator_phase")) != string::npos)
{
double value;
sscanf(data.c_str(), "%*s %*c %lf", &value);
target->setOscillatorPhase(value);
}
else if((pos = data.find("amp_attack")) != string::npos)
{
double value;
sscanf(data.c_str(), "%*s %*c %lf", &value);
target->getEnvelope()->setAttack(value);
}
else if((pos = data.find("amp_decay")) != string::npos)
{
double value;
sscanf(data.c_str(), "%*s %*c %lf", &value);
target->getEnvelope()->setDecay(value);
}
else if((pos = data.find("amp_sustain")) != string::npos)
{
double value;
sscanf(data.c_str(), "%*s %*c %lf", &value);
target->getEnvelope()->setSustain(value);
}
else if((pos = data.find("amp_release ")) != string::npos)
{
double value;
sscanf(data.c_str(), "%*s %*c %lf", &value);
target->getEnvelope()->setRelease(value);
}
else if((pos = data.find("amp_release_point")) != string::npos)
{
double value;
sscanf(data.c_str(), "%*s %*c %lf", &value);
target->getEnvelope()->setReleasePoint(value);
}
else if((pos = data.find("amp_envelope_amount")) != string::npos)
//.........这里部分代码省略.........