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

Defines

#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 TRUE   1
#define FALSE   0
#define ABS(x)   ( (x) > 0 ? (x) : -(x) )
#define ABS(x)   ( (x) > 0 ? (x) : -(x) )

Functions

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

Detailed Description


Define Documentation

#define ABS (  )     ( (x) > 0 ? (x) : -(x) )
#define ABS (  )     ( (x) > 0 ? (x) : -(x) )
#define ASSERT_CALL ( expr,
success   ) 
Value:
aErr_ = (expr); \
    assert( aErr_ == success );

Referenced by PaJack_Initialize().

#define ENSURE_PA ( expr   ) 
Value:
do { \
        if( (paErr_ = (expr)) < paNoError ) \
        { \
            if( (paErr_) == paUnanticipatedHostError && pthread_self() == mainThread_ ) \
            { \
                if (! jackErr_ ) jackErr_ = "unknown error";\
                PaUtil_SetLastHostErrorInfo( paJACK, -1, jackErr_ ); \
            } \
            PaUtil_DebugPrint(( "Expression '" #expr "' failed in '" __FILE__ "', line: " STRINGIZE( __LINE__ ) "\n" )); \
            result = paErr_; \
            goto error; \
        } \
    } while( 0 )

Referenced by PaJack_GetClientName(), and PaJack_Initialize().

#define FALSE   0
#define STRINGIZE ( expr   )     STRINGIZE_HELPER(expr)
#define STRINGIZE_HELPER ( expr   )     #expr
#define TRUE   1

Referenced by propertyProc().

#define UNLESS ( expr,
code   ) 
Value:
do { \
        if( (expr) == 0 ) \
        { \
            if( (code) == paUnanticipatedHostError && pthread_self() == mainThread_ ) \
            { \
                if (!jackErr_) jackErr_ = "unknown error";\
                PaUtil_SetLastHostErrorInfo( paJACK, -1, jackErr_ ); \
            } \
            PaUtil_DebugPrint(( "Expression '" #expr "' failed in '" __FILE__ "', line: " STRINGIZE( __LINE__ ) "\n" )); \
            result = (code); \
            goto error; \
        } \
    } while( 0 )

Referenced by PaJack_Initialize().


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.


Generated for PortAudio by  doxygen1.6.1