dxd - dynax driver framework 3.0.0d222
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::midi::services::driver< device_t > Class Template Referenceabstract

Windows MIDI Services client driver interface class. More...

#include <dx_midi_services_driver.h>

Inheritance diagram for dx::midi::services::driver< device_t >:
Collaboration diagram for dx::midi::services::driver< device_t >:

Classes

struct  property

Public Member Functions

virtual DX_PRAGMA_IGNORE_RETURN_VALUE_END bool boot () try
virtual DX_PRAGMA_IGNORE_RETURN_VALUE_END bool boot () try
DX_PRAGMA_IGNORE_RETURN_VALUE_END void exception (const class exception &exception, bool filtered=false) const noexcept override try
 notification exception handler
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
virtual void exception (const exception &exception, bool filtered=false) const noexcept=0
 notification exception handler
virtual bool shutdown () try
 client driver::shutdown/boot(): override to shutdown/boot host driver
virtual bool shutdown () try
 client driver::shutdown/boot(): override to shutdown/boot host driver
bool try_conclude () noexcept
 atomically conclude()s if currently launched; returns whether this call did it
bool try_conclude () noexcept
 atomically conclude()s if currently launched; returns whether this call did it
bool try_launch ()
 atomically launch()es if not already launched; returns whether this call did it
bool try_launch ()
 atomically launch()es if not already launched; returns whether this call did it

Public Attributes

elements
 STL member.
elements
 STL member.
keys
 STL member.
keys
 STL member.
std::atomic< bool > launched
std::atomic< bool > launched {}
dx::log log {}
 cached local log level, mirrors driver_settings::log
dx::log log
 cached local log level, mirrors driver_settings::log
preference_t preference
decltype(device_t::preference) preference
const char * product_id
const char * product_id
promoted< os_resultstatus {driver_not_connected}
promoted< os_resultstatus
uint32_t version = DX_VERSION32
uint32_t version

Protected Types

typedef std::conditional_t< held, typename view::template iterator< typename holders::const_iterator >, typename holders::const_iterator > const_iterator
typedef decltype(device_t::id) device_id_t
typedef std::map< device_id_t, std::shared_ptr< device_t > > holders
typedef std::conditional_t< held, typename view::template iterator< typename holders::iterator >, typename holders::iterator > iterator

Protected Member Functions

virtual void add (const device_id_t &)=0
 adds a new device to the device list
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
 adds a new device to the device list
virtual void arrived ()
 notify device arrivals completed stub
virtual void arrived (device_t &)
 notify specific device arrival stub
const_iterator begin () const noexcept
iterator begin () noexcept
 catch (...)
 catch (...)
DX_PRAGMA_IGNORE_RETURN_VALUE_BEGIN catch (const dx::exception &__dx_exception)
DX_PRAGMA_IGNORE_RETURN_VALUE_BEGIN catch (const dx::exception &__dx_exception)
 catch (const std::exception &__std_exception)
 catch (const std::exception &__std_exception)
