Ardour  9.0-pre0-582-g084a23a80d
ARDOUR::CoreAudioPCM Class Reference

#include <coreaudio_pcmio.h>

Public Member Functions

 CoreAudioPCM (void)
 
 ~CoreAudioPCM (void)
 
int state (void) const
 
uint32_t n_playback_channels (void) const
 
uint32_t n_capture_channels (void) const
 
void discover ()
 
void device_list (std::map< size_t, std::string > &devices) const
 
void input_device_list (std::map< size_t, std::string > &devices) const
 
void output_device_list (std::map< size_t, std::string > &devices) const
 
void duplex_device_list (std::map< size_t, std::string > &devices) const
 
int available_sample_rates (uint32_t device_id, std::vector< float > &sampleRates)
 
int available_buffer_sizes (uint32_t device_id, std::vector< uint32_t > &sampleRates)
 
uint32_t available_channels (uint32_t device_id, bool input)
 
float current_sample_rate (uint32_t device_id, bool input=false)
 
uint32_t get_latency (uint32_t device_id, bool input)
 
std::string cached_port_name (uint32_t portnum, bool input) const
 
float sample_rate ()
 
uint32_t samples_per_period () const
 
int set_samples_per_period (uint32_t)
 
void launch_control_app (uint32_t device_id)
 
void pcm_stop (void)
 
int pcm_start (uint32_t input_device, uint32_t output_device, uint32_t sample_rate, uint32_t samples_per_period, int(process_callback(void *, const uint32_t, const uint64_t)), void *process_arg, PBD::TimingStats &dsp_timer)
 
void set_error_callback (void(error_callback(void *)), void *error_arg)
 
void set_halted_callback (void(halted_callback(void *)), void *halted_arg)
 
void set_hw_changed_callback (void(callback(void *)), void *arg)
 
void set_xrun_callback (void(callback(void *)), void *arg)
 
void set_buffer_size_callback (void(callback(void *)), void *arg)
 
void set_sample_rate_callback (void(callback(void *)), void *arg)
 
int get_capture_channel (uint32_t chn, float *input, uint32_t n_samples)
 
int set_playback_channel (uint32_t chn, const float *input, uint32_t n_samples)
 
uint32_t n_samples () const
 
OSStatus render_callback (AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberSamples, AudioBufferList *ioData)
 
void xrun_callback ()
 
void buffer_size_callback ()
 
void sample_rate_callback ()
 
void hw_changed_callback ()
 
void halted_callback ()
 

Private Member Functions

float current_sample_rate_id (AudioDeviceID id, bool input)
 
uint32_t current_buffer_size_id (AudioDeviceID id)
 
int set_device_sample_rate_id (AudioDeviceID id, float rate, bool input)
 
int set_device_buffer_size_id (AudioDeviceID id, uint32_t samples_per_period)
 
int set_device_sample_rate (uint32_t device_id, float rate, bool input)
 
void get_stream_latencies (uint32_t device_id, bool input, std::vector< uint32_t > &latencies)
 
void cache_port_names (AudioDeviceID id, bool input)
 
void destroy_aggregate_device ()
 
int create_aggregate_device (AudioDeviceID input_device_id, AudioDeviceID output_device_id, uint32_t sample_rate, AudioDeviceID *created_device)
 

Private Attributes

::AudioUnit _auhal
 
AudioDeviceID * _device_ids
 
AudioBufferList * _input_audio_buffer_list
 
AudioBufferList * _output_audio_buffer_list
 
AudioDeviceID _active_device_id
 
AudioDeviceID _aggregate_device_id
 
AudioDeviceID _aggregate_plugin_id
 
int _state
 
uint32_t _samples_per_period
 
uint32_t _cur_samples_per_period
 
uint32_t _capture_channels
 
uint32_t _playback_channels
 
bool _in_process
 
size_t _n_devices
 
int(* _process_callback )(void *, const uint32_t, const uint64_t)
 
