19 #ifndef __libbackend_coreaudio_pcmio_h__
20 #define __libbackend_coreaudio_pcmio_h__
22 #include <CoreServices/CoreServices.h>
23 #include <CoreAudio/CoreAudio.h>
24 #include <AudioUnit/AudioUnit.h>
26 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 110000
27 # include <AudioToolbox/AudioToolbox.h>
30 #include <AudioUnit/AudioUnit.h>
31 #include <AudioToolbox/AudioToolbox.h>
39 #define AUHAL_OUTPUT_ELEMENT 0
40 #define AUHAL_INPUT_ELEMENT 1
80 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 110000
81 bool workgroup (os_workgroup_t&);
86 uint32_t input_device,
87 uint32_t output_device,
90 int (process_callback (
void*,
const uint32_t,
const uint64_t)),
96 void ( error_callback (
void*)),
112 void ( callback (
void*)),
120 void ( callback (
void*)),
127 void ( callback (
void*)),
134 void ( callback (
void*)),
148 AudioUnitRenderActionFlags* ioActionFlags,
149 const AudioTimeStamp* inTimeStamp,
151 UInt32 inNumberSamples,
152 AudioBufferList* ioData);
171 AudioDeviceID input_device_id,
172 AudioDeviceID output_device_id,
174 AudioDeviceID *created_device);
std::string cached_port_name(uint32_t portnum, bool input) const
uint32_t n_capture_channels(void) const
void(* _error_callback)(void *)
std::map< size_t, std::string > _devices
uint32_t _samples_per_period
pthread_mutex_t _discovery_lock
void set_hw_changed_callback(void(callback(void *)), void *arg)
uint32_t n_samples() const
uint32_t available_channels(uint32_t device_id, bool input)
uint32_t samples_per_period() const
void destroy_aggregate_device()
void cache_port_names(AudioDeviceID id, bool input)
void set_xrun_callback(void(callback(void *)), void *arg)
std::map< size_t, std::string > _input_devices
void set_buffer_size_callback(void(callback(void *)), void *arg)
void hw_changed_callback()
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)
uint32_t get_latency(uint32_t device_id, bool input)
uint32_t _cur_samples_per_period
std::vector< std::string > _input_names
void set_sample_rate_callback(void(callback(void *)), void *arg)
void duplex_device_list(std::map< size_t, std::string > &devices) const
void launch_control_app(uint32_t device_id)
int get_capture_channel(uint32_t chn, float *input, uint32_t n_samples)
OSStatus render_callback(AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberSamples, AudioBufferList *ioData)
AudioDeviceID _aggregate_plugin_id
AudioDeviceID * _device_ids
void sample_rate_callback()
void output_device_list(std::map< size_t, std::string > &devices) const
void(* _sample_rate_callback)(void *)
AudioDeviceID _aggregate_device_id
int(* _process_callback)(void *, const uint32_t, const uint64_t)
void input_device_list(std::map< size_t, std::string > &devices) const
uint32_t _capture_channels
int set_device_sample_rate_id(AudioDeviceID id, float rate, bool input)
void buffer_size_callback()
std::vector< std::string > _output_names
void(* _buffer_size_callback)(void *)
std::map< size_t, std::string > _output_devices
uint32_t _playback_channels
void(* _xrun_callback)(void *)
void set_error_callback(void(error_callback(void *)), void *error_arg)
AudioBufferList * _input_audio_buffer_list
AudioBufferList * _output_audio_buffer_list
void get_stream_latencies(uint32_t device_id, bool input, std::vector< uint32_t > &latencies)
uint32_t n_playback_channels(void) const
PBD::TimingStats * _dsp_timer
void set_halted_callback(void(halted_callback(void *)), void *halted_arg)
int create_aggregate_device(AudioDeviceID input_device_id, AudioDeviceID output_device_id, uint32_t sample_rate, AudioDeviceID *created_device)
int set_playback_channel(uint32_t chn, const float *input, uint32_t n_samples)
int set_device_sample_rate(uint32_t device_id, float rate, bool input)
void device_list(std::map< size_t, std::string > &devices) const
void(* _halted_callback)(void *)
int available_buffer_sizes(uint32_t device_id, std::vector< uint32_t > &sampleRates)
std::map< size_t, std::string > _duplex_devices
int set_samples_per_period(uint32_t)
AudioDeviceID _active_device_id
float current_sample_rate(uint32_t device_id, bool input=false)
int available_sample_rates(uint32_t device_id, std::vector< float > &sampleRates)
uint32_t current_buffer_size_id(AudioDeviceID id)
float current_sample_rate_id(AudioDeviceID id, bool input)
void(* _hw_changed_callback)(void *)
int set_device_buffer_size_id(AudioDeviceID id, uint32_t samples_per_period)