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

C++ processInput函数代码示例

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

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



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

示例1: processInput

void pdsp::PRNoiseGen::process(int bufferSize) noexcept  {

        int trigSeedBufferState;
        const float* trigSeedBuffer = processInput(input_trig_seed, trigSeedBufferState);

        int trigSyncBufferState;
        const float* trigSyncBuffer = processInput(input_trig_clock, trigSyncBufferState);

        //generate noise
        switch(trigSyncBufferState){
            case Unchanged: case Changed:
                process_run(bufferSize); //just noise
            break;
            case AudioRate:
                switch (trigSeedBufferState){
                    case Unchanged: case Changed:
                         process_PA(trigSyncBuffer, bufferSize);
                    break;
                        
                    case AudioRate:                    
                        process_SA_TA(trigSyncBuffer, trigSeedBuffer, bufferSize);
                    break;
                    
                    default: break;                       
                }
            break;
            
            default: break;
        }
        
}
开发者ID:alessandrostone,项目名称:ofxPDSP,代码行数:31,代码来源:PRNoiseGen.cpp


示例2: processInput

void pdsp::EnvelopeFollower::process (int bufferSize) noexcept {
    
    int inputState;
    const float* inputBuffer = processInput(input, inputState);

    if(inputState==AudioRate){
                           
        int changed;
        const float* attackBuffer = processInput(in_attack_ms, changed);
        if(changed) {  attackCoeff  = expf( TC / (attackBuffer[0]  * sampleRate * 0.001f) ); }
        const float* releaseBuffer = processInput(in_release_ms, changed);
        if(changed) {  releaseCoeff = expf( TC / (releaseBuffer[0] * sampleRate * 0.001f) ); }
        
        float* outputBuffer = getOutputBufferToFill(output);
        
        for(int n=0; n<bufferSize; ++n){
            float xn = inputBuffer[n]; 
            if(xn > envelopeOutput ){
                envelopeOutput = attackCoeff  * (envelopeOutput-xn) + xn;
            }else{
                envelopeOutput = releaseCoeff * (envelopeOutput-xn) + xn;
            }
            outputBuffer[n] = envelopeOutput;
        }
        
        meter.store(outputBuffer[0]);
        
    }else{
        
        setOutputToZero( output );
        meter.store( 0.0f );
        
    }
    
}
开发者ID:npisanti,项目名称:ofxPDSP,代码行数:35,代码来源:EnvelopeFollower.cpp


示例3: processInput

void pdsp::Amp::process (int bufferSize) noexcept {
    
    int modState;
    const float* modBuffer = processInput(input_mod, modState);
    meter.store(modBuffer[0]);
        
    if ( modBuffer[0] == 0.0f && modState != AudioRate ){

        setOutputToZero(output);
        meterOut.store(0.0f);   
             
    }else{        
           
        int signalState;
        const float* signalBuffer = processInput(input_signal, signalState);

        if (signalState == AudioRate){
            float* outputBuffer = getOutputBufferToFill(output);
            if (modState == AudioRate){
                ofx_Aeq_BmulC(outputBuffer, signalBuffer, modBuffer, bufferSize);
            }else{
                ofx_Aeq_BmulS(outputBuffer, signalBuffer, modBuffer[0], bufferSize);
            }
            meterOut.store(outputBuffer[0]);       
        }else {
            float out = modBuffer[0]*signalBuffer[0];
            setControlRateOutput(output, out);
            meterOut.store(out);       
        }
        
    }
    


}
开发者ID:drakh,项目名称:ofxPDSP,代码行数:35,代码来源:Amp.cpp


示例4: processInput

void pdsp::Bitcruncher::process (int bufferSize) noexcept  {
       
        int inputBufferState;
        const float* inputBuffer = processInput(input_signal, inputBufferState);
     
        if( inputBufferState == AudioRate){
            int bitsState;
            const float* bitsBuffer = processInput(input_bits, bitsState);
         
            switch (bitsState){
                case Unchanged:
                    process_audio<false>(inputBuffer, bitsBuffer, bufferSize);
                    break;
                case Changed:
                    multiply = powf(2.0f, bitsBuffer[0]);
                    scaleBack = 1.0f / multiply;
                    process_audio<false>(inputBuffer, bitsBuffer, bufferSize);
                    break;      
                case AudioRate:
                    process_audio<true>(inputBuffer, bitsBuffer, bufferSize);
                    break;          
            }     
        }else{
            setOutputToZero(output);
        }
}
开发者ID:npisanti,项目名称:ofxPDSP,代码行数:26,代码来源:Bitcruncher.cpp


