git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4508 0c269be4-1314-0410-8aa9-9f06e86f4224tags/1.9.8
| @@ -494,8 +494,7 @@ namespace Jack | |||
| } | |||
| for (int audio_port_index = 0; audio_port_index < fParams.fSendAudioChannels; audio_port_index++) { | |||
| #ifdef OPTIMIZED_PROTOCOL | |||
| // fNetAudioCaptureBuffer->SetBuffer(audio_port_index, GetInputBuffer(audio_port_index, true)); | |||
| fNetAudioCaptureBuffer->SetBuffer(audio_port_index, GetInputBuffer(audio_port_index)); | |||
| fNetAudioCaptureBuffer->SetBuffer(audio_port_index, GetInputBuffer(audio_port_index, true)); | |||
| #else | |||
| fNetAudioCaptureBuffer->SetBuffer(audio_port_index, GetInputBuffer(audio_port_index)); | |||
| #endif | |||
| @@ -550,14 +549,11 @@ namespace Jack | |||
| for (int audio_port_index = 0; audio_port_index < fPlaybackChannels; audio_port_index++) { | |||
| #ifdef OPTIMIZED_PROTOCOL | |||
| // Port is connected on other side... | |||
| /* | |||
| if ((intptr_t)fNetAudioPlaybackBuffer->GetBuffer(audio_port_index) == -1) { | |||
| fNetAudioPlaybackBuffer->SetBuffer(audio_port_index, GetOutputBuffer(audio_port_index, true)); | |||
| } else { | |||
| fNetAudioPlaybackBuffer->SetBuffer(audio_port_index, NULL); | |||
| } | |||
| */ | |||
| fNetAudioPlaybackBuffer->SetBuffer(audio_port_index, GetOutputBuffer(audio_port_index)); | |||
| #else | |||
| fNetAudioPlaybackBuffer->SetBuffer(audio_port_index, GetOutputBuffer(audio_port_index)); | |||
| #endif | |||
| @@ -492,7 +492,7 @@ namespace Jack | |||
| if (MidiSend(fNetMidiCaptureBuffer, fParams.fSendMidiChannels, fParams.fSendAudioChannels) == SOCKET_ERROR) { | |||
| return SOCKET_ERROR; | |||
| } | |||
| return AudioSend(fNetAudioPlaybackBuffer, fParams.fSendAudioChannels); | |||
| return AudioSend(fNetAudioCaptureBuffer, fParams.fSendAudioChannels); | |||
| } | |||
| int JackNetMasterInterface::SyncRecv() | |||
| @@ -400,7 +400,6 @@ namespace Jack | |||
| for (int audio_port_index = 0; audio_port_index < fParams.fSendAudioChannels; audio_port_index++) { | |||
| #ifdef OPTIMIZED_PROTOCOL | |||
| /* | |||
| if ((intptr_t)fNetAudioCaptureBuffer->GetBuffer(audio_port_index) == -1) { | |||
| // Port is connected on other side... | |||
| fNetAudioCaptureBuffer->SetBuffer(audio_port_index, | |||
| @@ -409,11 +408,6 @@ namespace Jack | |||
| } else { | |||
| fNetAudioCaptureBuffer->SetBuffer(audio_port_index, NULL); | |||
| } | |||
| */ | |||
| fNetAudioCaptureBuffer->SetBuffer(audio_port_index, | |||
| static_cast<sample_t*>(jack_port_get_buffer(fAudioCapturePorts[audio_port_index], | |||
| fParams.fPeriodSize))); | |||
| #else | |||
| fNetAudioCaptureBuffer->SetBuffer(audio_port_index, | |||
| static_cast<sample_t*>(jack_port_get_buffer(fAudioCapturePorts[audio_port_index], | |||
| @@ -430,15 +424,9 @@ namespace Jack | |||
| for (int audio_port_index = 0; audio_port_index < fParams.fReturnAudioChannels; audio_port_index++) { | |||
| #ifdef OPTIMIZED_PROTOCOL | |||
| /* | |||
| fNetAudioPlaybackBuffer->SetBuffer(audio_port_index, | |||
| static_cast<sample_t*>(jack_port_get_buffer_nulled(fAudioPlaybackPorts[audio_port_index], | |||
| fParams.fPeriodSize))); | |||
| */ | |||
| fNetAudioPlaybackBuffer->SetBuffer(audio_port_index, | |||
| static_cast<sample_t*>(jack_port_get_buffer(fAudioPlaybackPorts[audio_port_index], | |||
| fParams.fPeriodSize))); | |||
| #else | |||
| fNetAudioPlaybackBuffer->SetBuffer(audio_port_index, | |||
| static_cast<sample_t*>(jack_port_get_buffer(fAudioPlaybackPorts[audio_port_index], | |||
| @@ -354,7 +354,7 @@ namespace Jack | |||
| virtual int GetNumPackets() | |||
| { | |||
| jack_info("GetNumPackets packet = %d fPeriodSize = %d fSubPeriodSize = %d fSubPeriodBytesSize = %d", | |||
| jack_log("GetNumPackets packet = %d fPeriodSize = %d fSubPeriodSize = %d fSubPeriodBytesSize = %d", | |||
| fPeriodSize / fSubPeriodSize, fPeriodSize, fSubPeriodSize, fSubPeriodBytesSize); | |||
| return fPeriodSize / fSubPeriodSize; | |||
| } | |||
| @@ -504,6 +504,7 @@ namespace Jack | |||
| virtual void ActivePortsToNetwork(char* net_buffer, uint32_t& port_num) | |||
| { | |||
| // Default behaviour: all ports are active | |||
| port_num = fNPorts; | |||
| } | |||
| @@ -537,6 +538,10 @@ namespace Jack | |||
| } | |||
| fSubPeriodBytesSize = fSubPeriodSize * sizeof(sample_t) + sizeof(uint32_t); // The port number in coded on 4 bytes | |||
| jack_log("GetNumPackets packet = %d fPeriodSize = %d fSubPeriodSize = %d fSubPeriodBytesSize = %d", | |||
| fPeriodSize / fSubPeriodSize, fPeriodSize, fSubPeriodSize, fSubPeriodBytesSize); | |||
| return fPeriodSize / fSubPeriodSize; // At least one packet | |||
| } | |||
| @@ -610,10 +615,8 @@ namespace Jack | |||
| #endif | |||
| /* | |||
| virtual void ActivePortsToNetwork(char* net_buffer, uint32_t& port_num) | |||
| { | |||
| // Init active port count | |||
| port_num = 0; | |||
| short* active_port_address = (short*)net_buffer; | |||
| @@ -631,9 +634,6 @@ namespace Jack | |||
| virtual void ActivePortsFromNetwork(char* net_buffer, uint32_t port_num) | |||
| { | |||
| // steph | |||
| return; | |||
| short* active_port_address = (short*)net_buffer; | |||
| for (int port_index = 0; port_index < fNPorts; port_index++) { | |||
| @@ -650,7 +650,6 @@ namespace Jack | |||
| active_port_address++; | |||
| } | |||
| } | |||
| */ | |||
| }; | |||