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

WASAPI client streaming device interface class. More...

#include <dx_wasapi_client_device.h>

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

Classes

struct  property
 beside the generic settings: the share mode this device's endpoints are opened in, which decides whether a rate other than the engine's mix format is reachable at all More...

Public Types

typedef desc_t desc_t
typedef event event_t
typedef std::conditional_t<std::is_void_v<group_t>, dx::stream::group<device>, group_t> group_t
 bus devices driving their groups' tick pass their own group type
typedef promoted<uint32_t>::template preference<decltype(super_device_t::preference)> source_t
typedef dx::stream::control<dx::device<std::string, 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 WASAPI 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>(& channel_map)[2], const dx::stream::format(& format)[2])
 the consumer's planar channel buffers in the format each direction's buffers carry
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
void exception(const dx::exception& exception, bool filtered= false) const noexcept override
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
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 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)
void wake() override
 ~_device() override

Public Attributes

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
std::map<decltype(desc_t::stream::group), group_t> group
struct dx::stream::device:: { ... }  hw
promoted<std::string>::preference<decltype(super::preference)> icon
promoted<uint32_t>::preference<decltype(super::preference)> iosize
dx::stream::device::monitor monitor
promoted<uint32_t>::preference<decltype(super::preference)> samplerate
std::map<decltype(desc_t::stream::target.idx()), source_t> sources
promoted<uint32_t> start{0}
promoted<bool> started{false}
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

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

Protected Attributes

std::function<void()> flush_hook= []{}
std::function<void()> halt_hook= []{}
std::function<void()> run_hook= []{}
decltype(super::samplerate) ::chain samplerate_server
 exclusive: every stream's client is recreated at the aligned rate, paused across it; shared: the engine's mix format rate is the only one

Detailed Description

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

WASAPI client streaming device interface class.

One audio adapter: its desc is synthesized from its active endpoints, one stream with one pin, one clock and one group per endpoint. The share mode is the device's property: shared streams in the audio engine's mix format, exclusive streams in the first sample format the endpoint takes, at every standard rate it takes it.

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::stream::control<dx::device<std::string, preference_t>>, desc_t, stream_t, group_t>::desc_t
inherited

◆ event_t

typedef event dx::stream::device<dx::stream::control<dx::device<std::string, preference_t>>, desc_t, stream_t, group_t>::event_t
inherited

◆ group_t

typedef std::conditional_t<std::is_void_v<group_t>, dx::stream::group<device>, group_t> dx::stream::device<dx::stream::control<dx::device<std::string, preference_t>>, desc_t, stream_t, group_t>::group_t
inherited

bus devices driving their groups' tick pass their own group type

◆ source_t

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

◆ super_device_t

typedef dx::stream::control<dx::device<std::string, preference_t>> dx::stream::device<dx::stream::control<dx::device<std::string, 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::wasapi::client::_device<desc_t, preference_t, stream_t, group_t>::_device(decltype(super::driver)& driver, decltype(super::id)& id)
inline

the WASAPI stream device class constructor

< the endpoints follow the first one's rate; a shared mode engine converts its own mix format to it

< only a rate every endpoint takes can be the domain's - in shared mode the engine converts instead, so the reference's rate stands

◆ ~_device()

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

Member Function Documentation

◆ align()

virtual desc_t::configuration dx::stream::device<dx::stream::control<dx::device<std::string, 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

◆ attach()

void dx::stream::device<dx::stream::control<dx::device<std::string, preference_t>>, desc_t, stream_t, group_t>::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

◆ budget()

virtual uint64_t dx::stream::device<dx::stream::control<dx::device<std::string, 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

◆ conclude()

void dx::stream::device<dx::stream::control<dx::device<std::string, preference_t>>, desc_t, stream_t, group_t>::conclude()
inlineoverridenoexceptinherited

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

◆ exception()

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

◆ frame()

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

◆ grouped()

virtual void dx::stream::device<dx::stream::control<dx::device<std::string, 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::stream::control<dx::device<std::string, preference_t>>, desc_t, stream_t, group_t>::hw_clock() const
inlinevirtualnoexceptinherited

