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

ASIO client streaming device interface class. More...

#include <dx_asio_client_device.h>

Inheritance diagram for dx::asio::client::_device< desc_t, preference_t, stream_t, group_t >:
Collaboration diagram for dx::asio::client::_device< desc_t, preference_t, stream_t, group_t >:

Classes

class  asio
 the SDK driver this device is, opened off a list of its own: its id holds however the registry moves More...

Public Types

typedef desc_t desc_t
typedef event event_t
typedef promoted<uint32_t>::template preference<decltype(super_device_t::preference)> source_t
typedef dx::device<dx::guid, preference_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

Public Member Functions

 _device(decltype(super::driver)& driver, decltype(super::id)& id)
 the ASIO stream device class constructor
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>(&)[2], const dx::stream::format(& format)[2])
 the engine works on the driver's own buffers: they carry the format the driver states for its channels
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
 conclude notification: object will be removed. If you overwrite conclude() you also need to overwrite destructor and check if its needed to be called from there. Called only through try_conclude() - never call this directly from outside the class hierarchy.
void exception(const dx::exception& exception, bool filtered= false) const noexcept override
 notification exception handler
virtual uint64_t frame() const
virtual bool hw_clock() const noexcept
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 desc_t::stream::desc& descdesc, 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 desc_t::stream::desc& stream)
 the stream's group, created on first use
_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 desc_t::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)
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
 ~_device() override

Public Attributes

promoted<typename super::client_map> clients
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
promoted<desc_t>::template preference<preference_t> desc{this->preference}
dx::driver<decltype(id), preference_t>& driver
std::map<decltype(desc_t::stream::group), group_t> group
struct dx::stream::device:: { ... }  hw
promoted<std::string>::preference<decltype(super::preference)> icon
const id_t id
promoted<uint32_t>::preference<decltype(super::preference)> iosize
std::atomic<bool> launched{}
dx::stream::device::monitor monitor
preference_t preference{driver.preference[puuid]}
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<uint32_t>::preference<decltype(super::preference)> samplerate
std::map<decltype(desc_t::stream::target.idx()), source_t> sources
promoted<structdesc_t::stream *>::template preference<decltype(super::preference), uint32_t> sync_reference
dx::stream::device::monitor version

Static Public Attributes

static constexpr bool hosted
 the transport's settings belong to another process' device: a hosted device mirrors them through its chains, it keeps no store of them

Protected Member Functions

long asioMessage(long selector, long value, void* message, double* opt) noexcept override
void bufferSwitch(long doubleBufferIndex, ::ASIOBool) noexcept override
 the ASIO host's processing place: this device's groups tick right here, on the driver's own callback, on the half it names
::ASIOTime* bufferSwitchTimeInfo(::ASIOTime* params, long doubleBufferIndex, ::ASIOBool directProcess) noexcept override
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.
 operator ::ASIOCallbacks*()
void sampleRateDidChange(::ASIOSampleRate sRate) noexcept override

Protected Attributes

long half{}
decltype(super::samplerate) ::chain samplerate_server
 the driver runs the rate the app sets, aligned to what it can
class dx::asio::client::_device::asio* this
uint32_t thunk_idx{}

Friends

template<typename>
class client::group
 the app wraps this bus's own group, so friendship has to name it, not just the device's group_t

Detailed Description

template<typename desc_t, typename preference_t, typename stream_t, typename group_t>
class dx::asio::client::_device< desc_t, preference_t, stream_t, group_t >

ASIO client streaming device interface class.

Exceptions
Incase of an error returned by the underlaying API the device class throws a dx::exception.

Member Typedef Documentation

◆ desc_t

typedef desc_t dx::stream::device<dx::device<dx::guid, preference_t>, desc_t, stream_t, group_t>::desc_t
inherited

◆ event_t

typedef event dx::stream::device<dx::device<dx::guid, preference_t>, desc_t, stream_t, group_t>::event_t
inherited

◆ source_t

typedef promoted<uint32_t>::template preference<decltype(super_device_t::preference)> dx::stream::device<dx::device<dx::guid, preference_t>, desc_t, stream_t, group_t>::source_t
inherited

◆ super_device_t

typedef dx::device<dx::guid, preference_t> dx::stream::device<dx::device<dx::guid, preference_t>, desc_t, stream_t, group_t>::super_device_t
inherited

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

Constructor & Destructor Documentation

◆ _device()

template<typename desc_t, typename preference_t, typename stream_t, typename group_t>
dx::asio::client::_device<desc_t, preference_t, stream_t, group_t>::_device(decltype(super::driver)& driver, decltype(super::id)& id)
inline

the ASIO stream device class constructor

