当前位置: 首页>>代码示例>>C++>>正文


C++ IParam::InitDouble方法代码示例

本文整理汇总了C++中IParam::InitDouble方法的典型用法代码示例。如果您正苦于以下问题:C++ IParam::InitDouble方法的具体用法?C++ IParam::InitDouble怎么用?C++ IParam::InitDouble使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IParam的用法示例。


在下文中一共展示了IParam::InitDouble方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CreateParams

void SpaceBass::CreateParams() {
  for (int i = 0; i < kNumParams; i++) {
    IParam* param = GetParam(i);
    const parameterProperties_struct& properties = parameterProperties[i];
    switch (i) {
        // Enum Parameters:
      case mOsc1Waveform:
      case mOsc2Waveform:
        param->InitEnum(properties.name,
                        Oscillator::OSCILLATOR_MODE_SAW,
                        Oscillator::kNumOscillatorModes);
        // For VST3:
        param->SetDisplayText(0, properties.name);
        break;
      case mLFOWaveform:
        param->InitEnum(properties.name,
                        Oscillator::OSCILLATOR_MODE_TRIANGLE,
                        Oscillator::kNumOscillatorModes);
        // For VST3:
        param->SetDisplayText(0, properties.name);
        break;
      case mFilterMode:
        param->InitEnum(properties.name,
                        Filter::FILTER_MODE_LOWPASS,
                        Filter::kNumFilterModes);
        break;
        // Double Parameters:
      default:
        param->InitDouble(properties.name,
                          properties.defaultVal,
                          properties.minVal,
                          properties.maxVal,
                          parameterStep);
        break;
    }
  }
  GetParam(mFilterCutoff)->SetShape(2);
  GetParam(mVolumeEnvAttack)->SetShape(3);
  GetParam(mFilterEnvAttack)->SetShape(3);
  GetParam(mVolumeEnvDecay)->SetShape(3);
  GetParam(mFilterEnvDecay)->SetShape(3);
  GetParam(mVolumeEnvSustain)->SetShape(2);
  GetParam(mFilterEnvSustain)->SetShape(2);
  GetParam(mVolumeEnvRelease)->SetShape(3);
  GetParam(mFilterEnvRelease)->SetShape(3);
  for (int i = 0; i < kNumParams; i++) {
    OnParamChange(i);
  }
}
开发者ID:Add9Sus4,项目名称:Synthesis,代码行数:49,代码来源:SpaceBass.cpp

示例2: CreateParams

void Synthesis::CreateParams() {
  for (int i = 0; i < kNumParams; i++) {
    IParam* param = GetParam(i);
    const parameterProperties_struct& properties = parameterProperties[i];
    switch (i) {
      // Int parameters:
      case mNumPartials:
        param->InitInt(properties.name,
                        10, // default
                        1, // min
                        200); // max
        break;
      // Bool parameters:
//      case mNoisyTransient:
//        param->InitBool(properties.name, true);
//        break;
      // Double parameters:
      default:
        param->InitDouble(properties.name,
                          properties.defaultVal,
                          properties.minVal,
                          properties.maxVal,
                          parameterStep);
        break;
    }
  }
  
  /// set shape for knobs
  GetParam(mB)->SetShape(5);
  GetParam(mNumPartials)->SetShape(1);
  
  /// initialize correct default parameter values on load
  for (int i = 0; i < kNumParams; i++) {
    OnParamChange(i);
  }
}
开发者ID:UIKit0,项目名称:gpu-synth,代码行数:36,代码来源:Synthesis.cpp

示例3: CreateParams

void Vega::CreateParams() {
  for (int i = 0; i < kNumParams; i++) {
    IParam* param = GetParam(i);
    const paramProperties& properties = paramProps[i];
    switch (i) {
      // Enum Parameters:
    case mOsc1Wave:
    case mOsc2Wave:
    case mOsc3Wave:
    case mLFOWave:
      param->InitEnum(properties.name,
        Oscillator::OSCILLATOR_MODE_SAW,
        Oscillator::kNumOscillatorModes);
      // For VST3:
      param->SetDisplayText(0, properties.name);
      break;
    case mFilterType:
      param->InitEnum(properties.name,
        Filter::FILTER_MODE_LOWPASS,
        Filter::kNumFilterModes);
      param->SetDisplayText(0, properties.name);
      break;
      // Integer Parameters (Using double notation)
    case mOsc1Oct:
    case mOsc2Oct:
    case mOsc3Oct:
    case mOsc1Pitch:
    case mOsc2Pitch:
    case mOsc3Pitch:
    case mOsc1Phase:
    case mOsc2Phase:
    case mOsc3Phase:
    case mBendRange:
    case mOsc1Voices:
    case mOsc2Voices:
    case mOsc3Voices:
    case mFilterSlope:
      param->InitInt(properties.name,
        (int)properties.defaultVal,
        (int)properties.minVal,
        (int)properties.maxVal);
      break;
      // Double Parameters:
    default:
      param->InitDouble(properties.name,
        properties.defaultVal,
        properties.minVal,
        properties.maxVal,
        parameterStep);
      break;
    }
  }
  GetParam(mVolAttack)->SetShape(3);
  GetParam(mVolDecay)->SetShape(3);
  GetParam(mVolSustain)->SetShape(2);
  GetParam(mVolRelease)->SetShape(3);
  GetParam(mFilterCutoff)->SetShape(2);
  GetParam(mFilterCtlCutoff)->SetShape(2);
  GetParam(mFilterAttack)->SetShape(3);
  GetParam(mFilterDecay)->SetShape(3);
  GetParam(mFilterSustain)->SetShape(2);
  GetParam(mFilterRelease)->SetShape(3);

  for (int i = 0; i < kNumParams; i++) {
    OnParamChange(i);
  }
}
开发者ID:eriser,项目名称:VegaVST,代码行数:67,代码来源:Vega.cpp


注:本文中的IParam::InitDouble方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。