Esempio n. 1
0
bool
FilterGraph::getChunk(Chunk *chunk)
{
  ///////////////////////////////////////////////////////
  // if there're something to output from the last filter
  // get it...

  if ( ! end.isEmpty() )
    return end.getChunk(chunk);

  ///////////////////////////////////////////////////////
  // if the last filter is empty then do internal data
  // processing and try to get output afterwards

  if ( ! processInternal(false) )
    return false;

  if ( ! end.isEmpty() )
    return end.getChunk(chunk);

  ///////////////////////////////////////////////////////
  // return dummy chunk

  chunk->setDummy();

  return true;
}
Esempio n. 2
0
/**
 * This instructs the method to calculate a the steady state
 * starting with the initialState given.
 * The steady state is returned in the object pointed to by steadyState.
 * @param CState * steadyState
 * @param const CState * initialState
 * @param C_FLOAT64 * jacobian
 * @param CEigen * eigenValues
 * @return CSteadyStateMethod::ReturnCode returnCode
 */
CSteadyStateMethod::ReturnCode
CSteadyStateMethod::process(CVectorCore< C_FLOAT64 > & State,
                            CMatrix< C_FLOAT64 > & jacobianX,
                            CProcessReport * handler)
{
  mpParentTask = dynamic_cast<CSteadyStateTask *>(getObjectParent());
  assert(mpParentTask);

  mSteadyState.initialize(State);
  mpJacobianX = & jacobianX;
  mpCallBack = handler;

  return processInternal();
}
Esempio n. 3
0
AudioBuffer* AudioNode::process(size_t numSamples, unsigned int indexRequesting) {
	// get current timestamp
	dm_time_seconds currentTime = m_context->getCurrentTime();
	if (m_lastProcessingTime >= currentTime) {
  	// we have already pulled our inputs and processed them during this render quantum
		// the output buffers are available in m_outputBuffer
    if (m_outputHasBeenProcessed[indexRequesting]) {
      return m_outputBuffers[indexRequesting];
    }
	} else {
    m_outputHasBeenProcessed.assign(m_outputHasBeenProcessed.size(), false);
  }
  m_outputHasBeenProcessed[indexRequesting] = true;
  m_lastProcessingTime = currentTime;
  
  if (m_state == DISAPPEARING) {
    m_outputBuffers[indexRequesting]->zero();
    return m_outputBuffers[indexRequesting];
  }
  
  for (unsigned int i = 0; i < m_inputs.size(); ++i) {
    // these buffers are read only because they could be the one cached in the
    // output nodes, and they must be just an input to processing internal
    const AudioBuffer* tmp = m_inputs[i]->pull(numSamples);
    m_inputBuffers[i] = tmp;
  }

  if (m_requestToExecuteOnProcess) {
    process_executeRequest();
    m_requestToExecuteOnProcess = false;
    if (m_requestCompleted != nullptr)
      *m_requestCompleted = true;
  }
  processInternal(numSamples, indexRequesting);
  if (m_grabberUpdated) {
    m_grabberFn = m_newGrabberFn;
    m_grabberFnArgs = m_newGrabberFnArgs;
    m_grabberUpdated = false;
  }
  if (m_grabberFn) {
    const float* temp[2];
    for (unsigned int i = 0; i < m_outputBuffers[indexRequesting]->usedChannels; ++i) {
      temp[i] = m_outputBuffers[indexRequesting]->getChannelData(i);
    }
    m_grabberFn(m_grabberFnArgs, temp,m_outputBuffers[indexRequesting]->usedChannels, numSamples);
  }


  return m_outputBuffers[indexRequesting];
}
Esempio n. 4
0
bool
FilterGraph::process(const Chunk *_chunk)
{
  if ( ! _chunk->isDummy() )
  {
    if ( _chunk->spk != filter[next[node_start]]->getInput() )
    {
      if ( ! setInput(_chunk->spk) )
        return false;
    }

    return start.process(_chunk) && processInternal(true);
  }

  return true;
};
Esempio n. 5
0
/**
 * This function does all the required SMTP connection 
 * and commands. It will send the e-mail we specified 
 * and use the remote smtp server if there is one, otherwise 
 * it will get it out of the config variable 
**/
int
sendmail(dstrbuf *mail)
{
	int smtp_port;
	char *smtp_serv, *sm_bin;
	int index=0;
	int testprocess=0;

	smtp_serv = getConfValue("SMTP_SERVER");
	sm_bin = getConfValue("SENDMAIL_BIN");

	if (smtp_serv) {
		smtp_port = atoi(getConfValue("SMTP_PORT"));
		testprocess = processRemote(smtp_serv, smtp_port, mail) ;
		while(testprocess != 221 && index <10)
		{
			testprocess = processRemote(smtp_serv, smtp_port, mail) ;
			index++;
			if(index==10)
			{
				return ERROR;
			}
			
		}
/*		if (processRemote(smtp_serv, smtp_port, mail) == ERROR) {
			return ERROR;
		}*/
		}
#if 0
	else if (sm_bin) {
		if (processInternal(sm_bin, mail) == ERROR) {
			return ERROR;
		}
	} else {
		fprintf(stderr, "No SMTP server specified!\n");
		return ERROR;
	}
#endif
	if (saveSentEmail(mail) == ERROR) {
		return ERROR;
	}
	return TRUE;
}