本文整理汇总了C++中IParam::Value方法的典型用法代码示例。如果您正苦于以下问题:C++ IParam::Value方法的具体用法?C++ IParam::Value怎么用?C++ IParam::Value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IParam
的用法示例。
在下文中一共展示了IParam::Value方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetChunk
ComponentResult IPlugProcess::SetChunk(OSType chunkID, SFicPlugInChunk *chunk)
{
TRACE;
if (chunkID == mPluginID)
{
int dataSize = chunk->fSize - sizeof(SFicPlugInChunkHeader);
ByteChunk IPlugChunk;
IPlugChunk.PutBytes(chunk->fData, dataSize);
mPlug->UnserializeState(&IPlugChunk, 0);
for (int i = 0; i< mPlug->NParams(); i++)
{
IParam *p = mPlug->GetParam(i);
int idx = i+kPTParamIdxOffset;
switch (p->Type())
{
case IParam::kTypeDouble:
{
CPluginControl_Continuous *control = dynamic_cast<CPluginControl_Continuous*>(GetControl(idx));
SetControlValue(idx, control->ConvertContinuousToControl( p->Value() ));
break;
}
case IParam::kTypeInt:
case IParam::kTypeEnum:
case IParam::kTypeBool:
{
CPluginControl_Discrete *control = dynamic_cast<CPluginControl_Discrete*>(GetControl(idx));
SetControlValue(idx, control->ConvertDiscreteToControl( p->Int() ));
break;
}
default:
break;
}
}
fNumPlugInChanges++;
return noErr;
}
return kChunkRangeErr;
}
示例2: OnParamChange
void SpaceBass::OnParamChange(int paramIdx)
{
IMutexLock lock(this);
IParam* param = GetParam(paramIdx);
if(paramIdx == mLFOWaveform) {
voiceManager.setLFOMode(static_cast<Oscillator::OscillatorMode>(param->Int()));
} else if(paramIdx == mLFOFrequency) {
voiceManager.setLFOFrequency(param->Value());
} else {
using std::tr1::placeholders::_1;
using std::tr1::bind;
VoiceManager::VoiceChangerFunction changer;
switch(paramIdx) {
case mOsc1Waveform:
changer = bind(&VoiceManager::setOscillatorMode,
_1,
1,
static_cast<Oscillator::OscillatorMode>(param->Int()));
break;
case mOsc1PitchMod:
changer = bind(&VoiceManager::setOscillatorPitchMod, _1, 1, param->Value());
break;
case mOsc2Waveform:
changer = bind(&VoiceManager::setOscillatorMode, _1, 2, static_cast<Oscillator::OscillatorMode>(param->Int()));
break;
case mOsc2PitchMod:
changer = bind(&VoiceManager::setOscillatorPitchMod, _1, 2, param->Value());
break;
case mOscMix:
changer = bind(&VoiceManager::setOscillatorMix, _1, param->Value());
break;
// Filter Section:
case mFilterMode:
changer = bind(&VoiceManager::setFilterMode, _1, static_cast<Filter::FilterMode>(param->Int()));
break;
case mFilterCutoff:
changer = bind(&VoiceManager::setFilterCutoff, _1, param->Value());
break;
case mFilterResonance:
changer = bind(&VoiceManager::setFilterResonance, _1, param->Value());
break;
case mFilterLfoAmount:
changer = bind(&VoiceManager::setFilterLFOAmount, _1, param->Value());
break;
case mFilterEnvAmount:
changer = bind(&VoiceManager::setFilterEnvAmount, _1, param->Value());
break;
// Volume Envelope:
case mVolumeEnvAttack:
changer = bind(&VoiceManager::setVolumeEnvelopeStageValue, _1, EnvelopeGenerator::ENVELOPE_STAGE_ATTACK, param->Value());
break;
case mVolumeEnvDecay:
changer = bind(&VoiceManager::setVolumeEnvelopeStageValue, _1, EnvelopeGenerator::ENVELOPE_STAGE_DECAY, param->Value());
break;
case mVolumeEnvSustain:
changer = bind(&VoiceManager::setVolumeEnvelopeStageValue, _1, EnvelopeGenerator::ENVELOPE_STAGE_SUSTAIN, param->Value());
break;
case mVolumeEnvRelease:
changer = bind(&VoiceManager::setVolumeEnvelopeStageValue, _1, EnvelopeGenerator::ENVELOPE_STAGE_RELEASE, param->Value());
break;
// Filter Envelope:
case mFilterEnvAttack:
changer = bind(&VoiceManager::setFilterEnvelopeStageValue, _1, EnvelopeGenerator::ENVELOPE_STAGE_ATTACK, param->Value());
break;
case mFilterEnvDecay:
changer = bind(&VoiceManager::setFilterEnvelopeStageValue, _1, EnvelopeGenerator::ENVELOPE_STAGE_DECAY, param->Value());
break;
case mFilterEnvSustain:
changer = bind(&VoiceManager::setFilterEnvelopeStageValue, _1, EnvelopeGenerator::ENVELOPE_STAGE_SUSTAIN, param->Value());
break;
case mFilterEnvRelease:
changer = bind(&VoiceManager::setFilterEnvelopeStageValue, _1, EnvelopeGenerator::ENVELOPE_STAGE_RELEASE, param->Value());
break;
}
voiceManager.changeAllVoices(changer);
}
}
示例3: OnParamChange
void Synthesis::OnParamChange(int paramIdx)
{
IMutexLock lock(this);
VoiceManager& voiceManager = VoiceManager::getInstance();
IParam* param = GetParam(paramIdx);
// std::cout << paramIdx << "\n";
// printf("\nparam: %s", paramIdx);
switch(paramIdx) {
// Volume Envelope:
case mB:
voiceManager.updateInharmonicityCoeff(param->Value());
break;
case mNumPartials:
voiceManager.updateNumPartials(param->Value());
break;
case mStringDetuneRange:
voiceManager.updateStringDetuneRange(param->Value());
break;
case mPartialDetuneRange:
voiceManager.updatePartialDetuneRange(param->Value());
break;
case mDamping:
voiceManager.updateDamping(param->Value());
break;
case mLinearTerm:
voiceManager.updateLinearTerm(param->Value());
break;
case mSquaredTerm:
voiceManager.updateSquaredTerm(param->Value());
break;
case mCubicTerm:
voiceManager.updateCubicTerm(param->Value());
break;
case mBrightnessA:
voiceManager.updateBrightnessA(param->Value());
break;
case mBrightnessB:
voiceManager.updateBrightnessB(param->Value());
break;
case mPitchBendCoarse:
voiceManager.updatePitchBendCoarse(param->Value());
break;
case mPitchBendFine:
voiceManager.updatePitchBendFine(param->Value());
break;
default:
break;
}
}