15#include <CoreAudio/AudioServerPlugIn.h>
77 std::shared_ptr<Plugin>
plugin = {},
78 std::shared_ptr<Storage> storage = {});
153 const std::shared_ptr<Context> context_;
154 const std::shared_ptr<Plugin> plugin_;
155 const std::shared_ptr<Storage> storage_;
167 std::atomic<ULONG> refCounter_ = 0;
Handler for HAL requests to driver.
Plugin persistent storage.
Doubly-buffered value with non-blocking read and blocking write.
virtual OSStatus DestroyDevice(AudioObjectID objectID)
Destroy device. Default implementation returns kAudioHardwareUnsupportedOperationError.
virtual OSStatus CreateDevice(CFDictionaryRef description, const AudioServerPlugInClientInfo *clientInfo, AudioObjectID *outDeviceObjectID)
Create device. Default implementation returns kAudioHardwareUnsupportedOperationError.
virtual OSStatus Initialize()
Initialize driver. Default implementation invokes DriverRequestHandler::OnInitialize().
Driver(std::shared_ptr< Context > context={}, std::shared_ptr< Plugin > plugin={}, std::shared_ptr< Storage > storage={})
Construct driver. If context, plugin, or storage is not set, it is created automatically.
void SetDriverHandler(std::shared_ptr< DriverRequestHandler > handler)
Set handler for HAL requests to driver. Optional. Use when you need to do custom handling.
std::shared_ptr< Plugin > GetPlugin() const
Get plugin. Plugin is the root of driver's object tree.
AudioServerPlugInDriverRef GetReference()
Get driver reference. This is what should be returned from plugin entry point.
void SetDriverHandler(DriverRequestHandler *handler)
Set handler for HAL requests to driver (raw pointer overload). This overload uses raw pointer instead...
std::shared_ptr< const Context > GetContext() const
Get context. Context contains data shared among all driver objects.
std::shared_ptr< Storage > GetStorage() const
Get storage. Storage provides API for persistent key-value database.
static Driver * GetDriver(AudioServerPlugInDriverRef driverRef)
Cast driver reference back to driver.
const AudioServerPlugInDriverInterface & GetPluginInterface() const
Get plugin interface. Plugin interface is a table with function pointers which implement various plug...
Handler for HAL requests to driver.