void * _process_arg
 
PBD::TimingStats_dsp_timer
 
void(* _error_callback )(void *)
 
void * _error_arg
 
void(* _halted_callback )(void *)
 
void * _halted_arg
 
void(* _hw_changed_callback )(void *)
 
void * _hw_changed_arg
 
void(* _xrun_callback )(void *)
 
void * _xrun_arg
 
void(* _buffer_size_callback )(void *)
 
void * _buffer_size_arg
 
void(* _sample_rate_callback )(void *)
 
void * _sample_rate_arg
 
std::map< size_t, std::string > _devices
 
std::map< size_t, std::string > _input_devices
 
std::map< size_t, std::string > _output_devices
 
std::map< size_t, std::string > _duplex_devices
 
uint32_t * _device_ins
 
uint32_t * _device_outs
 
std::vector< std::string > _input_names
 
std::vector< std::string > _output_names
 
pthread_mutex_t _discovery_lock
 

Detailed Description

Definition at line 49 of file coreaudio_pcmio.h.

Constructor & Destructor Documentation

◆ CoreAudioPCM()

ARDOUR::CoreAudioPCM::CoreAudioPCM ( void  )

◆ ~CoreAudioPCM()

ARDOUR::CoreAudioPCM::~CoreAudioPCM ( void  )

Member Function Documentation

◆ available_buffer_sizes()

int ARDOUR::CoreAudioPCM::available_buffer_sizes ( uint32_t  device_id,
std::vector< uint32_t > &  sampleRates 
)

◆ available_channels()

uint32_t ARDOUR::CoreAudioPCM::available_channels ( uint32_t  device_id,
bool  input 
)

◆ available_sample_rates()

int ARDOUR::CoreAudioPCM::available_sample_rates ( uint32_t  device_id,
std::vector< float > &  sampleRates 
)

◆ buffer_size_callback()

void ARDOUR::CoreAudioPCM::buffer_size_callback ( )

◆ cache_port_names()

void ARDOUR::CoreAudioPCM::cache_port_names ( AudioDeviceID  id,
bool  input 
)
private

◆ cached_port_name()

std::string ARDOUR::CoreAudioPCM::cached_port_name ( uint32_t  portnum,
bool  input 
) const

◆ create_aggregate_device()

int ARDOUR::CoreAudioPCM::create_aggregate_device ( AudioDeviceID  input_device_id,
AudioDeviceID  output_device_id,
uint32_t  sample_rate,
AudioDeviceID *  created_device 
)
private

◆ current_buffer_size_id()

uint32_t ARDOUR::CoreAudioPCM::current_buffer_size_id ( AudioDeviceID  id)
private

◆ current_sample_rate()

float ARDOUR::CoreAudioPCM::current_sample_rate ( uint32_t  device_id,
bool  input = false 
)

◆ current_sample_rate_id()

float ARDOUR::CoreAudioPCM::current_sample_rate_id ( AudioDeviceID  id,
bool  input 
)
private

◆ destroy_aggregate_device()

void ARDOUR::CoreAudioPCM::destroy_aggregate_device ( )
private

◆ device_list()

void ARDOUR::CoreAudioPCM::device_list ( std::map< size_t, std::string > &  devices) const
inline

Definition at line 60 of file coreaudio_pcmio.h.

◆ discover()

void ARDOUR::CoreAudioPCM::discover ( )

◆ duplex_device_list()

void ARDOUR::CoreAudioPCM::duplex_device_list ( std::map< size_t, std::string > &  devices) const
inline

Definition at line 63 of file coreaudio_pcmio.h.

◆ get_capture_channel()

int ARDOUR::CoreAudioPCM::get_capture_channel ( uint32_t  chn,
float *  input,
uint32_t  n_samples 
)

◆ get_latency()

uint32_t ARDOUR::CoreAudioPCM::get_latency ( uint32_t  device_id,
bool  input 
)

