Browse Source

Cleanup.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4482 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.9.8
sletz 14 years ago
parent
commit
4a182fbd48
17 changed files with 71 additions and 66 deletions
  1. +2
    -2
      common/JackAPI.cpp
  2. +1
    -1
      common/JackNetAdapter.cpp
  3. +1
    -1
      common/JackNetAdapter.h
  4. +1
    -1
      common/JackNetDriver.cpp
  5. +1
    -1
      common/JackNetDriver.h
  6. +1
    -1
      common/JackNetInterface.cpp
  7. +1
    -1
      common/JackNetInterface.h
  8. +1
    -1
      common/JackNetManager.cpp
  9. +1
    -1
      common/JackNetOneDriver.cpp
  10. +1
    -1
      common/JackNetOneDriver.h
  11. +1
    -1
      common/JackNetSocket.h
  12. +1
    -1
      common/JackNetTool.cpp
  13. +51
    -47
      common/JackNetTool.h
  14. +1
    -1
      posix/JackNetUnixSocket.cpp
  15. +1
    -1
      posix/JackNetUnixSocket.h
  16. +4
    -3
      windows/portaudio/JackPortAudioDevices.cpp
  17. +1
    -1
      windows/portaudio/JackPortAudioDevices.h

+ 2
- 2
common/JackAPI.cpp View File

