Browse Source

Improve some of example-clients, cleanup.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4610 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.9.8
sletz 10 years ago
parent
commit
f0a9512dd7
16 changed files with 39 additions and 82 deletions
  1. +1
    -1
      common/JackGlobals.cpp
  2. +1
    -1
      common/JackGlobals.h
  3. +22
    -72
      common/JackNetInterface.cpp
  4. +2
    -0
      common/JackNetInterface.h
  5. +2
    -3
      example-clients/capture_client.c
  6. +1
    -0
      example-clients/impulse_grabber.c
  7. +1
    -0
      example-clients/latent_client.c
  8. +1
    -0
      example-clients/midisine.c
  9. +1
    -0
      example-clients/netsource.c
  10. +1
    -0
      example-clients/showtime.c
  11. +1
    -0
      example-clients/tw.c
  12. +1
    -0
      macosx/Jackdmp.xcodeproj/project.pbxproj
  13. +1
    -2
      macosx/coremidi/JackCoreMidiDriver.cpp
  14. +1
    -1
      macosx/coremidi/JackCoreMidiOutputPort.cpp
  15. +1
    -1
      tests/cpu.c
  16. +1
    -1
      windows/winmme/JackWinMMEDriver.cpp

+ 1
- 1
common/JackGlobals.cpp View File

@@ -31,7 +31,7 @@ jack_tls_key JackGlobals::fKeyLogFunction;
static bool fKeyLogFunctionInitialized = jack_tls_allocate_key(&JackGlobals::fKeyLogFunction);

JackMutex* JackGlobals::fOpenMutex = new JackMutex();
bool JackGlobals::fServerRunning = false;
volatile bool JackGlobals::fServerRunning = false;
JackClient* JackGlobals::fClientTable[CLIENT_NUM] = {};

#ifndef WIN32


+ 1
- 1
common/JackGlobals.h View File

@@ -40,7 +40,7 @@ struct JackGlobals {
static jack_tls_key fRealTime;
static jack_tls_key fKeyLogFunction;
static JackMutex* fOpenMutex;
static bool fServerRunning;
static volatile bool fServerRunning;
static JackClient* fClientTable[];
static bool fVerbose;
#ifndef WIN32


+ 22
- 72
common/JackNetInterface.cpp View File

@@ -227,6 +227,24 @@ namespace Jack
return NET_PACKET_ERROR;
}

NetAudioBuffer* JackNetInterface::AudioBufferFactory(int nports, char* buffer)
{
switch (fParams.fSampleEncoder) {

case JackFloatEncoder:
return new NetFloatAudioBuffer(&fParams, nports, buffer);

case JackIntEncoder:
return new NetIntAudioBuffer(&fParams, nports, buffer);

case JackCeltEncoder:
#if HAVE_CELT
return new NetCeltAudioBuffer(&fParams, nports, buffer, fParams.fKBps);
#endif
}
return NULL;
}

// JackNetMasterInterface ************************************************************************************

bool JackNetMasterInterface::Init()
@@ -316,46 +334,12 @@ namespace Jack

// audio net buffers
if (fParams.fSendAudioChannels > 0) {

switch (fParams.fSampleEncoder) {

case JackFloatEncoder:
fNetAudioCaptureBuffer = new NetFloatAudioBuffer(&fParams, fParams.fSendAudioChannels, fTxData);
break;

case JackIntEncoder:
fNetAudioCaptureBuffer = new NetIntAudioBuffer(&fParams, fParams.fSendAudioChannels, fTxData);
break;

case JackCeltEncoder:
#if HAVE_CELT
fNetAudioCaptureBuffer = new NetCeltAudioBuffer(&fParams, fParams.fSendAudioChannels, fTxData, fParams.fKBps);
#endif
break;
}

fNetAudioCaptureBuffer = AudioBufferFactory(fParams.fSendAudioChannels, fTxData);
assert(fNetAudioCaptureBuffer);
}

if (fParams.fReturnAudioChannels > 0) {

switch (fParams.fSampleEncoder) {

case JackFloatEncoder:
fNetAudioPlaybackBuffer = new NetFloatAudioBuffer(&fParams, fParams.fReturnAudioChannels, fRxData);
break;

case JackIntEncoder:
fNetAudioPlaybackBuffer = new NetIntAudioBuffer(&fParams, fParams.fReturnAudioChannels, fRxData);
break;

case JackCeltEncoder:
#if HAVE_CELT
fNetAudioPlaybackBuffer = new NetCeltAudioBuffer(&fParams, fParams.fReturnAudioChannels, fRxData, fParams.fKBps);
#endif
break;
}

fNetAudioPlaybackBuffer = AudioBufferFactory(fParams.fReturnAudioChannels, fRxData);
assert(fNetAudioPlaybackBuffer);
}

@@ -809,46 +793,12 @@ namespace Jack

// audio net buffers
if (fParams.fSendAudioChannels > 0) {

switch (fParams.fSampleEncoder) {

case JackFloatEncoder:
fNetAudioCaptureBuffer = new NetFloatAudioBuffer(&fParams, fParams.fSendAudioChannels, fRxData);
break;

case JackIntEncoder:
fNetAudioCaptureBuffer = new NetIntAudioBuffer(&fParams, fParams.fSendAudioChannels, fRxData);
break;

case JackCeltEncoder:
#if HAVE_CELT
fNetAudioCaptureBuffer = new NetCeltAudioBuffer(&fParams, fParams.fSendAudioChannels, fRxData, fParams.fKBps);
#endif
break;
}

fNetAudioCaptureBuffer = AudioBufferFactory(fParams.fSendAudioChannels, fRxData);
assert(fNetAudioCaptureBuffer);
}

