dxd - dynax driver framework 3.0.2
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::coreaudio::device< desc_t, preference_t, stream_t, group_t, _hosted > Class Template Reference

CoreAudio client device. More...

#include <dx_coreaudio_device.h>

Inheritance diagram for dx::coreaudio::device< desc_t, preference_t, stream_t, group_t, _hosted >:
Collaboration diagram for dx::coreaudio::device< desc_t, preference_t, stream_t, group_t, _hosted >:

Classes

struct  mirror
 a setting the device's host keeps (dx::stream::setting) mirrored: a promoted property of the plugin's device, addressed by the setting and its stream's index - as service::client::device::mirror over its connection More...

Public Types

typedef dx::virtuel::stream::desc desc_t
typedef event event_t
typedef promoted<uint32_t>::template preference<decltype(super_device_t::preference)> source_t
typedef dx::stream::stream<device<dx::virtuel::stream::desc, cf::preference, dx::stream::stream, group, false>> stream_t
typedef dx::device<::AudioObjectID, cf::preference> super_device_t
 the device this streaming device sits on: its own operations of a name this class takes for itself (a USB device's configuration()) are reached through it

Public Member Functions

struct stream* align(struct stream* sync_reference)
 the given stream where it may be the sync reference, else the first one that may - what a stored reference is aligned to when the desc changed under it
uint32_t align(uint32_t sync_reference) const
virtual desc_t::configuration align(const typename desc_t::configuration& value, const typename desc_t::configuration &)
 a configuration the device can run: every stream's index within its configurations, one past them the stream off - a bus device narrows it to what its bus carries, the streams value leaves as current has them standing
void attach(void** io[dx::stream::direction::directions][2], const std::vector<bool>(& channel_map)[2], const dx::stream::format(& format)[2])
 the consumer's planar channel buffers in the format each direction's buffers carry
configuration bound(configuration value, const configuration& current, align_t&& align, bind_t&& bind) const
virtual uint64_t budget(const typename desc_t::configuration &)
 the periodic bus time the configuration takes, in ns - a bus device with a periodic budget states it
void conclude() noexcept override
 ends every group's session before the device's resources go; the start counts stay with their holders
uint32_t enumerate(const format& format= any) const
 enumerate typified pins
void exception(const dx::exception& exception, bool filtered= false) const noexcept override
 notification exception handler
stream_t* find(const decltype(stream_t::target.idx())& target)
 by the target's index, where the target has one
struct stream* find(const format& format= any, enum direction::direction direction= direction::any)
struct stream* find(const target& target)
struct stream* find(uint32_t& pin, const format& format= any, enum direction::direction direction= direction::any)
 finds and returns the stream description and pin idx into this stream
virtual uint64_t frame() const
virtual void hw_clock(abstract::event* hw_clock, uint32_t iosize)
 registers a consumer with the device's clock: it is signalled every iosize samples of the clock's own advance. A bus whose driver owns the clock hands the registration on instead
std::shared_ptr<stream_t> open(const typename dx::virtuel::stream::desc::stream::desc& desc, bool client= false)
 the desc's stream: the registered one, else created, registered and launched - a host's client takes a data driven stream alone, its ring has one writer and one reader
const struct desc_t::stream::config& operator ()(const struct desc_t::stream& stream)
 the stream configuration the device runs the stream in: the stream is one of the desc's
virtual device& operator >>(std::ostream &) const
 the device's own diagnostics, beyond its operator <<
group_t& operator [](const typename dx::virtuel::stream::desc::stream::desc& stream)
 the stream's group, created on first use
configuration preferred(align_t&& align) const
virtual _device& reset()
void setting(dx::stream::setting setting, uint32_t index, f_t&& f)
 the setting a host keeps for its clients handed to f as its promoted: the transport settings the sync reference's group's, the source the one of the stream whose target index is index
virtual void sleep()
 notify system will sleep stub
virtual std::pair<source_t &, bool> source(const struct dx::virtuel::stream::desc::stream& stream)
 the stream's source selector, created on first use: the preference by stream target, the value an index into the stream's sources
std::string string(uint8_t idx)
uint32_t sync_reference(struct stream* sync_reference)
struct stream* sync_reference(uint32_t sync_reference)
 the n-th stream qualifying as sync reference, and the twin below the index of a given one - the two directions of the preference's value
bool try_conclude() noexcept
 atomically conclude()s if currently launched; returns whether this call did it
bool try_launch()
 atomically launch()es if not already launched; returns whether this call did it. A launch() that throws is concluded before the exception leaves: the object never claims a launch it did not finish
void wake() override

Public Attributes

dx::stream::bus::bus bus
 the bus this device hangs on
promoted::property<typename super::client_map, typename super::client_map::value_t, false> clients
struct dx::stream::desc::clock clock [1]
uint32_t clocks
promoted<uint32_t>::preference<decltype(super::preference)> clocksource
promoted<typenamedesc_t::configuration>::template preference<decltype(super::preference)> configuration
 the device's configuration: per stream the stream configuration it runs, the richest by default - a bus device narrows it to what its bus carries (align()), and it stands while a group is started
bool dflt
 can be selected as default (OS audio) device
dx::driver<decltype(id), cf::preference>& driver
bool editable
 can be edited
struct dx::stream::desc::firmware firmware
std::map<decltype(dx::virtuel::stream::desc::stream::group), group_t> group
bool hidden
 hide device
struct dx::stream::device:: { ... }  hw
promoted::property<icon, ::CFURLRef, false> icon
dx::coreaudio::_device::clocksource id
promoted<uint32_t>::preference<decltype(super::preference)> iosize
std::atomic<bool> launched
struct dx::stream::desc::name_id model
dx::stream::device::monitor monitor
bool persistence
 device has capability to store persistent settings (i.e. sample rate; clock source; etc.)
cf::preference preference
std::string puid
 persistent UID - system unique - could change with location
std::string puuid
 persistent universal UID - universally unique ID (i.e. serial number)
promoted::property<::Float64> samplerate
std::map<decltype(dx::virtuel::stream::desc::stream::target.idx()), source_t> sources
direction::direction start_stop_order
struct dx::stream::desc::stream stream [max_streams]
uint32_t streams
 number of streams
promoted<structdesc_t::stream *>::template preference<decltype(super::preference), uint32_t> sync_reference
struct dx::stream::desc::name_id vendor
dx::stream::device::monitor version

Static Public Attributes

static constexpr bool hosted= _hosted

Protected Member Functions

virtual void grouped(group_t &)
 operator[](): a group just came into existence, a host wires its per-group transports here
virtual void launch()
 launch notification: object mounted and ready to use. Called only through try_launch() - never call this directly from outside the class hierarchy.
virtual void process(const ::AudioTimeStamp *, const ::AudioBufferList *, const ::AudioTimeStamp *, ::AudioBufferList *, const ::AudioTimeStamp *)

Protected Attributes

std::vector<std::shared_ptr<typename super::dx::stream::stream<device<dx::virtuel::stream::desc, cf::preference, dx::stream::stream, group, false>>>> io_streams
 the streams process() iterates: fixed between AudioDeviceStart and AudioDeviceStop and held for it, so the IOProc never touches the mutable streams map nor a stream its client let go

Detailed Description

template<typename desc_t = dx::virtuel::stream::desc, typename preference_t = cf::preference, template< typename ... > typename stream_t = dx::stream::stream, template< typename ... > typename group_t = group, bool _hosted = false>
class dx::coreaudio::device< desc_t, preference_t, stream_t, group_t, _hosted >

CoreAudio client device.

< the rings and transport settings are another process' (the pod's counterpart) the bus's device as a product composes it; _hosted marks the one whose rings and transport settings belong to another process - the pod's counterpart, which mirrors them through mirror below