virtual 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. Called only through try_conclude() - never call this directly from outside the class hierarchy.
 driver (const match &matching_ids, const char *product_id, const decltype(super::preference)&preference, dx::log log={})
 the Windows MIDI Services client driver interface class constructor
 driver (const match &matching_ids, const char *product_id, dx::log log={})
 dx_catchall_handler (this,) virtual driver &operator<<(std
 restores device settings
 dx_catchall_rethrow () void conclude() noexcept override
const_iterator end () const noexcept
iterator end () noexcept
iterator find (const device_id_t &device_id)
const_iterator find (const device_id_t &device_id) const
void found (const enumeration::MidiEndpointDeviceInformation &endpoint) try
 an endpoint the watcher reports: taken where it matches
void info (std::ostream &os) noexcept override
 log object class information
void launch () override try
 launch notification: object mounted and ready to use. Called only through try_launch() - never call this directly from outside the class hierarchy.
bool matches (const enumeration::MidiEndpointDeviceInformation &endpoint) const
 any dictionary whose entries all match (case-insensitive substrings) takes the endpoint; an empty match takes every endpoint
virtual operator bool () const noexcept
virtual driveroperator<< (const char *file)
virtual driveroperator>> (const char *file) const
virtual driveroperator>> (std::ostream &ostream) const
 saves device tree
virtual void remove (const device_id_t &)=0
 finds and removes a device from the device list
virtual void remove (const decltype(device_t::id) &)=0
 finds and removes a device from the device list
void remove (const device_id_t &device_id) override try
 finds and removes a device from the device list
virtual void removed (device_t &) noexcept
 notify specific device removal stub
void sleep () override
 < notify system will sleep
void wake () override
 ~driver () override

Static Protected Member Functions

static device_t::desc_t endpoint ()
 what every endpoint is to this bus: an in and an out stream of Universal MIDI Packets, one pin each, the group inside the word, a ring of buffers words; a product sets its own ahead of launch, the device takes it and adds what the service says of the endpoint

Protected Attributes

device_t::desc_t desc = endpoint()
enumeration::MidiEndpointDeviceInformationFilters filters = enumeration::MidiEndpointDeviceInformationFilters::AllStandardEndpoints
 what the watcher lists, set ahead of launch: the standard endpoints, DiagnosticLoopback beside them for a round trip without a device
dx_catchall_handler(this,) public typedef decltype(matching_idsmatch
std::vector< dictionarymatching_ids
api::MidiApiMode mode {}
dx_catchall_handler(this,) public typedef std::conditional_t< held, typename view::value_type, typename holders::value_type > value_type

Detailed Description

template<class device_t>
class dx::midi::services::driver< device_t >

Windows MIDI Services client driver interface class.

One device per UMP endpoint, identified by its endpoint device id and matched by substrings of what the service says of it. Arrival and removal come from the SDK's endpoint watcher.

Exceptions
incase of an error returned by the underlaying API the driver class throws a dx::exception.

Member Typedef Documentation

◆ const_iterator

typedef std::conditional_t<held, typename view::template iterator<typename holders::const_iterator>, typename holders::const_iterator> dx::map::driver< device_t, device_t >::const_iterator
protectedinherited

◆ device_id_t

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

◆ holders

typedef std::map<device_id_t, std::shared_ptr<device_t> > dx::map::driver< device_t, device_t >::holders
protectedinherited

◆ iterator

typedef std::conditional_t<held, typename view::template iterator<typename holders::iterator>, typename holders::iterator> dx::map::driver< device_t, device_t >::iterator
protectedinherited

Constructor & Destructor Documentation

◆ driver() [1/2]

template<class device_t>
dx::midi::services::driver< device_t >::driver ( const match & matching_ids,
const char * product_id,
const decltype(super::preference)& preference,
dx::log log = {} )
inlineprotected

the Windows MIDI Services client driver interface class constructor

Parameters
matching_idsthe matching dictionaries identifying the endpoints
product_idclient driver ID
preferencepreference
loglog settings

◆ driver() [2/2]

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

◆ ~driver()

template<class device_t>
dx::midi::services::driver< device_t >::~driver ( )
inlineoverrideprotected
Here is the call graph for this function:

Member Function Documentation

◆ add() [1/3]

template<typename device_id_t, typename preference_t>
virtual void dx::driver< device_id_t, preference_t >::add ( const device_id_t & )
protectedpure virtualinherited

adds a new device to the device list

Exceptions
dx::exception

◆ add() [2/3]

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() [3/3]

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

adds a new device to the device list

Exceptions
dx::exception
Here is the call graph for this function:
Here is the caller graph for this function:

◆ arrived() [1/2]

( )
protectedvirtualinherited

notify device arrivals completed stub

Reimplemented from dx::driver< device_id_t, preference_t >.

Here is the caller graph for this function:

◆ arrived() [2/2]

virtual void dx::map::driver< device_t, device_t >::arrived ( device_t & )
inlineprotectedvirtualinherited

notify specific device arrival stub

Reimplemented in dx::stream::driver< dx::map::driver< device_t > >, and dx::stream::driver< map::driver< device_t > >.

Here is the caller graph for this function:

◆ begin() [1/2]

const_iterator dx::map::driver< device_t, device_t >::begin ( ) const
inlineprotectednoexceptinherited

◆ begin() [2/2]

iterator dx::map::driver< device_t, device_t >::begin ( )
inlineprotectednoexceptinherited
Here is the call graph for this function:
Here is the caller graph for this function:

◆ boot() [1/2]

template<typename device_id_t, typename preference_t>
virtual DX_PRAGMA_IGNORE_RETURN_VALUE_END bool dx::driver< device_id_t, preference_t >::boot ( )
inlinevirtualinherited
Here is the caller graph for this function:

◆ boot() [2/2]

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

◆ catch() [1/6]

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

◆ catch() [2/6]

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

◆ catch() [3/6]

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

◆ catch() [4/6]

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

◆ catch() [5/6]

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

◆ catch() [6/6]

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

◆ clear()

virtual DX_PRAGMA_IGNORE_RETURN_VALUE_END void dx::map::driver< device_t, device_t >::clear ( )
inlineprotectedvirtualnoexceptinherited

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

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

◆ conclude()

DX_PRAGMA_IGNORE_RETURN_VALUE_END void dx::map::driver< device_t, 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. Called only through try_conclude() - never call this directly from outside the class hierarchy.

Reimplemented from dx::object.

Reimplemented in dx::wasapi::client::driver< device_t >.

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

◆ dx_catchall_handler()

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

restores device settings

◆ dx_catchall_rethrow()

template<class device_t>
dx::midi::services::driver< device_t >::dx_catchall_rethrow ( )
inlineoverrideprotectednoexcept

◆ end() [1/2]

const_iterator dx::map::driver< device_t, device_t >::end ( ) const
inlineprotectednoexceptinherited

◆ end() [2/2]

iterator dx::map::driver< device_t, device_t >::end ( )
inlineprotectednoexceptinherited
Here is the caller graph for this function:

◆ endpoint()

template<class device_t>
device_t::desc_t dx::midi::services::driver< device_t >::endpoint ( )
inlinestaticprotected

what every endpoint is to this bus: an in and an out stream of Universal MIDI Packets, one pin each, the group inside the word, a ring of buffers words; a product sets its own ahead of launch, the device takes it and adds what the service says of the endpoint

Here is the caller graph for this function:

◆ exception() [1/4]

template<typename device_id_t, typename preference_t>
DX_PRAGMA_IGNORE_RETURN_VALUE_END void dx::driver< device_id_t, preference_t >::exception ( const class exception & exception,
bool filtered = false ) const
inlineoverridenoexceptinherited

notification exception handler

Here is the caller graph for this function:

◆ exception() [2/4]

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() [3/4]

virtual void dx::object::exception ( const exception & exception,
bool filtered = false ) const
pure virtualnoexceptinherited

notification exception handler

◆ exception() [4/4]

virtual void dx::object::exception ( const exception & exception,
bool filtered = false ) const
pure virtualnoexceptinherited

notification exception handler

Implemented in dx::asio::client::_device< desc_t, preference_t, stream_t, group_t >, dx::asio::client::_device< desc, preference, stream< device< desc, preference, stream, group > >, group< device< desc, preference, stream, group > > >, dx::asio::client::_device< desc_t, preference_t, stream_t< device< desc_t, preference_t, stream_t, group_t > >, group_t< device< desc_t, preference_t, stream_t, group_t > > >, dx::device< id_t, preference_t >, dx::device< dx::guid, preference >, dx::device< std::string, dx::preference >, dx::device< std::string, preference >, dx::device< std::string, preference_t >, dx::device<::AudioObjectID, cf::preference >, dx::device<::io_service_t, dx::preference >, dx::device<::io_service_t, preference_t >, dx::device<::MIDIDeviceRef, cf::preference >, dx::device<>, dx::proxy::device< preference_t >, dx::proxy::device< dx::preference >, dx::service::app, dx::service::client::_device< desc_t, preference_t, stream_t, group_t >, dx::service::client::_device< desc, preference, stream< device< desc, preference, stream, group > >, group< device< desc, preference, stream, group > > >, dx::service::client::_device< desc_t, preference_t, stream_t< device< desc_t, preference_t, stream_t, group_t > >, group_t< device< desc_t, preference_t, stream_t, group_t > > >, dx::stream::pin< device_t, _circular_t >, dx::usb::platform::device< preference_t >, dx::usb::platform::device< dx::preference >, dx::usb::platform::device< preference_t >, dx::usb::stream::pipe< device_t, circular_t, stream_t >, dx::virtuel::stream::_device< desc_t, preference_t, stream_t, group_t >, dx::virtuel::stream::_device< desc, dx::preference, dx::stream::shared::stream< device< desc, dx::preference, dx::stream::shared::stream, group > >, group< device< desc, dx::preference, dx::stream::shared::stream, group > > >, dx::virtuel::stream::_device< desc_t, preference_t, stream_t< device< desc_t, preference_t, stream_t, group_t > >, group_t< device< desc_t, preference_t, stream_t, group_t > > >, and dx::wasapi::client::_device< desc, preference, stream< device< desc, preference, stream, group > >, group< device< desc, preference, stream, group > > >.

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

◆ find() [1/2]

iterator dx::map::driver< device_t, device_t >::find ( const device_id_t & device_id)
inlineprotectedinherited
Here is the caller graph for this function:

◆ find() [2/2]

const_iterator dx::map::driver< device_t, device_t >::find ( const device_id_t & device_id) const
inlineprotectedinherited

◆ found()

template<class device_t>
void dx::midi::services::driver< device_t >::found ( const enumeration::MidiEndpointDeviceInformation & endpoint)
inlineprotected

an endpoint the watcher reports: taken where it matches

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

◆ info()

template<class device_t>
void dx::midi::services::driver< device_t >::info ( std::ostream & os)
inlineoverrideprotectedvirtualnoexcept

log object class information

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

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

◆ launch()

template<class device_t>
void dx::midi::services::driver< device_t >::launch ( )
inlineoverrideprotectedvirtual

launch notification: object mounted and ready to use. Called only through try_launch() - never call this directly from outside the class hierarchy.

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

Here is the call graph for this function:

◆ matches()

template<class device_t>
bool dx::midi::services::driver< device_t >::matches ( const enumeration::MidiEndpointDeviceInformation & endpoint) const
inlineprotected

any dictionary whose entries all match (case-insensitive substrings) takes the endpoint; an empty match takes every endpoint

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

◆ operator bool()

template<class device_t>
virtual dx::midi::services::driver< device_t >::operator bool ( ) const
inlineprotectedvirtualnoexcept

◆ operator<<()

virtual driver & dx::map::driver< device_t, device_t >::operator<< ( const char * file)
inlineprotectedvirtualinherited
Here is the call graph for this function:

◆ operator>>() [1/2]

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

◆ operator>>() [2/2]

virtual driver & dx::map::driver< device_t, device_t >::operator>> ( std::ostream & ostream) const
inlineprotectedvirtualinherited

saves device tree

Reimplemented in dx::coreaudio::driver< device_t >.

◆ remove() [1/3]

template<typename device_id_t, typename preference_t>
virtual void dx::driver< device_id_t, preference_t >::remove ( const device_id_t & )
protectedpure virtualinherited

finds and removes a device from the device list

◆ remove() [2/3]

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() [3/3]

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

finds and removes a device from the device list

Exceptions
dx::exception
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removed()

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

notify specific device removal stub

Here is the caller graph for this function:

◆ shutdown() [1/2]

template<typename device_id_t, typename preference_t>
virtual bool dx::driver< device_id_t, preference_t >::shutdown ( )
inlinevirtualinherited

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

Reimplemented in dx::coreaudio::driver< device_t >.

Here is the caller graph for this function:

◆ shutdown() [2/2]

virtual bool dx::driver< decltype(device_t::id), decltype(device_t::preference) >::shutdown ( )
inlinevirtualinherited

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

◆ sleep()

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

< notify system will sleep

notify system wake completed stub

◆ try_conclude() [1/2]

bool dx::object::try_conclude ( )
inlinenoexceptinherited

atomically conclude()s if currently launched; returns whether this call did it

◆ try_conclude() [2/2]

bool dx::object::try_conclude ( )
inlinenoexceptinherited

atomically conclude()s if currently launched; returns whether this call did it

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

◆ try_launch() [1/2]

bool dx::object::try_launch ( )
inlineinherited

atomically launch()es if not already launched; returns whether this call did it

◆ try_launch() [2/2]

bool dx::object::try_launch ( )
inlineinherited

atomically launch()es if not already launched; returns whether this call did it

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

◆ wake()

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

Member Data Documentation

◆ added

template<class device_t>
::winrt::event_token dx::midi::services::driver< device_t >::added

◆ completed

template<class device_t>
::winrt::event_token dx::midi::services::driver< device_t >::completed

◆ desc

template<class device_t>
device_t::desc_t dx::midi::services::driver< device_t >::desc = endpoint()
protected

◆ elements [1/2]

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

STL member.

◆ elements [2/2]

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

STL member.

◆ filters

template<class device_t>
enumeration::MidiEndpointDeviceInformationFilters dx::midi::services::driver< device_t >::filters = enumeration::MidiEndpointDeviceInformationFilters::AllStandardEndpoints
protected

what the watcher lists, set ahead of launch: the standard endpoints, DiagnosticLoopback beside them for a round trip without a device

◆ keys [1/2]

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

STL member.

◆ keys [2/2]

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

STL member.

◆ launched [1/2]

std::atomic<bool> dx::object::launched
inherited

◆ launched [2/2]

std::atomic<bool> dx::object::launched {}
inherited

◆ log [1/2]

template<typename device_id_t, typename preference_t>
dx::log dx::driver< device_id_t, preference_t >::log {}
inherited

cached local log level, mirrors driver_settings::log

◆ log [2/2]

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

cached local log level, mirrors driver_settings::log

◆ match

template<class device_t>
dx_catchall_handler (this,) public typedef decltype(matching_ids) dx::midi::services::driver< device_t >::match
protected

◆ matching_ids

template<class device_t>
std::vector<dictionary> dx::midi::services::driver< device_t >::matching_ids
protected

◆ mode

template<class device_t>
api::MidiApiMode dx::midi::services::driver< device_t >::mode {}
protected

the API mode the machine runs in, read at launch: in legacy mode the service lists no device

◆ preference [1/2]

template<typename device_id_t, typename preference_t>
preference_t dx::driver< device_id_t, preference_t >::preference
inherited

◆ preference [2/2]

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

◆ product_id [1/2]

template<typename device_id_t, typename preference_t>
const char* dx::driver< device_id_t, preference_t >::product_id
inherited

◆ product_id [2/2]

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

◆ removed

template<class device_t>
::winrt::event_token dx::midi::services::driver< device_t >::removed

◆ status [1/2]

template<typename device_id_t, typename preference_t>
promoted<os_result> dx::driver< device_id_t, preference_t >::status {driver_not_connected}
inherited

◆ status [2/2]

promoted<os_result> dx::driver< decltype(device_t::id), decltype(device_t::preference) >::status
inherited

◆ updated

template<class device_t>
::winrt::event_token dx::midi::services::driver< device_t >::updated

◆ value_type

dx_catchall_handler (this,) public typedef std::conditional_t<held, typename view::value_type, typename holders::value_type> dx::map::driver< device_t, device_t >::value_type
protectedinherited

◆ version [1/2]

template<typename device_id_t, typename preference_t>
uint32_t dx::driver< device_id_t, preference_t >::version = DX_VERSION32
inherited

◆ version [2/2]

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

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.