◆ get_stream_latencies()

void ARDOUR::CoreAudioPCM::get_stream_latencies ( uint32_t  device_id,
bool  input,
std::vector< uint32_t > &  latencies 
)
private

◆ halted_callback()

void ARDOUR::CoreAudioPCM::halted_callback ( )

◆ hw_changed_callback()

void ARDOUR::CoreAudioPCM::hw_changed_callback ( )

◆ input_device_list()

void ARDOUR::CoreAudioPCM::input_device_list ( std::map< size_t, std::string > &  devices) const
inline

Definition at line 61 of file coreaudio_pcmio.h.

◆ launch_control_app()

void ARDOUR::CoreAudioPCM::launch_control_app ( uint32_t  device_id)

◆ n_capture_channels()

uint32_t ARDOUR::CoreAudioPCM::n_capture_channels ( void  ) const
inline

Definition at line 57 of file coreaudio_pcmio.h.

◆ n_playback_channels()

uint32_t ARDOUR::CoreAudioPCM::n_playback_channels ( void  ) const
inline

Definition at line 56 of file coreaudio_pcmio.h.

◆ n_samples()

uint32_t ARDOUR::CoreAudioPCM::n_samples ( ) const
inline

Definition at line 144 of file coreaudio_pcmio.h.

◆ output_device_list()

void ARDOUR::CoreAudioPCM::output_device_list ( std::map< size_t, std::string > &  devices) const
inline

Definition at line 62 of file coreaudio_pcmio.h.

◆ pcm_start()

int ARDOUR::CoreAudioPCM::pcm_start ( uint32_t  input_device,
uint32_t  output_device,
uint32_t  sample_rate,
uint32_t  samples_per_period,
int(process_callback(void *, const uint32_t, const uint64_t))  ,
void *  process_arg,
PBD::TimingStats dsp_timer 
)

◆ pcm_stop()

void ARDOUR::CoreAudioPCM::pcm_stop ( void  )

◆ render_callback()

OSStatus ARDOUR::CoreAudioPCM::render_callback ( AudioUnitRenderActionFlags *  ioActionFlags,
const AudioTimeStamp *  inTimeStamp,
UInt32  inBusNumber,
UInt32  inNumberSamples,
AudioBufferList *  ioData 
)

◆ sample_rate()

float ARDOUR::CoreAudioPCM::sample_rate ( )

◆ sample_rate_callback()

void ARDOUR::CoreAudioPCM::sample_rate_callback ( )

◆ samples_per_period()

uint32_t ARDOUR::CoreAudioPCM::samples_per_period ( ) const
inline

Definition at line 74 of file coreaudio_pcmio.h.

◆ set_buffer_size_callback()

void ARDOUR::CoreAudioPCM::set_buffer_size_callback ( void(callback(void *))  ,
void *  arg 
)
inline

Definition at line 126 of file coreaudio_pcmio.h.

◆ set_device_buffer_size_id()

int ARDOUR::CoreAudioPCM::set_device_buffer_size_id ( AudioDeviceID  id,
uint32_t  samples_per_period 
)
private

◆ set_device_sample_rate()

int ARDOUR::CoreAudioPCM::set_device_sample_rate ( uint32_t  device_id,
float  rate,
bool  input 
)
private

◆ set_device_sample_rate_id()

int ARDOUR::CoreAudioPCM::set_device_sample_rate_id ( AudioDeviceID  id,
float  rate,
bool  input 
)
private

◆ set_error_callback()

void ARDOUR::CoreAudioPCM::set_error_callback ( void(error_callback(void *))  ,
void *  error_arg 
)
inline

Definition at line 95 of file coreaudio_pcmio.h.

◆ set_halted_callback()

void ARDOUR::CoreAudioPCM::set_halted_callback ( void(halted_callback(void *))  ,
void *  halted_arg 
)
inline

Definition at line 103 of file coreaudio_pcmio.h.

