Commit 3dff31a0 authored by sletz's avatar sletz
Browse files

Compile on Linux.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4328 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 4c56bcb0
......@@ -25,6 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "JackException.h"
#include "JackAudioAdapterInterface.h"
#ifdef __cplusplus
extern "C"
{
......@@ -293,7 +294,7 @@ struct JackNetExtMaster : public JackNetMasterInterface {
void AllocPorts()
{
unsigned int port_index;
int port_index;
// Set buffers
if (fParams.fSendAudioChannels > 0) {
......@@ -331,7 +332,7 @@ struct JackNetExtMaster : public JackNetMasterInterface {
void FreePorts()
{
unsigned int port_index;
int port_index;
if (fAudioPlaybackBuffer) {
for (port_index = 0; port_index < fParams.fSendAudioChannels; port_index++)
......@@ -365,7 +366,7 @@ struct JackNetExtMaster : public JackNetMasterInterface {
int Read(int audio_input, float** audio_input_buffer, int midi_input, void** midi_input_buffer)
{
try {
assert((unsigned int)audio_input == fParams.fReturnAudioChannels);
assert(audio_input == fParams.fReturnAudioChannels);
for (int port_index = 0; port_index < audio_input; port_index++) {
fNetAudioPlaybackBuffer->SetBuffer(port_index, audio_input_buffer[port_index]);
......@@ -390,7 +391,7 @@ struct JackNetExtMaster : public JackNetMasterInterface {
int Write(int audio_output, float** audio_output_buffer, int midi_output, void** midi_output_buffer)
{
try {
assert((unsigned int)audio_output == fParams.fSendAudioChannels);
assert(audio_output == fParams.fSendAudioChannels);
for (int port_index = 0; port_index < audio_output; port_index++) {
fNetAudioCaptureBuffer->SetBuffer(port_index, audio_output_buffer[port_index]);
......@@ -544,7 +545,7 @@ struct JackNetExtSlave : public JackNetSlaveInterface, public JackRunnableInterf
void AllocPorts()
{
unsigned int port_index;
int port_index;
// Set buffers
fAudioCaptureBuffer = new float*[fParams.fSendAudioChannels];
......@@ -574,7 +575,7 @@ struct JackNetExtSlave : public JackNetSlaveInterface, public JackRunnableInterf
void FreePorts()
{
unsigned int port_index;
int port_index;
if (fAudioCaptureBuffer) {
for (port_index = 0; port_index < fParams.fSendAudioChannels; port_index++)
......@@ -615,7 +616,7 @@ struct JackNetExtSlave : public JackNetSlaveInterface, public JackRunnableInterf
bool Init()
{
// Will do "something" on OSX only...
fThread.SetParams(float(fParams.fPeriodSize) / float(fParams.fSampleRate) * 1000000, 100 * 1000, 500 * 1000);
fThread.SetParams(UInt64(float(fParams.fPeriodSize)/float(fParams.fSampleRate)*1000000), 100 * 1000, 500 * 1000);
return (fThread.AcquireRealTime(80) == 0); // TODO: get a value from the server
}
......
......@@ -520,8 +520,6 @@ namespace Jack
{
int rx_bytes = 0;
uint recvd_midi_pckt = 0;
uint recvd_audio_pckt = 0;
packet_header_t* rx_head = reinterpret_cast<packet_header_t*> ( fRxBuffer );
while ( !fRxHeader.fIsLastPckt )
......@@ -911,8 +909,6 @@ namespace Jack
{
int rx_bytes = 0;
uint recvd_midi_pckt = 0;
uint recvd_audio_pckt = 0;
packet_header_t* rx_head = reinterpret_cast<packet_header_t*> ( fRxBuffer );
while ( !fRxHeader.fIsLastPckt )
......
......@@ -390,7 +390,11 @@ namespace Jack
for (int port_index = 0; port_index < fNPorts; port_index++) {
memcpy(floatbuf, fPortBuffer[port_index], fPeriodSize * sizeof(float));
int res = celt_encode_float(fCeltEncoder[port_index], floatbuf, NULL, fCompressedBuffer[port_index], fCompressedSizeByte);
#if HAVE_CELT_API_0_8 || HAVE_CELT_API_0_11
int res = celt_encode_float(fCeltEncoder[port_index], floatbuf, fPeriodSize, fCompressedBuffer[port_index], fCompressedSizeByte);
#else
int res = celt_encode_float(fCeltEncoder[port_index], floatbuf, NULL, fCompressedBuffer[port_index], fCompressedSizeByte);
#endif
if (res != fCompressedSizeByte) {
jack_error("celt_encode_float error fCompressedSizeByte = %d res = %d", fCompressedSizeByte, res);
}
......@@ -402,7 +406,11 @@ namespace Jack
int NetCeltAudioBuffer::RenderToJackPorts()
{
for (int port_index = 0; port_index < fNPorts; port_index++) {
int res = celt_decode_float(fCeltDecoder[port_index], fCompressedBuffer[port_index], fCompressedSizeByte, fPortBuffer[port_index]);
#if HAVE_CELT_API_0_8 || HAVE_CELT_API_0_11
int res = celt_decode_float(fCeltDecoder[port_index], fCompressedBuffer[port_index], fCompressedSizeByte, fPortBuffer[port_index], fPeriodSize );
#else
int res = celt_decode_float(fCeltDecoder[port_index], fCompressedBuffer[port_index], fCompressedSizeByte, fPortBuffer[port_index]);
#endif
if (res != CELT_OK) {
jack_error("celt_decode_float error res = %d", fCompressedSizeByte, res);
}
......
......@@ -65,7 +65,7 @@ def build(bld):
]
includes = ['.', './jack', '..']
uselib = ["PTHREAD"]
uselib = ["PTHREAD", "CELT"]
if bld.env['IS_LINUX']:
common_libsources += [
......@@ -130,10 +130,6 @@ def build(bld):
'JackNetTool.cpp',
'JackNetInterface.cpp',
'JackArgParser.cpp',
#'JackPhysicalMidiInput.cpp',
#'JackPhysicalMidiOutput.cpp',
'JackMidiAsyncQueue.cpp',
'JackMidiAsyncWaitQueue.cpp',
'JackMidiBufferReadQueue.cpp',
......@@ -192,7 +188,7 @@ def build(bld):
netlib.includes = includes
netlib.name = 'netlib'
netlib.target = 'jacknet'
netlib.uselib = 'SAMPLERATE'
netlib.uselib = ['SAMPLERATE', 'CELT']
netlib.install_path = '${LIBDIR}'
netlib.source = ['JackNetAPI.cpp',
'JackNetInterface.cpp',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment