dxd - dynax driver framework 3.0.2
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::wasapi::client::group< device_t > Class Template Reference

WASAPI client streaming group: one endpoint's engine period thread, signalled by the audio engine through the stream's client. More...

#include <dx_wasapi_client_device.h>

Inheritance diagram for dx::wasapi::client::group< device_t >:
Collaboration diagram for dx::wasapi::client::group< device_t >:

Public Types

typedef settings<device_t>::client client
typedef dx::clock<dx::source<dx::event<dx::kernel>>> clock
 the one clock of this group, its source freely selectable
typedef dx::source<>::clock_t clock_t
typedef device_t device_t
typedef dx::source<>::event_t event_t
typedef settings_promoted<device_t, store>::type promoted
typedef settings_promoted<device_t, store>::type promoted
typedef device_t::stream_t stream_t
typedef settings<device_t>::transport transport
 the group's two sides, reached as transport::/client:: members

Public Member Functions

void conclude() noexcept
virtual void halt() noexcept
 stop and remove clock thread
realtime& initialize(const std::chrono::high_resolution_clock::duration& resolution)
void initialize(const typename clock_t::duration& duration)
 operator event_t&() noexcept
 operator event_t*() noexcept
void run() override
 the session starts on the registered streams, held until its thread ends
virtual void sync(const typename clock_t::time_point& now)
virtual source& wait(bool reset= false)

Static Public Member Functions

static std::string key(direction::direction direction, uint32_t strategy)
static std::string key(direction::direction direction, uint32_t)

Public Attributes

listener<dx::listen<std::function<void(const uint32_t &)>>> iosize_listener
 a margin defaulted by the device's iosize (a host's tick is its buffer) reloads with it
promoted safety_offset [direction::directions]
promoted safety_offset [direction::directions]
promoted<uint32_t> start
promoted<bool> started
std::map<decltype(stream_t::target.idx()), std::weak_ptr<stream_t>> streams
 shared stream ownership: central weak reference per stream, guarded by device
promoted sync_strategy
promoted sync_strategy
dx::shared::lockfree::list<typename super::stream_t> transfers
 the started streams' audio clients: a client leaves before it stops, the audio engine fails a Reset() racing a buffer call

Protected Member Functions

void discharge() noexcept override
 the thread's last act: the session's streams are released on the thread that visited them
virtual void notify() noexcept
bool self() const
 the caller is the clock's own thread: a halt from its tick ends the loop, nobody joins it
void tick() override
 this bus's own transport, ticked by the endpoint's period event: moves every started stream's period and runs the device's clock by the sync reference's advance

Protected Attributes

std::condition_variable condition_variable
device_t& device
 also the mutex serializing membership
_event_t event
std::function<void()> flush_hook
std::function<void()> halt_hook
std::vector<std::shared_ptr<stream_t>> members
 the session's streams: taken before the thread starts, released at its end - the tick visits them without a lock
dx::stream::clock::monitor* monitor
 device.monitor cached at the session's start: the tick never maps shared memory
std::mutex mutex
_clock_t::time_point objective
std::function<void()> run_hook
std::atomic<bool> running
os_result status
const struct device_t::desc_t::stream* sync_reference
 device.sync_reference cached: the tick never reads the promoted

Detailed Description

template<typename device_t>
class dx::wasapi::client::group< device_t >

WASAPI client streaming group: one endpoint's engine period thread, signalled by the audio engine through the stream's client.

Member Typedef Documentation

◆ client

◆ clock

the one clock of this group, its source freely selectable

◆ clock_t

typedef dx::source<>::clock_t dx::clock<dx::source<>>::clock_t
inherited

◆ device_t

◆ event_t

typedef dx::source<>::event_t dx::clock<dx::source<>>::event_t
inherited

◆ promoted [1/2]

typedef settings_promoted<device_t,store>::type dx::stream::settings<device_t, store>::promoted
inherited

◆ promoted [2/2]

typedef settings_promoted<device_t,store>::type dx::stream::settings<device_t, store>::promoted
inherited

◆ stream_t

typedef device_t::stream_t dx::stream::group<device_t, dx::source<dx::event<dx::kernel>>>::stream_t
inherited

◆ transport

the group's two sides, reached as transport::/client:: members

Member Function Documentation

◆ conclude()

void dx::stream::control<dx::clock<dx::source<>>>::conclude()
inlinenoexceptinherited

◆ discharge()

void dx::stream::group<device_t, dx::source<dx::event<dx::kernel>>>::discharge()
inlineoverrideprotectednoexceptinherited

the thread's last act: the session's streams are released on the thread that visited them

◆ halt()

virtual void dx::clock<dx::source<>>::halt()
inlinevirtualnoexceptinherited

stop and remove clock thread

<halting from its own tick: the loop ends once the tick returns, nobody can join here

<elect the single caller allowed to join() - concurrent halt() callers (e.g. async surprise vs. the main test thread) would otherwise both reach join() on the same thread, undefined behavior

