• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setProgram函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中setProgram函数的典型用法代码示例。如果您正苦于以下问题:C++ setProgram函数的具体用法?C++ setProgram怎么用?C++ setProgram使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: setProgram

static void setProgram(Node *n, GLProgram *p)
{
    n->setShaderProgram(p);
    
    auto& children = n->getChildren();
    for(const auto &child : children) {
        setProgram(child, p);
    }
}
开发者ID:TinySlik,项目名称:cocos2d-x-3.x-Qt,代码行数:9,代码来源:CCClippingNode.cpp


示例2: setShowHelp

bool ContextBase::parseCmdArgs(int argc, char **argv, int skipFirstArgs) {
	_argc = argc;
	_argv = argv;
	_skipFirstArgs = skipFirstArgs;
	if (_argc < 2) {
		setShowHelp(true);
		return false;
	}

	setProgram(_programNames[argv[0]]);

	_argsProcessed.resize(_argc - _skipFirstArgs, false);

	for (_i=_skipFirstArgs; _i < argc; _i++) {
		if (isUsed(_i - _skipFirstArgs)) {
			continue;
		}

		if (strcmp(_argv[_i], "-i") == 0) {
			if (!handle_i()) return false;
		}
		else if (strcmp(_argv[_i], "-g") == 0) {
			if (!handle_g()) return false;
		}
		else if ((strcmp(_argv[_i], "-h") == 0) || (strcmp(_argv[_i], "--help") == 0)) {
			if (!handle_h()) return false;
		}
		else if (strcmp(_argv[_i], "-split") == 0) {
			if (!handle_split()) return false;
		}
        else if (strcmp(_argv[_i], "-bed") == 0) {
			if (!handle_bed()) return false;
       }
        else if (strcmp(_argv[_i], "-ubam") == 0) {
			if (!handle_ubam()) return false;
        }
        else if (strcmp(_argv[_i], "-fbam") == 0) {
			if (!handle_fbam()) return false;
        }
        else if(strcmp(_argv[_i], "-sorted") == 0) {
			if (!handle_sorted()) return false;
        }
        else if (strcmp(_argv[_i], "-nobuf") == 0) {
			if (!handle_nobuf()) return false;
        }
        else if (strcmp(_argv[_i], "-header") == 0) {
			if (!handle_header()) return false;
        }
        else if (strcmp(_argv[_i], "-n") == 0) {
			if (!handle_n()) return false;
        }
        else if (strcmp(_argv[_i], "-seed") == 0) {
			if (!handle_seed()) return false;
        }
	}
	return true;
}
开发者ID:ml4wc,项目名称:bedtools2,代码行数:57,代码来源:ContextBase.cpp


示例3: Q_D

KProcess &KProcess::operator<<(const QStringList &args)
{
    Q_D(KProcess);

    if (d->prog.isEmpty())
        setProgram(args);
    else
        d->args << args;
    return *this;
}
开发者ID:vasi,项目名称:kdelibs,代码行数:10,代码来源:kprocess.cpp


示例4: PizMidi

//-----------------------------------------------------------------------------
MidiCCStepper::MidiCCStepper(audioMasterCallback audioMaster)
	: PizMidi(audioMaster, kNumPrograms, kNumParams)
{
	programs = new MidiCCStepperProgram[numPrograms];

	if (programs) setProgram (0);

	lastTime = 0 - samplesPerStep;

	init();
}
开发者ID:Amcut,项目名称:pizmidi,代码行数:12,代码来源:midiCCStepper.cpp


示例5: setProgram

//----------------------------------------------------------------------------
//You don't have to do this, but I like to...
//----------------------------------------------------------------------------
void AmplitudeImposer::MIDI_ProgramChange(int ch, int val, int delta)
{
	if(val < kNumPrograms)
		setProgram(val);

	MIDIEvent[0]->midiData[0] = 0xD0 + ch;
	MIDIEvent[0]->midiData[1] = val;
	MIDIEvent[0]->midiData[2] = 0;
	MIDIEvent[0]->deltaFrames = delta;
	sendVstEventsToHost(Events);
}
开发者ID:ZECTBynmo,项目名称:JST-Proof,代码行数:14,代码来源:AmplitudeImposer.cpp


示例6: setProgram

NS_CC_BEGIN

