示例#1
0
 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);
 }
示例#2
0
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;
}
void GetParameterStr(const char* parameter, char* str)
{
    if(str == NULL)
        fprintf(stderr, "Empty string passed to GetParameterStr\n");
    else
        strcpy(str, GetParameter(parameter));
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//	Ç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;
	}
}
示例#5
0
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//	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; 
}
void
CBCI2000Controller::get_parameter( ArgList& ioArgs )
{
  std::string result;
  CALL( GetParameter( ioArgs.GetString( 1 ), result ) );
  ioArgs.SetString( 0, result );
}
示例#7
0
//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;
}
示例#8
0
bool ParameterList::ParameterExists(const std::string parname) const {
	try {
		GetParameter( parname );
		return true;
	} catch ( std::exception& ex) {
		return false;
	}
	return false;
}
示例#9
0
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);
	}
}
示例#10
0
/*
Sets a uniform value. In OpenGL we had loads of glUniformx type
functions, for the different types of data. In GCM we have a single
function, which takes a CGparameter and a pointer to some float data,
and the function works out the rest. Simpler, but more likely to go
wrong when incorrect data is sent to it. 
*/
void	Shader::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) {	
		cellGcmSetVertexProgramParameter(p, data);
	}
}
示例#11
0
//--------------------------------------------------------------------------------
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);
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//	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);
}
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);
}
示例#14
0
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;
}
示例#15
0
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;
}
示例#16
0
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;
}
示例#17
0
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....";
  }
}
示例#18
0
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....";
  }
}
示例#19
0
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;
}
示例#20
0
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));
  }

}
示例#21
0
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;
  }
}
示例#22
0
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;
}
示例#23
0
int Gene::LoadGene(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.length() == 0) {
		return FAIL; 
	}
	SetData("FILENAME",InFilename.data(),STRING);

	if (!FileExists(InFilename)) {
		InFilename = GetDatabaseDirectory(GetParameter("database"),"gene directory")+InFilename;
		if (!FileExists(InFilename)) {
			return FAIL;
		}
	}

	ifstream Input;
	if (!OpenInput(Input,InFilename)) {
		SetKill(true);
		return FAIL;
	}
	
	do {
		vector<string>* Strings = GetStringsFileline(Input,"\t");
		if (Strings->size() >= 2) {
			//I save the input headings so I can print out the same headings when it's time to save the file
			AddData("INPUT_HEADER",(*Strings)[0].data(),STRING);
			for (int i=1; i < int(Strings->size()); i++) {
				Interpreter((*Strings)[0],(*Strings)[i],true);
			}
		}
		delete Strings;
	} while(!Input.eof());

	if (GetData("DATABASE",STRING).length() == 0) {
		AddData("DATABASE",InFilename.data(),STRING);
	}
	if (MainData != NULL && MainData->GetData("DATABASE",STRING).length() > 0 && GetData("DATABASE",STRING).length() > 0) {
		AddData(MainData->GetData("DATABASE",STRING).data(),GetData("DATABASE",STRING).data(),DATABASE_LINK);
	}

	Input.close();
	return SUCCESS;
}
示例#24
0
// 开始搜索电视频道
U32 tvcore_startSearchTV(STVMode iMode, TuningParam *pTuningParam,ISearchTVNotify *pNotify)
{
	//停止解扰
	tvplayer_stop_descramb();
	// 获取运营商ids;
	int nId = 0;
	int nReplyLen = sizeof(int);
	int nRet = GetParameter(GET_OPERATOR_ID,&nId,&nReplyLen);
	if(-1 == nRet || -1 == nId){
		tvplayer_set_module_state(1);
		return StartSearchTV(iMode,pTuningParam,pNotify);
	}
	
	std::vector<OperatorId> ids;
	U16 uRet = stbca_get_operator_ids(ids);
	if(0 != uRet || ids.size() <= 0){
		LOGTRACE(LOGINFO,"GetOperatorIds failed or not exist.\n");
		return uRet;
	}
	
	nId = (0 == nId) ? ids[0] :nId;	
	
	bool bMatched = false;
	std::vector<OperatorId>::iterator iter = ids.begin();
	for(;iter != ids.end();iter++){
		if(nId == *iter){
			bMatched = true;
			break;
		}
	}
	
	if(!bMatched){
		LOGTRACE(LOGINFO,"not exist operator id.\n");
		return -1;
	}
	
	std::vector<U32> acs;
	uRet = (U32)stbca_get_operator_acs(nId,acs);
	if(0 != uRet || acs.size() <= 0){
		LOGTRACE(LOGINFO,"GetOperatorAcs failed or not exist.\n");
		return uRet;
	}

	int nReqLen = sizeof(U32) * acs.size();
	SetParameter(SET_OPERATOR_ACS,&acs,nReqLen);
	
	tvplayer_set_module_state(1);
	return StartSearchTV(iMode,pTuningParam,pNotify);
}
示例#25
0
/*!
@brief ウィンドウの生成
@par   関数説明
ウィンドウを生成する。
決まったウィンドウサイズやスタイルがあるのであればあらかじめSet系関数で設定しておく。
@param nCmdShow WinMain関数で取得できる第三引数。
@return 0=成功。
@return 1=生成に失敗。
*/
unsigned long Window::MakeWindow( int nCmdShow )
{
	//int w = 0, h = 0;
	unsigned long err;

	if ( wd.WindowParent )
	{
		SetWindowStyleDirect( GetWindowStyle() | WS_CHILD );
	} else
	{
		SetWindowStyleDirect( GetWindowStyle() & ( ~WS_CHILD ) );
	}

	// 判定。
	//if ( GetPositionX() < 0 ){ SetPositionX( 0 ); w = GetWindowWidth();  SetWindowWidth( 640 );  }
	//if ( GetPositionY() < 0 ){ SetPositionY( 0 ); h = GetWindowHeight(); SetWindowHeight( 480 ); }

	//ウィンドウの生成
	wd.WindowHandle = CreateWindowEx(
		GetWindowStyleEx(),
		wd.wcx.lpszClassName,//MIKANCLASSNAME,//GetClassNameEx(),
		GetWindowName(),
		GetWindowStyle(),
		GetPositionX(), GetPositionY(),
		GetWindowWidth(), GetWindowHeight(),
		GetParentWindowHandle(),
		GetMenuHandle(),
		GetInstanceHandle(),
		GetParameter()
		);
	/*if ( w > 0 || h > 0 )
	{
	SetWindowSize( w, h );
	SetWindow();
	}*/

	//生成に失敗したら1を返して終了
	if ( wd.WindowHandle == NULL )
	{
		err = GetLastError();
		return err;
	}

	ShowWindow( wd.WindowHandle, nCmdShow );
	UpdateWindow( wd.WindowHandle );
	//  SetWindowText( wd.WindowParent, GetWindowName() );

	return 0;
}
示例#26
0
	std::string ParametralFeature::Print() const
	{
		std::string strSignature = "( ";
		for ( int i = 0 ; i < GetParameterCount() ; i++ ) {
			OclCommon::FormalParameter parameter = GetParameter( i );
			if ( ! parameter.IsRequired() )
				strSignature += " { ";
			if ( i != 0 )
				strSignature += ", ";
			strSignature += parameter.GetTypeName();
			if ( i == GetParameterCount() - 1 && ! parameter.IsRequired() )
				strSignature += "} ";
		}
		return strSignature + " )";
	}