示例5: processInput

void pdsp::GainComputer::process (int bufferSize) noexcept {
  
        int inputState;
        const float* inputBuffer = processInput(input, inputState);

        if(inputState==AudioRate){
                
                float threshold = processAndGetSingleValue(in_thresh, 0);
                float knee = processAndGetSingleValue(input_knee, 0);
                
                int ratioChanged;
                const float * ratioBuffer = processInput(input_ratio, ratioChanged);
                
                if(ratioChanged){
                    if(ratioBuffer[0] > 40.0f){
                        CS = 1.0f;
                    }else{
                        CS = 1.0f-(1.0f/ratioBuffer[0]);
                    }
                }

                float* outputBuffer = getOutputBufferToFill(output);
                
                if(knee>0.0f){
                        vect_calculateGainReductionDBWithKnee(outputBuffer, inputBuffer, threshold, CS, knee, bufferSize); 
                }else{
                        vect_calculateGainReductionDB(outputBuffer, inputBuffer, threshold, CS, bufferSize); 
                }
                
                meter.store(outputBuffer[0]);
        }else{
            setOutputToZero(output);
            meter.store(0.0f);
        }  
}
开发者ID:alessandrostone,项目名称:ofxPDSP,代码行数:35,代码来源:GainComputer.cpp


示例6: processInput

void pdsp::Decimator::process (int bufferSize) noexcept {
        int inputBufferState;
        const float* inputBuffer = processInput(input_signal, inputBufferState);
          
        if( inputBufferState == AudioRate){
            int freqBufferState;
            const float* freqBuffer = processInput(input_freq, freqBufferState);
             
            switch (freqBufferState){
                case Unchanged:
                    process_audio<false>(inputBuffer, freqBuffer, bufferSize);
                    break;
                case Changed:
                    inc = freqBuffer[0] * incCalculationMultiplier;
                    process_audio<false>(inputBuffer, freqBuffer, bufferSize);
                    break;      
                case AudioRate:
                    process_audio<true>(inputBuffer, freqBuffer, bufferSize);
                    break;          
            }     
            
            if(phase >= 1.0f){ // if the fre rate is higher than the sampling rate this could happen
                int phase_i = static_cast<int> (phase);
                phase -= phase_i;
            }
        }else{
            setOutputToZero(output);
        }

}
开发者ID:alessandrostone,项目名称:ofxPDSP,代码行数:30,代码来源:Decimator.cpp


示例7: closeMenu

bool GUIConfirmRegistration::OnEvent(const SEvent &event)
{
	if (event.EventType == EET_KEY_INPUT_EVENT) {
		// clang-format off
		if ((event.KeyInput.Key == KEY_ESCAPE ||
				event.KeyInput.Key == KEY_CANCEL) &&
				event.KeyInput.PressedDown) {
			closeMenu(false);
			return true;
		}
		// clang-format on
		if (event.KeyInput.Key == KEY_RETURN && event.KeyInput.PressedDown) {
			acceptInput();
			if (processInput())
				closeMenu(true);
			return true;
		}
	}

	if (event.EventType != EET_GUI_EVENT)
		return Parent ? Parent->OnEvent(event) : false;

	if (event.GUIEvent.EventType == gui::EGET_ELEMENT_FOCUS_LOST && isVisible()) {
		if (!canTakeFocus(event.GUIEvent.Element)) {
			dstream << "GUIConfirmRegistration: Not allowing focus "
				   "change."
				<< std::endl;
			// Returning true disables focus change
			return true;
		}
	} else if (event.GUIEvent.EventType == gui::EGET_BUTTON_CLICKED) {
		switch (event.GUIEvent.Caller->getID()) {
		case ID_confirm:
			acceptInput();
			if (processInput())
				closeMenu(true);
			return true;
		case ID_cancel:
			closeMenu(false);
			return true;
		}
	} else if (event.GUIEvent.EventType == gui::EGET_EDITBOX_ENTER) {
		switch (event.GUIEvent.Caller->getID()) {
		case ID_confirmPassword:
			acceptInput();
			if (processInput())
				closeMenu(true);
			return true;
		}
	}

	return false;
}
开发者ID:Snipie,项目名称:minetest,代码行数:53,代码来源:guiConfirmRegistration.cpp


