本文整理汇总了C++中IParam::GetStep方法的典型用法代码示例。如果您正苦于以下问题:C++ IParam::GetStep方法的具体用法?C++ IParam::GetStep怎么用?C++ IParam::GetStep使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IParam
的用法示例。
在下文中一共展示了IParam::GetStep方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EffectInit
void IPlugProcess::EffectInit()
{
TRACE;
if (mPlug)
{
AddControl(new CPluginControl_OnOff('bypa', "Master Bypass\nMastrByp\nMByp\nByp", false, true)); // Default to off
DefineMasterBypassControlIndex(1);
int paramCount = mPlug->NParams();
for (int i=0; i<paramCount; i++)
{
IParam *p = mPlug->GetParam(i);
switch (p->Type())
{
case IParam::kTypeDouble:
AddControl(new CPluginControl_Linear(' ld '+i, p->GetNameForHost(), p->GetMin(), p->GetMax(), p->GetStep(), p->GetDefault(), p->GetCanAutomate()));
break;
case IParam::kTypeInt:
AddControl(new CPluginControl_Discrete(' ld '+i, p->GetNameForHost(), (long) p->GetMin(), (long) p->GetMax(), (long) p->GetDefault(), p->GetCanAutomate()));
break;
case IParam::kTypeEnum:
case IParam::kTypeBool:
{
std::vector<std::string> displayTexts;
for (int j=0; j<p->GetNDisplayTexts(); j++)
{
displayTexts.push_back(p->GetDisplayTextAtIdx(j));
}
assert(displayTexts.size());
AddControl(new CPluginControl_List(' ld '+i, p->GetNameForHost(), displayTexts, (long) p->GetDefault(), p->GetCanAutomate()));
break;
}
default:
break;
}
}
#if PLUG_DOES_MIDI
if (!IsAS())
{
ComponentResult result = noErr;
Cmn_Int32 requestedVersion = 7;
std::string midiNodeName(PLUG_NAME" Midi");
while (requestedVersion)
{
result = DirectMidi_RegisterClient(requestedVersion, this, reinterpret_cast<Cmn_UInt32>(this), (void **)&mDirectMidiInterface);
if (result == noErr && mDirectMidiInterface != NULL)
{
mDirectMidiInterface->CreateRTASBufferedMidiNode(0, const_cast<char *>(midiNodeName.c_str()), 1);
break;
}
requestedVersion--;
}
}
#endif
mPlug->SetIO(GetNumInputs(), GetNumOutputs());
mPlug->SetSampleRate(GetSampleRate());
mPlug->Reset();
}
}
示例2: if
tresult PLUGIN_API IPlugVST3::initialize (FUnknown* context)
{
TRACE;
tresult result = SingleComponentEffect::initialize (context);
if (result == kResultOk)
{
addAudioInput (STR16("Audio Input"), getSpeakerArrForChans(NInChannels()) );
addAudioOutput (STR16("Audio Output"), getSpeakerArrForChans(NOutChannels()) );
if (mScChans == 1)
addAudioInput(STR16("Sidechain Input"), SpeakerArr::kMono, kAux, 0);
else if (mScChans >= 2)
{
mScChans = 2;
addAudioInput(STR16("Sidechain Input"), SpeakerArr::kStereo, kAux, 0);
}
if(mDoesMidi) {
addEventInput (STR16("MIDI In"), 1);
addEventOutput(STR16("MIDI Out"), 1);
}
for (int i=0;i<NParams();i++)
{
IParam *p = GetParam(i);
int32 flags = 0;
if (p->GetCanAutomate()) {
flags |= ParameterInfo::kCanAutomate;
}
switch (p->Type()) {
case IParam::kTypeDouble:
case IParam::kTypeInt:
{
Parameter* param = new RangeParameter ( STR16(p->GetNameForHost()),
i,
STR16(p->GetLabelForHost()),
p->GetMin(),
p->GetMax(),
p->GetDefault(),
p->GetStep(),
flags);
param->setPrecision (p->GetPrecision());
parameters.addParameter (param);
break;
}
case IParam::kTypeEnum:
case IParam::kTypeBool:
{
StringListParameter* param = new StringListParameter (STR16(p->GetNameForHost()),
i,
STR16(p->GetLabelForHost()),
flags | ParameterInfo::kIsList);
int nDisplayTexts = p->GetNDisplayTexts();
assert(nDisplayTexts);
for (int j=0; j<nDisplayTexts; j++)
{
param->appendString(STR16(p->GetDisplayText(j)));
}
parameters.addParameter (param);
break;
}
default:
break;
}
}
}
return result;
}