示例#27
0
Gene::Gene(string InFilename, Data* InData) {
	MainData = InData;

	if (InFilename.length() > 0) {
		AddData("DATABASE",InFilename.data(),STRING);
		AddData("FILENAME",InFilename.data(),STRING);
		if (GetParameter("Load genes").compare("1") == 0) {
			LoadGene(InFilename);
		}
	}

	GeneUseVariable = NULL;
	Next = NULL;
	Previous = NULL;
}
JBoolean
JPlotLinearFit::GetYValue
	(
	const JFloat 	x,
	JFloat* 		y
	)
	const
{
	JFloat a;
	JFloat b;
	GetParameter(1, &a);
	GetParameter(2, &b);

	if (itsYIsLog)
		{
		*y = a * exp(b*x);
		}
	else
		{
		*y = a + b*x;
		}

	return kJTrue;
}
示例#29
0
OMX_ERRORTYPE omxil_comp::get_param_other_init(OMX_PORT_PARAM_TYPE *param) const
{
	OMX_ERRORTYPE result;

	*param = {};
	param->nSize = sizeof(*param);
	fill_version(&param->nVersion);
	result = GetParameter(OMX_IndexParamOtherInit, param);
	if (result != OMX_ErrorNone) {
		fprintf(stderr, "OMX_GetParameter(IndexParamOtherInit) "
			"failed.\n");
		return result;
	}

	return result;
}
示例#30
0
文件: index.cpp 项目: acgtun/gpu-perm
int main(int argc, char* argv[]) {
  Option opt;
  GetParameter(argc, argv, opt);

  CReference refGenome;
  CHashTable hashTable;

  TIME_INFO(BuildIndex(opt, &refGenome, &hashTable), "Build index");

  /* release memory*/
  free(refGenome.refSeq);
  free(hashTable.counter);
  free(hashTable.index);

  return 0;
}