dxd - dynax driver framework 2.6.0d201
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::coreaudio::driver< device_t > Class Template Referenceabstract

#include <dx_coreaudio_driver.h>

+ Inheritance diagram for dx::coreaudio::driver< device_t >:
+ Collaboration diagram for dx::coreaudio::driver< device_t >:

Public Member Functions

virtual DX_PRAGMA_IGNORE_RETURN_VALUE_END bool boot () try
 
 catch (...)
 
DX_PRAGMA_IGNORE_RETURN_VALUE_BEGIN catch (const dx::exception &__dx_exception)
 
 catch (const std::exception &__std_exception)
 
DX_PRAGMA_IGNORE_RETURN_VALUE_END bool contains (const std::string &id) noexcept
 
virtual drivercreate (const std::string &id, const typename super::device_t::desc_t &desc)
 
DX_PRAGMA_IGNORE_RETURN_VALUE_BEGIN virtual DX_PRAGMA_IGNORE_RETURN_VALUE_END driverdestroy (const std::string &id)
 
DX_PRAGMA_IGNORE_RETURN_VALUE_END void exception (const class exception &exception, bool filtered=false) const noexcept override try
 notification exception handler
 
virtual void exception (const exception &exception, bool filtered=false) const noexcept=0
 notification exception handler
 
void info (std::ostream &os) noexcept override
 
std::shared_ptr< typename super::device_toperator[] (const std::string &id) try
 
std::shared_ptr< typename super::device_twait (const std::string &id) noexcept
 

Public Attributes

elements
 STL member.
 
keys
 STL member.
 
bool launched {}
 
log log
 
decltype(_device_t::preference) preference
 
const char * product_id
 
uint32_t version
 

Protected Types

typedef decltype(device_t::id) device_id_t
 

Protected Member Functions

virtual void add (const decltype(_device_t::id) &)=0
 adds a new device to the device list
 
void add (const device_id_t &device_id) override try
 adds a new device to the device list
 
virtual void arrived ()
 notify device arrivals completed stub
 
void arrived (super::device_t &device) override try
 
 catch (...)
 
DX_PRAGMA_IGNORE_RETURN_VALUE_BEGIN catch (const dx::exception &__dx_exception)
 
 catch (const std::exception &__std_exception)
 
DX_PRAGMA_IGNORE_RETURN_VALUE_END void clear () noexcept try
 replaces std::map::clear to call virtual notification methods
 