#if CC_CLIPPING_NODE_OPENGLES
static void setProgram(Node *n, GLProgram *p)
{
    n->setGLProgram(p);
    
    auto& children = n->getChildren();
    for(const auto &child : children) {
        setProgram(child, p);
    }
}
开发者ID:MinhHTML5,项目名称:FocusFire,代码行数:12,代码来源:CCClippingNode.cpp


示例7: pinInt

void pinInt() {
	unsigned char pinClock = PINB & _BV(DAT);
	if (pinClock != pinClockLast && pinClock != 0) {
		readData();
		if (msgIdx == 8) {
			setProgram();
			TOC = BRIGHTMAX - 1;
			clearMsg();
		}
	}
	pinClockLast = pinClock;
}
开发者ID:dreid1991,项目名称:avr,代码行数:12,代码来源:lightController.c


示例8: setProgram

bool ContextBase::testCmdArgs(int argc, char **argv) {
	_argc = argc;
	_argv = argv;
	_skipFirstArgs = 1;
	_origProgramName = argv[0];
	setProgram(_programNames[_origProgramName]);
	_argsProcessed.resize(_argc - _skipFirstArgs, false);

	if (!parseCmdArgs(argc, argv, 1) || getShowHelp() || !isValidState()) {
		return false;
	}
	return true;
}
开发者ID:francois-a,项目名称:bedtools2,代码行数:13,代码来源:ContextBase.cpp


示例9: AudioEffectX

mdaLoudness::mdaLoudness(audioMasterCallback audioMaster): AudioEffectX(audioMaster, NPROGS, NPARAMS)
{
  setNumInputs(2);
  setNumOutputs(2);
  setUniqueID('mdal');
	DECLARE_VST_DEPRECATED(canMono) ();				      
  canProcessReplacing();

  programs = new mdaLoudnessProgram[NPROGS];
  setProgram(0);

  suspend();
}
开发者ID:arcanelab,项目名称:mda-VST-plug-ins,代码行数:13,代码来源:mdaLoudness.cpp


示例10: channel

//have fun modifying this one!
void Midi16CCRouter::processMidiEvents (VstMidiEventVec *inputs, VstMidiEventVec *outputs, VstInt32 sampleFrames) 
{
	// process incoming events
    for (unsigned int i=0;i<inputs[0].size();i++) {
        //copying event "i" from input (with all its fields)
		VstMidiEvent tomod = inputs[0][i];
		
        short status     = tomod.midiData[0] & 0xf0;   // scraping  channel
        short channel    = (tomod.midiData[0] & 0x0f) + 1;  // isolating channel (1-16)
        short data1      = tomod.midiData[1] & 0x7f;
        //short data2		 = tomod.midiData[2] & 0x7f;
       
        int cci[numCCs];
        int cco[numCCs]; 

        bool discard=false;

        for (int i=0;i<numCCs;i++) {
		   cci[i] = FLOAT_TO_MIDI(param[i*2]);
		   cco[i] = FLOAT_TO_MIDI2(param[i*2+1]);
        }
        int chi = FLOAT_TO_CHANNEL016(param[kChi]);
        int cho = FLOAT_TO_CHANNEL016(param[kCho]);
        if (cho==0) cho=channel;
        int chipc = FLOAT_TO_CHANNEL016(param[kPC]);
        if (param[kPC]==1.0f) chipc=-1;
    	
        //only look at the selected channel
        if (channel == chipc || chipc == 0) { 
            if (status == MIDI_PROGRAMCHANGE){
                automated=true;
                setProgram(data1);
            }
        }
        if (channel == chi || chi == 0) { 
            if (status == MIDI_CONTROLCHANGE){
               for (int i=0;i<numCCs;i++) {
                   if (data1==cci[i]/* && cco[i]>0*/) {
                       if (cco[i]!=0) 
                            tomod.midiData[1] = cco[i]-1;
                       tomod.midiData[0] = status | (cho-1);
                       outputs[0].push_back(tomod);
                       discard=true;
                   }
               }
           }
    	}
    	if (!discard) outputs[0].push_back(tomod);
    }
}
开发者ID:Amcut,项目名称:pizmidi,代码行数:51,代码来源:midi16CCRouter.cpp


示例11: setShowHelp

