git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2682 0c269be4-1314-0410-8aa9-9f06e86f4224tags/1.90
| @@ -448,9 +448,9 @@ namespace Jack | |||
| //buffers | |||
| for ( midi_port_index = 0; midi_port_index < fParams.fSendMidiChannels; midi_port_index++ ) | |||
| fNetMidiCaptureBuffer->fPortBuffer[midi_port_index] = GetMidiInputBuffer ( midi_port_index ); | |||
| fNetMidiCaptureBuffer->SetBuffer(midi_port_index, GetMidiInputBuffer ( midi_port_index )); | |||
| for ( audio_port_index = 0; audio_port_index < fCaptureChannels; audio_port_index++ ) | |||
| fNetAudioCaptureBuffer->fPortBuffer[audio_port_index] = GetInputBuffer ( audio_port_index ); | |||
| fNetAudioCaptureBuffer->SetBuffer(audio_port_index, GetInputBuffer ( audio_port_index )); | |||
| //receive sync (launch the cycle) | |||
| do | |||
| @@ -515,9 +515,9 @@ namespace Jack | |||
| //buffers | |||
| for ( midi_port_index = 0; midi_port_index < fParams.fReturnMidiChannels; midi_port_index++ ) | |||
| fNetMidiPlaybackBuffer->fPortBuffer[midi_port_index] = GetMidiOutputBuffer ( midi_port_index ); | |||
| fNetMidiPlaybackBuffer->SetBuffer(midi_port_index, GetMidiOutputBuffer ( midi_port_index )); | |||
| for ( audio_port_index = 0; audio_port_index < fPlaybackChannels; audio_port_index++ ) | |||
| fNetAudioPlaybackBuffer->fPortBuffer[audio_port_index] = GetOutputBuffer ( audio_port_index ); | |||
| fNetAudioPlaybackBuffer->SetBuffer(audio_port_index, GetOutputBuffer ( audio_port_index )); | |||
| //midi | |||
| if ( fParams.fReturnMidiChannels ) | |||
| @@ -341,17 +341,17 @@ fail: | |||
| //buffers | |||
| uint port_index; | |||
| for ( port_index = 0; port_index < fParams.fSendMidiChannels; port_index++ ) | |||
| fNetMidiCaptureBuffer->fPortBuffer[port_index] = | |||
| static_cast<JackMidiBuffer*> ( jack_port_get_buffer ( fMidiCapturePorts[port_index], fParams.fPeriodSize ) ); | |||
| fNetMidiCaptureBuffer->SetBuffer(port_index, | |||
| static_cast<JackMidiBuffer*> ( jack_port_get_buffer ( fMidiCapturePorts[port_index], fParams.fPeriodSize ))); | |||
| for ( port_index = 0; port_index < fParams.fSendAudioChannels; port_index++ ) | |||
| fNetAudioCaptureBuffer->fPortBuffer[port_index] = | |||
| static_cast<sample_t*> ( jack_port_get_buffer ( fAudioCapturePorts[port_index], fParams.fPeriodSize ) ); | |||
| fNetAudioCaptureBuffer->SetBuffer(port_index, | |||
| static_cast<sample_t*> ( jack_port_get_buffer ( fAudioCapturePorts[port_index], fParams.fPeriodSize ))); | |||
| for ( port_index = 0; port_index < fParams.fReturnMidiChannels; port_index++ ) | |||
| fNetMidiPlaybackBuffer->fPortBuffer[port_index] = | |||
| static_cast<JackMidiBuffer*> ( jack_port_get_buffer ( fMidiPlaybackPorts[port_index], fParams.fPeriodSize ) ); | |||
| fNetMidiPlaybackBuffer->SetBuffer(port_index, | |||
| static_cast<JackMidiBuffer*> ( jack_port_get_buffer ( fMidiPlaybackPorts[port_index], fParams.fPeriodSize ))); | |||
| for ( port_index = 0; port_index < fParams.fReturnAudioChannels; port_index++ ) | |||
| fNetAudioPlaybackBuffer->fPortBuffer[port_index] = | |||
| static_cast<sample_t*> ( jack_port_get_buffer ( fAudioPlaybackPorts[port_index], fParams.fPeriodSize ) ); | |||
| fNetAudioPlaybackBuffer->SetBuffer(port_index, | |||
| static_cast<sample_t*> ( jack_port_get_buffer ( fAudioPlaybackPorts[port_index], fParams.fPeriodSize ))); | |||
| //send ------------------------------------------------------------------------------------------------------------------ | |||
| //sync | |||
| @@ -47,6 +47,11 @@ namespace Jack | |||
| { | |||
| return fMaxBufsize; | |||
| } | |||
| void NetMidiBuffer::SetBuffer(int index, JackMidiBuffer* buffer) | |||
| { | |||
| fPortBuffer[index] = buffer; | |||
| } | |||
| void NetMidiBuffer::DisplayEvents() | |||
| { | |||
| @@ -129,6 +134,11 @@ namespace Jack | |||
| { | |||
| return fNPorts * fSubPeriodBytesSize; | |||
| } | |||
| void NetAudioBuffer::SetBuffer(int index, sample_t* buffer) | |||
| { | |||
| fPortBuffer[index] = buffer; | |||
| } | |||
| void NetAudioBuffer::RenderFromJackPorts ( int subcycle ) | |||
| { | |||
| @@ -118,12 +118,12 @@ namespace Jack | |||
| //data | |||
| char* fBuffer; | |||
| char* fNetBuffer; | |||
| JackMidiBuffer** fPortBuffer; | |||
| public: | |||
| NetMidiBuffer ( session_params_t* params, uint32_t nports, char* net_buffer ); | |||
| ~NetMidiBuffer(); | |||
| JackMidiBuffer** fPortBuffer; | |||
| void Reset(); | |||
| size_t GetSize(); | |||
| //utility | |||
| @@ -134,6 +134,8 @@ namespace Jack | |||
| //network<->buffer | |||
| int RenderFromNetwork ( int subcycle, size_t copy_size ); | |||
| int RenderToNetwork ( int subcycle, size_t total_size ); | |||
| void SetBuffer(int index, JackMidiBuffer* buffer); | |||
| }; | |||
| // audio data ********************************************************************************* | |||
| @@ -146,16 +148,17 @@ namespace Jack | |||
| jack_nframes_t fSubPeriodSize; | |||
| size_t fSubPeriodBytesSize; | |||
| char* fNetBuffer; | |||
| sample_t** fPortBuffer; | |||
| public: | |||
| NetAudioBuffer ( session_params_t* params, uint32_t nports, char* net_buffer ); | |||
| ~NetAudioBuffer(); | |||
| sample_t** fPortBuffer; | |||
| size_t GetSize(); | |||
| //jack<->buffer | |||
| void RenderFromJackPorts ( int subcycle ); | |||
| void RenderToJackPorts ( int subcycle ); | |||
| void SetBuffer(int index, sample_t* buffer); | |||
| }; | |||
| //utility ************************************************************************************* | |||