DX_PRAGMA_IGNORE_RETURN_VALUE_END void conclude () noexcept override try
 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.
 
 driver (const match &matching_ids, const char *product_id, dx::log log={})
 the driver interface class constructor
 
 dx_catchall_handler (this,) virtual driver &operator<<(std
 restores device settings
 
 dx_catchall_rethrow () bool boot() override try
 
 dx_catchall_rethrow () void launch() override try
 
DX_PRAGMA_IGNORE_RETURN_VALUE_END void launch () override try
 launch notification: object mounted and ready to use
 
virtual void notify (::AudioObjectID id, const property::addresses &addresses) try
 
 operator bool () const noexcept override
 
virtual driveroperator<< (const char *file)
 
dx::log operator= (const dx::log &log) override try
 
virtual driveroperator>> (const char *file) const
 
dx_catchall_rethrow() super &create(const std superoperator>> (std::ostream &ostream) const override
 restores device tree
 
virtual void remove (const decltype(_device_t::id) &)=0
 finds and removes a device from the device list
 
DX_PRAGMA_IGNORE_RETURN_VALUE_END void remove (const device_id_t &device_id) override try
 finds and removes a device from the device list
 
virtual void removed () noexcept
 notify device removals completed stub
 
virtual void removed (device_t &) noexcept
 notify specific device removal stub
 
virtual void scan () try
 
bool shutdown () override try
 client driver::shutdown/boot(): override to shutdown/boot host driver
 
void sleep () override
 < notify system will sleep
 
void wake () override
 

Protected Attributes

dx_catchall_rethrow() public promoted::property<::AudioObjectID > connection_id
 
dx_catchall_rethrow() std std::map<::AudioObjectPropertySelector, property::listenlisten
 

Member Typedef Documentation

◆ device_id_t

typedef decltype(device_t::id) dx::map::driver< device_t >::device_id_t
protectedinherited

Constructor & Destructor Documentation

◆ driver()

template<class device_t >
dx::coreaudio::driver< device_t >::driver ( const match & matching_ids,
const char * product_id,
dx::log log = {} )
inlineprotected

the driver interface class constructor

Todo
handle kext blocking https://developer.apple.com/library/content/technotes/tn2459/_index.html
Parameters
matching_idsthe matching dictionaries identifying the driver interface
product_iddrivers bundle ID

Member Function Documentation

◆ add() [1/2]

virtual void dx::driver< decltype(_device_t::id) , decltype(_device_t::preference) >::add ( const decltype(_device_t::id) & )
protectedpure virtualinherited

adds a new device to the device list

Exceptions
dx::exception

◆ add() [2/2]

void dx::map::driver< device_t >::add ( const device_id_t & device_id)
inlineoverrideprotectedinherited

adds a new device to the device list

Exceptions
dx::exception

◆ arrived() [1/2]

◆ arrived() [2/2]

void dx::stream::driver< map::driver< device_t > >::arrived ( super::device_t & )
inlineoverrideprotectedvirtualinherited

Reimplemented from dx::map::driver< device_t >.

◆ boot()

virtual DX_PRAGMA_IGNORE_RETURN_VALUE_END bool dx::driver< decltype(_device_t::id) , decltype(_device_t::preference) >::boot ( )
inlinevirtualinherited

◆ catch() [1/6]

dx::stream::driver< map::driver< device_t > >::catch ( ...)
inlineprotectedinherited

◆ catch() [2/6]

dx::stream::driver< map::driver< device_t > >::catch ( ...)
inlineinherited

◆ catch() [3/6]

DX_PRAGMA_IGNORE_RETURN_VALUE_BEGIN dx::stream::driver< map::driver< device_t > >::catch ( const dx::exception & __dx_exception)
inlineprotectedinherited

◆ catch() [4/6]

DX_PRAGMA_IGNORE_RETURN_VALUE_BEGIN dx::stream::driver< map::driver< device_t > >::catch ( const dx::exception & __dx_exception)
inlineinherited

◆ catch() [5/6]

dx::stream::driver< map::driver< device_t > >::catch ( const std::exception & __std_exception)
inlineprotectedinherited

◆ catch() [6/6]

dx::stream::driver< map::driver< device_t > >::catch ( const std::exception & __std_exception)
inlineinherited

◆ clear()

DX_PRAGMA_IGNORE_RETURN_VALUE_END void dx::map::driver< device_t >::clear ( )
inlineprotectednoexceptinherited

replaces std::map::clear to call virtual notification methods

◆ conclude()

DX_PRAGMA_IGNORE_RETURN_VALUE_END void dx::map::driver< device_t >::conclude ( )
inlineoverrideprotectedvirtualnoexceptinherited

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.

Reimplemented from dx::object.

Reimplemented in dx::stream::engine< dx::test::device< super_device_t >, audio_pin_t, dx::virtuel::driver< dx::test::device< super_device_t > >, int32_t >.

◆ contains()

DX_PRAGMA_IGNORE_RETURN_VALUE_END bool dx::stream::driver< map::driver< device_t > >::contains ( const std::string & id)
inlinenoexceptinherited

◆ create()

virtual driver & dx::stream::driver< map::driver< device_t > >::create ( const std::string & id,
const typename super::device_t::desc_t & desc )
inlinevirtualinherited

◆ destroy()

DX_PRAGMA_IGNORE_RETURN_VALUE_BEGIN virtual DX_PRAGMA_IGNORE_RETURN_VALUE_END driver & dx::stream::driver< map::driver< device_t > >::destroy ( const std::string & id)
inlinevirtualinherited

◆ dx_catchall_handler()

dx::map::driver< device_t >::dx_catchall_handler ( this ) &
inlineprotectedinherited

restores device settings

◆ dx_catchall_rethrow() [1/2]

template<class device_t >
dx::coreaudio::driver< device_t >::dx_catchall_rethrow ( )
inlineoverrideprotected

◆ dx_catchall_rethrow() [2/2]

template<class device_t >
dx::coreaudio::driver< device_t >::dx_catchall_rethrow ( )
inlineoverrideprotected

◆ exception() [1/2]

DX_PRAGMA_IGNORE_RETURN_VALUE_END void dx::driver< decltype(_device_t::id) , decltype(_device_t::preference) >::exception ( const class exception & exception,
bool filtered = false ) const
inlineoverridenoexceptinherited

notification exception handler

◆ exception() [2/2]

◆ info()

void dx::stream::driver< map::driver< device_t > >::info ( std::ostream & os)
inlineoverridevirtualnoexceptinherited

◆ launch()

DX_PRAGMA_IGNORE_RETURN_VALUE_END void dx::map::driver< device_t >::launch ( )
inlineoverrideprotectedvirtualinherited

launch notification: object mounted and ready to use

Reimplemented from dx::object.

Reimplemented in dx::asio::client::driver< device_t >, dx::virtuel::driver< device_t >, and dx::service::client::driver< device_t >.

◆ notify()

template<class device_t >
virtual void dx::coreaudio::driver< device_t >::notify ( ::AudioObjectID id,
const property::addresses & addresses )
inlineprotectedvirtual
Todo
coreaudio::driver::notify(): evaluate other synchronization options
+ Here is the call graph for this function:

◆ operator bool()

template<class device_t >
dx::coreaudio::driver< device_t >::operator bool ( ) const
inlineoverrideprotectednoexcept

◆ operator<<()

virtual driver & dx::map::driver< device_t >::operator<< ( const char * file)
inlineprotectedvirtualinherited

◆ operator=()

template<class device_t >
dx::log dx::coreaudio::driver< device_t >::operator= ( const dx::log & log)
inlineoverrideprotectedvirtual

Reimplemented from dx::map::driver< device_t >.

◆ operator>>() [1/2]

virtual driver & dx::map::driver< device_t >::operator>> ( const char * file) const
inlineprotectedvirtualinherited

◆ operator>>() [2/2]

template<class device_t >
dx_catchall_rethrow() super &create(const std super & dx::coreaudio::driver< device_t >::operator>> ( std::ostream & ostream) const
inlineoverrideprotectedvirtual

restores device tree

saves device tree

Reimplemented from dx::map::driver< device_t >.

+ Here is the call graph for this function:

◆ operator[]()

std::shared_ptr< typename super::device_t > dx::stream::driver< map::driver< device_t > >::operator[] ( const std::string & id)
inlineinherited

◆ remove() [1/2]

virtual void dx::driver< decltype(_device_t::id) , decltype(_device_t::preference) >::remove ( const decltype(_device_t::id) & )
protectedpure virtualinherited

finds and removes a device from the device list

◆ remove() [2/2]

DX_PRAGMA_IGNORE_RETURN_VALUE_END void dx::map::driver< device_t >::remove ( const device_id_t & device_id)
inlineoverrideprotectedinherited

finds and removes a device from the device list

Exceptions
dx::exception

◆ removed() [1/2]

virtual void dx::driver< device_id_t, preference_t >::removed ( )
inlineprotectedvirtualnoexceptinherited

notify device removals completed stub

Reimplemented from dx::driver< decltype(_device_t::id), decltype(_device_t::preference)>.

◆ removed() [2/2]

virtual void dx::map::driver< device_t >::removed ( device_t & )
inlineprotectedvirtualnoexceptinherited

notify specific device removal stub

◆ scan()

template<class device_t >
virtual void dx::coreaudio::driver< device_t >::scan ( )
inlineprotectedvirtual
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shutdown()

template<class device_t >
bool dx::coreaudio::driver< device_t >::shutdown ( )
inlineoverrideprotectedvirtual

client driver::shutdown/boot(): override to shutdown/boot host driver

Reimplemented from dx::driver< decltype(_device_t::id), decltype(_device_t::preference)>.

◆ sleep()

void dx::map::driver< device_t >::sleep ( )
inlineoverrideprotectedinherited

< notify system will sleep

notify system wake completed stub

◆ wait()

std::shared_ptr< typename super::device_t > dx::stream::driver< map::driver< device_t > >::wait ( const std::string & id)
inlinenoexceptinherited

◆ wake()

void dx::map::driver< device_t >::wake ( )
inlineoverrideprotectedinherited

Member Data Documentation

◆ connection_id

template<class device_t >
dx_catchall_rethrow () public promoted::property<::AudioObjectID> dx::coreaudio::driver< device_t >::connection_id
protected
Initial value:
{::kAudioObjectSystemObject,
{.mSelector= ::kAudioHardwarePropertyTranslateBundleIDToPlugIn},
[this](::AudioObjectID value){
if(value){
this->version= cf::type<uint32_t>{static_cast<::CFNumberRef>(property)};
listen.insert({property::plugin::log, {value, {.mSelector= property::plugin::log},
std::bind(&driver::notify, this, std::placeholders::_1, std::placeholders::_2)}});
try{
static_cast<::CFDictionaryRef>(
}else
if(this->launched){
this->conclude();
launch();
}},
{.data= static_cast<const void*>(static_cast<::CFStringRef>(*this)), .size= sizeof(::CFStringRef)},
}
key value pair store
Definition cf_dictionary.h:49
Definition cf_reference.h:35
dx_catchall_rethrow() std std::map<::AudioObjectPropertySelector, property::listen > listen
Definition dx_coreaudio_driver.h:95
virtual void notify(::AudioObjectID id, const property::addresses &addresses) try
Definition dx_coreaudio_driver.h:73
coreaudio::property
Definition dx_coreaudio_property.h:103
DX_PRAGMA_IGNORE_RETURN_VALUE_END void conclude() noexcept override try
Definition dx_driver.h:354
DX_PRAGMA_IGNORE_RETURN_VALUE_END void launch() override try
Definition dx_driver.h:347
bool launched
Definition dx_common.h:285
uint64_t size() const
DriverKit memory size.
Definition driverkit/dxd_memory.h:131
#define dx_catchall_handler(object, inject,...)
Definition dx_exception.h:112
static constexpr auto log
Definition dx_coreaudio_property.h:145
static constexpr auto version
Definition dx_coreaudio_property.h:142

◆ elements

T std::map< K, T >::elements
inherited

STL member.

◆ keys

K std::map< K, T >::keys
inherited

STL member.

◆ launched

bool dx::object::launched {}
inherited

◆ listen

template<class device_t >
dx_catchall_rethrow () std std::map<::AudioObjectPropertySelector, property::listen> dx::coreaudio::driver< device_t >::listen
protected
Initial value:
{
{::kAudioHardwarePropertyPlugInList,
{kAudioObjectSystemObject, {.mSelector= ::kAudioHardwarePropertyPlugInList},
std::bind(&driver::notify, this, std::placeholders::_1, std::placeholders::_2)}},
{::kAudioHardwarePropertyDevices,
{::kAudioObjectSystemObject, {.mSelector= ::kAudioHardwarePropertyDevices},
std::bind(&driver::notify, this, std::placeholders::_1, std::placeholders::_2)}},
}

◆ log

log dx::driver< decltype(_device_t::id) , decltype(_device_t::preference) >::log
inherited

◆ preference

decltype(_device_t::preference) dx::driver< decltype(_device_t::id) , decltype(_device_t::preference) >::preference
inherited

◆ product_id

const char* dx::driver< decltype(_device_t::id) , decltype(_device_t::preference) >::product_id
inherited

◆ version

uint32_t dx::driver< decltype(_device_t::id) , decltype(_device_t::preference) >::version
inherited

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

(c) copyright 2009 dynamic acoustics e.U. generated on Mon Mar 9 2026

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.