bool ContextClosest::parseCmdArgs(int argc, char **argv, int skipFirstArgs){
	_argc = argc;
	_argv = argv;
	_skipFirstArgs = skipFirstArgs;
	if (_argc < 2) {
		setShowHelp(true);
		return false;
	}

	setProgram(_programNames[argv[0]]);

	_argsProcessed.resize(_argc - _skipFirstArgs, false);

	for (_i=_skipFirstArgs; _i < argc; _i++) {
		if (isUsed(_i - _skipFirstArgs)) {
			continue;
		}
		if (strcmp(_argv[_i], "-c") == 0) {
			//bypass intersect's use of the -c option, because -c
			//means writeCount for intersect, but means columns for map.
			if (!ContextBase::handle_c()) return false;
		}
        else if (strcmp(_argv[_i], "-d") == 0) {
           if (!handle_d()) return false;
        }
        else if (strcmp(_argv[_i], "-D") == 0) {
        	if (!handle_D()) return false;
        }
        else if (strcmp(_argv[_i], "-io") == 0) {
        	if (!handle_io()) return false;
        }
        else if (strcmp(_argv[_i], "-iu") == 0) {
        	if (!handle_iu()) return false;
        }
        else if (strcmp(_argv[_i], "-id") == 0) {
        	if (!handle_id()) return false;
        }
        else if (strcmp(_argv[_i], "-N") == 0) {
        	if (!handle_N()) return false;
        }
        else if (strcmp(_argv[_i], "-t") == 0) {
        	if (!handle_t()) return false;
        }
        else if (strcmp(_argv[_i], "-mdb") == 0) {
        	if (!handle_mdb()) return false;
        }

	}
	return ContextIntersect::parseCmdArgs(argc, argv, _skipFirstArgs);
}
开发者ID:daler,项目名称:bedtools2,代码行数:50,代码来源:ContextClosest.cpp


示例12: close

void Bank::newBank( const string& path, const string& name, bool doSave )
{
    close( doSave );

    path_       = path;
    name_       = name;
    programNum_ = -1;

    Program* program = generateDefaultProgram( 0 );
    insert( end(), program );
    setProgram( 0, false );

    if( doSave )
        save( path_, false );
}
开发者ID:dreieier,项目名称:Nexus,代码行数:15,代码来源:Bank.cpp


示例13: resize

void Bank::generateDefaultBank()
{
    resize( NUMPROGRAMS );

    for( INT32 i=0; i<NUMPROGRAMS; i++ )
    {
        Program* program = generateDefaultProgram( i );
        insertProgram( i, program );
    }
    programNum_ = -1;
    name_       = "Default Bank";
    path_       = "";

    setProgram( 0, false );
}
开发者ID:dreieier,项目名称:Nexus,代码行数:15,代码来源:Bank.cpp


示例14: Program

void JenSx1000AudioProcessor::setStateInformation (const void* data, int sizeInBytes)
{
    // You should use this method to restore your parameters from this memory block,
    // whose contents will have been created by the getStateInformation() call.
    
    Program* newProgram = new Program("New Program");
    
    ScopedPointer<XmlElement> xmlState (getXmlFromBinary (data, sizeInBytes));
    
    newProgram -> setProgramFromXml(xmlState);
    
    setProgram(newProgram);
    
    
}
开发者ID:dimitrisudell,项目名称:JenSX1000,代码行数:15,代码来源:PluginProcessor.cpp


示例15: setProgram

bool ContextBase::testCmdArgs(int argc, char **argv) {
	_argc = argc;
	_argv = argv;
	_skipFirstArgs = 1;
	setProgram(_programNames[argv[0]]);
	_argsProcessed.resize(_argc - _skipFirstArgs, false);

	if (!parseCmdArgs(argc, argv, 1) || getShowHelp() || !isValidState()) {
		if (!_errorMsg.empty()) {
			cerr <<_errorMsg << endl;
		}
		return false;
	}
	return true;
}
开发者ID:aeron15,项目名称:bedtools2,代码行数:15,代码来源:ContextBase.cpp


示例16: i18n

/**
 * Executes the back-end process.
 * @param	sName		The name of the process (for error messages)
 * @param	slArgs		A list containing the command-line arguments
 * @param	sWorkDir	(Optional) working directory
 * @param	bBlock		(Optional) true to block, false otherwise
 * @return	true if the process was executed successfully, false otherwise
 */