◆ set_hw_changed_callback()

void ARDOUR::CoreAudioPCM::set_hw_changed_callback ( void(callback(void *))  ,
void *  arg 
)
inline

Definition at line 111 of file coreaudio_pcmio.h.

◆ set_playback_channel()

int ARDOUR::CoreAudioPCM::set_playback_channel ( uint32_t  chn,
const float *  input,
uint32_t  n_samples 
)

◆ set_sample_rate_callback()

void ARDOUR::CoreAudioPCM::set_sample_rate_callback ( void(callback(void *))  ,
void *  arg 
)
inline

Definition at line 133 of file coreaudio_pcmio.h.

◆ set_samples_per_period()

int ARDOUR::CoreAudioPCM::set_samples_per_period ( uint32_t  )

◆ set_xrun_callback()

void ARDOUR::CoreAudioPCM::set_xrun_callback ( void(callback(void *))  ,
void *  arg 
)
inline

Definition at line 119 of file coreaudio_pcmio.h.

◆ state()

int ARDOUR::CoreAudioPCM::state ( void  ) const
inline

Definition at line 55 of file coreaudio_pcmio.h.

◆ xrun_callback()

void ARDOUR::CoreAudioPCM::xrun_callback ( )

Member Data Documentation

◆ _active_device_id

AudioDeviceID ARDOUR::CoreAudioPCM::_active_device_id
private

Definition at line 182 of file coreaudio_pcmio.h.

◆ _aggregate_device_id

AudioDeviceID ARDOUR::CoreAudioPCM::_aggregate_device_id
private

Definition at line 183 of file coreaudio_pcmio.h.

◆ _aggregate_plugin_id

AudioDeviceID ARDOUR::CoreAudioPCM::_aggregate_plugin_id
private

Definition at line 184 of file coreaudio_pcmio.h.

◆ _auhal

::AudioUnit ARDOUR::CoreAudioPCM::_auhal
private

Definition at line 177 of file coreaudio_pcmio.h.

◆ _buffer_size_arg

void* ARDOUR::CoreAudioPCM::_buffer_size_arg
private

Definition at line 213 of file coreaudio_pcmio.h.

◆ _buffer_size_callback

void(* ARDOUR::CoreAudioPCM::_buffer_size_callback) (void *)
private

Definition at line 212 of file coreaudio_pcmio.h.

◆ _capture_channels

uint32_t ARDOUR::CoreAudioPCM::_capture_channels
private

Definition at line 190 of file coreaudio_pcmio.h.

◆ _cur_samples_per_period

uint32_t ARDOUR::CoreAudioPCM::_cur_samples_per_period
private

Definition at line 189 of file coreaudio_pcmio.h.

◆ _device_ids

AudioDeviceID* ARDOUR::CoreAudioPCM::_device_ids
private

Definition at line 178 of file coreaudio_pcmio.h.

◆ _device_ins

uint32_t* ARDOUR::CoreAudioPCM::_device_ins
private

Definition at line 224 of file coreaudio_pcmio.h.

◆ _device_outs

uint32_t* ARDOUR::CoreAudioPCM::_device_outs
private

Definition at line 225 of file coreaudio_pcmio.h.

◆ _devices

std::map<size_t, std::string> ARDOUR::CoreAudioPCM::_devices
private

Definition at line 220 of file coreaudio_pcmio.h.

◆ _discovery_lock

pthread_mutex_t ARDOUR::CoreAudioPCM::_discovery_lock
private

Definition at line 229 of file coreaudio_pcmio.h.

◆ _dsp_timer

PBD::TimingStats* ARDOUR::CoreAudioPCM::_dsp_timer
private

Definition at line 198 of file coreaudio_pcmio.h.

◆ _duplex_devices

std::map<size_t, std::string> ARDOUR::CoreAudioPCM::_duplex_devices
private

Definition at line 223 of file coreaudio_pcmio.h.

◆ _error_arg