◆ initialize() [1/2]

realtime& dx::thread::prio::realtime::initialize(const std::chrono::high_resolution_clock::duration& resolution)
inlineinherited
Todo
dx::thread::prio: replace experimental hardcoded preemption limit with real limit obtained from machine

◆ initialize() [2/2]

void dx::clock<dx::source<>>::initialize(const typename clock_t::duration& duration)
inlineinherited

◆ key() [1/2]

std::string dx::stream::settings<device_t, store>::transport::key(direction::direction direction, uint32_t strategy)
inlinestaticinherited

◆ key() [2/2]

std::string dx::stream::settings<device_t, store>::client::key(direction::direction direction, uint32_t)
inlinestaticinherited

◆ notify()

virtual void dx::clock<dx::source<>>::notify()
inlineprotectedvirtualnoexceptinherited

notify change from device requiring streaming reset

◆ operator event_t &()

dx::clock<dx::source<>>::operator event_t&()
inlinenoexceptinherited

◆ operator event_t *()

dx::clock<dx::source<>>::operator event_t*()
inlinenoexceptinherited

◆ run()

void dx::stream::group<device_t, dx::source<dx::event<dx::kernel>>>::run()
inlineoverrideinherited

the session starts on the registered streams, held until its thread ends

◆ self()

bool dx::clock<dx::source<>>::self() const
inlineprotectedinherited

the caller is the clock's own thread: a halt from its tick ends the loop, nobody joins it

◆ sync()

virtual void dx::source<_event_t, _clock_t>::sync(const typename clock_t::time_point& now)
inlinevirtualinherited

◆ tick()

template<typename device_t>
void dx::wasapi::client::group<device_t>::tick()
inlineoverrideprotected

this bus's own transport, ticked by the endpoint's period event: moves every started stream's period and runs the device's clock by the sync reference's advance

Here is the call graph for this function:

◆ wait()

virtual source& dx::source<_event_t, _clock_t>::wait(bool reset= false)
inlinevirtualinherited

Member Data Documentation

◆ condition_variable

std::condition_variable dx::source<_event_t, _clock_t>::condition_variable
protectedinherited

◆ device

also the mutex serializing membership

◆ event

_event_t dx::source<_event_t, _clock_t>::event
protectedinherited
Todo
evaluate clock::status replacement (exception?)

◆ flush_hook

std::function<void()> dx::stream::control<dx::clock<dx::source<>>>::flush_hook
protectedinherited

◆ halt_hook

std::function<void()> dx::stream::control<dx::clock<dx::source<>>>::halt_hook
protectedinherited

◆ iosize_listener

listener<dx::listen<std::function<void(const uint32_t&)>>> dx::stream::settings<device_t, store>::client::iosize_listener
inherited

a margin defaulted by the device's iosize (a host's tick is its buffer) reloads with it

◆ members

std::vector<std::shared_ptr<stream_t>> dx::stream::group<device_t, dx::source<dx::event<dx::kernel>>>::members
protectedinherited

the session's streams: taken before the thread starts, released at its end - the tick visits them without a lock

◆ monitor

device.monitor cached at the session's start: the tick never maps shared memory

◆ mutex

std::mutex dx::source<_event_t, _clock_t>::mutex
protectedinherited

◆ objective

_clock_t::time_point dx::source<_event_t, _clock_t>::objective
protectedinherited

◆ run_hook

std::function<void()> dx::stream::control<dx::clock<dx::source<>>>::run_hook
protectedinherited

◆ running

std::atomic<bool> dx::source<_event_t, _clock_t>::running
protectedinherited

◆ safety_offset [1/2]

promoted dx::stream::settings<device_t, store>::safety_offset[direction::directions]
inherited

◆ safety_offset [2/2]

promoted dx::stream::settings<device_t, store>::safety_offset[direction::directions]
inherited

◆ start

◆ started

promoted<bool> dx::stream::control<dx::clock<dx::source<>>>::started
inherited

◆ status

os_result dx::source<_event_t, _clock_t>::status
protectedinherited

◆ streams

std::map<decltype(stream_t::target.idx()), std::weak_ptr<stream_t>> dx::stream::group<device_t, dx::source<dx::event<dx::kernel>>>::streams
inherited

shared stream ownership: central weak reference per stream, guarded by device

◆ sync_reference

const struct device_t::desc_t::stream* dx::stream::group<device_t, dx::source<dx::event<dx::kernel>>>::sync_reference
protectedinherited

device.sync_reference cached: the tick never reads the promoted

◆ sync_strategy [1/2]

promoted dx::stream::settings<device_t, store>::sync_strategy
inherited

◆ sync_strategy [2/2]

promoted dx::stream::settings<device_t, store>::sync_strategy
inherited

◆ transfers

the started streams' audio clients: a client leaves before it stops, the audio engine fails a Reset() racing a buffer call


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