示例#1
0
  void VoiceHandler::process() {
    global_router_.process();

    int polyphony = static_cast<int>(input(kPolyphony)->at(0));
    setPolyphony(utils::iclamp(polyphony, 1, polyphony));
    for (int i = 0; i < numOutputs(); ++i) {
      int buffer_size = voice_outputs_[i]->owner->getBufferSize();
      memset(output(i)->buffer, 0, buffer_size * sizeof(mopo_float));
    }

    std::list<Voice*>::iterator iter = active_voices_.begin();
    while (iter != active_voices_.end()) {
      Voice* voice = *iter;
      prepareVoiceTriggers(voice);
      processVoice(voice);

      // Remove voice if the right processor has a full silent buffer.
      if (voice_killer_ && voice->state().event != kVoiceOn &&
          utils::isSilent(voice_killer_->buffer, buffer_size_)) {
        free_voices_.push_back(voice);
        iter = active_voices_.erase(iter);
      }
      else
        iter++;
    }
  }
示例#2
0
文件: dstar.cpp 项目: f4exb/dsdcc
void DSDDstar::process()
{
    if (m_frameType == DStarVoiceFrame)
    {
        processVoice();
    }
    else if (m_frameType == DStarDataFrame)
    {
        processData();
    }
    else if (m_frameType == DStarSyncFrame)
    {
        processSync();
    }
}
示例#3
0
  void VoiceHandler::process() {
    global_router_.process();

    size_t polyphony = static_cast<size_t>(inputs_[kPolyphony]->at(0));
    setPolyphony(CLAMP(polyphony, 1, polyphony));
    memset(outputs_[0]->buffer, 0, BUFFER_SIZE * sizeof(mopo_float));

    std::list<Voice*>::iterator iter = active_voices_.begin();
    while (iter != active_voices_.end()) {
      Voice* voice = *iter;
      prepareVoiceTriggers(voice);
      processVoice(voice);

      // Remove voice if the right processor has a full silent buffer.
      if (voice_killer_ &&
          utils::isSilent(voice_killer_->buffer, BUFFER_SIZE)) {
        free_voices_.push_back(voice);
        iter = active_voices_.erase(iter);
      }
      else
        iter++;
    }
  }