本文整理汇总了C++中IParam::GetLabelForHost方法的典型用法代码示例。如果您正苦于以下问题:C++ IParam::GetLabelForHost方法的具体用法?C++ IParam::GetLabelForHost怎么用?C++ IParam::GetLabelForHost使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IParam
的用法示例。
在下文中一共展示了IParam::GetLabelForHost方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Draw
bool ICaptionControl::Draw(IGraphics* pGraphics)
{
IParam* pParam = mPlug->GetParam(mParamIdx);
char cStr[32];
pParam->GetDisplayForHost(cStr);
mStr.Set(cStr);
if (mShowParamLabel) {
mStr.Append(" ");
mStr.Append(pParam->GetLabelForHost());
}
return ITextControl::Draw(pGraphics);
}
示例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;
}
示例3: SetHost
//.........这里部分代码省略.........
STR16(""),
0,
NPresets(),
ParameterInfo::kIsProgramChange));
}
if(!mIsInst)
{
StringListParameter * bypass = new StringListParameter(STR16("Bypass"),
kBypassParam,
0,
ParameterInfo::kCanAutomate | ParameterInfo::kIsBypass | ParameterInfo::kIsList);
bypass->appendString(STR16("off"));
bypass->appendString(STR16("on"));
parameters.addParameter(bypass);
}
for (int i=0; i<NParams(); i++)
{
IParam *p = GetParam(i);
int32 flags = 0;
UnitID unitID = kRootUnitId;
const char* paramGroupName = p->GetParamGroupForHost();
if (CSTR_NOT_EMPTY(paramGroupName))
{
for(int j = 0; j < mParamGroups.GetSize(); j++)
{
if(strcmp(paramGroupName, mParamGroups.Get(j)) == 0)
{
unitID = j+1;
}
}
if (unitID == kRootUnitId) // new unit, nothing found, so add it
{
mParamGroups.Add(paramGroupName);
unitID = mParamGroups.GetSize();
}
}
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(),
0, // continuous
flags,
unitID);
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,
unitID);
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;
}
}
}
OnHostIdentified();
RestorePreset(0);
return result;
}
示例4: EffectInit
AAX_Result IPlugAAX::EffectInit()
{
TRACE;
AAX_CString bypassID = NULL;
this->GetMasterBypassParameter( &bypassID );
mBypassParameter = new AAX_CParameter<bool>(bypassID.CString(),
AAX_CString("Master Bypass"),
false,
AAX_CBinaryTaperDelegate<bool>(),
AAX_CBinaryDisplayDelegate<bool>("bypass", "on"),
true);
mBypassParameter->SetNumberOfSteps( 2 );
mBypassParameter->SetType( AAX_eParameterType_Discrete );
mParameterManager.AddParameter(mBypassParameter);
for (int i=0;i<NParams();i++)
{
IParam *p = GetParam(i);
AAX_IParameter* param = 0;
WDL_String* paramID = new WDL_String("_", 1);
paramID->SetFormatted(32, "%i", i+kAAXParamIdxOffset);
mParamIDs.Add(paramID);
switch (p->Type())
{
case IParam::kTypeDouble:
{
param = new AAX_CParameter<double>(paramID->Get(),
AAX_CString(p->GetNameForHost()),
p->GetDefault(),
AAX_CIPlugTaperDelegate<double>(p->GetMin(), p->GetMax(), p->GetShape()),
AAX_CUnitDisplayDelegateDecorator<double>( AAX_CNumberDisplayDelegate<double>(), AAX_CString(p->GetLabelForHost())),
p->GetCanAutomate());
param->SetNumberOfSteps(128); // TODO: check this https://developer.digidesign.com/index.php?L1=5&L2=13&L3=56
param->SetType(AAX_eParameterType_Continuous);
break;
}
case IParam::kTypeInt:
{
param = new AAX_CParameter<int>(paramID->Get(),
AAX_CString(p->GetNameForHost()),
(int)p->GetDefault(),
AAX_CLinearTaperDelegate<int>((int)p->GetMin(), (int)p->GetMax()),
AAX_CUnitDisplayDelegateDecorator<int>( AAX_CNumberDisplayDelegate<int>(), AAX_CString(p->GetLabelForHost())),
p->GetCanAutomate());
param->SetNumberOfSteps(128);
param->SetType(AAX_eParameterType_Continuous);
break;
}
case IParam::kTypeEnum:
case IParam::kTypeBool:
{
int nTexts = p->GetNDisplayTexts();
std::map<int, AAX_CString> displayTexts;
for (int j=0; j<p->GetNDisplayTexts(); j++)
{
int value;
const char* text = p->GetDisplayTextAtIdx(j, &value);
displayTexts.insert(std::pair<int, AAX_CString>(value, AAX_CString(text)) );
}
param = new AAX_CParameter<int>(paramID->Get(),
AAX_CString(p->GetNameForHost()),
(int)p->GetDefault(),
AAX_CLinearTaperDelegate<int>((int)p->GetMin(), (int)p->GetMax()),
AAX_CStringDisplayDelegate<int>(displayTexts),
p->GetCanAutomate());
param->SetNumberOfSteps(nTexts);
param->SetType(AAX_eParameterType_Discrete);
break;
}
default:
break;
}
mParameterManager.AddParameter(param);
}
AAX_CSampleRate sr;
Controller()->GetSampleRate(&sr);
SetSampleRate(sr);
Reset();
return AAX_SUCCESS;
}