< both directions run off the ASIO driver's one clock

Here is the caller graph for this function:

◆ ~_device()

template<typename desc_t, typename preference_t, typename stream_t, typename group_t>
dx::asio::client::_device<desc_t, preference_t, stream_t, group_t>::~_device()
inlineoverride

Member Function Documentation

◆ align()

virtual desc_t::configuration dx::stream::device<dx::device<dx::guid, preference_t>, desc_t, stream_t, group_t>::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

◆ asioMessage()

template<typename desc_t, typename preference_t, typename stream_t, typename group_t>
long dx::asio::client::_device<desc_t, preference_t, stream_t, group_t>::asioMessage(long selector, long value, void* message, double* opt)
inlineoverrideprotectedvirtualnoexcept

◆ attach()

template<typename desc_t, typename preference_t, typename stream_t, typename group_t>
void dx::asio::client::_device<desc_t, preference_t, stream_t, group_t>::attach(void** io[dx::stream::direction::directions][2], const std::vector<bool>(&)[2], const dx::stream::format(&) format[2])
inline

the engine works on the driver's own buffers: they carry the format the driver states for its channels

◆ budget()

virtual uint64_t dx::stream::device<dx::device<dx::guid, preference_t>, desc_t, stream_t, group_t>::budget(const typename desc_t::configuration&)
inlinevirtualinherited

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

◆ bufferSwitch()

template<typename desc_t, typename preference_t, typename stream_t, typename group_t>
void dx::asio::client::_device<desc_t, preference_t, stream_t, group_t>::bufferSwitch(long doubleBufferIndex, ::ASIOBool)
inlineoverrideprotectedvirtualnoexcept

the ASIO host's processing place: this device's groups tick right here, on the driver's own callback, on the half it names

Implements dx::asio::client::callbacks.

◆ bufferSwitchTimeInfo()

template<typename desc_t, typename preference_t, typename stream_t, typename group_t>
::ASIOTime* dx::asio::client::_device<desc_t, preference_t, stream_t, group_t>::bufferSwitchTimeInfo(::ASIOTime* params, long doubleBufferIndex, ::ASIOBool directProcess)
inlineoverrideprotectedvirtualnoexcept

◆ conclude()

template<typename desc_t, typename preference_t, typename stream_t, typename group_t>
void dx::asio::client::_device<desc_t, preference_t, stream_t, group_t>::conclude()
inlineoverridevirtualnoexcept

conclude notification: object will be removed. If you overwrite conclude() you also need to overwrite destructor and check if its needed to be called from there. Called only through try_conclude() - never call this directly from outside the class hierarchy.

Reimplemented from dx::object.

◆ exception()

template<typename desc_t, typename preference_t, typename stream_t, typename group_t>
void dx::asio::client::_device<desc_t, preference_t, stream_t, group_t>::exception(const dx::exception& exception, bool filtered= false) const
inlineoverridevirtualnoexcept

notification exception handler

Implements dx::object.

◆ frame()

template<typename desc_t, typename preference_t, typename stream_t, typename group_t>
virtual uint64_t dx::asio::client::_device<desc_t, preference_t, stream_t, group_t>::frame() const
inlinevirtual

◆ grouped()

virtual void dx::stream::device<dx::device<dx::guid, preference_t>, desc_t, stream_t, group_t>::grouped(group_t&)
inlineprotectedvirtualinherited

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

◆ hw_clock() [1/2]

virtual bool dx::stream::device<dx::device<dx::guid, preference_t>, desc_t, stream_t, group_t>::hw_clock() const
inlinevirtualnoexceptinherited

◆ hw_clock() [2/2]

virtual void dx::stream::device<dx::device<dx::guid, preference_t>, desc_t, stream_t, group_t>::hw_clock(abstract::event* hw_clock, uint32_t iosize)
inlinevirtualinherited

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.

