dxd - dynax driver framework 3.0.0d222
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::asio::driver< device_t, driver_t > Class Template Reference

#include <dx_asio_driver.h>

Inheritance diagram for dx::asio::driver< device_t, driver_t >:
Collaboration diagram for dx::asio::driver< device_t, driver_t >:

Classes

class  pause
struct  property

Public Member Functions

 driver (const super::match &matching_ids, const char *product_id, ::IUnknown *unknown, ::HRESULT *result)

Static Public Member Functions

static int factory (const std::string &product_id, ::LPFNNewCOMObject create)

Protected Member Functions

void arrived (device_t &device) override
::ASIOError canSampleRate (::ASIOSampleRate samplerate) noexcept override
::ASIOError controlPanel () noexcept override
::ASIOError createBuffers (::ASIOBufferInfo *info, long channels, long iosize, ::ASIOCallbacks *callbacks) noexcept override
std::shared_ptr< device_t > device () noexcept
 the device a host call works on: a strong reference under the driver's map lock, so it stands for the whole call
::ASIOError disposeBuffers () noexcept override
void exception (const exception &exception, bool filtered=false) const noexcept override
::ASIOError future (long selector, void *) noexcept override
::ASIOError getBufferSize (long *min, long *max, long *preferred, long *granularity) noexcept override
::ASIOError getChannelInfo (::ASIOChannelInfo *info) noexcept override
::ASIOError getChannels (long *ins, long *outs) noexcept override
::ASIOError getClockSources (::ASIOClockSource *clocks, long *sources) noexcept override
void getDriverName (char *name) noexcept override
long getDriverVersion () noexcept override
void getErrorMessage (char *string) noexcept override
::ASIOError getLatencies (long *rx, long *tx) noexcept override
::ASIOError getSamplePosition (::ASIOSamples *samples, ::ASIOTimeStamp *timestamp) noexcept override
 Inquires the sample position/time stamp pair.
::ASIOError getSampleRate (::ASIOSampleRate *samplerate) noexcept override
::ASIOBool init (void *) noexcept override
DECLARE_IUNKNOWN ::HRESULT STDMETHODCALLTYPE NonDelegatingQueryInterface (const ::IID &riid, void **object) noexcept override
void notify () noexcept
void notify (unsigned int samplerate) noexcept
::ASIOError outputReady () noexcept override
void overload () noexcept
void process (int64_t timestamp) noexcept
void removed (device_t &device) noexcept override
 the engine goes with the device's own conclude(); this driver keeps the device until the host releases the COM object, so no host call can meet a released one
::ASIOError setClockSource (long index) noexcept override
::ASIOError setSampleRate (::ASIOSampleRate samplerate) noexcept override
void sleep () override
::ASIOError start () noexcept override
::ASIOError stop () noexcept override
void wake () override
 ~driver () noexcept
 concludes while this driver still stands: its own listeners reach its overrides, and those are gone once a base destructor runs

Protected Attributes

::ASIOCallbacks * callbacks {}
redirect::file cerr
redirect::file clog
uint32_t iosize {}
 the host session's buffer size, kept plain: the realtime path reads no promoted
std::string log_path
int64_t mmoffset {}
 the process' high precision timestamps calibrated to MMSystem
bool paused {}
uint64_t sample_position {}
 the ASIOTime sample counter this object hands the host
os_result status {not_initialized}
bool time_code {}
 indicate to generate time code
bool time_info {}
 indicate ASIO host supports time info

Detailed Description

template<typename device_t, typename driver_t>
class dx::asio::driver< device_t, driver_t >
Todo
strongly consider getting rid of Bills COM macro orgy https://github.com/AlexBAV/moderncom

Constructor & Destructor Documentation

◆ ~driver()

template<typename device_t, typename driver_t>
dx::asio::driver< device_t, driver_t >::~driver ( )
inlineprotectednoexcept

concludes while this driver still stands: its own listeners reach its overrides, and those are gone once a base destructor runs

< ends the session: the pins stop and the group's tick thread is joined, so no tick can reach this object afterwards

Here is the call graph for this function:

◆ driver()

template<typename device_t, typename driver_t>
dx::asio::driver< device_t, driver_t >::driver ( const super::match & matching_ids,
const char * product_id,
::IUnknown * unknown,
::HRESULT * result )
inline
Here is the caller graph for this function:

Member Function Documentation

◆ arrived()

template<typename device_t, typename driver_t>
void dx::asio::driver< device_t, driver_t >::arrived ( device_t & device)
inlineoverrideprotected

< no audio endpoints of its own: not the device this driver streams

< this driver streams the one device it bound first

Here is the call graph for this function:

◆ canSampleRate()

template<typename device_t, typename driver_t>
::ASIOError dx::asio::driver< device_t, driver_t >::canSampleRate ( ::ASIOSampleRate samplerate)
inlineoverrideprotectednoexcept
Here is the call graph for this function:

◆ controlPanel()

template<typename device_t, typename driver_t>
::ASIOError dx::asio::driver< device_t, driver_t >::controlPanel ( )
inlineoverrideprotectednoexcept