@@ -353,12 +353,12 @@ EXPORT void* jack_port_get_buffer(jack_port_t* port, jack_nframes_t frames)
EXPORT void* jack_port_get_buffer_nulled(jack_port_t* port, jack_nframes_t frames)
{
#ifdef __CLIENTDEBUG__
JackGlobals::CheckContext("jack_port_get_buffer");
JackGlobals::CheckContext("jack_port_get_buffer_nulled");
#endif
uintptr_t port_aux = (uintptr_t)port;
jack_port_id_t myport = (jack_port_id_t)port_aux;
if (!CheckPort(myport)) {
jack_error("jack_port_get_buffer called with an incorrect port %ld", myport);
jack_error("jack_port_get_buffer_nulled called with an incorrect port %ld", myport);
return NULL;
} else {
JackGraphManager* manager = GetGraphManager();


+ 1
- 1
common/JackNetAdapter.cpp View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 2008 Romain Moret at Grame
Copyright (C) 2008-2011 Romain Moret at Grame

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by


+ 1
- 1
common/JackNetAdapter.h View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 2008 Romain Moret at Grame
Copyright (C) 2008-2011 Romain Moret at Grame

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by


+ 1
- 1
common/JackNetDriver.cpp View File

@@ -1,6 +1,6 @@
/*
Copyright (C) 2001 Paul Davis
Copyright (C) 2008 Romain Moret at Grame
Copyright (C) 2008-2011 Romain Moret at Grame

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by


+ 1
- 1
common/JackNetDriver.h View File

@@ -1,6 +1,6 @@
/*
Copyright (C) 2001 Paul Davis
Copyright (C) 2008 Romain Moret at Grame
Copyright (C) 2008-2011 Romain Moret at Grame

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by


+ 1
- 1
common/JackNetInterface.cpp View File

@@ -1,6 +1,6 @@
/*
Copyright (C) 2001 Paul Davis
Copyright (C) 2008 Romain Moret at Grame
Copyright (C) 2008-2011 Romain Moret at Grame

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by


+ 1
- 1
common/JackNetInterface.h View File

@@ -1,6 +1,6 @@
/*
Copyright (C) 2001 Paul Davis
Copyright (C) 2008 Romain Moret at Grame
Copyright (C) 2008-2011 Romain Moret at Grame

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by


+ 1
- 1
common/JackNetManager.cpp View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 2008 Romain Moret at Grame
Copyright (C) 2008-2011 Romain Moret at Grame

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by


+ 1
- 1
common/JackNetOneDriver.cpp View File

@@ -1,6 +1,6 @@
/*
Copyright (C) 2001 Paul Davis
Copyright (C) 2008 Romain Moret at Grame
Copyright (C) 2008-2011 Romain Moret at Grame

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by


+ 1
- 1
common/JackNetOneDriver.h View File

@@ -1,6 +1,6 @@
/*
Copyright (C) 2001 Paul Davis
Copyright (C) 2008 Romain Moret at Grame
Copyright (C) 2008-2011 Romain Moret at Grame

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by


+ 1
- 1
common/JackNetSocket.h View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 2008 Romain Moret at Grame
Copyright (C) 2008-2011 Romain Moret at Grame

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by


+ 1
- 1
common/JackNetTool.cpp View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 2008 Romain Moret at Grame
Copyright (C) 2008-2011 Romain Moret at Grame

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by


+ 51
- 47
common/JackNetTool.h View File

@@ -1,5 +1,5 @@
/*
Copyright(C) 2008 Romain Moret at Grame
Copyright (C) 2008-2011 Romain Moret at Grame

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -307,6 +307,8 @@ namespace Jack

struct JackPortList {

// "[---Header---|--audio data--|--audio data--]..."

jack_nframes_t fPeriodSize;
jack_nframes_t fSubPeriodSize;
size_t fSubPeriodBytesSize;
@@ -494,6 +496,8 @@ namespace Jack

struct JackOptimizedPortList : JackPortList {

// "[---Header---|--active_port_num---audio data--|--active_port_num---audio data--]..."

JackOptimizedPortList(session_params_t* params, uint32_t nports)
:JackPortList(params, nports)
{}
@@ -558,6 +562,7 @@ namespace Jack

virtual int RenderToNetwork(char* net_buffer,int sub_cycle, size_t total_size, uint32_t& port_num)
{
// Init active port count
port_num = 0;

for (int port_index = 0; port_index < fNPorts; port_index++) {
@@ -577,45 +582,6 @@ namespace Jack

};

struct JackPortListAllocate : public JackPortList {

JackPortListAllocate()
{
fNPorts = 0;
fPeriodSize = 0;
fSubPeriodSize = 0;
fSubPeriodBytesSize = 0;
fPortBuffer = 0;
}

~JackPortListAllocate()
{
for (int port_index = 0; port_index < fNPorts; port_index++)
delete [] fPortBuffer[port_index];
delete [] fPortBuffer;
}

void Init(session_params_t* params, uint32_t nports)
{
fNPorts = nports;
fPeriodSize = params->fPeriodSize;

if (params->fSendAudioChannels == 0 && params->fReturnAudioChannels == 0) {
fSubPeriodSize = params->fPeriodSize;
} else {
jack_nframes_t period = (int) powf(2.f, (int)(log(float((params->fMtu - sizeof(packet_header_t)))
/ (max(params->fReturnAudioChannels, params->fSendAudioChannels) * sizeof(sample_t))) / log(2.)));
fSubPeriodSize = (period > params->fPeriodSize) ? params->fPeriodSize : period;
}

fSubPeriodBytesSize = fSubPeriodSize * sizeof(sample_t);
fPortBuffer = new sample_t* [fNPorts];
for (int port_index = 0; port_index < fNPorts; port_index++)
fPortBuffer[port_index] = new sample_t[fPeriodSize];
}

};

class SERVER_EXPORT NetFloatAudioBuffer : public NetAudioBuffer
{
private:
@@ -673,8 +639,8 @@ namespace Jack
int fCompressedSizeByte;
jack_nframes_t fPeriodSize;
int fNumPackets;
float fCycleDuration; // in sec
size_t fCycleSize; // needed size in bytes for an entire cycle
float fCycleDuration; // in sec
size_t fCycleSize; // needed size in bytes for an entire cycle

size_t fSubPeriodBytesSize;
size_t fLastSubPeriodBytesSize;
@@ -722,8 +688,8 @@ namespace Jack
jack_nframes_t fPeriodSize;

int fNumPackets;
float fCycleDuration; // in sec
size_t fCycleSize; // needed size in bytes for an entire cycle
float fCycleDuration; // in sec
size_t fCycleSize; // needed size in bytes for an entire cycle

size_t fSubPeriodSize;
size_t fSubPeriodBytesSize;
@@ -761,10 +727,48 @@ namespace Jack
int RenderToNetwork(int sub_cycle, size_t total_size, uint32_t& port_num);
};

/*
#define AUDIO_BUFFER_SIZE 8

/*
struct JackPortListAllocate : public JackPortList {

JackPortListAllocate()
{
fNPorts = 0;
fPeriodSize = 0;
fSubPeriodSize = 0;
fSubPeriodBytesSize = 0;
fPortBuffer = 0;
}

~JackPortListAllocate()
{
for (int port_index = 0; port_index < fNPorts; port_index++)
delete [] fPortBuffer[port_index];
delete [] fPortBuffer;
}

void Init(session_params_t* params, uint32_t nports)
{
fNPorts = nports;
fPeriodSize = params->fPeriodSize;

if (params->fSendAudioChannels == 0 && params->fReturnAudioChannels == 0) {
fSubPeriodSize = params->fPeriodSize;
} else {
jack_nframes_t period = (int) powf(2.f, (int)(log(float((params->fMtu - sizeof(packet_header_t)))
/ (max(params->fReturnAudioChannels, params->fSendAudioChannels) * sizeof(sample_t))) / log(2.)));
fSubPeriodSize = (period > params->fPeriodSize) ? params->fPeriodSize : period;
}

fSubPeriodBytesSize = fSubPeriodSize * sizeof(sample_t);
fPortBuffer = new sample_t* [fNPorts];
for (int port_index = 0; port_index < fNPorts; port_index++)
fPortBuffer[port_index] = new sample_t[fPeriodSize];
}

};

class SERVER_EXPORT NetBufferedAudioBuffer : public NetAudioBuffer
{

@@ -809,7 +813,7 @@ namespace Jack
};
*/

//utility *************************************************************************************
//utility *************************************************************************************

//socket API management
SERVER_EXPORT int SocketAPIInit();


+ 1
- 1
posix/JackNetUnixSocket.cpp View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 2008 Romain Moret at Grame
Copyright (C) 2008-2011 Romain Moret at Grame

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by


+ 1
- 1
posix/JackNetUnixSocket.h View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 2008 Romain Moret at Grame
Copyright (C) 2008-2011 Romain Moret at Grame

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by


+ 4
- 3
windows/portaudio/JackPortAudioDevices.cpp View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 2008 Romain Moret at Grame
Copyright (C) 2008-2011 Romain Moret at Grame

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -18,8 +18,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#include "JackPortAudioDevices.h"
#include "JackError.h"
#include <stdlib.h>
#include "JackError.h"
#include <stdlib.h>

using namespace std;

@@ -290,3 +290,4 @@ bool PortAudioDevices::IsDuplex ( PaDeviceIndex id )
//then the device isn't full duplex
return false;
}


+ 1
- 1
windows/portaudio/JackPortAudioDevices.h View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 2008 Romain Moret at Grame
Copyright (C) 2008-2011 Romain Moret at Grame

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by


Loading…
Cancel
Save