pa_mac_core_internal.h File Reference

#include <AudioUnit/AudioUnit.h>
#include <AudioToolbox/AudioToolbox.h>
#include "portaudio.h"
#include "pa_util.h"
#include "pa_hostapi.h"
#include "pa_stream.h"
#include "pa_allocation.h"
#include "pa_cpuload.h"
#include "pa_process.h"
#include "ringbuffer.h"
#include "pa_mac_core_blocking.h"

Go to the source code of this file.

Data Structures

struct  PaMacAUHAL
struct  PaMacCoreStream

Defines

#define RING_BUFFER_ADVANCE_DENOMINATOR   (4)

Functions

PaError PaMacCore_Initialize (PaUtilHostApiRepresentation **hostApi, PaHostApiIndex index)
PaError ReadStream (PaStream *stream, void *buffer, unsigned long frames)
PaError WriteStream (PaStream *stream, const void *buffer, unsigned long frames)
signed long GetStreamReadAvailable (PaStream *stream)
signed long GetStreamWriteAvailable (PaStream *stream)


Define Documentation

#define RING_BUFFER_ADVANCE_DENOMINATOR   (4)


Function Documentation

signed long GetStreamReadAvailable ( PaStream stream  ) 

Number of frames that can be read from input stream without blocking.

Parameters:
s Pointer to PortAudio stream
Returns:
Number of frames, or PortAudio error code

signed long GetStreamWriteAvailable ( PaStream stream  ) 

Number of frames that can be written to output stream without blocking.

Parameters:
s Pointer to PortAudio stream
Returns:
Number of frames, or PortAudio error code

PaError PaMacCore_Initialize ( PaUtilHostApiRepresentation **  hostApi,
PaHostApiIndex  index 
)

PaError ReadStream ( PaStream stream,
void *  buffer,
unsigned long  frames 
)

Read data from input stream. This reads the indicated number of frames into the supplied buffer from an input stream, and blocks until this is done.

Parameters:
s Pointer to PortAudio stream
buffer Pointer to buffer that will receive interleaved data (or an array of pointers to a buffer for each non-interleaved channel)
frames Number of frames to read from stream
Returns:
PortAudio error code (also indicates overflow via paInputOverflowed)

Todo:
REVIEW: consider what to do if the input overflows. do we requeue all of the buffers? should we be running a thread to make sure they are always queued?

PaError WriteStream ( PaStream stream,
const void *  buffer,
unsigned long  frames 
)

Write data to output stream. This writes the indicated number of frames from the supplied buffer to an output stream, and blocks until this is done.

Parameters:
s Pointer to PortAudio stream
buffer Pointer to buffer that provides interleaved data (or an array of pointers to a buffer for each non-interleaved channel)
frames Number of frames to write to stream
Returns:
PortAudio error code (also indicates underflow via paOutputUnderflowed)

Todo:
REVIEW: consider what to do if the output underflows. do we requeue all the existing buffers with zeros? should we run a separate thread to keep the buffers enqueued at all times?


Generated on Fri Aug 25 17:18:24 2006 for PortAudio by  doxygen 1.4.7