Ardour
9.0-pre0-582-g084a23a80d
|
#include <portaudio_backend.h>
Classes | |
struct | ThreadData |
Public Member Functions | |
PortAudioBackend (AudioEngine &e, AudioBackendInfo &info) | |
~PortAudioBackend () | |
std::string | name () const |
bool | is_realtime () const |
bool | requires_driver_selection () const |
std::string | driver_name () const |
std::vector< std::string > | enumerate_drivers () const |
int | set_driver (const std::string &) |
bool | can_request_update_devices () |
bool | update_devices () |
bool | can_use_buffered_io () |
void | set_use_buffered_io (bool) |
bool | get_use_buffered_io () |
bool | use_separate_input_and_output_devices () const |
std::vector< DeviceStatus > | enumerate_devices () const |
std::vector< DeviceStatus > | enumerate_input_devices () const |
std::vector< DeviceStatus > | enumerate_output_devices () const |
std::vector< float > | available_sample_rates (const std::string &device) const |
std::vector< uint32_t > | available_buffer_sizes (const std::string &device) const |
bool | can_change_sample_rate_when_running () const |
bool | can_change_buffer_size_when_running () const |
int | set_device_name (const std::string &) |
int | set_input_device_name (const std::string &) |
int | set_output_device_name (const std::string &) |
int | set_sample_rate (float) |
int | set_buffer_size (uint32_t) |
int | set_interleaved (bool yn) |
int | set_systemic_input_latency (uint32_t) |
int | set_systemic_output_latency (uint32_t) |
int | set_systemic_midi_input_latency (std::string const, uint32_t) |
int | set_systemic_midi_output_latency (std::string const, uint32_t) |
int | reset_device () |
std::string | device_name () const |
std::string | input_device_name () const |
std::string | output_device_name () const |
float | sample_rate () const |
uint32_t | buffer_size () const |
bool | interleaved () const |
uint32_t | systemic_input_latency () const |
uint32_t | systemic_output_latency () const |
uint32_t | systemic_midi_input_latency (std::string const) const |
uint32_t | systemic_midi_output_latency (std::string const) const |
bool | can_measure_systemic_latency () const |
bool | can_set_systemic_midi_latencies () const |
std::string | control_app_name () const |
void | launch_control_app () |
std::vector< std::string > | enumerate_midi_options () const |
int | set_midi_option (const std::string &) |
std::string | midi_option () const |
std::vector< DeviceStatus > | enumerate_midi_devices () const |
int | set_midi_device_enabled (std::string const, bool) |
bool | midi_device_enabled (std::string const) const |
int | stop () |
int | freewheel (bool) |
float | dsp_load () const |
size_t | raw_buffer_size (DataType t) |
samplepos_t | sample_time () |
samplepos_t | sample_time_at_cycle_start () |
pframes_t | samples_since_cycle_start () |
int | create_process_thread (std::function< void()> func) |
int | join_process_threads () |
bool | in_process_thread () |
uint32_t | process_thread_count () |
void | update_latencies () |
void * | private_handle () const |
const std::string & | my_name () const |
bool | port_is_physical (PortEngine::PortHandle ph) const |
void | get_physical_outputs (DataType type, std::vector< std::string > &results) |
void | get_physical_inputs (DataType type, std::vector< std::string > &results) |
ChanCount | n_physical_outputs () const |
ChanCount | n_physical_inputs () const |
uint32_t | port_name_size () const |
int | set_port_name (PortEngine::PortHandle ph, const std::string &name) |
std::string | get_port_name (PortEngine::PortHandle ph) const |
PortFlags | get_port_flags (PortEngine::PortHandle ph) const |
PortEngine::PortPtr | get_port_by_name (std::string const &name) const |
int | get_port_property (PortEngine::PortHandle ph, const std::string &key, std::string &value, std::string &type) const |
int | set_port_property (PortEngine::PortHandle ph, const std::string &key, const std::string &value, const std::string &type) |
int | get_ports (const std::string &port_name_pattern, DataType type, PortFlags flags, std::vector< std::string > &results) const |
DataType | port_data_type (PortEngine::PortHandle ph) const |
PortEngine::PortPtr | register_port (const std::string &shortname, ARDOUR::DataType type, ARDOUR::PortFlags flags) |
void | unregister_port (PortHandle ph) |
int | connect (const std::string &src, const std::string &dst) |
int | disconnect (const std::string &src, const std::string &dst) |
int | connect (PortEngine::PortHandle ph, const std::string &other) |
int | disconnect (PortEngine::PortHandle ph, const std::string &other) |
int | disconnect_all (PortEngine::PortHandle ph) |
bool | connected (PortEngine::PortHandle ph, bool process_callback_safe) |
bool | connected_to (PortEngine::PortHandle ph, const std::string &other, bool process_callback_safe) |
bool | physically_connected (PortEngine::PortHandle ph, bool process_callback_safe) |
int | get_connections (PortEngine::PortHandle ph, std::vector< std::string > &results, bool process_callback_safe) |
int | midi_event_get (pframes_t ×tamp, size_t &size, uint8_t const **buf, void *port_buffer, uint32_t event_index) |
int | midi_event_put (void *port_buffer, pframes_t timestamp, const uint8_t *buffer, size_t size) |
uint32_t | get_midi_event_count (void *port_buffer) |
void | midi_clear (void *port_buffer) |
bool | can_monitor_input () const |
int | request_input_monitoring (PortHandle, bool) |
int | ensure_input_monitoring (PortHandle, bool) |
bool | monitoring_input (PortHandle) |
void | set_latency_range (PortHandle, bool for_playback, LatencyRange) |
LatencyRange | get_latency_range (PortHandle, bool for_playback) |
void * | get_buffer (PortHandle, pframes_t) |
void * | blocking_process_thread () |
void * | freewheel_process_thread () |
Public Member Functions inherited from ARDOUR::AudioBackend | |
AudioBackend (AudioEngine &e, AudioBackendInfo &i) | |
virtual | ~AudioBackend () |
AudioBackendInfo & | info () const |
virtual bool | is_jack () const |
virtual int | client_real_time_priority () |
virtual bool | match_input_output_devices_or_none () const |
virtual bool | can_set_period_size () const |
virtual std::vector< uint32_t > | available_period_sizes (const std::string &driver, const std::string &device) const |
virtual int | set_peridod_size (uint32_t) |
virtual std::vector< float > | available_sample_rates2 (const std::string &input_device, const std::string &output_device) const |
virtual float | default_sample_rate () const |
virtual std::vector< uint32_t > | available_buffer_sizes2 (const std::string &input_device, const std::string &output_device) const |
virtual uint32_t | default_buffer_size (const std::string &device) const |
virtual bool | can_change_systemic_latency_when_running () const |
virtual int | drop_device () |
virtual uint32_t | period_size () const |
int | start (bool for_latency_measurement=false) |
virtual void | transport_start () |
virtual void | transport_stop () |
virtual TransportState | transport_state () const |
virtual void | transport_locate (samplepos_t pos) |
virtual samplepos_t | transport_sample () const |
virtual int | set_time_master (bool yn) |
virtual int | usecs_per_cycle () const |
virtual bool | get_sync_offset (pframes_t &offset) const |
virtual bool | speed_and_position (double &speed, samplepos_t &position) |
Public Member Functions inherited from ARDOUR::PortEngine | |
PortEngine (PortManager &pm) | |
virtual | ~PortEngine () |
virtual bool | externally_connected (PortHandle port, bool process_callback_safe=true) |
Public Member Functions inherited from ARDOUR::PortEngineSharedImpl | |
PortEngineSharedImpl (PortManager &mgr, std::string const &instance_name) | |
virtual | ~PortEngineSharedImpl () |
bool | port_is_physical (PortEngine::PortHandle) const |
void | get_physical_outputs (DataType type, std::vector< std::string > &) |
void | get_physical_inputs (DataType type, std::vector< std::string > &) |
ChanCount | n_physical_outputs () const |
ChanCount | n_physical_inputs () const |
uint32_t | port_name_size () const |
int | set_port_name (PortEngine::PortHandle, const std::string &) |
std::string | get_port_name (PortEngine::PortHandle) const |
PortFlags | get_port_flags (PortEngine::PortHandle) const |
PortEngine::PortPtr | get_port_by_name (const std::string &) 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) |
int | get_ports (const std::string &port_name_pattern, DataType type, PortFlags flags, std::vector< std::string > &) const |
DataType | port_data_type (PortEngine::PortHandle) const |
PortEngine::PortPtr | register_port (const std::string &shortname, ARDOUR::DataType, ARDOUR::PortFlags) |
int | connect (const std::string &src, const std::string &dst) |
int | disconnect (const std::string &src, const std::string &dst) |
int | connect (PortEngine::PortHandle, const std::string &) |
int | disconnect (PortEngine::PortHandle, const std::string &) |
int | disconnect_all (PortEngine::PortHandle) |
bool | connected (PortEngine::PortHandle, bool process_callback_safe) |
bool | connected_to (PortEngine::PortHandle, const std::string &, bool process_callback_safe) |
bool | physically_connected (PortEngine::PortHandle, bool process_callback_safe) |
int | get_connections (PortEngine::PortHandle, std::vector< std::string > &, bool process_callback_safe) |
Protected Member Functions | |
int | _start (bool for_latency_measurement) |
Protected Member Functions inherited from ARDOUR::PortEngineSharedImpl | |
void | port_connect_callback (const std::string &a, const std::string &b, bool conn) |
void | process_connection_queue_locked (PortManager &mgr) |
void | port_connect_add_remove_callback () |
virtual void | update_system_port_latencies () |
void | clear_ports () |
BackendPortPtr | add_port (const std::string &shortname, ARDOUR::DataType, ARDOUR::PortFlags) |
void | unregister_ports (bool system_only=false) |
bool | valid_port (BackendPortHandle port) const |
BackendPortPtr | find_port (const std::string &port_name) const |
void | list_ports () const |
Private Member Functions | |
bool | start_blocking_process_thread () |
bool | stop_blocking_process_thread () |
bool | blocking_process_freewheel () |
bool | blocking_process_main (const float *interleaved_input_data, float *interleaved_output_data) |
void | process_port_connection_changes () |
void | process_incoming_midi () |
void | process_outgoing_midi () |
bool | engine_halted () |
bool | running () |
bool | process_callback (const float *input, float *output, uint32_t sample_count, const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags) |
bool | start_freewheel_process_thread () |
bool | stop_freewheel_process_thread () |
MidiDeviceInfo * | midi_device_info (const std::string &) const |
int | name_to_id (std::string) const |
BackendPort * | port_factory (std::string const &name, ARDOUR::DataType dt, ARDOUR::PortFlags flags) |
int | register_system_audio_ports () |
int | register_system_midi_ports (std::string const &device="") |
void | update_systemic_midi_latencies () |
Static Private Member Functions | |
static int | portaudio_callback (const void *input, void *output, unsigned long frameCount, const PaStreamCallbackTimeInfo *timeInfo, PaStreamCallbackFlags statusFlags, void *userData) |
static bool | set_mmcss_pro_audio (HANDLE *task_handle) |
static bool | reset_mmcss (HANDLE task_handle) |
static void * | portaudio_process_thread (void *) |
Private Attributes | |
std::string | _instance_name |
PortAudioIO * | _pcmio |
WinMMEMidiIO * | _midiio |
bool | _run |
bool | _active |
bool | _use_blocking_api |
bool | _freewheel |
bool | _freewheeling |
bool | _freewheel_ack |
bool | _reinit_thread_callback |
bool | _measure_latency |
int | _freewheel_processed |
ARDOUR::DSPLoadCalculator | _dsp_calc |
bool | _freewheel_thread_active |
pthread_mutex_t | _freewheel_mutex |
pthread_cond_t | _freewheel_signal |
uint64_t | _cycle_count |
uint64_t | _total_deviation_us |
uint64_t | _max_deviation_us |
CycleTimer | _cycle_timer |
uint64_t | _last_cycle_start |
std::string | _input_audio_device |
std::string | _output_audio_device |
std::string | _midi_driver_option |
float | _samplerate |
size_t | _samples_per_period |
uint32_t | _systemic_audio_input_latency |
uint32_t | _systemic_audio_output_latency |
float | _dsp_load |
samplecnt_t | _processed_samples |
pthread_t | _main_blocking_thread |
pthread_t | _main_thread |
pthread_t | _pthread_freewheel |
std::vector< pthread_t > | _threads |
Static Private Attributes | |
static std::vector< std::string > | _midi_options |
static std::vector< AudioBackend::DeviceStatus > | _input_audio_device_status |
static std::vector< AudioBackend::DeviceStatus > | _output_audio_device_status |
static std::vector< AudioBackend::DeviceStatus > | _midi_device_status |
static size_t | _max_buffer_size |
Definition at line 94 of file portaudio_backend.h.
ARDOUR::PortAudioBackend::PortAudioBackend | ( | AudioEngine & | e, |
AudioBackendInfo & | info | ||
) |
ARDOUR::PortAudioBackend::~PortAudioBackend | ( | ) |
|
protectedvirtual |
Implements ARDOUR::AudioBackend.
|
virtual |
Returns a collection of uint32 identifying buffer sizes that are potentially usable with the hardware identified by device
. Any of these values may be supplied in other calls to this backend as the desired buffer size to use with the name device, but the requested buffer size may turn out to be unavailable, or become invalid at any time.
Implements ARDOUR::AudioBackend.
|
virtual |
Returns a collection of float identifying sample rates that are potentially usable with the hardware identified by device
. Any of these values may be supplied in other calls to this backend as the desired sample rate to use with the name device, but the requested sample rate may turn out to be unavailable, or become invalid at any time.
Implements ARDOUR::AudioBackend.
|
private |
|
private |
void* ARDOUR::PortAudioBackend::blocking_process_thread | ( | ) |
|
virtual |
Implements ARDOUR::AudioBackend.
|
virtual |
Implements ARDOUR::AudioBackend.
|
virtual |
Implements ARDOUR::AudioBackend.
|
inlinevirtual |
return true if the backend is configured using a single full-duplex device and measuring systemic latency can produce meaningful results.
Implements ARDOUR::AudioBackend.
Definition at line 152 of file portaudio_backend.h.
|
virtual |
Return true if the implementation can offer input monitoring.
Input monitoring involves the (selective) routing of incoming data to an outgoing data stream, without the data being passed to the CPU.
Only certain audio hardware can provide this, and only certain audio APIs can offer it.
Implements ARDOUR::PortEngine.
|
inlinevirtual |
Reimplemented from ARDOUR::AudioBackend.
Definition at line 109 of file portaudio_backend.h.
|
inlinevirtual |
if backend supports systemic_midi_[in|ou]tput_latency()
Implements ARDOUR::AudioBackend.
Definition at line 153 of file portaudio_backend.h.
|
inlinevirtual |
Reimplemented from ARDOUR::AudioBackend.
Definition at line 112 of file portaudio_backend.h.
|
inlinevirtual |
Ensure that data written to the port named by src
will be readable from the port named by dst
src | name of source port to connect |
dst | name of destination (sink) port |
Implements ARDOUR::PortEngine.
Definition at line 213 of file portaudio_backend.h.
|
inlinevirtual |
Ensure that data written to the port referenced by src
will be readable from the port named by dst
src | PortHandle of source port to connect |
dst | PortHandle of destination (sink) port |
Implements ARDOUR::PortEngine.
Definition at line 215 of file portaudio_backend.h.
|
inlinevirtual |
Test if given port
is connected
port | PortHandle of port to test |
process_callback_safe | true if this method is not called from rt-context of backend callbacks |
port
has any connections to other ports. Return false otherwise. Implements ARDOUR::PortEngine.
Definition at line 218 of file portaudio_backend.h.
|
inlinevirtual |
Test port connection
port | PortHandle of source port to test |
name | name of destination to test |
process_callback_safe | true if this method is not called from rt-context of backend callbacks |
port
is connected to the port named by name
. Return false otherwise. Implements ARDOUR::PortEngine.
Definition at line 219 of file portaudio_backend.h.
|
virtual |
Return the name of a control application for the selected/in-use device. If no such application exists, or if no device has been selected or is in-use, return an empty string.
Implements ARDOUR::AudioBackend.
|
virtual |
Create a new thread suitable for running part of the buffer process cycle (i.e. Realtime scheduling, memory allocation, stacksize, etc. are all correctly setup). The thread will begin executing func, and will exit when that function returns.
func | process function to run |
Implements ARDOUR::AudioBackend.
|
virtual |
Implements ARDOUR::AudioBackend.
|
inlinevirtual |
Remove any existing connection between the ports named by src
and dst
src | name of source port to dis-connect to disconnect from |
dst | name of destination (sink) port to disconnect |
Implements ARDOUR::PortEngine.
Definition at line 214 of file portaudio_backend.h.
|
inlinevirtual |
Remove any existing connection between the port referenced by src
and the port named dst
src | PortHandle of source port to disconnect from |
dst | PortHandle of destination (sink) port to disconnect |
Implements ARDOUR::PortEngine.
Definition at line 216 of file portaudio_backend.h.
|
inlinevirtual |
Remove all connections between the port referred to by port
and any other ports.
port | PortHandle of port to disconnect |
Implements ARDOUR::PortEngine.
Definition at line 217 of file portaudio_backend.h.
|
virtual |
override this if this implementation returns true from requires_driver_selection()
Reimplemented from ARDOUR::AudioBackend.
|
virtual |
return the fraction of the time represented by the current buffer size that is being used for each buffer process cycle, as a value from 0.0 to 1.0
E.g. if the buffer size represents 5msec and current processing takes 1msec, the returned value should be 0.2.
Implementations can feel free to smooth the values returned over time (e.g. high pass filtering, or its equivalent).
Implements ARDOUR::AudioBackend.
|
private |
|
virtual |
Implements ARDOUR::PortEngine.
|
virtual |
Returns a collection of DeviceStatuses identifying devices discovered by this backend since the start of the process.
Any of the names in each DeviceStatus may be used to identify a device in other calls to the backend, though any of them may become invalid at any time.
Implements ARDOUR::AudioBackend.
|
virtual |
If the return value of requires_driver_selection() is true, then this function can return the list of known driver names.
If the return value of requires_driver_selection() is false, then this function should not be called. If it is called its return value is an empty vector of strings.
Reimplemented from ARDOUR::AudioBackend.
|
virtual |
Returns a collection of DeviceStatuses identifying input devices discovered by this backend since the start of the process.
Any of the names in each DeviceStatus may be used to identify a device in other calls to the backend, though any of them may become invalid at any time.
Reimplemented from ARDOUR::AudioBackend.
|
virtual |
Detailed MIDI device list - if available
Implements ARDOUR::AudioBackend.
|
virtual |
Implements ARDOUR::AudioBackend.
|
virtual |
Returns a collection of DeviceStatuses identifying output devices discovered by this backend since the start of the process.
Any of the names in each DeviceStatus may be used to identify a device in other calls to the backend, though any of them may become invalid at any time.
Reimplemented from ARDOUR::AudioBackend.
|
virtual |
While remaining connected to the device, and without changing its configuration, start (or stop) calling the process_callback of the engine without waiting for the device. Once process_callback() has returned, it will be called again immediately, thus allowing for faster-than-realtime processing.
All registered ports remain in existence and all connections remain unaltered. However, any physical ports should NOT be used by the process_callback() during freewheeling - the data behaviour is undefined.
If start_stop
is true, begin this behaviour; otherwise cease this behaviour if it currently occuring, and return to calling process_callback() of the engine by waiting for the device.
start_stop | true to engage freewheel processing |
Implements ARDOUR::AudioBackend.
void* ARDOUR::PortAudioBackend::freewheel_process_thread | ( | ) |
|
virtual |
Return the address of the memory area where data for the port can be written (if the port has the PortFlag IsOutput set) or read (if the port has the PortFlag IsInput set).
The return value is untyped because buffers containing different data depending on the port type.
port | PortHandle |
off | memory offset |
Implements ARDOUR::PortEngine.
|
inlinevirtual |
Place the names of all ports connected to the port named by port
into names
.
port | PortHandle |
names | array or returned port-names |
process_callback_safe | true if this method is not called from rt-context of backend callbacks |
Implements ARDOUR::PortEngine.
Definition at line 221 of file portaudio_backend.h.
|
virtual |
Return the latency range for the port referred to by port
. The playback range will be returned if for_playback
is true, otherwise the capture range will be returned.
port | The PortHandle to query |
for_playback | When true, playback (downstream) latency is queried, false for capture (upstream) latency. |
Implements ARDOUR::PortEngine.
|
virtual |
Query the number of MIDI events in the data at port_buffer
port_buffer | the midi-port buffer |
port_buffer
Implements ARDOUR::PortEngine.
|
inlinevirtual |
Store into names
the names of all ports with the IsInput and IsPhysical flags set, that handle data of type type
.
This can be used to discover inputs associated with hardware devices.
Implements ARDOUR::PortEngine.
Definition at line 199 of file portaudio_backend.h.
|
inlinevirtual |
Store into names
the names of all ports with the IsOutput and IsPhysical flag set, that handle data of type type
.
This can be used to discover outputs associated with hardware devices.
type | Data-type to lookup |
names | return value to populate with names |
Implements ARDOUR::PortEngine.
Definition at line 198 of file portaudio_backend.h.
|
inlinevirtual |
Return a reference to a port with the fullname name
.
name | Full port-name to lookup |
Implements ARDOUR::PortEngine.
Definition at line 206 of file portaudio_backend.h.
|
inlinevirtual |
Query port-flags
port | PortHandle |
port
. If the port does not exist, return PortFlags (0) Implements ARDOUR::PortEngine.
Definition at line 205 of file portaudio_backend.h.
|
inlinevirtual |
Query port name
port | PortHandle |
port
. If the port does not exist, return an empty string. Implements ARDOUR::PortEngine.
Definition at line 204 of file portaudio_backend.h.
|
inlinevirtual |
Return the port-property value and type for a given key. (eg query a human readable port name)
The API follows jack_get_property():
key | The key of the property to retrieve |
value | Set to the value of the property if found |
type | The type of the property if set ( Type of data, either a MIME type or URI. If type is empty, the data is assumed to be a UTF-8 encoded string. |
subject
has no key
property.for available keys, see https://github.com/jackaudio/headers/blob/master/metadata.h https://github.com/drobilla/jackey/blob/master/jackey.h
Reimplemented from ARDOUR::PortEngine.
Definition at line 207 of file portaudio_backend.h.
|
inlinevirtual |
Find the set of ports whose names, types and flags match specified values, place the names of each port into ports
.
port_name_pattern | match by given pattern. To avoid selecting by name, pass an empty string. |
type | filter by given type; pass DataType::NIL to match all types. |
flags | filter by flags, pass PortFlags (0) to avoid selecting by flags. |
ports | array filled with matching port-names |
Implements ARDOUR::PortEngine.
Definition at line 209 of file portaudio_backend.h.
|
inlinevirtual |
Reimplemented from ARDOUR::AudioBackend.
Definition at line 114 of file portaudio_backend.h.
|
virtual |
Return true if execution context is in a backend thread
Implements ARDOUR::AudioBackend.
|
virtual |
Reimplemented from ARDOUR::AudioBackend.
|
virtual |
Implements ARDOUR::AudioBackend.
|
virtual |
Return true if the callback from the underlying mechanism/API (CoreAudio, JACK, ASIO etc.) occurs in a thread subject to realtime constraints. Return false otherwise.
Implements ARDOUR::AudioBackend.
|
virtual |
Wait for all processing threads to exit.
Return zero on success, non-zero on failure.
Implements ARDOUR::AudioBackend.
|
virtual |
Launch the control app for the currently in-use or selected device. May do nothing if the control app is undefined or cannot be launched.
Implements ARDOUR::AudioBackend.
|
virtual |
Clear the buffer at port_buffer
of all MIDI events.
After a call to this method, an immediate, subsequent call to get_midi_event_count with the same port_buffer
argument must return zero.
port_buffer | the buffer to clear |
Implements ARDOUR::PortEngine.
|
virtual |
query if a midi-device is enabled
Implements ARDOUR::AudioBackend.
|
private |
|
virtual |
Retrieve a MIDI event from the data at port_buffer
. The event number to be retrieved is given by event_index
(a value of zero indicates that the first event in the port_buffer should be retrieved).
The data associated with the event will be copied into the buffer at buf
and the number of bytes written will be stored in size
. The timestamp of the event (which is always relative to the start of the current process cycle, in samples) will be stored in timestamp
.
timestamp | time in samples relative to the current cycle start |
size | number of bytes read into buf |
buf | raw MIDI data |
port_buffer | the midi-port buffer |
event_index | index of event to retrieve |
Implements ARDOUR::PortEngine.
|
virtual |
Place a MIDI event consisting of size
bytes copied from the data at buffer
into the port buffer referred to by port_buffer
. The MIDI event will be marked with a time given by timestamp
.
Events must be added monotonically to a port buffer. An attempt to add a non-monotonic event (e.g. out-of-order) will cause this method to return a failure status.
port_buffer | the midi-port buffer |
timestamp | time in samples relative to the current cycle start |
buffer | raw MIDI data to emplace |
size | number of bytes of buffer |
Implements ARDOUR::PortEngine.
|
virtual |
Implements ARDOUR::AudioBackend.
|
virtual |
Query status of hardware monitoring for given port
port | PortHandle to test |
port
. Return false otherwise. Implements ARDOUR::PortEngine.
|
virtual |
Return the name of this process as used by the port manager when naming ports.
Implements ARDOUR::PortEngine.
|
inlinevirtual |
Implements ARDOUR::PortEngine.
Definition at line 201 of file portaudio_backend.h.
|
inlinevirtual |
Implements ARDOUR::PortEngine.
Definition at line 200 of file portaudio_backend.h.
|
virtual |
Return the name of this backend.
Should use a well-known, unique term. Expected examples might include "JACK", "CoreAudio", "ASIO" etc.
Implements ARDOUR::AudioBackend.
|
private |
|
virtual |
Reimplemented from ARDOUR::AudioBackend.
|
inlinevirtual |
Test if given port
is connected to physical I/O ports.
port | PortHandle of source port to test |
process_callback_safe | true if this method is not called from rt-context of backend callbacks |
port
has any connections to ports marked with the PortFlag IsPhysical. Return false otherwise. Implements ARDOUR::PortEngine.
Definition at line 220 of file portaudio_backend.h.
|
inlinevirtual |
Lookup data type of a port
port | PortHandle of the port to lookup. |
port
. DataType::NIL is returned if the port does not exist. Implements ARDOUR::PortEngine.
Definition at line 210 of file portaudio_backend.h.
|
privatevirtual |
Implements ARDOUR::PortEngineSharedImpl.
|
inlinevirtual |
Return true if the port referred to by port
has the IsPhysical flag set. Return false otherwise.
port | PortHandle to query |
Implements ARDOUR::PortEngine.
Definition at line 197 of file portaudio_backend.h.
|
inlinevirtual |
Return the maximum size of a port name
Implements ARDOUR::PortEngine.
Definition at line 202 of file portaudio_backend.h.
|
staticprivate |
|
staticprivate |
|
virtual |
Return a private, type-free pointer to any data that might be useful to a concrete implementation
Implements ARDOUR::PortEngine.
|
private |
|
private |
|
private |
|
private |
|
virtual |
Return number of processing threads
Implements ARDOUR::AudioBackend.
|
virtual |
Implements ARDOUR::AudioBackend.
|
inlinevirtual |
Create a new port whose fullname will be the conjunction of my_name(), ":" and shortname
. The port will handle data specified by type
and will have the flags given by flags
. If successful,
shortname | Name of port to create |
type | type of port to create |
flags | flags of the port to create |
Implements ARDOUR::PortEngine.
Definition at line 211 of file portaudio_backend.h.
|
private |
|
private |
|
virtual |
Increment or decrement the number of requests to monitor the input of the hardware channel represented by the port referred to by port
.
If the number of requests rises above zero, input monitoring will be enabled (if can_monitor_input() returns true for the implementation).
If the number of requests falls to zero, input monitoring will be disabled (if can_monitor_input() returns true for the implementation)
port | PortHandle |
yn | true to enable hardware monitoring, false to disable |
Implements ARDOUR::PortEngine.
|
virtual |
Return true if this backend requires the selection of a "driver" before any device can be selected. Return false otherwise.
Intended mainly to differentiate between meta-APIs like JACK which can still expose different backends (such as ALSA or CoreAudio or FFADO or netjack) and those like ASIO or CoreAudio which do not.
Reimplemented from ARDOUR::AudioBackend.
|
inlinevirtual |
Reset device.
Return zero if successful, negative values on error
Implements ARDOUR::AudioBackend.
Definition at line 138 of file portaudio_backend.h.
|
staticprivate |
|
private |
|
virtual |
Implements ARDOUR::AudioBackend.
|
virtual |
return the time according to the sample clock in use, measured in samples since an arbitrary zero time in the past. The value should increase monotonically and linearly, without interruption from any source (including CPU frequency scaling).
It is extremely likely that any implementation will use a DLL, since this function can be called from any thread, at any time, and must be able to accurately determine the correct sample time.
Can be called from any thread.
Implements ARDOUR::AudioBackend.
|
virtual |
Return the time according to the sample clock in use when the most recent buffer process cycle began. Can be called from any thread.
Implements ARDOUR::AudioBackend.
|
virtual |
Return the time since the current buffer process cycle started, in samples, according to the sample clock in use.
Can ONLY be called from within a process() callback tree (which implies that it can only be called by a process thread)
Implements ARDOUR::AudioBackend.
|
virtual |
Set the buffer size to be used.
The device is assumed to use a double buffering scheme, so that one buffer's worth of data can be processed by hardware while software works on the other buffer. All known suitable audio APIs support this model (though ALSA allows for alternate numbers of buffers, and CoreAudio doesn't directly expose the concept).
Implements ARDOUR::AudioBackend.
|
virtual |
Set the name of the device to be used
Implements ARDOUR::AudioBackend.
|
virtual |
Returns zero if the backend can successfully use drivername
as the driver, non-zero otherwise.
Should not be used unless the backend returns true from requires_driver_selection()
Reimplemented from ARDOUR::AudioBackend.
|
virtual |
Set the name of the input device to be used if using separate input/output devices.
Reimplemented from ARDOUR::AudioBackend.
|
virtual |
Set the preferred underlying hardware data layout. If yn
is true, then the hardware will interleave samples for successive channels; otherwise, the hardware will store samples for a single channel contiguously.
Setting this does not change the fact that all data streams to and from Ports are mono (essentially, non-interleaved)
Implements ARDOUR::AudioBackend.
|
virtual |
Set the latency range for the port referred to by port
to r
. The playback range will be set if for_playback
is true, otherwise the capture range will be set.
port | PortHandle to operate on |
for_playback | When true, playback latency is set: How long will it be until the signal arrives at the edge of the process graph. When false the capture latency is set: ow long has it been since the signal arrived at the edge of the process graph. |
r | min/max latency for given port. |
Implements ARDOUR::PortEngine.
|
virtual |
mark a midi-devices as enabled
Implements ARDOUR::AudioBackend.
|
virtual |
Implements ARDOUR::AudioBackend.
|
staticprivate |
|
virtual |
Set the name of the output device to be used if using separate input/output devices.
Reimplemented from ARDOUR::AudioBackend.
|
inlinevirtual |
Set/rename port
port | PortHandle to operate on |
name | new name to use for this port |
Implements ARDOUR::PortEngine.
Definition at line 203 of file portaudio_backend.h.
|
inlinevirtual |
Set the port-property value and type for a given key
The API follows jack_set_property():
key | The key of the property. |
value | The value of the property. |
type | The type of the property. |
Reimplemented from ARDOUR::PortEngine.
Definition at line 208 of file portaudio_backend.h.
|
virtual |
Set the sample rate to be used
Implements ARDOUR::AudioBackend.
|
virtual |
Set the (additional) input latency that cannot be determined via the implementation's underlying code (e.g. latency from external D-A/D-A converters. Units are samples.
Implements ARDOUR::AudioBackend.
|
virtual |
Set the (additional) input latency for a specific midi device, or if the identifier is empty, apply to all midi devices.
Implements ARDOUR::AudioBackend.
|
virtual |
Set the (additional) output latency for a specific midi device, or if the identifier is empty, apply to all midi devices.
Implements ARDOUR::AudioBackend.
|
virtual |
Set the (additional) output latency that cannot be determined via the implementation's underlying code (e.g. latency from external D-A/D-A converters. Units are samples.
Implements ARDOUR::AudioBackend.
|
virtual |
Set the backend to use a blocking or buffered I/O mode
Reimplemented from ARDOUR::AudioBackend.
|
private |
|
private |
|
virtual |
Stop using the device currently in use.
If the function is successfully called, no subsequent calls to the process_callback() of engine will be made after the function returns, until parameters are reset and start() are called again.
The backend is considered to be un-configured after a successful return, and requires calls to set hardware parameters before it can be start()-ed again. See pause() for a way to avoid this. stop() should only be used when reconfiguration is required OR when there are no plans to use the backend in the future with a reconfiguration.
Return zero if successful, 1 if the device is not in use, negative values on error
Implements ARDOUR::AudioBackend.
|
private |
|
private |
|
virtual |
Implements ARDOUR::AudioBackend.
|
virtual |
Implements ARDOUR::AudioBackend.
|
virtual |
Implements ARDOUR::AudioBackend.
|
virtual |
Implements ARDOUR::AudioBackend.
|
inlinevirtual |
Reimplemented from ARDOUR::PortEngineSharedImpl.
Definition at line 212 of file portaudio_backend.h.
|
virtual |
Request an update to the list of devices returned in the enumerations. The Backend must return true from can_request_update_devices to support this interface.
Reimplemented from ARDOUR::AudioBackend.
|
virtual |
Implements ARDOUR::AudioBackend.
|
private |
|
virtual |
An optional alternate interface for backends to provide a facility to select separate input and output devices.
If a backend returns true then enumerate_input_devices() and enumerate_output_devices() will be used instead of enumerate_devices() to enumerate devices. Similarly set_input/output_device_name() should be used to set devices instead of set_device_name().
Reimplemented from ARDOUR::AudioBackend.
|
private |
Definition at line 288 of file portaudio_backend.h.
|
private |
Definition at line 304 of file portaudio_backend.h.
|
private |
Definition at line 308 of file portaudio_backend.h.
|
private |
Definition at line 297 of file portaudio_backend.h.
|
private |
Definition at line 334 of file portaudio_backend.h.
|
private |
Definition at line 290 of file portaudio_backend.h.
|
private |
Definition at line 292 of file portaudio_backend.h.
|
private |
Definition at line 301 of file portaudio_backend.h.
|
private |
Definition at line 295 of file portaudio_backend.h.
|
private |
Definition at line 302 of file portaudio_backend.h.
|
private |
Definition at line 299 of file portaudio_backend.h.
|
private |
Definition at line 291 of file portaudio_backend.h.
|
mutableprivate |
Definition at line 316 of file portaudio_backend.h.
|
staticprivate |
Definition at line 312 of file portaudio_backend.h.
|
private |
Definition at line 283 of file portaudio_backend.h.
|
private |
Definition at line 309 of file portaudio_backend.h.
|
private |
Definition at line 338 of file portaudio_backend.h.
|
private |
Definition at line 341 of file portaudio_backend.h.
|
staticprivate |
Definition at line 323 of file portaudio_backend.h.
|
private |
Definition at line 306 of file portaudio_backend.h.
|
private |
Definition at line 294 of file portaudio_backend.h.
|
staticprivate |
Definition at line 314 of file portaudio_backend.h.
|
private |
Definition at line 318 of file portaudio_backend.h.
|
staticprivate |
Definition at line 311 of file portaudio_backend.h.
|
private |
Definition at line 285 of file portaudio_backend.h.
|
mutableprivate |
Definition at line 317 of file portaudio_backend.h.
|
staticprivate |
Definition at line 313 of file portaudio_backend.h.
|
private |
Definition at line 284 of file portaudio_backend.h.
|
private |
Definition at line 335 of file portaudio_backend.h.
|
private |
Definition at line 344 of file portaudio_backend.h.
|
private |
Definition at line 293 of file portaudio_backend.h.
|
private |
Definition at line 287 of file portaudio_backend.h.
|
private |
Definition at line 321 of file portaudio_backend.h.
|
private |
Definition at line 322 of file portaudio_backend.h.
|
private |
Definition at line 325 of file portaudio_backend.h.
|
private |
Definition at line 326 of file portaudio_backend.h.
|
private |
Definition at line 348 of file portaudio_backend.h.
|
private |
Definition at line 305 of file portaudio_backend.h.
|
private |
Definition at line 289 of file portaudio_backend.h.