if (fParams.fReturnAudioChannels > 0) {

switch (fParams.fSampleEncoder) {

case JackFloatEncoder:
fNetAudioPlaybackBuffer = new NetFloatAudioBuffer(&fParams, fParams.fReturnAudioChannels, fTxData);
break;

case JackIntEncoder:
fNetAudioPlaybackBuffer = new NetIntAudioBuffer(&fParams, fParams.fReturnAudioChannels, fTxData);
break;

case JackCeltEncoder:
#if HAVE_CELT
fNetAudioPlaybackBuffer = new NetCeltAudioBuffer(&fParams, fParams.fReturnAudioChannels, fTxData, fParams.fKBps);
#endif
break;
}

fNetAudioPlaybackBuffer = AudioBufferFactory(fParams.fReturnAudioChannels, fTxData);
assert(fNetAudioPlaybackBuffer);
}



+ 2
- 0
common/JackNetInterface.h View File

@@ -107,6 +107,8 @@ namespace Jack

int FinishRecv(NetAudioBuffer* buffer);

NetAudioBuffer* AudioBufferFactory(int nports, char* buffer);

public:

JackNetInterface();


+ 2
- 3
example-clients/capture_client.c View File

@@ -158,9 +158,8 @@ process (jack_nframes_t nframes, void *arg)
static void
jack_shutdown (void *arg)
{
fprintf (stderr, "JACK shutdown\n");
// exit (0);
abort();
fprintf(stderr, "JACK shut down, exiting ...\n");
exit(1);
}

static void


+ 1
- 0
example-clients/impulse_grabber.c View File

@@ -78,6 +78,7 @@ process (jack_nframes_t nframes, void *arg)
static void
jack_shutdown (void *arg)
{
fprintf(stderr, "JACK shut down, exiting ...\n");
exit (1);
}



+ 1
- 0
example-clients/latent_client.c View File

@@ -77,6 +77,7 @@ latency_cb (jack_latency_callback_mode_t mode, void *arg)
void
jack_shutdown (void *arg)
{
fprintf(stderr, "JACK shut down, exiting ...\n");
exit (1);
}



+ 1
- 0
example-clients/midisine.c View File

@@ -111,6 +111,7 @@ static int srate(jack_nframes_t nframes, void *arg)

static void jack_shutdown(void *arg)
{
fprintf(stderr, "JACK shut down, exiting ...\n");
exit(1);
}



+ 1
- 0
example-clients/netsource.c View File

@@ -477,6 +477,7 @@ process (jack_nframes_t nframes, void *arg)
void
jack_shutdown (void *arg)
{
fprintf(stderr, "JACK shut down, exiting ...\n");
exit (1);
}



+ 1
- 0
example-clients/showtime.c View File

@@ -64,6 +64,7 @@ showtime ()
static void
jack_shutdown (void *arg)
{
fprintf(stderr, "JACK shut down, exiting ...\n");
exit (1);
}



+ 1
- 0
example-clients/tw.c View File

@@ -124,6 +124,7 @@ static void* jack_thread(void *arg)
static void
jack_shutdown (void *arg)
{
fprintf(stderr, "JACK shut down, exiting ...\n");
exit (1);
}



+ 1
- 0
macosx/Jackdmp.xcodeproj/project.pbxproj View File

@@ -6170,6 +6170,7 @@
isa = PBXProject;
buildConfigurationList = 4B699DD5097D427F00A18468 /* Build configuration list for PBXProject "Jackdmp" */;
compatibilityVersion = "Xcode 2.4";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,


+ 1
- 2
macosx/coremidi/JackCoreMidiDriver.cpp View File

@@ -717,8 +717,7 @@ JackCoreMidiDriver::Write()
}
for (int i = 0; i < num_virtual_outputs; i++) {
virtual_output_ports[i]->
ProcessJack(GetOutputBuffer(num_physical_outputs + i),
buffer_size);
ProcessJack(GetOutputBuffer(num_physical_outputs + i), buffer_size);
}
Unlock();
return 0;


+ 1
- 1
macosx/coremidi/JackCoreMidiOutputPort.cpp View File

@@ -167,7 +167,7 @@ JackCoreMidiOutputPort::Init()
{
set_threaded_log_function();

// OSX only, values read in RT CoreMidi thread
// OSX only, values read in RT CoreMIDI thread
UInt64 period = 0;
UInt64 computation = 250 * 1000;
UInt64 constraint = 500 * 1000;


+ 1
- 1
tests/cpu.c View File

@@ -96,7 +96,7 @@ int process(jack_nframes_t nframes, void *arg)

void jack_shutdown(void *arg)
{
printf("Jack_cpu has been kicked out by jackd !\n");
fprintf(stderr, "JACK shut down, exiting ...\n");
exit (1);
}



+ 1
- 1
windows/winmme/JackWinMMEDriver.cpp View File

@@ -357,7 +357,7 @@ extern "C"
{
#endif

// singleton kind of driver
// singleton kind of driver
static Jack::JackDriverClientInterface* driver = NULL;

SERVER_EXPORT jack_driver_desc_t * driver_get_descriptor()


Loading…
Cancel
Save