20 #ifndef __libbackend_coreaudio_backend_h__
21 #define __libbackend_coreaudio_backend_h__
41 #define MaxCoreMidiEventSize 256
45 class CoreAudioBackend;
90 void parse_events (
const uint64_t time,
const uint8_t *data,
const size_t size);
139 void prepare(
const uint64_t time,
const size_t size) {
216 return std::vector<AudioBackend::DeviceStatus> ();
236 int _start (
bool for_latency_measurement);
382 std::function<void ()>
f;
386 #if MAC_OS_X_VERSION_MAX_ALLOWED >= 110000
387 bool _joined_workgroup;
388 os_workgroup_t _workgroup;
389 os_workgroup_join_token_s _join_token;
400 for (std::vector<BackendPortPtr>::const_iterator it = plist.begin (); it != plist.end (); ++it) {
401 if ((*it)->name () == port_name) {
AudioBackendInfo & info() const
BackendPortPtr find_port_in(std::vector< BackendPortPtr > const &plist, const std::string &port_name) const
size_t _samples_per_period
pthread_t _freeewheel_thread
void sample_rate_callback()
int set_midi_device_enabled(std::string const, bool)
bool can_change_buffer_size_when_running() const
int set_buffer_size(uint32_t)
DataType port_data_type(PortEngine::PortHandle ph) const
int create_process_thread(std::function< void()> func)
int connect(PortEngine::PortHandle ph, const std::string &other)
std::string _midi_driver_option
PortEngine::PortPtr register_port(const std::string &shortname, ARDOUR::DataType type, ARDOUR::PortFlags flags)
bool port_is_physical(PortEngine::PortHandle ph) const
std::vector< pthread_t > _threads
void get_physical_outputs(DataType type, std::vector< std::string > &results)
int set_output_device_name(const std::string &)
int process_callback(uint32_t, uint64_t)
bool use_separate_input_and_output_devices() const
int disconnect(PortEngine::PortHandle ph, const std::string &other)
std::string control_app_name() const
samplepos_t sample_time()
ChanCount n_physical_inputs() const
int ensure_input_monitoring(PortHandle, bool)
static int _midi_event_put(void *port_buffer, pframes_t timestamp, const uint8_t *buffer, size_t size)
BackendPort * port_factory(std::string const &name, ARDOUR::DataType type, ARDOUR::PortFlags)
ARDOUR::DSPLoadCalculator _dsp_load_calc
std::vector< DeviceStatus > enumerate_devices() const
int connect(const std::string &src, const std::string &dst)
int register_system_audio_ports()
void * freewheel_thread()
int set_port_name(PortEngine::PortHandle ph, const std::string &name)
uint32_t systemic_output_latency() const
void launch_control_app()
std::string output_device_name() const
int set_midi_option(const std::string &)
std::vector< DeviceStatus > enumerate_input_devices() const
uint32_t _hw_audio_output_latency
std::string _output_audio_device
void midi_clear(void *port_buffer)
bool monitoring_input(PortHandle)
int midi_event_get(pframes_t ×tamp, size_t &size, uint8_t const **buf, void *port_buffer, uint32_t event_index)
int set_device_name(const std::string &)
uint32_t systemic_midi_input_latency(std::string const) const
bool physically_connected(PortEngine::PortHandle ph, bool process_callback_safe)
static void * coreaudio_process_thread(void *)
uint32_t _hw_audio_input_latency
uint64_t _processed_samples
std::string input_device_name() const
void unregister_port(PortHandle ph)
std::string midi_option() const
int midi_event_put(void *port_buffer, pframes_t timestamp, const uint8_t *buffer, size_t size)
int set_systemic_output_latency(uint32_t)
uint64_t _last_process_start
bool connected(PortEngine::PortHandle ph, bool process_callback_safe)
void set_latency_range(PortHandle, bool for_playback, LatencyRange)
std::string _instance_name
size_t raw_buffer_size(DataType t)
int set_port_property(PortEngine::PortHandle ph, const std::string &key, const std::string &value, const std::string &type)
std::vector< float > available_sample_rates2(const std::string &, const std::string &) const
std::string get_port_name(PortEngine::PortHandle ph) const
int get_ports(const std::string &port_name_pattern, DataType type, PortFlags flags, std::vector< std::string > &results) const
int set_systemic_midi_input_latency(std::string const, uint32_t)
static std::vector< std::string > _midi_options
uint32_t get_midi_event_count(void *port_buffer)
pframes_t samples_since_cycle_start()
int request_input_monitoring(PortHandle, bool)
pthread_cond_t _freewheel_signal
std::string _input_audio_device
pthread_mutex_t _process_callback_mutex
samplepos_t sample_time_at_cycle_start()
static size_t _max_buffer_size
void get_physical_inputs(DataType type, std::vector< std::string > &results)
uint32_t _systemic_audio_output_latency
uint32_t process_thread_count()
void * get_buffer(PortHandle, pframes_t)
bool can_monitor_input() const
std::vector< float > available_sample_rates(const std::string &device) const
int disconnect(const std::string &src, const std::string &dst)
uint32_t systemic_input_latency() const
std::vector< DeviceStatus > enumerate_midi_devices() const
uint32_t _systemic_audio_input_latency
std::vector< std::string > enumerate_midi_options() const
pthread_mutex_t _freewheel_mutex
PortFlags get_port_flags(PortEngine::PortHandle ph) const
bool midi_device_enabled(std::string const) const
float sample_rate() const
int _start(bool for_latency_measurement)
int set_input_device_name(const std::string &)
int get_connections(PortEngine::PortHandle ph, std::vector< std::string > &results, bool process_callback_safe)
bool can_measure_systemic_latency() const
bool connected_to(PortEngine::PortHandle ph, const std::string &other, bool process_callback_safe)
static std::vector< AudioBackend::DeviceStatus > _input_audio_device_status
const std::string & my_name() const
void reset_midi_parsers()
bool can_change_sample_rate_when_running() const
bool _reinit_thread_callback
int get_port_property(PortEngine::PortHandle ph, const std::string &key, std::string &value, std::string &type) const
uint32_t port_name_size() const
static std::vector< AudioBackend::DeviceStatus > _midi_device_status
uint32_t systemic_midi_output_latency(std::string const) const
uint32_t buffer_size() const
static std::vector< AudioBackend::DeviceStatus > _output_audio_device_status
int set_interleaved(bool yn)
int set_systemic_midi_output_latency(std::string const, uint32_t)
std::string device_name() const
PortEngine::PortPtr get_port_by_name(std::string const &name) const
int set_sample_rate(float)
void * private_handle() const
bool can_set_systemic_midi_latencies() const
int set_systemic_input_latency(uint32_t)
ChanCount n_physical_outputs() const
int disconnect_all(PortEngine::PortHandle ph)
void buffer_size_callback()
void coremidi_rediscover()
std::vector< uint32_t > available_buffer_sizes2(const std::string &, const std::string &) const
int join_process_threads()
static std::vector< AudioBackend::DeviceStatus > _duplex_audio_device_status
CoreAudioBackend(AudioEngine &e, AudioBackendInfo &info)
LatencyRange get_latency_range(PortHandle, bool for_playback)
std::vector< uint32_t > available_buffer_sizes(const std::string &device) const
std::vector< DeviceStatus > enumerate_output_devices() const
void hw_changed_callback()
uint32_t name_to_id(std::string, DeviceFilter filter=All) const
CoreAudioPort(CoreAudioBackend &b, const std::string &, PortFlags)
const Sample * const_buffer() const
void * get_buffer(pframes_t nframes)
CoreMidiEvent(const pframes_t timestamp, const uint8_t *data, size_t size)
CoreMidiEvent(const CoreMidiEvent &other)
const uint8_t * data() const
pframes_t timestamp() const
void record_byte(uint8_t byte)
CoreMidiBuffer _buffer[2]
void parse_events(const uint64_t time, const uint8_t *data, const size_t size)
bool process_byte(const uint64_t, const uint8_t)
CoreMidiPort(CoreAudioBackend &b, const std::string &, PortFlags)
uint8_t _parser_buffer[1024]
const CoreMidiBuffer * const_buffer() const
void prepare_byte_event(const uint64_t time, const uint8_t byte)
struct ARDOUR::CoreMidiPort::ParserEvent _event
void * get_buffer(pframes_t nframes)
int queue_event(void *port_buffer, pframes_t timestamp, const uint8_t *buffer, size_t size)
bool prepare_buffered_event(const uint64_t time)
void set_n_periods(int n)
int set_port_name(PortEngine::PortHandle, const std::string &)
uint32_t port_name_size() const
virtual void unregister_port(PortEngine::PortHandle)
bool physically_connected(PortEngine::PortHandle, bool process_callback_safe)
int disconnect(const std::string &src, const std::string &dst)
PortEngine::PortPtr get_port_by_name(const std::string &) const
int get_ports(const std::string &port_name_pattern, DataType type, PortFlags flags, std::vector< std::string > &) const
int connect(const std::string &src, const std::string &dst)
ChanCount n_physical_outputs() const
PortFlags get_port_flags(PortEngine::PortHandle) const
bool connected_to(PortEngine::PortHandle, const std::string &, bool process_callback_safe)
bool connected(PortEngine::PortHandle, bool process_callback_safe)
int get_connections(PortEngine::PortHandle, std::vector< std::string > &, bool process_callback_safe)
std::string get_port_name(PortEngine::PortHandle) const
ChanCount n_physical_inputs() const
void get_physical_outputs(DataType type, std::vector< std::string > &)
void get_physical_inputs(DataType type, std::vector< std::string > &)
DataType port_data_type(PortEngine::PortHandle) const
int disconnect_all(PortEngine::PortHandle)
bool port_is_physical(PortEngine::PortHandle) const
int get_port_property(PortEngine::PortHandle, const std::string &key, std::string &value, std::string &type) const
int set_port_property(PortEngine::PortHandle, const std::string &key, const std::string &value, const std::string &type)
PortEngine::PortPtr register_port(const std::string &shortname, ARDOUR::DataType, ARDOUR::PortFlags)
PortPtr const & PortHandle
std::shared_ptr< ProtoPort > PortPtr
#define MaxCoreMidiEventSize
std::shared_ptr< BackendPort > BackendPortPtr
std::vector< CoreMidiEvent > CoreMidiBuffer
Temporal::samplepos_t samplepos_t
CoreAudioBackend * engine
ThreadData(CoreAudioBackend *e, std::function< void()> fp, size_t stacksz, double period)
ParserEvent(const uint64_t time, const size_t size)
void prepare(const uint64_t time, const size_t size)