◆ hw_clock() [2/2]

virtual void dx::stream::device<dx::stream::control<dx::device<std::string, 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

◆ open()

std::shared_ptr<stream_t> dx::stream::device<dx::stream::control<dx::device<std::string, 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::stream::control<dx::device<std::string, 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 []()

group_t& dx::stream::device<dx::stream::control<dx::device<std::string, 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::wasapi::client::_device<desc_t, preference_t, stream_t, group_t>::reset()
inline

◆ setting()

void dx::stream::device<dx::stream::control<dx::device<std::string, 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

◆ source()

virtual std::pair<source_t &, bool> dx::stream::device<dx::stream::control<dx::device<std::string, 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::wasapi::client::_device<desc_t, preference_t, stream_t, group_t>::string(uint8_t)
inline

◆ wake()

void dx::stream::device<dx::stream::control<dx::device<std::string, preference_t>>, desc_t, stream_t, group_t>::wake()
inlineoverrideinherited

Member Data Documentation

◆ clocksource

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

◆ configuration

promoted<typenamedesc_t::configuration>::template preference<decltype(super::preference)> dx::stream::device<dx::stream::control<dx::device<std::string, 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

◆ flush_hook

template<typename object_t>
std::function<void()> dx::stream::control<object_t>::flush_hook= []{}
protectedinherited

◆ group

std::map<decltype(desc_t::stream::group), group_t> dx::stream::device<dx::stream::control<dx::device<std::string, 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

◆ halt_hook

template<typename object_t>
std::function<void()> dx::stream::control<object_t>::halt_hook= []{}
protectedinherited

◆ hosted

bool dx::stream::device<dx::stream::control<dx::device<std::string, 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::stream::control<dx::device<std::string, preference_t>>, desc_t, stream_t, group_t>::hw

◆ icon

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

◆ iosize

◆ monitor

◆ run_hook

template<typename object_t>
std::function<void()> dx::stream::control<object_t>::run_hook= []{}
protectedinherited

◆ samplerate

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

◆ samplerate_server

template<typename desc_t, typename preference_t, typename stream_t, typename group_t>
decltype(super::samplerate) ::chain dx::wasapi::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(this->preference[property::mode](0u)== mode::exclusive && (!this->samplerate.initialized || aligned!= current))
for(auto& stream: streams())
if(stream->launched){
typename stream_t::pause pause{*stream};
stream->open(aligned);
}
samplerate_server.server(std::move(tmp), aligned, current);
}}
a session held open across a change that needs it stopped: the counted shares are taken out for the s...
Definition dx_stream_control.h:118
promoted< uint32_t >::preference< decltype(super::preference)> samplerate
Definition dx_stream_device.h:185
decltype(super::samplerate) ::chain samplerate_server
exclusive: every stream's client is recreated at the aligned rate, paused across it; shared: the engi...
Definition dx_wasapi_client_device.h:297
WASAPI client stream: one endpoint's audio client, moved by its group one engine period per tick betw...
Definition dx_wasapi_client_device.h:98
void open(uint32_t samplerate)
(re)creates the endpoint's audio client in the stream's format at the device's rate - shared through ...
Definition dx_wasapi_client_device.h:200
@ exclusive
Definition dx_wasapi_client_device.h:48
key_value_tree< registry > preference
hierarchical preference store over the Windows registry see dx::key_value_tree (dx_key_value_tree....
Definition dx_registry.h:496
static constexpr auto mode
Definition dx_wasapi_client_device.h:291
unsigned int uint32_t
Definition wdm/dxd_platform.h:117

exclusive: every stream's client is recreated at the aligned rate, paused across it; shared: the engine's mix format rate is the only one

◆ sources

std::map<decltype(desc_t::stream::target.idx()), source_t> dx::stream::device<dx::stream::control<dx::device<std::string, 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

◆ start

template<typename object_t>
promoted<uint32_t> dx::stream::control<object_t>::start{0}
inherited

◆ started

template<typename object_t>
promoted<bool> dx::stream::control<object_t>::started{false}
inherited

◆ sync_reference

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

◆ version


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