本文整理汇总了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;
}
}
示例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 );
}
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例8: while
void MainGame::gameLoop() {
while (_gameState != GameState::EXIT) {
processInput();
_time += 0.01f;
draw();
}
}
示例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();
}
}
示例10: while
void MultiplayerGUI::clientDataRecieved()
{
while(clientSock->canReadLine()){
QString str = clientSock->readLine();
processInput(str);
}
}
示例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);
}
示例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();
}
}
示例13: processInput
void Util::waitMouseUp() {
do {
processInput();
if (_mouseButtons != kMouseButtonsNone)
delay(10);
} while (_mouseButtons != kMouseButtonsNone);
}
示例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 ();
}
示例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();
}