示例8: while

void MainGame::gameLoop() {
	while (_gameState != GameState::EXIT) {
		processInput();
		_time += 0.01f;
		draw();
	}
}
开发者ID:J-J-Chen,项目名称:20PercentProject,代码行数:7,代码来源:MainGame.cpp


示例9: while

void MainGame::gameLoop()
{
	Skengine::FpsLimiter fpsLimiter;
	fpsLimiter.setMaxFPS(60);
	while (_currentState == GAME_STATE::PLAY)
	{
		fpsLimiter.begin();



		processInput();
		_camera.setPosition(_player->getPosition());
		_camera.update();
		//UPDUATE AGENTS
		for (int i = 0; i < _humans.size(); i++)
		{
			_humans[i]->update(_levels[_currentLevel]->getLevelData(), _humans, _zombies);
		}
		for (int i = 0; i < _humans.size(); i++)
		{
			for (int j = i + 1; j < _humans.size(); j++)
			{
				_humans[i]->collideWithAgent(_humans[j]);
			}
		}

		//Add Zombies
		drawGame();

		_fps = fpsLimiter.end();
	}
}
开发者ID:Snorflake,项目名称:Skengine,代码行数:32,代码来源:MainGame.cpp


示例10: while

void MultiplayerGUI::clientDataRecieved()
{
    while(clientSock->canReadLine()){
        QString str = clientSock->readLine();
        processInput(str);
    }
}
开发者ID:ssidw,项目名称:cps111brickbreaker,代码行数:7,代码来源:multiplayergui.cpp


示例11: processInput

QString LanguageDetector::detectLanguage(QString inputStr){
    processInput(inputStr);
    init();
    int weight = 1;
    QList<int> occurenceList = inputWeightMap->uniqueKeys();
    QList<QString> languageList = languageScoreMap->keys();
    for(int i = occurenceList.size() - 1; i > -1; i--)  {
        QList<QString> sameWeightNGramList = inputWeightMap->values(occurenceList.at(i));

        for(int j = 0; j < sameWeightNGramList.size(); j++) {
            QString nGram = sameWeightNGramList[j];
            for(int k = 0; k < languageList.size(); k++) {
                QString language = languageList.at(k);
                updateScore(language, nGram, weight);
            }
            languageList = removeNonProbableLanguages(languageList, 3);
            if(languageList.size() == 1) {
                return languageList.at(0);
            }
        }
        weight++;
    }
    languageList = removeNonProbableLanguages(languageList, 0);
    return languageList.at(0);
}
开发者ID:amourphious,项目名称:Language-Detection,代码行数:25,代码来源:language_detector.cpp


示例12: SDL_GetTicks

void Boiler::run()
{
	double prevTime = SDL_GetTicks();
	double frameLag = 0.0f;

	running = true;
	while(running)
	{
		//get the delta time
		double currentTime = SDL_GetTicks();
		double frameDelta = (currentTime - prevTime) / 1000.0f;
		prevTime = currentTime;
		frameLag += frameDelta;

		processInput();

		while (frameLag >= frameInterval)
		{
			// TODO: Render system needs to not kick in when frame is lagging, only physics etc systems should be updated during frame lag catchup.
			// Need a clean way to essentially move the render() to outside the while loop here (after).
			update(frameInterval);
			part->update(frameInterval);
			frameLag -= frameInterval;
		} 
		
		renderer->beginRender();
		renderSystem->update(getEcs().getComponentStore(), frameDelta);
		glyphSystem->update(getEcs().getComponentStore(), frameDelta);
		renderer->endRender();
	}
}
开发者ID:nickenchev,项目名称:boiler,代码行数:31,代码来源:boiler.cpp


示例13: processInput