Template Parameters
group_tthe app's consumer group (dx::stream::engine::group) wraps this bus's own

Member Typedef Documentation

◆ desc_t

◆ event_t

◆ source_t

◆ stream_t

◆ super_device_t

the device this streaming device sits on: its own operations of a name this class takes for itself (a USB device's configuration()) are reached through it

Member Function Documentation

◆ align() [1/3]

struct stream* dx::stream::desc<target, max_streams, max_pins, 1, 1, 1, 1>::align(struct stream* sync_reference)
inlineinherited

the given stream where it may be the sync reference, else the first one that may - what a stored reference is aligned to when the desc changed under it

Here is the call graph for this function:

◆ align() [2/3]

uint32_t dx::stream::desc<target, max_streams, max_pins, 1, 1, 1, 1>::align(uint32_t sync_reference) const
inlineinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ align() [3/3]

virtual desc_t::configuration dx::stream::device<dx::device<::AudioObjectID, cf::preference>, dx::virtuel::stream::desc, dx::stream::stream<device<dx::virtuel::stream::desc, cf::preference, dx::stream::stream, group, false>>, group<device<dx::virtuel::stream::desc, cf::preference, dx::stream::stream, group, false>>>::align(const typename desc_t::configuration& value, const typename desc_t::configuration&)
inlinevirtualinherited

a configuration the device can run: every stream's index within its configurations, one past them the stream off - a bus device narrows it to what its bus carries, the streams value leaves as current has them standing

◆ attach()

void dx::stream::device<dx::device<::AudioObjectID, cf::preference>, dx::virtuel::stream::desc, dx::stream::stream<device<dx::virtuel::stream::desc, cf::preference, dx::stream::stream, group, false>>, group<device<dx::virtuel::stream::desc, cf::preference, dx::stream::stream, group, false>>>::attach(void** io[dx::stream::direction::directions][2], const std::vector<bool>(&) channel_map[2], const dx::stream::format(&) format[2])
inlineinherited

the consumer's planar channel buffers in the format each direction's buffers carry

◆ bound()

configuration dx::stream::desc<target, max_streams, max_pins, 1, 1, 1, 1>::bound(configuration value, const configuration& current, align_t&& align, bind_t&& bind) const
inlineinherited

the configuration align(value, current) answers for the wish that the streams carry: bind(idx, config) moves a stream to its aligned stream configuration, one it refuses stands as current has it and the wish is aligned around it again - the result is an answer of align

Here is the call graph for this function:

◆ budget()

the periodic bus time the configuration takes, in ns - a bus device with a periodic budget states it

◆ conclude()

ends every group's session before the device's resources go; the start counts stay with their holders

Reimplemented from dx::object.

◆ enumerate()

uint32_t dx::stream::desc<target, max_streams, max_pins, 1, 1, 1, 1>::enumerate(const format& format= any) const
inlineinherited

enumerate typified pins

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exception()

void dx::device<::AudioObjectID, cf::preference>::exception(const dx::exception& exception, bool filtered= false) const
inlineoverridevirtualnoexceptinherited

notification exception handler

Implements dx::object.

◆ find() [1/4]

stream_t* dx::stream::desc<target, max_streams, max_pins, 1, 1, 1, 1>::find(const decltype(stream_t::target.idx())& target)
inlineinherited

by the target's index, where the target has one

◆ find() [2/4]

struct stream* dx::stream::desc<target, max_streams, max_pins, 1, 1, 1, 1>::find(const format& format= any, enum direction::direction direction= direction::any)
inlineinherited
Parameters
formatsearch stream format filter
directionsearch stream direction filter
Here is the call graph for this function:

◆ find() [3/4]

struct stream* dx::stream::desc<target, max_streams, max_pins, 1, 1, 1, 1>::find(const target& target)
inlineinherited

◆ find() [4/4]

struct stream* dx::stream::desc<target, max_streams, max_pins, 1, 1, 1, 1>::find(uint32_t& pin, const format& format= any, enum direction::direction direction= direction::any)
inlineinherited

finds and returns the stream description and pin idx into this stream

Returns
stream description of indexed pin, pin idx will be altered on return!
Parameters
pinin: global pin index, out: pin index into returned stream description
formatsearch stream format filter
directionsearch stream direction filter
Here is the caller graph for this function:

◆ frame()

◆ grouped()

operator[](): a group just came into existence, a host wires its per-group transports here

◆ hw_clock()

registers a consumer with the device's clock: it is signalled every iosize samples of the clock's own advance. A bus whose driver owns the clock hands the registration on instead

◆ launch()

virtual void dx::object::launch()
inlineprotectedvirtualinherited

launch notification: object mounted and ready to use. Called only through try_launch() - never call this directly from outside the class hierarchy.

◆ open()

std::shared_ptr<stream_t> dx::stream::device<dx::device<::AudioObjectID, cf::preference>, dx::virtuel::stream::desc, dx::stream::stream<device<dx::virtuel::stream::desc, cf::preference, dx::stream::stream, group, false>>, group<device<dx::virtuel::stream::desc, cf::preference, dx::stream::stream, group, false>>>::open(const typename dx::virtuel::stream::desc::stream::desc& desc, bool client= false)
inlineinherited

the desc's stream: the registered one, else created, registered and launched - a host's client takes a data driven stream alone, its ring has one writer and one reader

◆ operator ()()

the stream configuration the device runs the stream in: the stream is one of the desc's

◆ operator >>()

virtual device& dx::device<::AudioObjectID, cf::preference>::operator >>(std::ostream&) const
inlinevirtualinherited

the device's own diagnostics, beyond its operator <<

◆ operator []()

group_t& dx::stream::device<dx::device<::AudioObjectID, cf::preference>, dx::virtuel::stream::desc, dx::stream::stream<device<dx::virtuel::stream::desc, cf::preference, dx::stream::stream, group, false>>, group<device<dx::virtuel::stream::desc, cf::preference, dx::stream::stream, group, false>>>::operator [](const typename dx::virtuel::stream::desc::stream::desc& stream)
inlineinherited

the stream's group, created on first use

◆ preferred()

configuration dx::stream::desc<target, max_streams, max_pins, 1, 1, 1, 1>::preferred(align_t&& align) const
inlineinherited

the richest configuration align admits (it returns the candidate as it stands): the largest sum of channels times bits over the streams that run, on a tie the richer stream configuration to the smaller stream index, then the more streams running - streams without channels (MIDI, raw) score nothing - every combination is tried

Here is the call graph for this function:

◆ process()

virtual void dx::coreaudio::_device<dx::virtuel::stream::desc, cf::preference, dx::stream::stream<device<dx::virtuel::stream::desc, cf::preference, dx::stream::stream, group, false>>, group<device<dx::virtuel::stream::desc, cf::preference, dx::stream::stream, group, false>>>::process(const ::AudioTimeStamp*, const ::AudioBufferList*, const ::AudioTimeStamp*, ::AudioBufferList*, const ::AudioTimeStamp*)
inlineprotectedvirtualinherited

◆ reset()

◆ setting()

the setting a host keeps for its clients handed to f as its promoted: the transport settings the sync reference's group's, the source the one of the stream whose target index is index

◆ sleep()

virtual void dx::device<::AudioObjectID, cf::preference>::sleep()
inlinevirtualinherited

notify system will sleep stub

◆ source()

the stream's source selector, created on first use: the preference by stream target, the value an index into the stream's sources

◆ string()

◆ sync_reference() [1/2]

uint32_t dx::stream::desc<target, max_streams, max_pins, 1, 1, 1, 1>::sync_reference(struct stream* sync_reference)
inlineinherited
Here is the call graph for this function:

◆ sync_reference() [2/2]

struct stream* dx::stream::desc<target, max_streams, max_pins, 1, 1, 1, 1>::sync_reference(uint32_t sync_reference)
inlineinherited

the n-th stream qualifying as sync reference, and the twin below the index of a given one - the two directions of the preference's value

Here is the call graph for this function:
Here is the caller graph for this function:

◆ try_conclude()

bool dx::object::try_conclude()
inlinenoexceptinherited

atomically conclude()s if currently launched; returns whether this call did it

◆ try_launch()

bool dx::object::try_launch()
inlineinherited

atomically launch()es if not already launched; returns whether this call did it. A launch() that throws is concluded before the exception leaves: the object never claims a launch it did not finish

◆ wake()

Member Data Documentation

◆ bus

dx::stream::bus::bus dx::stream::desc<target, max_streams, max_pins, 1, 1, 1, 1>::bus
inherited

the bus this device hangs on

◆ clients

◆ clock

struct dx::stream::desc::clock dx::stream::desc<target, max_streams, max_pins, 1, 1, 1, 1>::clock[1]
inherited

◆ clocks

uint32_t dx::stream::desc<target, max_streams, max_pins, 1, 1, 1, 1>::clocks
inherited

number of independent clocks [currenlty only single clock support]

◆ clocksource

◆ configuration

the device's configuration: per stream the stream configuration it runs, the richest by default - a bus device narrows it to what its bus carries (align()), and it stands while a group is started

◆ dflt

bool dx::stream::desc<target, max_streams, max_pins, 1, 1, 1, 1>::dflt
inherited

can be selected as default (OS audio) device

◆ driver

dx::driver<decltype(id), cf::preference>& dx::device<::AudioObjectID, cf::preference>::driver
inherited

◆ editable

bool dx::stream::desc<target, max_streams, max_pins, 1, 1, 1, 1>::editable
inherited

can be edited

◆ firmware

struct dx::stream::desc::firmware dx::stream::desc<target, max_streams, max_pins, 1, 1, 1, 1>::firmware
inherited

◆ group

streaming groups by desc::stream::group id: every stream of this device is registered with its group - behind the settings its groups listen to, so they go first

◆ hidden

bool dx::stream::desc<target, max_streams, max_pins, 1, 1, 1, 1>::hidden
inherited

hide device

◆ hosted

template<typename desc_t= dx::virtuel::stream::desc, typename preference_t= cf::preference, template<typename ...> typename stream_t= dx::stream::stream, template<typename ...> typename group_t= group, bool _hosted= false>
bool dx::coreaudio::device<desc_t, preference_t, stream_t, group_t, _hosted>::hosted= _hosted
staticconstexpr

◆ hw

◆ icon

◆ id

◆ io_streams

the streams process() iterates: fixed between AudioDeviceStart and AudioDeviceStop and held for it, so the IOProc never touches the mutable streams map nor a stream its client let go

◆ iosize

◆ launched

std::atomic<bool> dx::object::launched
inherited

◆ model

struct dx::stream::desc::name_id dx::stream::desc<target, max_streams, max_pins, 1, 1, 1, 1>::model
inherited

◆ monitor

◆ persistence

bool dx::stream::desc<target, max_streams, max_pins, 1, 1, 1, 1>::persistence
inherited

device has capability to store persistent settings (i.e. sample rate; clock source; etc.)

◆ preference

◆ puid

std::string dx::device<::AudioObjectID, cf::preference>::puid
inherited

persistent UID - system unique - could change with location

◆ puuid

std::string dx::device<::AudioObjectID, cf::preference>::puuid
inherited

persistent universal UID - universally unique ID (i.e. serial number)

◆ samplerate

◆ sources

source selectors by stream target: a stream with sources gets its own on first use

◆ start_stop_order

direction::direction dx::stream::desc<target, max_streams, max_pins, 1, 1, 1, 1>::start_stop_order
inherited

◆ stream

struct dx::stream::desc::stream dx::stream::desc<target, max_streams, max_pins, 1, 1, 1, 1>::stream[max_streams]
inherited

◆ streams

uint32_t dx::stream::desc<target, max_streams, max_pins, 1, 1, 1, 1>::streams
inherited

number of streams

◆ sync_reference

◆ vendor

struct dx::stream::desc::name_id dx::stream::desc<target, max_streams, max_pins, 1, 1, 1, 1>::vendor
inherited

◆ version


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