bool Frontend::run(const QString& sName, const QStringList& slArgs,
		   const QString& incDirs, const QString& srcDirs,
		   const QString& sWorkDir, bool bBlock)
{
	// Cannot start if another controlled process is currently running
	if (QProcess::state() == QProcess::Running) {
		m_sError = i18n("Cannot restart while another process is still "
			"running");
		return false;
	}

	// Reset variables
	m_nRecords = 0;
	m_bKilled = false;

	// Setup the command-line arguments
	clearProgram();

	if (m_bUseShell)
		// Execute inside a shell; join all arguments in a single QString
		setShellCommand(slArgs.join(" "));
	else
		// Or setup args directly
		setProgram(slArgs);

	// Set the working directory, if requested
	if (!sWorkDir.isEmpty())
		setWorkingDirectory(sWorkDir);

	// Set environment variables (INCLUDEDIRS & SOURCEDIRS) if required
	if (! incDirs.isEmpty()) {
		setEnv("INCLUDEDIRS", incDirs);
	}
	if (! srcDirs.isEmpty()) {
		setEnv("SOURCEDIRS", srcDirs);
	}

	// Execute the child process
	setOutputChannelMode( KProcess::SeparateChannels );
	start();
	if (! ( bBlock ? waitForFinished( -1 ) : waitForStarted ( -1 ))) {
		m_sError = sName + i18n(": Failed to start process");
		return false;
	}

	m_sError = i18n("No error");
	return true;
}
开发者ID:AlexanderStein,项目名称:kscope4,代码行数:56,代码来源:frontend.cpp


示例17: kWarning

bool KJavaProcess::invokeJVM()
{
    QStringList args;

    if( !d->classPath.isEmpty() )
    {
        args << "-classpath";
        args << d->classPath;
    }

    //set the system properties, iterate through the qmap of system properties
    QMap<QString,QString>::ConstIterator it = d->systemProps.constBegin();
    const QMap<QString,QString>::ConstIterator itEnd = d->systemProps.constEnd();

    for( ; it != itEnd; ++it )
    {
        if( !it.key().isEmpty() )
        {
            QString currarg = "-D" + it.key();
            if( !it.value().isEmpty() )
                currarg += '=' + it.value();
            args << currarg;
        }
    }

    //load the extra user-defined arguments
    if( !d->extraArgs.isEmpty() )
    {
        KShell::Errors err;
        args += KShell::splitArgs( d->extraArgs, KShell::AbortOnMeta, &err );
        if( err != KShell::NoError )
            kWarning(6100) << "Extra args for JVM cannot be parsed, arguments = " << d->extraArgs;

    }

    args << d->mainClass;

    if ( !d->classArgs.isNull() )
        args << d->classArgs;

    kDebug(6100) << "Invoking JVM" << d->jvmPath << "now...with arguments = " << KShell::joinArgs(args);

    setOutputChannelMode(KProcess::SeparateChannels);
    setProgram( d->jvmPath, args );
    start();

    return waitForStarted();
}
开发者ID:vasi,项目名称:kdelibs,代码行数:48,代码来源:kjavaprocess.cpp


示例18: PizMidi

//-----------------------------------------------------------------------------
MidiScaleChanger::MidiScaleChanger(audioMasterCallback audioMaster)
	: PizMidi(audioMaster, kNumPrograms, kNumParams), programs(0)
{
	programs = new MidiScaleChangerProgram[numPrograms];

	if (programs) {
		CFxBank* defaultBank = new CFxBank(numPrograms,numParams);
		if (readDefaultBank(PLUG_NAME,defaultBank)) {
			if((VstInt32)defaultBank->GetFxID()==PLUG_IDENT) {
				for(int i=0;i<numPrograms;i++){
					n0  = defaultBank->GetProgParm(i,k0);
					n1  = defaultBank->GetProgParm(i,k1);
					n2  = defaultBank->GetProgParm(i,k2);
					n3  = defaultBank->GetProgParm(i,k3);
					n4  = defaultBank->GetProgParm(i,k4);
					n5  = defaultBank->GetProgParm(i,k5);
					n6  = defaultBank->GetProgParm(i,k6);
					n7  = defaultBank->GetProgParm(i,k7);
					n8  = defaultBank->GetProgParm(i,k8);
					n9  = defaultBank->GetProgParm(i,k9);
					n10 = defaultBank->GetProgParm(i,k10);
					n11 = defaultBank->GetProgParm(i,k11);
					fRoot = defaultBank->GetProgParm(i,kRoot);
					fWrap = defaultBank->GetProgParm(i,kWrap);
					fChannel = defaultBank->GetProgParm(i,kChannel);
					fAltChannel = defaultBank->GetProgParm(i,kAltChannel);
					strcpy(programs[i].name,defaultBank->GetProgramName(i));
				}
			}
		}
		else {
            for(int i=0;i<numPrograms;i++){
                sprintf(programs[i].name,"Program %d",i+1);
            }
        }
		setProgram (0);
	}

	for (int n=0;n<128;n++) {
		for (int c=0;c<16;c++) {
			transposed[n][c]=n;
			noteOnChannel[n][c]=c;
		}
	}

	settingprog=false;
	init();
}
开发者ID:Amcut,项目名称:pizmidi,代码行数:49,代码来源:midiScaleChanger.cpp


