PortAudio  2.0
Data Structures | Macros | Typedefs | Functions
pa_jack.c File Reference
#include <string.h>
#include <regex.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
#include <signal.h>
#include <math.h>
#include <semaphore.h>
#include <jack/types.h>
#include <jack/jack.h>
#include "pa_util.h"
#include "pa_hostapi.h"
#include "pa_stream.h"
#include "pa_process.h"
#include "pa_allocation.h"
#include "pa_cpuload.h"
#include "pa_ringbuffer.h"
#include "pa_debugprint.h"

Data Structures

struct  PaJackHostApiRepresentation
 
struct  PaJackStream
 

Macros

#define STRINGIZE_HELPER(expr)   #expr
 
#define STRINGIZE(expr)   STRINGIZE_HELPER(expr)
 
#define ENSURE_PA(expr)
 
#define UNLESS(expr, code)
 
#define ASSERT_CALL(expr, success)
 
#define JACK_PORT_TYPE_FILTER   "audio"
 
#define TRUE   1
 
#define FALSE   0
 
#define ABS(x)   ( (x) > 0 ? (x) : -(x) )
 
#define ABS(x)   ( (x) > 0 ? (x) : -(x) )
 

Typedefs

typedef struct PaJackStream PaJackStream
 

Functions

PaError PaJack_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex)
 
PaError PaJack_SetClientName (const char *name)
 
PaError PaJack_GetClientName (const char **clientName)
 

Macro Definition Documentation

#define ABS (   x)    ( (x) > 0 ? (x) : -(x) )
#define ABS (   x)    ( (x) > 0 ? (x) : -(x) )
#define ASSERT_CALL (   expr,
  success 
)
Value:
do { \
int err = (expr); \
assert( err == success ); \
} while( 0 )

Referenced by PaJack_Initialize().

#define ENSURE_PA (   expr)
Value:
do { \
PaError paErr; \
if( (paErr = (expr)) < paNoError ) \
{ \
if( (paErr) == paUnanticipatedHostError && pthread_self() == mainThread_ ) \
{ \
const char *err = jackErr_; \
if (! err ) err = "unknown error"; \
} \
PaUtil_DebugPrint(( "Expression '" #expr "' failed in '" __FILE__ "', line: " STRINGIZE( __LINE__ ) "\n" )); \
result = paErr; \
goto error; \
} \
} while( 0 )
void PaUtil_SetLastHostErrorInfo(PaHostApiTypeId hostApiType, long errorCode, const char *errorText)
Definition: pa_front.c:145
Definition: portaudio.h:127
Definition: portaudio.h:288
Definition: portaudio.h:124
int PaError
Definition: portaudio.h:121
void PaUtil_DebugPrint(const char *format,...)
Definition: pa_debugprint.c:88

Referenced by PaJack_GetClientName(), and PaJack_Initialize().

#define FALSE   0
#define JACK_PORT_TYPE_FILTER   "audio"
#define STRINGIZE (   expr)    STRINGIZE_HELPER(expr)
#define STRINGIZE_HELPER (   expr)    #expr
#define TRUE   1
#define UNLESS (   expr,
  code 
)
Value:
do { \
if( (expr) == 0 ) \
{ \
if( (code) == paUnanticipatedHostError && pthread_self() == mainThread_ ) \
{ \
const char *err = jackErr_; \
if (!err) err = "unknown error"; \
} \
PaUtil_DebugPrint(( "Expression '" #expr "' failed in '" __FILE__ "', line: " STRINGIZE( __LINE__ ) "\n" )); \
result = (code); \
goto error; \
} \
} while( 0 )
void PaUtil_SetLastHostErrorInfo(PaHostApiTypeId hostApiType, long errorCode, const char *errorText)
Definition: pa_front.c:145
Definition: portaudio.h:127
Definition: portaudio.h:288
void PaUtil_DebugPrint(const char *format,...)
Definition: pa_debugprint.c:88

Referenced by PaJack_Initialize().

Typedef Documentation

typedef struct PaJackStream PaJackStream

Function Documentation

PaError PaJack_GetClientName ( const char **  clientName)

Get the JACK client name used by PA JACK.

The caller is responsible for freeing the returned pointer.

References ENSURE_PA, PaJackHostApiRepresentation::jack_client, paJACK, paNoError, and PaUtil_GetHostApiRepresentation().

PaError PaJack_Initialize ( PaUtilHostApiRepresentation **  hostApi,
PaHostApiIndex  hostApiIndex 
)
PaError PaJack_SetClientName ( const char *  name)

Set the JACK client name.

During Pa_Initialize, When PA JACK connects as a client of the JACK server, it requests a certain name, which is for instance prepended to port names. By default this name is "PortAudio". The JACK server may append a suffix to the client name, in order to avoid clashes among clients that try to connect with the same name (e.g., different PA JACK clients).

This function must be called before Pa_Initialize, otherwise it won't have any effect. Note that the string is not copied, but instead referenced directly, so it must not be freed for as long as PA might need it.

See Also
PaJack_GetClientName

References paInvalidFlag, and paNoError.