◆ createBuffers()

template<typename device_t, typename driver_t>
::ASIOError dx::asio::driver< device_t, driver_t >::createBuffers ( ::ASIOBufferInfo * info,
long channels,
long iosize,
::ASIOCallbacks * callbacks )
inlineoverrideprotectednoexcept
Here is the call graph for this function:

◆ device()

template<typename device_t, typename driver_t>
std::shared_ptr< device_t > dx::asio::driver< device_t, driver_t >::device ( )
inlineprotectednoexcept

the device a host call works on: a strong reference under the driver's map lock, so it stands for the whole call

Here is the caller graph for this function:

◆ disposeBuffers()

template<typename device_t, typename driver_t>
::ASIOError dx::asio::driver< device_t, driver_t >::disposeBuffers ( )
inlineoverrideprotectednoexcept

< the host disposes what it never created: a driver that saw no device carries no group

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

◆ exception()

template<typename device_t, typename driver_t>
void dx::asio::driver< device_t, driver_t >::exception ( const exception & exception,
bool filtered = false ) const
inlineoverrideprotectednoexcept
Here is the call graph for this function:
Here is the caller graph for this function:

◆ factory()

template<typename device_t, typename driver_t>
int dx::asio::driver< device_t, driver_t >::factory ( const std::string & product_id,
::LPFNNewCOMObject create )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ future()

template<typename device_t, typename driver_t>
::ASIOError dx::asio::driver< device_t, driver_t >::future ( long selector,
void *  )
inlineoverrideprotectednoexcept

◆ getBufferSize()

template<typename device_t, typename driver_t>
::ASIOError dx::asio::driver< device_t, driver_t >::getBufferSize ( long * min,
long * max,
long * preferred,
long * granularity )
inlineoverrideprotectednoexcept

todo set limits for Windows clock if no ASIO clock IRQ is available or if HW clock is already in use

Here is the call graph for this function:

◆ getChannelInfo()

template<typename device_t, typename driver_t>
::ASIOError dx::asio::driver< device_t, driver_t >::getChannelInfo ( ::ASIOChannelInfo * info)
inlineoverrideprotectednoexcept
Here is the call graph for this function:

◆ getChannels()

template<typename device_t, typename driver_t>
::ASIOError dx::asio::driver< device_t, driver_t >::getChannels ( long * ins,
long * outs )
inlineoverrideprotectednoexcept
Here is the call graph for this function:

◆ getClockSources()

template<typename device_t, typename driver_t>
::ASIOError dx::asio::driver< device_t, driver_t >::getClockSources ( ::ASIOClockSource * clocks,
long * sources )
inlineoverrideprotectednoexcept
Here is the call graph for this function:

◆ getDriverName()

template<typename device_t, typename driver_t>
void dx::asio::driver< device_t, driver_t >::getDriverName ( char * name)
inlineoverrideprotectednoexcept
Here is the call graph for this function:

◆ getDriverVersion()

template<typename device_t, typename driver_t>
long dx::asio::driver< device_t, driver_t >::getDriverVersion ( )
inlineoverrideprotectednoexcept

◆ getErrorMessage()

template<typename device_t, typename driver_t>
void dx::asio::driver< device_t, driver_t >::getErrorMessage ( char * string)
inlineoverrideprotectednoexcept
Here is the call graph for this function:

◆ getLatencies()

template<typename device_t, typename driver_t>
::ASIOError dx::asio::driver< device_t, driver_t >::getLatencies ( long * rx,
long * tx )
inlineoverrideprotectednoexcept
Here is the call graph for this function:

◆ getSamplePosition()

template<typename device_t, typename driver_t>
::ASIOError dx::asio::driver< device_t, driver_t >::getSamplePosition ( ::ASIOSamples * samples,
::ASIOTimeStamp * timestamp )
inlineoverrideprotectednoexcept

Inquires the sample position/time stamp pair.

In order to be able to synchronize properly, the sample position / time stamp pair must refer to the current block, that is, the engine will call ASIOGetSamplePosition() in its bufferSwitch() callback and expect the time for the first sample of the current block. Thus, when requested in the very first bufferSwitch after ASIOStart(), the sample position should be zero, and the time stamp should refer to the very time where the stream was started. It also means that the sample position must be block aligned. The driver must ensure proper interpolation if the system time can not be determined for the block position. The driver is responsible for precise time stamps as it usually has most direct access to lower level resources. Proper behavior of ASIOGetSamplePosition() and ASIOGetLatencies() are essential for precise media synchronization!

Exceptions
Ifno input/output is present, ASE_NotPresent will be returned. If there is no clock, ASE_SPNotAdvancing will be returned.
Parameters
sampleswill hold the sample position on return. The sample position is reset to zero when ASIOStart() gets called.
timestampwill hold the system time on return when the sample position was latched
Here is the call graph for this function:

◆ getSampleRate()

template<typename device_t, typename driver_t>
::ASIOError dx::asio::driver< device_t, driver_t >::getSampleRate ( ::ASIOSampleRate * samplerate)
inlineoverrideprotectednoexcept
Here is the call graph for this function:

