Logo Search packages:      
Sourcecode: jacktrip version File versions  Download package

void JackAudioInterface::computeNetworkProcessFromNetwork (  ) [private]

Sets the part of the process callback that sends and receive packets.

Compute the process to receive packets to JACK

Todo:
cast *mInBuffer[i] to the bit resolution

Definition at line 383 of file JackAudioInterface.cpp.

References fromBitToSampleConversion(), mBitResolutionMode, mJackTrip, mNumFrames, mNumOutChans, mOutBuffer, mOutputPacket, and mSizeInBytesPerChannel.

Referenced by processCallback().

{
  /// \todo cast *mInBuffer[i] to the bit resolution
  //cout << mNumFrames << endl;
  // Output Process (from NETWORK to JACK)
  // ----------------------------------------------------------------
  // Read Audio buffer from RingBuffer (read from incoming packets)
  //mOutRingBuffer->readSlotNonBlocking( mOutputPacket );
  mJackTrip->receiveNetworkPacket( mOutputPacket );

  // Extract separate channels to send to Jack
  for (int i = 0; i < mNumOutChans; i++) {
    //--------
    // This should be faster for 32 bits
    //std::memcpy(mOutBuffer[i], &mOutputPacket[i*mSizeInBytesPerChannel],
    //            mSizeInBytesPerChannel);
    //--------
    sample_t* tmp_sample = mOutBuffer[i]; //sample buffer for channel i
    for (int j = 0; j < mNumFrames; j++) {
      //std::memcpy(&tmp_sample[j], &mOutputPacket[(i*mSizeInBytesPerChannel) + (j*4)], 4);
      // Change the bit resolution on each sample
      //cout << tmp_sample[j] << endl;
      fromBitToSampleConversion(&mOutputPacket[(i*mSizeInBytesPerChannel) 
                                     + (j*mBitResolutionMode)],
                        &tmp_sample[j],
                        mBitResolutionMode);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index