Reimplemented in dx::asio::client::driver< device_t, devices >, dx::coreaudio::driver< device_t >, dx::coremidi::driver< device_t >, dx::map::driver< _device_t, holder_t >, dx::map::driver< device<> >, dx::map::driver< device_t >, dx::map::driver< device_t, dx::apartment< device_t > >, dx::midi::services::driver< device_t >, dx::proxy::device< preference_t >, dx::proxy::device< preference_t >, dx::proxy::device< dx::preference >, dx::proxy::device<>, dx::proxy::driver< device_t >, dx::proxy::driver< device_t >, dx::service::app, dx::service::app, dx::service::client::_device< desc_t, preference_t, stream_t, group_t >, dx::service::client::_device< desc, preference, stream< device< desc, preference, stream, group > >, group< device< desc, preference, stream, group > > >, dx::service::client::_device< desc_t, preference_t, stream_t< device< desc_t, preference_t, stream_t, group_t > >, group_t< device< desc_t, preference_t, stream_t, group_t > > >, dx::service::client::driver< device_t >, dx::stream::stream< device_t, dx::circular, usb::pipe< device_t > >, dx::usb::stream::_device< desc_t, preference_t, stream_t, group_t >, dx::usb::stream::_device< desc_t, dx::preference, pipe< device< desc_t, dx::preference, pipe, group > >, group< device< desc_t, dx::preference, pipe, group > > >, dx::usb::stream::_device< desc_t, preference_t, stream_t< device< desc_t, preference_t, stream_t, group_t > >, group_t< device< desc_t, preference_t, stream_t, group_t > > >, dx::virtuel::driver< device_t >, and dx::wasapi::client::driver< device_t >.

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

◆ open()