void* ARDOUR::CoreAudioPCM::_error_arg
private

Definition at line 201 of file coreaudio_pcmio.h.

◆ _error_callback

void(* ARDOUR::CoreAudioPCM::_error_callback) (void *)
private

Definition at line 200 of file coreaudio_pcmio.h.

◆ _halted_arg

void* ARDOUR::CoreAudioPCM::_halted_arg
private

Definition at line 204 of file coreaudio_pcmio.h.

◆ _halted_callback

void(* ARDOUR::CoreAudioPCM::_halted_callback) (void *)
private

Definition at line 203 of file coreaudio_pcmio.h.

◆ _hw_changed_arg

void* ARDOUR::CoreAudioPCM::_hw_changed_arg
private

Definition at line 207 of file coreaudio_pcmio.h.

◆ _hw_changed_callback

void(* ARDOUR::CoreAudioPCM::_hw_changed_callback) (void *)
private

Definition at line 206 of file coreaudio_pcmio.h.

◆ _in_process

bool ARDOUR::CoreAudioPCM::_in_process
private

Definition at line 192 of file coreaudio_pcmio.h.

◆ _input_audio_buffer_list

AudioBufferList* ARDOUR::CoreAudioPCM::_input_audio_buffer_list
private

Definition at line 179 of file coreaudio_pcmio.h.

◆ _input_devices

std::map<size_t, std::string> ARDOUR::CoreAudioPCM::_input_devices
private

Definition at line 221 of file coreaudio_pcmio.h.

◆ _input_names

std::vector<std::string> ARDOUR::CoreAudioPCM::_input_names
private

Definition at line 226 of file coreaudio_pcmio.h.

◆ _n_devices

size_t ARDOUR::CoreAudioPCM::_n_devices
private

Definition at line 193 of file coreaudio_pcmio.h.

◆ _output_audio_buffer_list

AudioBufferList* ARDOUR::CoreAudioPCM::_output_audio_buffer_list
private

Definition at line 180 of file coreaudio_pcmio.h.

◆ _output_devices

std::map<size_t, std::string> ARDOUR::CoreAudioPCM::_output_devices
private

Definition at line 222 of file coreaudio_pcmio.h.

◆ _output_names

std::vector<std::string> ARDOUR::CoreAudioPCM::_output_names
private

Definition at line 227 of file coreaudio_pcmio.h.

◆ _playback_channels

uint32_t ARDOUR::CoreAudioPCM::_playback_channels
private

Definition at line 191 of file coreaudio_pcmio.h.

◆ _process_arg

void* ARDOUR::CoreAudioPCM::_process_arg
private

Definition at line 196 of file coreaudio_pcmio.h.

◆ _process_callback

int(* ARDOUR::CoreAudioPCM::_process_callback) (void *, const uint32_t, const uint64_t)
private

Definition at line 195 of file coreaudio_pcmio.h.

◆ _sample_rate_arg

void* ARDOUR::CoreAudioPCM::_sample_rate_arg
private

Definition at line 216 of file coreaudio_pcmio.h.

◆ _sample_rate_callback

void(* ARDOUR::CoreAudioPCM::_sample_rate_callback) (void *)
private

Definition at line 215 of file coreaudio_pcmio.h.

◆ _samples_per_period

uint32_t ARDOUR::CoreAudioPCM::_samples_per_period
private

Definition at line 188 of file coreaudio_pcmio.h.

◆ _state

int ARDOUR::CoreAudioPCM::_state
private

Definition at line 186 of file coreaudio_pcmio.h.

◆ _xrun_arg

void* ARDOUR::CoreAudioPCM::_xrun_arg
private

Definition at line 210 of file coreaudio_pcmio.h.

◆ _xrun_callback

void(* ARDOUR::CoreAudioPCM::_xrun_callback) (void *)
private

Definition at line 209 of file coreaudio_pcmio.h.


The documentation for this class was generated from the following file: