本文整理汇总了C++中GetParameter函数的典型用法代码示例。如果您正苦于以下问题:C++ GetParameter函数的具体用法?C++ GetParameter怎么用?C++ GetParameter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetParameter函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GetParameter
void GenericModel::AddParameter(const RooRealVar& var, Int_t nbins)
{
// Define a named parameter for the model, with its associated range
// of values and the number of 'bins' to be used to scan these values
fParameters.addClone(var);
GetParameter(var.GetName()).setBins(nbins);
}
开发者ID:GiuseppePast,项目名称:kaliveda,代码行数:7,代码来源:GenericModel.cpp
示例2: CPLEXPrintFromSolver
int CPLEXPrintFromSolver(int lpcount) {
int Status = 0;
if (CPLEXenv == NULL) {
FErrorFile() << "Cannot print problem to file because CPLEX environment is not open." << endl;
FlushErrorFile();
return FAIL;
}
if (CPLEXModel == NULL) {
FErrorFile() << "Cannot print problem to file because no CPLEX model exists." << endl;
FlushErrorFile();
return FAIL;
}
string Filename = CheckFilename(FOutputFilepath()+GetParameter("LP filename")+itoa(lpcount));
Status = CPXwriteprob (CPLEXenv, CPLEXModel,Filename.data(), "LP");
if (Status) {
FErrorFile() << "Cannot print problem to file for unknown reason." << endl;
FlushErrorFile();
return FAIL;
}
return SUCCESS;
}
开发者ID:samseaver,项目名称:ProbModelSEED,代码行数:25,代码来源:CPLEXapi.cpp
示例3: GetParameterStr
void GetParameterStr(const char* parameter, char* str)
{
if(str == NULL)
fprintf(stderr, "Empty string passed to GetParameterStr\n");
else
strcpy(str, GetParameter(parameter));
}
开发者ID:ThomasHeegaard,项目名称:C_Game_Engine,代码行数:7,代码来源:config_loader.c
示例4: GetParameter
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// ÇPROJECTNAMEÈ::ÇPROJECTNAMEÈKernel::Process
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
void ÇPROJECTNAMEÈ::ÇPROJECTNAMEÈKernel::Process( const Float32 *inSourceP,
Float32 *inDestP,
UInt32 inFramesToProcess,
UInt32 inNumChannels, // for version 2 AudioUnits inNumChannels is always 1
bool &ioSilence )
{
//This code will pass-thru the audio data.
//This is where you want to process data to produce an effect.
UInt32 nSampleFrames = inFramesToProcess;
const Float32 *sourceP = inSourceP;
Float32 *destP = inDestP;
Float32 gain = GetParameter( kParam_One );
while (nSampleFrames-- > 0) {
Float32 inputSample = *sourceP;
//The current (version 2) AudioUnit specification *requires*
//non-interleaved format for all inputs and outputs. Therefore inNumChannels is always 1
sourceP += inNumChannels; // advance to next frame (e.g. if stereo, we're advancing 2 samples);
// we're only processing one of an arbitrary number of interleaved channels
// here's where you do your DSP work
Float32 outputSample = inputSample * gain;
*destP = outputSample;
destP += inNumChannels;
}
}
开发者ID:fruitsamples,项目名称:AudioUnitEffectTemplates,代码行数:35,代码来源:StarterAU.cpp
示例5: GetParameter
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// karoke::ProcessBufferLists
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
OSStatus karoke::ProcessBufferLists (AudioUnitRenderActionFlags& iFlags,
const AudioBufferList& inBufferList,
AudioBufferList& outBufferList,
UInt32 iFrames)
{
float *leftSample = ((float*)inBufferList.mBuffers[0].mData);
float *rightSample = ((float*)inBufferList.mBuffers[1].mData);
float *leftOut = (float*)outBufferList.mBuffers[0].mData;
float *rightOut = (float*)outBufferList.mBuffers[1].mData;
Float32 gain = GetParameter( kParam_One );
while (iFrames > 0) {
float bass = filter.process(*leftSample);
float karaoked = *leftSample - *rightSample;
float output = karaoked + gain*bass;
*leftOut = output;
*rightOut = output;
iFrames--;
leftSample++;
rightSample++;
leftOut++;
rightOut++;
}
return noErr;
}
开发者ID:LupusDei,项目名称:8LU-DSP,代码行数:33,代码来源:karoke.cpp
示例6: CALL
void
CBCI2000Controller::get_parameter( ArgList& ioArgs )
{
std::string result;
CALL( GetParameter( ioArgs.GetString( 1 ), result ) );
ioArgs.SetString( 0, result );
}
开发者ID:ACrazyer,项目名称:NeuralSystemsBCI2000,代码行数:7,代码来源:BCI2000Controller.cpp
示例7: GetData
//Fileoutput
int Gene::SaveGene(string InFilename) {
if (InFilename.length() == 0) {
InFilename = GetData("FILENAME",STRING);
if (InFilename.length() == 0) {
InFilename = GetData("DATABASE",STRING);
if (InFilename.length() == 0) {
return FAIL;
}
}
}
if (InFilename.substr(1,1).compare(":") != 0 && InFilename.substr(0,1).compare("/") != 0) {
InFilename = GetDatabaseDirectory(false)+InFilename;
}
ofstream Output;
if (!OpenOutput(Output,InFilename)) {
return FAIL;
}
//First I check to see if the user specified that the input headers be printed in the output file
vector<string>* FileHeader = StringToStrings(GetParameter("gene data to print"),";");
vector<string> InputHeaders;
for (int i=0; i < int(FileHeader->size()); i++) {
if ((*FileHeader)[i].compare("INPUT_HEADER") == 0) {
InputHeaders = GetAllData("INPUT_HEADER",STRING);
break;
}
}
for (int i=0; i < int(InputHeaders.size()); i++) {
string Data;
Interpreter(InputHeaders[i],Data,false);
Output << InputHeaders[i] << "\t" << Data << endl;
}
for (int i=0; i < int(FileHeader->size()); i++) {
//I check to see if the current file header has already been printed to file
if ((*FileHeader)[i].compare("INPUT_HEADER") != 0) {
int j =0;
for (j=0; j < int(InputHeaders.size()); j++) {
if (InputHeaders[j].compare((*FileHeader)[i]) == 0) {
break;
}
}
if (j == int(InputHeaders.size())) {
//If the current file header has not already been printed to file, it is printed now
string Data;
Interpreter((*FileHeader)[i],Data,false);
if (Data.length() > 0) {
Output << (*FileHeader)[i] << "\t" << Data << endl;
}
}
}
}
Output.close();
return SUCCESS;
}
开发者ID:ModelSEED,项目名称:Model-SEED-core,代码行数:60,代码来源:Gene.cpp
示例8: GetParameter
void FragmentShader::SetParameter(std::string name, float*data) {
CGparameter p = GetParameter(name);
//DON'T try to set a non-existent parameter. GCM will instantly
//fall over.
if(p) {
cellGcmSetFragmentProgramParameter(program, p, data, offset);
}
}
开发者ID:gambiting,项目名称:Racer-PS3,代码行数:9,代码来源:Shader.cpp
示例9: switch
//--------------------------------------------------------------------------------
OSStatus SubSynth::GetProperty(AudioUnitPropertyID inPropertyID, AudioUnitScope inScope, AudioUnitElement inElement, void * outData)
{
if (inScope == kAudioUnitScope_Global)
{
switch (inPropertyID)
{
case kAudioUnitProperty_ParameterValueFromString:
{
AudioUnitParameterValueFromString * name = (AudioUnitParameterValueFromString*)outData;
if (name->inString == NULL)
return kAudioUnitErr_InvalidPropertyValue;
double paramValue_literal = CFStringGetDoubleValue(name->inString);
switch (name->inParamID)
{
case kParam_Tune:
if (paramValue_literal <= 0.0)
name->outValue = 0.0; // XXX avoid log10(0) or log10(-X)
else
name->outValue = (log10(paramValue_literal / (0.0726 * GetSampleRate())) + 2.5) / 1.5;
break;
case kParam_Release:
return kAudioUnitErr_PropertyNotInUse; // XXX I can't figure out how to invert this one
default:
return kAudioUnitErr_InvalidParameter;
}
return noErr;
}
case kAudioUnitProperty_ParameterStringFromValue:
{
AudioUnitParameterStringFromValue * name = (AudioUnitParameterStringFromValue*)outData;
double paramValue = (name->inValue == NULL) ? GetParameter(name->inParamID) : *(name->inValue);
int precision = 0;
switch (name->inParamID)
{
case kParam_Tune:
paramValue = 0.0726 * GetSampleRate() * pow(10.0, -2.5 + (1.5 * paramValue));
precision = 3;
break;
case kParam_Release:
paramValue = GetReleaseTimeForParamValue(paramValue);
precision = 1;
break;
default:
return kAudioUnitErr_InvalidParameter;
}
name->outString = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("%.*f"), precision, paramValue);
if (name->outString == NULL)
return coreFoundationUnknownErr;
return noErr;
}
}
}
return AUEffectBase::GetProperty(inPropertyID, inScope, inElement, outData);
}
开发者ID:arcanelab,项目名称:mda-VST-plug-ins,代码行数:57,代码来源:subsynth.cpp
示例10: switch
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// SampleEffectUnit::GetProperty
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
OSStatus SampleEffectUnit::GetProperty (AudioUnitPropertyID inID,
AudioUnitScope inScope,
AudioUnitElement inElement,
void * outData)
{
if (inScope == kAudioUnitScope_Global) {
switch (inID) {
case kAudioUnitProperty_ParameterValueFromString:
{
OSStatus retVal = kAudioUnitErr_InvalidPropertyValue;
AudioUnitParameterValueFromString &name = *(AudioUnitParameterValueFromString*)outData;
if (name.inParamID != kParam_Four)
return kAudioUnitErr_InvalidParameter;
if (name.inString == NULL)
return kAudioUnitErr_InvalidPropertyValue;
UniChar chars[2];
chars[0] = '-';
chars[1] = 0x221e; // this is the unicode symbol for infinity
CFStringRef comparisonString = CFStringCreateWithCharacters (NULL, chars, 2);
if ( CFStringCompare(comparisonString, name.inString, 0) == kCFCompareEqualTo ) {
name.outValue = kMinValue_ParamFour;
retVal = noErr;
}
if (comparisonString) CFRelease(comparisonString);
return retVal;
}
case kAudioUnitProperty_ParameterStringFromValue:
{
AudioUnitParameterStringFromValue &name = *(AudioUnitParameterStringFromValue*)outData;
if (name.inParamID != kParam_Four)
return kAudioUnitErr_InvalidParameter;
AudioUnitParameterValue paramValue = (name.inValue == NULL
? GetParameter (kParam_Four)
: *(name.inValue));
// for this usage only values <= -120 dB (the min value) have
// a special name "-infinity"
if (paramValue <= kMinValue_ParamFour) {
UniChar chars[2];
chars[0] = '-';
chars[1] = 0x221e; // this is the unicode symbol for infinity
name.outString = CFStringCreateWithCharacters (NULL, chars, 2);
} else
name.outString = NULL;
return noErr;
}
}
}
return AUEffectBase::GetProperty (inID, inScope, inElement, outData);
}
开发者ID:DannyDeng2014,项目名称:CocoaSampleCode,代码行数:60,代码来源:SampleEffectUnit.cpp
示例11: GetParameterInt
int GetParameterInt(const char* parameter)
{
char* tmp = GetParameter(parameter);
if(tmp == NULL)
{
fprintf(stderr, "No parameter gotten, returning 0\n");
return 0;
}
return ParseParameter(tmp);
}
开发者ID:ThomasHeegaard,项目名称:C_Game_Engine,代码行数:10,代码来源:config_loader.c
示例12: printf
bool CommandParser::GetParameterE(char ID,char *type,...) {
char **Out;
int opt_index=GetOptionIndex(ID);
if (opt_index==num_elements) return false;
int n_param=GetNumOptionParameters(opt_index);
int j=0;
int lenght=(int)strlen(type);
int num=-1;
char *typeB=new char[strlen(type)+2];
typeB[0]=0;
for(int i=0;i<lenght;i++) {
if (type[i]=='[') {
if (j<=n_param) num=j;
else break;
continue;
}
if (type[i]==']') {
if (j<=n_param) num=j;
else break;
continue;
}
typeB[j++]=type[i];
typeB[j]=0;
}
if (j<=n_param) num=j;
if (n_param!=num) {
printf("Invalid number of parameters for option -%c.\n",ID);
invalid_option_parameters=true;
delete[]typeB;
return false;
}
typeB[num]=0;
if (!GetParameter(ID,1,Out)) {delete[]typeB;return false;}
va_list marker;
va_start(marker,type);
for(int i=0;i<num;i++) {
if (Out[i][0]=='-') {delete[]typeB;return false;}
if (typeB[i]=='s') strcpy(va_arg(marker,char*),Out[i]);
if (typeB[i]=='i') *va_arg(marker,int*)=atoi(Out[i]);
if (typeB[i]=='c') *(va_arg(marker,char*))=Out[i][0];
if (typeB[i]=='f') *(va_arg(marker,float*))=(float)atof(Out[i]);
if (typeB[i]=='d') *(va_arg(marker,double*))=atof(Out[i]);
}
va_end(marker);
delete[]typeB;
return true;
}
开发者ID:ballanlu,项目名称:GammaLib,代码行数:54,代码来源:IOAddOn.cpp
示例13: GetFlag
bool CommandParser::GetFlag(char ID) {
char **Out;
bool exists=GetParameter(ID,0,Out);
if (exists) {
if (GetNumOptionParameters(GetOptionIndex(ID))!=0) {
printf("Invalid number of parameters for option -%c.\n",ID);
invalid_option_parameters=true;
}
}
return exists;
}
开发者ID:ballanlu,项目名称:GammaLib,代码行数:11,代码来源:IOAddOn.cpp
示例14: GetParameter
bool CommandParser::GetParameter(char ID,char *type,...) {
char **Out;
int num=(int)strlen(type);
if (!GetParameter(ID,num,Out)) return false;
if (!GetParameter(ID,1,Out)) return false;
va_list marker;
va_start(marker,type);
for(int i=0;i<num;i++) {
if (Out[i][0]=='-') return false;
if (type[i]=='s') strcpy(va_arg(marker,char*),Out[i]);
if (type[i]=='i') *va_arg(marker,int*)=atoi(Out[i]);
if (type[i]=='c') *(va_arg(marker,char*))=Out[i][0];
if (type[i]=='f') *(va_arg(marker,float*))=(float)atof(Out[i]);
if (type[i]=='d') *(va_arg(marker,double*))=atof(Out[i]);
}
va_end(marker);
return true;
}
开发者ID:ballanlu,项目名称:GammaLib,代码行数:20,代码来源:IOAddOn.cpp
示例15: GetParameter
void
mitk::GIFVolumetricStatistics::CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &mask, const Image::Pointer &, FeatureListType &featureList)
{
auto parsedArgs = GetParameter();
if (parsedArgs.count(GetLongName()))
{
MITK_INFO << "Start calculating Volumetric Features::....";
auto localResults = this->CalculateFeatures(feature, mask);
featureList.insert(featureList.end(), localResults.begin(), localResults.end());
MITK_INFO << "Finished calculating volumetric features....";
}
}
开发者ID:Cdebus,项目名称:MITK,代码行数:12,代码来源:mitkGIFVolumetricStatistics.cpp
示例16: GetParameter
void
mitk::GIFFirstOrderStatistics::CalculateFeaturesUsingParameters(const Image::Pointer & feature, const Image::Pointer &, const Image::Pointer &maskNoNAN, FeatureListType &featureList)
{
auto parsedArgs = GetParameter();
if (parsedArgs.count(GetLongName()))
{
InitializeQuantifierFromParameters(feature, maskNoNAN);
MITK_INFO << "Start calculating first order features ....";
auto localResults = this->CalculateFeatures(feature, maskNoNAN);
featureList.insert(featureList.end(), localResults.begin(), localResults.end());
MITK_INFO << "Finished calculating first order features....";
}
}
开发者ID:Cdebus,项目名称:MITK,代码行数:13,代码来源:mitkGIFFirstOrderStatistics.cpp
示例17: GB_Refresh_GBCfg
int GB_Refresh_GBCfg()
{
PRM_GB_SIPD_DEVMODE_CFG DevMode;
SN_MEMSET(&DevMode,0,sizeof(DevMode));
pthread_mutex_lock(&gGBCfgLock);
SN_MEMSET(&gGBCfg,0,sizeof(gGBCfg));
if(GetParameter (PRM_ID_GB_SIPD_CFG, NULL, &gGBCfg, sizeof(PRM_GB_SIPD_CFG), 1,
SUPER_USER_ID, NULL) != PARAM_OK)
{
printf("%s line=%d PRM_ID_GB_SIPD_CFG GetParameter err\n",__FUNCTION__, __LINE__);
pthread_mutex_unlock(&gGBCfgLock);
return -1;
}
if(GetParameter (PRM_ID_GB_SIPD_DEVMODE_CFG, NULL, &DevMode, sizeof(PRM_GB_SIPD_DEVMODE_CFG), 1,
SUPER_USER_ID, NULL) != PARAM_OK)
{
printf("%s line=%d PRM_ID_GB_SIPD_DEVMODE_CFG GetParameter err\n",__FUNCTION__, __LINE__);
pthread_mutex_unlock(&gGBCfgLock);
return -1;
}
if(DevMode.DevMode == DEV_MODE_GB)
{
gGBCfg.enable = 1;
}
else
{
gGBCfg.enable = 0;
}
pthread_mutex_unlock(&gGBCfgLock);
return 0;
}
开发者ID:github188,项目名称:Decoder_GB,代码行数:38,代码来源:GB_sipd.c
示例18: derivefromprofile
void derivefromprofile()
{
auto file = config.getfile_djt("mcPbqcd");
auto nt = (TTree *)file->Get("nt");
for (unsigned i=1;i<binbounds.size();i++) {
int b1 = binbounds[i-1];
int b2 = binbounds[i];
auto p = new TProfile(Form("p%d%d",b1,b2),Form("prof"),100,0,200);
nt->Project(p->GetName(),"(subid2 == 0 && refpt2 > 20):jtptSignal2",Form("weight*(jtpt1>100&&bin>=%d && bin<%d)",b1,b2));
profs.push_back(p);
auto f = new TF1(Form("f%d%d",b1,b2),"exp(-[0]*exp(-[1]*x))");
f->SetParameters(100,0.1);
p->Fit(f);
fs.push_back(f);
float median = -1/f->GetParameter(1)*log(-1/f->GetParameter(0)*log(0.5));
auto c = getc();
TLatex *Tl = new TLatex();
p->SetMinimum(0);p->SetMaximum(1);
p->Draw();
f->Draw("same");
Tl->DrawLatexNDC(0.6,0.4,Form("PbPb bin %d-%d",b1,b2));
Tl->DrawLatexNDC(0.6,0.35,Form("median = %.2f",median));
TLine *l1 = new TLine(median,0,median, f->Eval(median));
l1->Draw();
TLine *l2 = new TLine(0,0.5,median, f->Eval(median));
l2->Draw();
SavePlot(c,Form("fit%d%d",b1,b2));
}
}
开发者ID:bjet2015,项目名称:dibjets,代码行数:38,代码来源:eclipsederive.C
示例19: MOZ_ASSERT
OMX_ERRORTYPE
OmxPlatformLayer::Config()
{
MOZ_ASSERT(mInfo);
OMX_PORT_PARAM_TYPE portParam;
InitOmxParameter(&portParam);
if (mInfo->IsAudio()) {
GetParameter(OMX_IndexParamAudioInit, &portParam, sizeof(portParam));
mStartPortNumber = portParam.nStartPortNumber;
UniquePtr<OmxAudioConfig> conf(ConfigForMime<OmxAudioConfig>(mInfo->mMimeType));
MOZ_ASSERT(conf.get());
return conf->Apply(*this, *(mInfo->GetAsAudioInfo()));
} else if (mInfo->IsVideo()) {
GetParameter(OMX_IndexParamVideoInit, &portParam, sizeof(portParam));
UniquePtr<OmxVideoConfig> conf(ConfigForMime<OmxVideoConfig>(mInfo->mMimeType));
MOZ_ASSERT(conf.get());
return conf->Apply(*this, *(mInfo->GetAsVideoInfo()));
} else {
MOZ_ASSERT_UNREACHABLE("non-AV data (text?) is not supported.");
return OMX_ErrorNotImplemented;
}
}
开发者ID:heiher,项目名称:gecko-dev,代码行数:23,代码来源:OmxPlatformLayer.cpp
示例20: ZeroMemory
bool CSingInServer::GetAuthKey(char *pszString)
{
TSSystemParam Parameter;
ZeroMemory(&Parameter, sizeof(Parameter));
if( GetParameter(0, &Parameter) == RET_OK )
{
strcpy(pszString, Parameter.szParameter2);
}
else
strcpy(pszString, "9942CCCF0B333300A5");
return true;
}
开发者ID:nykma,项目名称:ykt4sungard,代码行数:14,代码来源:SingInServer.cpp
注:本文中的GetParameter函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论