示例19: PizMidi

//-----------------------------------------------------------------------------
ForceToRange::ForceToRange (audioMasterCallback audioMaster)
	: PizMidi (audioMaster, kNumPrograms, kNumParams), programs(0) 
{ 
	settingProgram=false;
	programs = new ForceToRangeProgram[numPrograms];
	if (programs) {
		CFxBank* defaultBank = new CFxBank(kNumPrograms,kNumParams);
		if (readDefaultBank(PLUG_NAME,defaultBank)) {
			if((VstInt32)defaultBank->GetFxID()==PLUG_IDENT) {
				for(int i=0;i<kNumPrograms;i++){
					for (int p=0;p<kNumParams;p++) {
						programs[i].param[p] = defaultBank->GetProgParm(i,p);
					}
					strcpy(programs[i].name,defaultBank->GetProgramName(i));
				}
			}
		}
		else {
			// built-in programs
			for(int i=0;i<kNumPrograms;i++){
				switch(i) 
				{
				case 0:
					programs[i].param[kLowNote]  = MIDI_TO_FLOAT(48);
					programs[i].param[kHighNote] = MIDI_TO_FLOAT(60);
					sprintf(programs[i].name,"Octave 2");
					break;
				case 1:
					programs[i].param[kLowNote]  = MIDI_TO_FLOAT(60);
					programs[i].param[kHighNote] = MIDI_TO_FLOAT(72);
					sprintf(programs[i].name,"Octave 3");
					break;
					//etc
				default: 
					sprintf(programs[i].name,"Program %d",i+1);
					break;
				}
			}
		}
		setProgram (0);
	}

	for (int n=0;n<128;n++) {
		for (int c=0;c<16;c++) transposed[n][c]=n;
	}

	init();
}
开发者ID:Amcut,项目名称:pizmidi,代码行数:49,代码来源:midiForceToRange.cpp


示例20: AudioEffectX

//-----------------------------------------------------------------------------------------
tf3Synth::tf3Synth (audioMasterCallback audioMaster, void* hInstance)
	: AudioEffectX (audioMaster, kNumPrograms, TF_PARAM_COUNT)
{
	// Initialize module path
	eChar mpath[512];
	eMemSet(mpath, 0, 512);
	GetModuleFileName((HMODULE)hInstance, mpath, 512);

	eChar *str = &mpath[511];
	while (str != mpath && *str!='/' && *str!='\\')
	{
		*str-- = '\0';
	}
	
	modulePath = QString(mpath);

	// Initialize tunefish
	tf = new tfInstrument();

	// initialize programs
	for (long i = 0; i < kNumPrograms; i++)
		programs[i].loadDefault(i);

	loadProgramAll();

	for (long i = 0; i < 16; i++)
		channelPrograms[i] = i;

	if (programs)
		setProgram (0);

    editor = new tfEditor(this);
	
	if (audioMaster)
	{
		setNumInputs (0);				// no inputs
		setNumOutputs (kNumOutputs);	// 2 outputs, 1 for each oscillator
		canProcessReplacing ();
		hasVu (false);
		hasClip (false);
		isSynth ();
		setUniqueID ('TF3');			// <<<! *must* change this!!!!
	}
	initProcess ();

	suspend ();
}
开发者ID:DX94,项目名称:Enigma-Studio-3,代码行数:48,代码来源:tf3synth.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setProjection函数代码示例发布时间:2022-05-30
下一篇:
C++ setPriority函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap