git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4388 0c269be4-1314-0410-8aa9-9f06e86f4224tags/1.9.8
| @@ -550,9 +550,9 @@ namespace Jack | |||
| //buffers | |||
| for (midi_port_index = 0; midi_port_index < fParams.fReturnMidiChannels; midi_port_index++) | |||
| fNetMidiPlaybackBuffer->SetBuffer (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->SetBuffer (audio_port_index, GetOutputBuffer (audio_port_index)); | |||
| fNetAudioPlaybackBuffer->SetBuffer(audio_port_index, GetOutputBuffer (audio_port_index)); | |||
| #ifdef JACK_MONITOR | |||
| fNetTimeMon->Add(((float) (GetMicroSeconds() - fRcvSyncUst) / (float)fEngineControl->fPeriodUsecs) * 100.f); | |||
| @@ -472,7 +472,7 @@ namespace Jack | |||
| if (fCycleOffset < CYCLE_OFFSET_SLOW) { | |||
| return 0; | |||
| } else { | |||
| rx_bytes = Recv (rx_head->fPacketSize, 0); | |||
| rx_bytes = Recv(rx_head->fPacketSize, 0); | |||
| } | |||
| /* | |||
| @@ -780,10 +780,10 @@ namespace Jack | |||
| //midi net buffers | |||
| if (fParams.fSendMidiChannels > 0) | |||
| fNetMidiCaptureBuffer = new NetMidiBuffer(&fParams, fParams.fSendMidiChannels, fTxData); | |||
| fNetMidiCaptureBuffer = new NetMidiBuffer(&fParams, fParams.fSendMidiChannels, fRxData); | |||
| if (fParams.fReturnMidiChannels > 0) | |||
| fNetMidiPlaybackBuffer = new NetMidiBuffer(&fParams, fParams.fReturnMidiChannels, fRxData); | |||
| fNetMidiPlaybackBuffer = new NetMidiBuffer(&fParams, fParams.fReturnMidiChannels, fTxData); | |||
| try { | |||
| @@ -422,18 +422,26 @@ namespace Jack | |||
| #endif | |||
| //buffers | |||
| for ( port_index = 0; port_index < fParams.fSendMidiChannels; port_index++ ) | |||
| 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->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->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->SetBuffer ( port_index, static_cast<sample_t*> ( jack_port_get_buffer ( fAudioPlaybackPorts[port_index], | |||
| fParams.fPeriodSize ) ) ); | |||
| for (port_index = 0; port_index < fParams.fSendMidiChannels; port_index++) { | |||
| 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->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->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->SetBuffer(port_index, | |||
| static_cast<sample_t*>(jack_port_get_buffer(fAudioPlaybackPorts[port_index], | |||
| fParams.fPeriodSize))); | |||
| } | |||
| if (IsSynched()) { // only send if connection is "synched" | |||
| @@ -441,11 +449,11 @@ namespace Jack | |||
| EncodeSyncPacket(); | |||
| //send sync | |||
| if ( SyncSend() == SOCKET_ERROR ) | |||
| if (SyncSend() == SOCKET_ERROR) | |||
| return SOCKET_ERROR; | |||
| #ifdef JACK_MONITOR | |||
| fNetTimeMon->Add ( ( ( ( float ) (GetMicroSeconds() - begin_time ) ) / ( float ) fPeriodUsecs ) * 100.f ); | |||
| fNetTimeMon->Add((((float) (GetMicroSeconds() - begin_time)) / (float) fPeriodUsecs ) * 100.f); | |||
| #endif | |||
| //send data | |||
| @@ -453,7 +461,7 @@ namespace Jack | |||
| return SOCKET_ERROR; | |||
| #ifdef JACK_MONITOR | |||
| fNetTimeMon->Add ( ( ( ( float ) (GetMicroSeconds() - begin_time ) ) / ( float ) fPeriodUsecs ) * 100.f ); | |||
| fNetTimeMon->Add((((float) (GetMicroSeconds() - begin_time)) / (float) fPeriodUsecs) * 100.f); | |||
| #endif | |||
| } else { | |||
| @@ -153,7 +153,7 @@ namespace Jack | |||
| copy_size = sizeof(JackMidiBuffer) + fPortBuffer[port_index]->event_count * sizeof(JackMidiEvent); | |||
| memcpy(fBuffer + pos, fPortBuffer[port_index], copy_size); | |||
| pos += copy_size; | |||
| memcpy(fBuffer + pos, fPortBuffer[port_index] +(fPortBuffer[port_index]->buffer_size - fPortBuffer[port_index]->write_pos), | |||
| memcpy(fBuffer + pos, fPortBuffer[port_index] + (fPortBuffer[port_index]->buffer_size - fPortBuffer[port_index]->write_pos), | |||
| fPortBuffer[port_index]->write_pos); | |||
| pos += fPortBuffer[port_index]->write_pos; | |||
| @@ -174,7 +174,7 @@ namespace Jack | |||
| copy_size = sizeof(JackMidiBuffer) + reinterpret_cast<JackMidiBuffer*>(fBuffer + pos)->event_count * sizeof(JackMidiEvent); | |||
| memcpy(fPortBuffer[port_index], fBuffer + pos, copy_size); | |||
| pos += copy_size; | |||
| memcpy(fPortBuffer[port_index] +(fPortBuffer[port_index]->buffer_size - fPortBuffer[port_index]->write_pos), | |||
| memcpy(fPortBuffer[port_index] + (fPortBuffer[port_index]->buffer_size - fPortBuffer[port_index]->write_pos), | |||
| fBuffer + pos, fPortBuffer[port_index]->write_pos); | |||
| pos += fPortBuffer[port_index]->write_pos; | |||
| } | |||
| @@ -833,7 +833,7 @@ namespace Jack | |||
| jack_info("ID : %u", header->fID); | |||
| jack_info("Cycle : %u", header->fCycle); | |||
| jack_info("SubCycle : %u", header->fSubCycle); | |||
| jack_info("Midi packets : %u", header->fNumPacket); | |||
| jack_info("DATA packets : %u", header->fNumPacket); | |||
| jack_info("Last packet : '%s'", (header->fIsLastPckt) ? "yes" : "no"); | |||
| jack_info("Bitdepth : %s", bitdepth); | |||
| jack_info("**********************************************"); | |||