本文整理汇总了C++中IParam::GetNormalized方法的典型用法代码示例。如果您正苦于以下问题:C++ IParam::GetNormalized方法的具体用法?C++ IParam::GetNormalized怎么用?C++ IParam::GetNormalized使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IParam
的用法示例。
在下文中一共展示了IParam::GetNormalized方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetParameterFromPlug
void IGraphics::SetParameterFromPlug(int paramIdx, double value, bool normalized)
{
if (!normalized)
{
IParam* pParam = mPlug->GetParam(paramIdx);
value = pParam->GetNormalized(value);
}
int i, n = mControls.GetSize();
IControl** ppControl = mControls.GetList();
for (i = 0; i < n; ++i, ++ppControl)
{
IControl* pControl = *ppControl;
if (pControl->ParamIdx() == paramIdx)
{
//WDL_MutexLock lock(&mMutex);
pControl->SetValueFromPlug(value);
// Could be more than one, don't break until we check them all.
}
// now look for any auxilliary parameters
int auxParamIdx = pControl->AuxParamIdx(paramIdx);
if (auxParamIdx > -1) // there are aux params
{
pControl->SetAuxParamValueFromPlug(auxParamIdx, value);
}
}
}
示例2: GetParam
ParamValue PLUGIN_API IPlugVST3Plugin::plainParamToNormalized(ParamID tag, ParamValue plainValue)
{
IParam* param = GetParam(tag);
if (param)
{
return param->GetNormalized(plainValue);
}
return plainValue;
}
示例3: GetParam
ParamValue PLUGIN_API IPlugVST3::getParamNormalized(ParamID tag)
{
IParam* param = GetParam(tag);
if (param)
{
return param->GetNormalized();
}
return 0.0;
}
示例4: SetParameterFromPlug
void IGraphics::SetParameterFromPlug(int paramIdx, double value, bool normalized)
{
if (!normalized) {
IParam* pParam = mPlug->GetParam(paramIdx);
value = pParam->GetNormalized(value);
}
int i, n = mControls.GetSize();
IControl** ppControl = mControls.GetList();
for (i = 0; i < n; ++i, ++ppControl) {
IControl* pControl = *ppControl;
if (pControl->ParamIdx() == paramIdx) {
//WDL_MutexLock lock(&mMutex);
pControl->SetValueFromPlug(value);
// Could be more than one, don't break until we check them all.
}
}
}
示例5: ClampControl
void IGraphics::ClampControl(int paramIdx, double lo, double hi, bool normalized)
{
if (!normalized) {
IParam* pParam = mPlug->GetParam(paramIdx);
lo = pParam->GetNormalized(lo);
hi = pParam->GetNormalized(hi);
}
int i, n = mControls.GetSize();
IControl** ppControl = mControls.GetList();
for (i = 0; i < n; ++i, ++ppControl) {
IControl* pControl = *ppControl;
if (pControl->ParamIdx() == paramIdx) {
pControl->Clamp(lo, hi);
}
// Could be more than one, don't break until we check them all.
}
}
示例6: return
ParamValue PLUGIN_API IPlugVST3Plugin::getParamNormalized(ParamID tag)
{
if (tag == kBypassParam)
{
return (ParamValue) mIsBypassed;
}
// else if (tag == kPresetParam)
// {
// return (ParamValue) ToNormalizedParam(mCurrentPresetIdx, 0, NPresets(), 1.);
// }
IParam* param = GetParam(tag);
if (param)
{
return param->GetNormalized();
}
return 0.0;
}
示例7: VSTDispatcher
//.........这里部分代码省略.........
{
_this->mHasVSTExtensions |= VSTEXT_COCOA;
return 0xbeef0000;
}
}
return 0;
}
case effVendorSpecific: {
switch (idx) {
// Mouse wheel
case 0x73744341: {
if (value == 0x57686565) {
IGraphics* pGraphics = _this->GetGUI();
if (pGraphics) {
return pGraphics->ProcessMouseWheel(opt);
}
}
break;
}
// Support Reaper VST extensions: http://www.reaper.fm/sdk/vst/
case effGetParamDisplay: {
if (ptr) {
if (value >= 0 && value < _this->NParams()) {
_this->GetParam(value)->GetDisplayForHost((double) opt, true, (char*) ptr);
}
return 0xbeef;
}
break;
}
case effString2Parameter: {
if (ptr && value >= 0 && value < _this->NParams()) {
if (*(char*) ptr != '\0') {
IParam* pParam = _this->GetParam(value);
sprintf((char*) ptr, "%.17f", pParam->GetNormalized(VSTString2Parameter(pParam, (char*) ptr)));
}
return 0xbeef;
}
break;
}
case kVstParameterUsesIntStep: {
if (value >= 0 && value < _this->NParams()) {
IParam* pParam = _this->GetParam(value);
switch (pParam->Type()) {
case IParam::kTypeBool: {
return 0xbeef;
}
case IParam::kTypeInt:
case IParam::kTypeEnum: {
double min, max;
pParam->GetBounds(&min, &max);
if (fabs(max - min) < 1.5) {
return 0xbeef;
}
break;
}
}
}
break;
}
}
return 0;
}
case effGetProgram: {
return _this->GetCurrentPresetIdx();
}
case effSetProgram: {