21 #ifndef __libbackend_portaudio_backend_h__
22 #define __libbackend_portaudio_backend_h__
43 class PortAudioBackend;
170 int _start (
bool for_latency_measurement);
254 float* interleaved_output_data);
265 unsigned long frameCount,
266 const PaStreamCallbackTimeInfo* timeInfo,
267 PaStreamCallbackFlags statusFlags,
272 uint32_t sample_count,
273 const PaStreamCallbackTimeInfo* timeInfo,
274 PaStreamCallbackFlags statusFlags);
352 std::function<void ()>
f;
AudioBackendInfo & info() const
std::vector< pthread_t > _threads
ChanCount n_physical_outputs() const
PortEngine::PortPtr get_port_by_name(std::string const &name) const
std::string _instance_name
void * private_handle() const
bool midi_device_enabled(std::string const) const
LatencyRange get_latency_range(PortHandle, bool for_playback)
std::vector< DeviceStatus > enumerate_devices() const
bool stop_freewheel_process_thread()
void process_incoming_midi()
static bool set_mmcss_pro_audio(HANDLE *task_handle)
samplecnt_t _processed_samples
int midi_event_get(pframes_t ×tamp, size_t &size, uint8_t const **buf, void *port_buffer, uint32_t event_index)
static std::vector< std::string > _midi_options
bool port_is_physical(PortEngine::PortHandle ph) const
static size_t _max_buffer_size
uint32_t systemic_output_latency() const
std::string device_name() const
int connect(PortEngine::PortHandle ph, const std::string &other)
uint32_t get_midi_event_count(void *port_buffer)
void * freewheel_process_thread()
int disconnect(PortEngine::PortHandle ph, const std::string &other)
std::vector< std::string > enumerate_midi_options() const
void process_port_connection_changes()
static std::vector< AudioBackend::DeviceStatus > _output_audio_device_status
bool can_set_systemic_midi_latencies() const
bool use_separate_input_and_output_devices() const
int set_sample_rate(float)
MidiDeviceInfo * midi_device_info(const std::string &) const
uint32_t _systemic_audio_output_latency
PortFlags get_port_flags(PortEngine::PortHandle ph) const
int create_process_thread(std::function< void()> func)
std::vector< DeviceStatus > enumerate_midi_devices() const
BackendPort * port_factory(std::string const &name, ARDOUR::DataType dt, ARDOUR::PortFlags flags)
std::vector< float > available_sample_rates(const std::string &device) const
bool connected(PortEngine::PortHandle ph, bool process_callback_safe)
int ensure_input_monitoring(PortHandle, bool)
std::vector< DeviceStatus > enumerate_input_devices() const
int name_to_id(std::string) const
int set_device_name(const std::string &)
int disconnect(const std::string &src, const std::string &dst)
int disconnect_all(PortEngine::PortHandle ph)
int register_system_midi_ports(std::string const &device="")
uint32_t systemic_input_latency() const
pframes_t samples_since_cycle_start()
std::string get_port_name(PortEngine::PortHandle ph) const
pthread_cond_t _freewheel_signal
ChanCount n_physical_inputs() const
bool blocking_process_main(const float *interleaved_input_data, float *interleaved_output_data)
static std::vector< AudioBackend::DeviceStatus > _input_audio_device_status
bool physically_connected(PortEngine::PortHandle ph, bool process_callback_safe)
std::string _input_audio_device
void get_physical_outputs(DataType type, std::vector< std::string > &results)
static int portaudio_callback(const void *input, void *output, unsigned long frameCount, const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags, void *userData)
int set_systemic_midi_input_latency(std::string const, uint32_t)
int set_systemic_input_latency(uint32_t)
std::vector< uint32_t > available_buffer_sizes(const std::string &device) const
ARDOUR::DSPLoadCalculator _dsp_calc
bool blocking_process_freewheel()
PortAudioBackend(AudioEngine &e, AudioBackendInfo &info)
uint32_t buffer_size() const
std::string driver_name() const
bool start_blocking_process_thread()
int set_port_name(PortEngine::PortHandle ph, const std::string &name)
bool can_change_sample_rate_when_running() const
uint64_t _max_deviation_us
int set_buffer_size(uint32_t)
uint32_t port_name_size() const
std::string output_device_name() const
bool connected_to(PortEngine::PortHandle ph, const std::string &other, bool process_callback_safe)
int get_port_property(PortEngine::PortHandle ph, const std::string &key, std::string &value, std::string &type) const
bool process_callback(const float *input, float *output, uint32_t sample_count, const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags)
int get_ports(const std::string &port_name_pattern, DataType type, PortFlags flags, std::vector< std::string > &results) const
int request_input_monitoring(PortHandle, bool)
static std::vector< AudioBackend::DeviceStatus > _midi_device_status
void set_latency_range(PortHandle, bool for_playback, LatencyRange)
void launch_control_app()
int set_midi_option(const std::string &)
void * get_buffer(PortHandle, pframes_t)
std::string input_device_name() const
bool start_freewheel_process_thread()
void set_use_buffered_io(bool)
bool _reinit_thread_callback
bool _freewheel_thread_active
uint32_t systemic_midi_output_latency(std::string const) const
uint32_t process_thread_count()
int set_interleaved(bool yn)
std::vector< std::string > enumerate_drivers() const
static bool reset_mmcss(HANDLE task_handle)
int get_connections(PortEngine::PortHandle ph, std::vector< std::string > &results, bool process_callback_safe)
int set_systemic_output_latency(uint32_t)
uint64_t _total_deviation_us
bool requires_driver_selection() const
bool stop_blocking_process_thread()
int set_output_device_name(const std::string &)
size_t raw_buffer_size(DataType t)
void midi_clear(void *port_buffer)
uint32_t systemic_midi_input_latency(std::string const) const
int register_system_audio_ports()
samplepos_t sample_time_at_cycle_start()
void * blocking_process_thread()
bool monitoring_input(PortHandle)
bool can_request_update_devices()
uint32_t _systemic_audio_input_latency
PortEngine::PortPtr register_port(const std::string &shortname, ARDOUR::DataType type, ARDOUR::PortFlags flags)
std::string _midi_driver_option
std::string control_app_name() const
bool can_measure_systemic_latency() const
int set_midi_device_enabled(std::string const, bool)
int join_process_threads()
static void * portaudio_process_thread(void *)
int midi_event_put(void *port_buffer, pframes_t timestamp, const uint8_t *buffer, size_t size)
std::string _output_audio_device
bool get_use_buffered_io()
void unregister_port(PortHandle ph)
void get_physical_inputs(DataType type, std::vector< std::string > &results)
const std::string & my_name() const
bool can_use_buffered_io()
void process_outgoing_midi()
bool can_change_buffer_size_when_running() const
std::string midi_option() const
int set_systemic_midi_output_latency(std::string const, uint32_t)
pthread_t _main_blocking_thread
bool can_monitor_input() const
int _start(bool for_latency_measurement)
samplepos_t sample_time()
int set_driver(const std::string &)
uint64_t _last_cycle_start
size_t _samples_per_period
int set_port_property(PortEngine::PortHandle ph, const std::string &key, const std::string &value, const std::string &type)
DataType port_data_type(PortEngine::PortHandle ph) const
pthread_mutex_t _freewheel_mutex
std::vector< DeviceStatus > enumerate_output_devices() const
int connect(const std::string &src, const std::string &dst)
int set_input_device_name(const std::string &)
float sample_rate() const
pthread_t _pthread_freewheel
void update_systemic_midi_latencies()
const Sample * const_buffer() const
PortAudioPort(PortAudioBackend &b, const std::string &, PortFlags)
void * get_buffer(pframes_t nframes)
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
PortMidiEvent(const PortMidiEvent &other)
const uint8_t * data() const
PortMidiEvent(const pframes_t timestamp, const uint8_t *data, size_t size)
pframes_t timestamp() const
void set_n_periods(int n)
PortMidiBuffer _buffer[2]
PortMidiPort(PortAudioBackend &b, const std::string &, PortFlags)
const PortMidiBuffer * const_buffer() const
void * get_buffer(pframes_t nframes)
std::vector< PortMidiEvent > PortMidiBuffer
Temporal::samplecnt_t samplecnt_t
Temporal::samplepos_t samplepos_t
PortAudioBackend * engine
ThreadData(PortAudioBackend *e, std::function< void()> fp, size_t stacksz)
#define MaxWinMidiEventSize