ParamInfo ParamInfo::defaultBandwidthParam () { return ParamInfo (idBandwidth, "BW", "Bandwidth (Octaves)", -4, 4, 1, &ParamInfo::Pow2_toControlValue, &ParamInfo::Pow2_toNativeValue, &ParamInfo::Real_toString); }
ParamInfo ParamInfo::defaultZeroRealParam () { return ParamInfo (idZeroReal, "B1", "Zero Real", -1, 1, -0.25, &ParamInfo::Real_toControlValue, &ParamInfo::Real_toNativeValue, &ParamInfo::Real_toString); }
ParamInfo ParamInfo::defaultGainParam () { return ParamInfo (idGain, "Gain", "Gain", -24, 24, -6, &ParamInfo::Real_toControlValue, &ParamInfo::Real_toNativeValue, &ParamInfo::Db_toString); }
ParamInfo ParamInfo::defaultSlopeParam () { return ParamInfo (idSlope, "Slope", "Slope", -2, 2, 1, &ParamInfo::Pow2_toControlValue, &ParamInfo::Pow2_toNativeValue, &ParamInfo::Real_toString); }
ParamInfo ParamInfo::defaultCenterFrequencyParam () { return ParamInfo (idFrequency, "Fc", "Center Frequency", 10, 22040, 2000, &ParamInfo::Log_toControlValue, &ParamInfo::Log_toNativeValue, &ParamInfo::Hz_toString); }
ParamInfo ParamInfo::defaultStopDbParam () { return ParamInfo (idStopDb, "Stop", "Stopband dB", 3, 60, 48, &ParamInfo::Real_toControlValue, &ParamInfo::Real_toNativeValue, &ParamInfo::Db_toString); }
ParamInfo ParamInfo::defaultQParam () { return ParamInfo (idQ, "Q", "Resonance", -4, 4, 1, &ParamInfo::Pow2_toControlValue, &ParamInfo::Pow2_toNativeValue, &ParamInfo::Real_toString); }
ParamInfo ParamInfo::defaultRolloffParam () { return ParamInfo (idRolloff, "W", "Transition Width", -16, 4, 0, &ParamInfo::Real_toControlValue, &ParamInfo::Real_toNativeValue, &ParamInfo::Real_toString); }
ParamInfo ParamInfo::defaultSampleRateParam () { return ParamInfo (idSampleRate, "Fs", "Sample Rate", 11025, 192000, 44100, &ParamInfo::Real_toControlValue, &ParamInfo::Real_toNativeValue, &ParamInfo::Hz_toString); }
ParamInfo ParamInfo::defaultZeroRhoParam () { return ParamInfo (idZeroRho, "Pd", "Zero Distance", 0, 1, 0.5, &ParamInfo::Real_toControlValue, &ParamInfo::Real_toNativeValue, &ParamInfo::Real_toString); }
ParamInfo ParamInfo::defaultZeroThetaParam () { return ParamInfo (idZeroTheta, "Pa", "Zero Angle", 0, doublePi, doublePi/2, &ParamInfo::Real_toControlValue, &ParamInfo::Real_toNativeValue, &ParamInfo::Real_toString); }
ParamInfo ParamInfo::defaultPoleRealParam () { return ParamInfo (idPoleReal, "A1", "Pole Real", -1, 1, 0.25, &ParamInfo::Real_toControlValue, &ParamInfo::Real_toNativeValue, &ParamInfo::Real_toString); }
ParamInfo ParamInfo::defaultRippleDbParam () { return ParamInfo (idRippleDb, "Ripple", "Ripple dB", 0.001, 12, 0.01, &ParamInfo::Real_toControlValue, &ParamInfo::Real_toNativeValue, &ParamInfo::Db_toString); }
ParamInfo ParamInfo::defaultBandwidthHzParam () { return ParamInfo (idBandwidthHz, "BW", "Bandwidth (Hz)", 10, 22040, 1720, &ParamInfo::Log_toControlValue, &ParamInfo::Log_toNativeValue, &ParamInfo::Hz_toString); }
//-------------------------------------------------------------------------------------------------- void le_arg_AddInt ( int* value, ///< The pointed at value will be updated with the user specified int. char shortName, ///< Simple name for this argument. char* longName, ///< Longer more readable name for this argument. const char* doc ///< Help documentation for this param. ) { Params.insert(ParamInfo(shortName, longName, doc, ParamInfo::INT, false, value, 0)); }
//-------------------------------------------------------------------------------------------------- void le_arg_AddOptionalFlag ( bool* flagPtr, ///< Pointer to flag value. Will be set to true if set, false otherwise. const char shortName, ///< Simple name for this flag. const char* longName, ///< Longer more readable name for this flag. const char* doc ///< Help documentation for this param. ) { Params.insert(ParamInfo(shortName, longName, doc, ParamInfo::FLAG, true, flagPtr, 0)); }
inline int SetUniformParam(ZZshProgram prog, ZZshParameter* param, const char* name) { GLint p = glGetUniformLocation(prog, name); if (p > -1) { *param = NumActiveUniforms; UniformsIndex[NumActiveUniforms] = ParamInfo(name, ZZ_FLOAT4, ZeroFloat4, -1, 0, false, false); // By define Uniform is FLOAT4 SettleTextureUnit(&(UniformsIndex[NumActiveUniforms]), name); UNIFORM_ERROR_LOG("uniform %s \t\t%d %d", name, p, UniformsIndex[NumActiveUniforms].type); NumActiveUniforms++; } else *param = -1; return p; }
bool FarSettings::list(ParamInfoVector& res) { FarSettingsEnum fse = { sizeof(FarSettingsEnum) }; fse.Root = dirId; if (!control(SCTL_ENUM, &fse)) { return false; } res.clear(); for (size_t i = 0; i < fse.Count; i++) { if (fse.Items[i].Type == FST_STRING) { res.push_back(ParamInfo(fse.Items[i].Name, fse.Items[i].Type)); } } return true; }
//-------------------------------------------------------------------------------------------------- void le_arg_AddString ( std::string* valuePtr, ///< Value to be updated with the user specified string. char shortName, ///< Simple name for this argument. const char* longName, ///< Longer more readable name for this argument. const char* doc ///< Help documentation for this param. ) { Params.insert(ParamInfo(shortName, longName, doc, ParamInfo::STRING, false, valuePtr, 0)); }
//-------------------------------------------------------------------------------------------------- void le_arg_AddMultipleString ( const char shortName, ///< Simple name for this argument. const char* longName, ///< Longer more readable name for this argument. const char* doc, ///< Help documentation for this param. le_arg_StringValueCallback_t callbackPtr, ///< Function to be called with each instance. void* contextPtr ///< Opaque value to pass to the callback function. ) { Params.insert(ParamInfo(shortName, longName, doc, ParamInfo::MULTI_STRING, callbackPtr, contextPtr)); }
//-------------------------------------------------------------------------------------------------- void le_arg_AddOptionalString ( std::string* valuePtr, ///< Value updated with either the command line value or the default. const char* defaultValue, ///< Default value for this argument. const char shortName, ///< Simple name for this argument. const char* longName, ///< Longer more readable name for this argument. const char* doc ///< Help documentation for this param. ) { Params.insert(ParamInfo(shortName, longName, doc, ParamInfo::STRING, true, valuePtr, defaultValue)); }
inline void SetGlobalUniform(ZZshParameter* param, const char* name) { *param = NumActiveUniforms; UniformsIndex[NumActiveUniforms] = ParamInfo(name, ZZ_FLOAT4, ZeroFloat4, -1, 0, false, false); NumActiveUniforms++; }