dxd - dynax driver framework 3.0.2
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::midi::services::stream< device_t, circular_t > Class Template Reference

a stream of a Windows MIDI Services endpoint: Universal MIDI Packets through the device's connection, an ump::circular ring on this side More...

#include <dx_midi_services_device.h>

Inheritance diagram for dx::midi::services::stream< device_t, circular_t >:
Collaboration diagram for dx::midi::services::stream< device_t, circular_t >:

Public Types

typedef struct device_t::desc::stream desc
typedef event<user> event_t

Public Member Functions

stream& attach(void **[2], const std::vector<bool> &, direction::direction, const dx::stream::format &)
 the pin passes its own direction: a stream shared by two pins carries none of its own
bool claim(direction::direction direction)
 taken while there is none
virtual bool encoder(dx::stream::encoder::index::type, unsigned int, float)
void exception(const class exception& exception, bool filtered= false) const noexcept override
void flush()
virtual void initialize()
void launch() override
uint64_t lost() const noexcept
 operator ump::circular*() const noexcept
ump::circular* operator ->() const noexcept
void receive(uint64_t timestamp, uint32_t count, const uint32_t* words) noexcept
 what the service hands over, from its thread, stamped by its clock: into the ring or dropped
virtual os_result status() noexcept
 stream(device_t& device, const decltype(super::id)& id, const super::desc& descdesc)
virtual bool submit(dx::stream::encoder::index::type, unsigned int, uint8_t)
 submit encoder stage to device return true if successfully submitted; if false is returned the encode state machine will not update the stage value (i.e. if the stage can't be submitted during streaming pause), given the chance to submit the stage at start().
 ~stream() override

Public Attributes

bool anchored
 origin is set: by the tick that first finds the ring ticking, reset by the run hook
struct dx::stream::stream:: { ... }  cache
dx::stream::channel::control* control
 kernel streaming: the driver's buffer switch bookkeeping, set by attach()
event_t data [direction::directions]
 event signalising data arrival(in) or draining(out)
dx::promoted<dx::stream::format> format
 the container this stream's ring runs: class and width its participants agreed on
const decltype(desc::target.idx()) id
uint32_t latency
int64_t origin
 the ring's index at the device's sample zero: a ticking group keeps every ring's cycle from its device time and this
decltype(device_t::samplerate)& samplerate
bool ticking
 the tick's own view of this stream's session: set by the run hook once the ring stands, cleared by the halt hook before the session ends - a plain flag, the tick must never block on a promoted's transition
volatile int64_t transport
std::mutex writer
 the ring's client writers one at a time: a stream's pins write one ring, each on its own port

Protected Member Functions

virtual void alloc(size_t size, bool free= true)
virtual void free() noexcept
 overrides may release further alloc()-acquired resources (request buffers, isoc pools, shared-memory attachments) alongside circular; called only from alloc()'s own self-cleanup or the destructor - never from halt()/stop(), so everything alloc() acquires stays live for the object's full lifetime
void transmit() noexcept
 the transmit thread: whole packets off the ring into the connection

Protected Attributes

ump::circular* circular
 allocated once by initialize()/alloc(); released only by free()

Detailed Description

template<typename device_t, typename circular_t = ump::circular>
class dx::midi::services::stream< device_t, circular_t >

a stream of a Windows MIDI Services endpoint: Universal MIDI Packets through the device's connection, an ump::circular ring on this side

in*: the connection's raw callback (the device's sink) writes the words it is handed into the ring and signals data[in]; it is the service's thread, so a ring that is full drops the words and counts them. out: the transmit thread reads whole packets off the ring and hands them to the connection, at most what one transmission takes, a run due at one moment in one transmission the service schedules; a writer signals data[in] after writing, the thread signals data[out] for every run it drained.

The connection stands while a stream runs: the first stream to run opens it, the last to halt closes it. one direction of a UMP endpoint: the in side takes the service's raw callback, stamps the words with the service's clock and never stalls - a full ring drops and counts - while the out side's thread sends a run due at one moment in one raw transmission of at most maximum words

Member Typedef Documentation

◆ desc

typedef struct device_t::desc::stream dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::desc
inherited

◆ event_t

typedef event<user> dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::event_t
inherited

Constructor & Destructor Documentation

◆ stream()

template<typename device_t, typename circular_t= ump::circular>
dx::midi::services::stream<device_t, circular_t>::stream(device_t& device, const decltype(super::id)& id, const super::desc& desc)
inline

the connection taken, the out stream's transmit thread started, composed with the ring reset of the base

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

◆ ~stream()

template<typename device_t, typename circular_t= ump::circular>
dx::midi::services::stream<device_t, circular_t>::~stream()
inlineoverride
Here is the call graph for this function:

Member Function Documentation

◆ alloc()

virtual void dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::alloc(size_t size, bool free= true)
inlineprotectedvirtualinherited

◆ attach()

stream& dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::attach(void**[2], const std::vector<bool>&, direction::direction, const dx::stream<device_t, ump::circular>::format&)
inlineinherited

the pin passes its own direction: a stream shared by two pins carries none of its own

◆ claim()

bool dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::claim(direction::direction direction)
inlineinherited

taken while there is none

◆ encoder()

virtual bool dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::encoder(dx::stream<device_t, ump::circular>::encoder::index::type, unsigned int, float)
inlinevirtualinherited

◆ exception()

void dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::exception(const class exception& exception, bool filtered= false) const
inlineoverridenoexceptinherited

◆ flush()

void dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::flush()
inlineinherited

◆ free()

virtual void dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::free()
inlineprotectedvirtualnoexceptinherited

overrides may release further alloc()-acquired resources (request buffers, isoc pools, shared-memory attachments) alongside circular; called only from alloc()'s own self-cleanup or the destructor - never from halt()/stop(), so everything alloc() acquires stays live for the object's full lifetime

◆ initialize()

virtual void dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::initialize()
inlinevirtualinherited

< a shared ring takes the wider of its two directions

< this stream's own contribution: the frames its transport keeps ahead of/behind the ring

< a hosted device's ring is its host's (kernel, service, plugin) and attached as it stands - sizing it here would write the ring into a mapping of the host's making

< a fresh ring, zeroed by alloc(), takes its size here

◆ launch()

void dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::launch()
inlineoverrideinherited

◆ lost()

template<typename device_t, typename circular_t= ump::circular>
uint64_t dx::midi::services::stream<device_t, circular_t>::lost() const
inlinenoexcept
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator ump::circular *()

dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::operator ump::circular*() const
inlinenoexceptinherited

◆ operator ->()

ump::circular* dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::operator ->() const
inlinenoexceptinherited

◆ receive()

template<typename device_t, typename circular_t= ump::circular>
void dx::midi::services::stream<device_t, circular_t>::receive(uint64_t timestamp, uint32_t count, const uint32_t* words)
inlinenoexcept

what the service hands over, from its thread, stamped by its clock: into the ring or dropped

Here is the call graph for this function:

◆ status()

virtual os_result dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::status()
inlinevirtualnoexceptinherited

◆ submit()

virtual bool dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::submit(dx::stream<device_t, ump::circular>::encoder::index::type, unsigned int, uint8_t)
inlinevirtualinherited

submit encoder stage to device return true if successfully submitted; if false is returned the encode state machine will not update the stage value (i.e. if the stage can't be submitted during streaming pause), given the chance to submit the stage at start().

◆ transmit()

template<typename device_t, typename circular_t= ump::circular>
void dx::midi::services::stream<device_t, circular_t>::transmit()
inlineprotectednoexcept

the transmit thread: whole packets off the ring into the connection

Here is the call graph for this function:

Member Data Documentation

◆ anchored

bool dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::anchored
inherited

origin is set: by the tick that first finds the ring ticking, reset by the run hook

◆ cache

struct { ... } dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::cache

◆ circular

ump::circular* dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::circular
protectedinherited

allocated once by initialize()/alloc(); released only by free()

◆ control

dx::stream::channel::control* dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::control
inherited

kernel streaming: the driver's buffer switch bookkeeping, set by attach()

◆ data

event_t dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::data[direction::directions]
inherited

event signalising data arrival(in) or draining(out)

◆ format

the container this stream's ring runs: class and width its participants agreed on

A bus that negotiates it installs its own server; without one the request stands, unless the stream's configuration states its format: that one runs whatever is asked. The seed is the desc's own pin format, so a stream that nobody contradicts runs what it was declared with.

◆ id

const decltype(desc::target.idx()) dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::id
inherited

◆ latency

uint32_t dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::latency
inherited

◆ origin

int64_t dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::origin
inherited

the ring's index at the device's sample zero: a ticking group keeps every ring's cycle from its device time and this

◆ samplerate

decltype(device_t::samplerate) & dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::samplerate
inherited

◆ ticking

bool dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::ticking
inherited

the tick's own view of this stream's session: set by the run hook once the ring stands, cleared by the halt hook before the session ends - a plain flag, the tick must never block on a promoted's transition

◆ transport

volatile int64_t dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::transport
inherited

the ring's one transport while a participant holds it, of the direction the desc declares: none again at its release and at the session's halt

◆ writer

std::mutex dx::stream::stream<device_t, ump::circular, control<object<device_t>>, event<user>>::writer
inherited

the ring's client writers one at a time: a stream's pins write one ring, each on its own port


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