◆ init()

template<typename device_t, typename driver_t>
::ASIOBool dx::asio::driver< device_t, driver_t >::init ( void * )
inlineoverrideprotectednoexcept
Here is the call graph for this function:

◆ NonDelegatingQueryInterface()

template<typename device_t, typename driver_t>
DECLARE_IUNKNOWN ::HRESULT STDMETHODCALLTYPE dx::asio::driver< device_t, driver_t >::NonDelegatingQueryInterface ( const ::IID & riid,
void ** object )
inlineoverrideprotectednoexcept
Here is the call graph for this function:

◆ notify() [1/2]

template<typename device_t, typename driver_t>
void dx::asio::driver< device_t, driver_t >::notify ( )
inlineprotectednoexcept
Here is the caller graph for this function:

◆ notify() [2/2]

template<typename device_t, typename driver_t>
void dx::asio::driver< device_t, driver_t >::notify ( unsigned int samplerate)
inlineprotectednoexcept

◆ outputReady()

template<typename device_t, typename driver_t>
::ASIOError dx::asio::driver< device_t, driver_t >::outputReady ( )
inlineoverrideprotectednoexcept

◆ overload()

template<typename device_t, typename driver_t>
void dx::asio::driver< device_t, driver_t >::overload ( )
inlineprotectednoexcept
Here is the caller graph for this function:

◆ process()

template<typename device_t, typename driver_t>
void dx::asio::driver< device_t, driver_t >::process ( int64_t timestamp)
inlineprotectednoexcept
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removed()

template<typename device_t, typename driver_t>
void dx::asio::driver< device_t, driver_t >::removed ( device_t & device)
inlineoverrideprotectednoexcept

the engine goes with the device's own conclude(); this driver keeps the device until the host releases the COM object, so no host call can meet a released one

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

◆ setClockSource()

template<typename device_t, typename driver_t>
::ASIOError dx::asio::driver< device_t, driver_t >::setClockSource ( long index)
inlineoverrideprotectednoexcept

◆ setSampleRate()

template<typename device_t, typename driver_t>
::ASIOError dx::asio::driver< device_t, driver_t >::setSampleRate ( ::ASIOSampleRate samplerate)
inlineoverrideprotectednoexcept

< outside the device's lock: it reaches the host through notify()

Here is the call graph for this function:

◆ sleep()

template<typename device_t, typename driver_t>
void dx::asio::driver< device_t, driver_t >::sleep ( )
inlineoverrideprotected
Here is the call graph for this function:

◆ start()

template<typename device_t, typename driver_t>
::ASIOError dx::asio::driver< device_t, driver_t >::start ( )
inlineoverrideprotectednoexcept

< starting this device's pins is what starts their group's streaming session

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

◆ stop()

template<typename device_t, typename driver_t>
::ASIOError dx::asio::driver< device_t, driver_t >::stop ( )
inlineoverrideprotectednoexcept
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wake()

template<typename device_t, typename driver_t>
void dx::asio::driver< device_t, driver_t >::wake ( )
inlineoverrideprotected
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ callbacks

template<typename device_t, typename driver_t>
::ASIOCallbacks* dx::asio::driver< device_t, driver_t >::callbacks {}
protected

◆ cerr

template<typename device_t, typename driver_t>
redirect::file dx::asio::driver< device_t, driver_t >::cerr
protected

◆ clog

template<typename device_t, typename driver_t>
redirect::file dx::asio::driver< device_t, driver_t >::clog
protected

◆ iosize

template<typename device_t, typename driver_t>
uint32_t dx::asio::driver< device_t, driver_t >::iosize {}
protected

the host session's buffer size, kept plain: the realtime path reads no promoted

◆ log_path

template<typename device_t, typename driver_t>
std::string dx::asio::driver< device_t, driver_t >::log_path
protected

◆ mmoffset

template<typename device_t, typename driver_t>
int64_t dx::asio::driver< device_t, driver_t >::mmoffset {}
protected

the process' high precision timestamps calibrated to MMSystem

◆ paused

template<typename device_t, typename driver_t>
bool dx::asio::driver< device_t, driver_t >::paused {}
protected

◆ sample_position

template<typename device_t, typename driver_t>
uint64_t dx::asio::driver< device_t, driver_t >::sample_position {}
protected

the ASIOTime sample counter this object hands the host

◆ status

template<typename device_t, typename driver_t>
os_result dx::asio::driver< device_t, driver_t >::status {not_initialized}
protected

◆ time_code

template<typename device_t, typename driver_t>
bool dx::asio::driver< device_t, driver_t >::time_code {}
protected

indicate to generate time code

◆ time_info

template<typename device_t, typename driver_t>
bool dx::asio::driver< device_t, driver_t >::time_info {}
protected

indicate ASIO host supports time info


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

(c) copyright 2009 dynamic acoustics e.U. generated on

a closed source license may be obtained by requesting a written permission from dynamic acoustics e.U.
however - governmental use generally and military use especially is strictly prohibited though.