std::shared_ptr<stream_t> dx::stream::device<dx::device<dx::guid, preference_t>, desc_t, stream_t, group_t>::open(const typename desc_t::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 ()()

const struct desc_t::stream::config& dx::stream::device<dx::device<dx::guid, preference_t>, desc_t, stream_t, group_t>::operator ()(const struct desc_t::stream& stream)
inlineinherited

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

◆ operator ::ASIOCallbacks *()

template<typename desc_t, typename preference_t, typename stream_t, typename group_t>
dx::asio::client::_device<desc_t, preference_t, stream_t, group_t>::operator ::ASIOCallbacks*()
inlineprotected

◆ operator >>()

template<typename id_t, typename preference_t= dx::preference>
virtual device& dx::device<id_t, preference_t>::operator >>(std::ostream&) const
inlinevirtualinherited

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

◆ operator []()

group_t& dx::stream::device<dx::device<dx::guid, preference_t>, desc_t, stream_t, group_t>::operator [](const typename desc_t::stream::desc& stream)
inlineinherited

the stream's group, created on first use

◆ reset()

template<typename desc_t, typename preference_t, typename stream_t, typename group_t>
_device& dx::asio::client::_device<desc_t, preference_t, stream_t, group_t>::reset()
inline

◆ sampleRateDidChange()

template<typename desc_t, typename preference_t, typename stream_t, typename group_t>
void dx::asio::client::_device<desc_t, preference_t, stream_t, group_t>::sampleRateDidChange(::ASIOSampleRate sRate)
inlineoverrideprotectedvirtualnoexcept

◆ setting()

void dx::stream::device<dx::device<dx::guid, preference_t>, desc_t, stream_t, group_t>::setting(dx::stream::setting setting, uint32_t index, f_t&& f)
inlineinherited

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()

template<typename id_t, typename preference_t= dx::preference>
virtual void dx::device<id_t, preference_t>::sleep()
inlinevirtualinherited

notify system will sleep stub

◆ source()

virtual std::pair<source_t &, bool> dx::stream::device<dx::device<dx::guid, preference_t>, desc_t, stream_t, group_t>::source(const struct desc_t::stream& stream)
inlinevirtualinherited

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

◆ string()

template<typename desc_t, typename preference_t, typename stream_t, typename group_t>
std::string dx::asio::client::_device<desc_t, preference_t, stream_t, group_t>::string(uint8_t)
inline

◆ try_conclude()

bool dx::object::try_conclude()
inlinenoexceptinherited

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

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

◆ 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

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

◆ wake()

void dx::stream::device<dx::device<dx::guid, preference_t>, desc_t, stream_t, group_t>::wake()
inlineoverridevirtualinherited

Reimplemented from dx::device< id_t, preference_t >.

◆ client::group

template<typename desc_t, typename preference_t, typename stream_t, typename group_t>
template<typename>
friend class client::group
friend

the app wraps this bus's own group, so friendship has to name it, not just the device's group_t

Member Data Documentation

◆ clients

template<typename desc_t, typename preference_t, typename stream_t, typename group_t>
promoted<typename super::client_map> dx::asio::client::_device<desc_t, preference_t, stream_t, group_t>::clients
Initial value:
{
[this](dx::promoted<typename super::client_map>::lock_t&& lock, const typename super::client_map& value, const typename super::client_map&){
dx::promoted<uint32_t>::lock_t tmp(std::move(lock));
if(clients.transient)
clients.commit(std::move(tmp), value);
}}
promoted< typename super::client_map > clients
Definition dx_asio_client_device.h:228
who has the device open: process id to bundle identifier and whether that client is running it - the ...
Definition dx_device.h:58
std::unique_lock< mutex_t > lock_t
Definition dx_value.h:75

◆ clocksource

◆ configuration

promoted<typenamedesc_t::configuration>::template preference<decltype(super::preference)> dx::stream::device<dx::device<dx::guid, preference_t>, desc_t, stream_t, group_t>::configuration
inherited

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

◆ desc

template<typename desc_t, typename preference_t, typename stream_t, typename group_t>
promoted<desc_t>::template preference<preference_t> dx::asio::client::_device<desc_t, preference_t, stream_t, group_t>::desc{this->preference}

◆ driver

template<typename id_t, typename preference_t= dx::preference>
dx::driver<decltype(id), preference_t>& dx::device<id_t, preference_t>::driver
inherited

◆ group

std::map<decltype(desc_t::stream::group), group_t> dx::stream::device<dx::device<dx::guid, preference_t>, desc_t, stream_t, group_t>::group
inherited

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

◆ half

template<typename desc_t, typename preference_t, typename stream_t, typename group_t>
long dx::asio::client::_device<desc_t, preference_t, stream_t, group_t>::half{}
protected

the half of the driver's double buffers at io[..][0]: attach() starts with 0, bufferSwitch names the one the host works

◆ hosted

bool dx::stream::device<dx::device<dx::guid, preference_t>, desc_t, stream_t, group_t>::hosted
staticconstexprinherited

the transport's settings belong to another process' device: a hosted device mirrors them through its chains, it keeps no store of them

◆ hw

struct { ... } dx::stream::device<dx::device<dx::guid, preference_t>, desc_t, stream_t, group_t>::hw

◆ icon

promoted<std::string>::preference<decltype(super::preference)> dx::stream::device<dx::device<dx::guid, preference_t>, desc_t, stream_t, group_t>::icon
inherited

◆ id

template<typename id_t, typename preference_t= dx::preference>
const id_t dx::device<id_t, preference_t>::id
inherited

◆ iosize

◆ launched

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

◆ monitor

◆ preference

template<typename id_t, typename preference_t= dx::preference>
preference_t dx::device<id_t, preference_t>::preference{driver.preference[puuid]}
inherited

◆ puid

template<typename id_t, typename preference_t= dx::preference>
std::string dx::device<id_t, preference_t>::puid
inherited

persistent UID - system unique - could change with location

◆ puuid

template<typename id_t, typename preference_t= dx::preference>
std::string dx::device<id_t, preference_t>::puuid
inherited

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

◆ samplerate

◆ samplerate_server

template<typename desc_t, typename preference_t, typename stream_t, typename group_t>
decltype(super::samplerate) ::chain dx::asio::client::_device<desc_t, preference_t, stream_t, group_t>::samplerate_server
protected
Initial value:
{
[this](decltype(super::samplerate)::lock_t&& lock, uint32_t value, uint32_t current){
typename decltype(super::samplerate)::lock_t tmp(std::move(lock));
const uint32_t aligned{this->samplerate.align(value, current)};
if(aligned!= current)
dx_pass_asio(asio.driver->setSampleRate(static_cast<::ASIOSampleRate>(aligned)));
samplerate_server.server(std::move(tmp), aligned, current);
}}
the SDK driver this device is, opened off a list of its own: its id holds however the registry moves
Definition dx_asio_client_device.h:148
::AsioDriver * driver
Definition dx_asio_client_device.h:153
decltype(super::samplerate) ::chain samplerate_server
the driver runs the rate the app sets, aligned to what it can
Definition dx_asio_client_device.h:176
promoted< uint32_t >::preference< decltype(super::preference)> samplerate
Definition dx_stream_device.h:185
#define dx_pass_asio(test,...)
Definition dx_asio.h:33
unsigned int uint32_t
Definition wdm/dxd_platform.h:117

the driver runs the rate the app sets, aligned to what it can

◆ sources

std::map<decltype(desc_t::stream::target.idx()), source_t> dx::stream::device<dx::device<dx::guid, preference_t>, desc_t, stream_t, group_t>::sources
inherited

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

◆ sync_reference

promoted<structdesc_t::stream*>::template preference<decltype(super::preference), uint32_t> dx::stream::device<dx::device<dx::guid, preference_t>, desc_t, stream_t, group_t>::sync_reference
inherited

◆ this

template<typename desc_t, typename preference_t, typename stream_t, typename group_t>
class dx::asio::client::_device::asio* dx::asio::client::_device<desc_t, preference_t, stream_t, group_t>::this
protected

◆ thunk_idx

template<typename desc_t, typename preference_t, typename stream_t, typename group_t>
uint32_t dx::asio::client::_device<desc_t, preference_t, stream_t, group_t>::thunk_idx{}
protected

◆ version


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