void Util::waitMouseUp() {
	do {
		processInput();
		if (_mouseButtons != kMouseButtonsNone)
			delay(10);
	} while (_mouseButtons != kMouseButtonsNone);
}
开发者ID:tramboi,项目名称:scummvm-test,代码行数:7,代码来源:util.cpp


示例14: loadInputCloud

 // Load and process the cloud in the given PCD file
 void
 loadInputCloud (const std::string &pcd_file)
 {
   xyz_ = PointCloud::Ptr (new PointCloud);
   pcl::io::loadPCDFile (pcd_file, *xyz_);
   processInput ();
 }
开发者ID:Dark-Guan,项目名称:mecanumbot-ros-pkg,代码行数:8,代码来源:CloudHelpers.cpp


示例15: renderBoard

void Game::updatePVP()
{
	cout << "|=                                                                          =|" << endl;
	cout << "|============================================================================|" << endl;
	cout << "|=                              Player VS Player                            =|" << endl;
	cout << "|============================================================================|" << endl;
	cout << "|=                                                                          =|" << endl;

	renderBoard();

	if (_error) {
		cout << "|= ERROR: Incorrect user input or block already taken.                      =|" << endl;
		_error = false;
	}
	else {
		cout << "|=                                                                          =|" << endl;
	}
		
	cout << "|= Please select a row    : ";
	cin >> rowSelection;
	cout << "|= Please select a column : ";
	cin >> colSelection;

	processInput();
}
开发者ID:inSight01,项目名称:MakingGamesWithBen,代码行数:25,代码来源:Game.cpp


示例16: processInput

void MTD_FLASHMEM ParameterReplacer::start(char const *strStart, char const *strEnd, Params *params, BlockParams *blockParams) {
  m_params = params;
  m_blockParams = blockParams;
  m_strStart = strStart;
  m_strEnd = strEnd;
  processInput();
}
开发者ID:venugopalsomu,项目名称:ESPWebFramework,代码行数:7,代码来源:fdvnetwork.cpp


示例17: processInput

//--------------------------------------------------------------
// control value changed
void mgDebugPane::guiChange(
  void* source,
  const char* name)
{
  mgString value;
  mgFieldControl* field = (mgFieldControl*) source;
  field->getText(value);
  field->reset();

  if (m_debugApp == NULL)
  {
    m_console->addLine(ERROR_COLOR, NULL, "mgDebugPane::setDebugApp() not called.");
    return;
  }

  value.trim();
  // echo the input
  if (value.length() > 0)
  {
    m_console->addLine(ECHO_COLOR, NULL, value);
    processInput(value);
  }
  else 
  {
    m_debugApp->debugIntro(value);
    m_console->addLine(OUTPUT_COLOR, NULL, value);
  }
}
开发者ID:Kelimion,项目名称:SeaOfMemes,代码行数:30,代码来源:mgDebugPane.cpp


示例18: updateCurrentText

void CmdPromptInput::checkEditedText(const QString& txt)
{
    updateCurrentText(txt);

    if(rapidFireEnabled)
        processInput();
}
开发者ID:claudeocquidant,项目名称:Embroidermodder,代码行数:7,代码来源:cmdprompt.cpp


示例19: getTimeKey

void Util::waitEndFrame(bool handleInput) {
	int32 time;

	time = getTimeKey() - _startFrameTime;
	if ((time > 1000) || (time < 0)) {
		_vm->_video->retrace();
		_startFrameTime = getTimeKey();
		return;
	}

	int32 toWait = 0;
	do {
		if (toWait > 0)
			delay(MIN<int>(toWait, 10));

		if (handleInput)
			processInput();

		_vm->_video->retrace();

		time   = getTimeKey() - _startFrameTime;
		toWait = _frameWaitTime - time;
	} while (toWait > 0);

	_startFrameTime = getTimeKey();
}
开发者ID:BenCastricum,项目名称:scummvm,代码行数:26,代码来源:util.cpp


示例20: main

int main()
{
    processInput();
    generateStringSubsets(0, 0);

    return 0;
}
开发者ID:VasilVP,项目名称:Software-University-Courses,代码行数:7,代码来源:SubsetsOfStringArray.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ processLine函数代码示例发布时间:2022-05-30
下一篇:
C++ processFrame函数代码示例发布时间: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