当前位置: 首页>>代码示例>>C++>>正文


C++ processInput函数代码示例

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


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


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