13#include <CoreAudio/AudioServerPlugIn.h>
17#include <unordered_map>
52 explicit Plugin(std::shared_ptr<const Context> context,
132 const AudioObjectPropertyAddress* address)
const override;
137 const AudioObjectPropertyAddress* address,
138 Boolean* outIsSettable)
const override;
143 const AudioObjectPropertyAddress* address,
144 UInt32 qualifierDataSize,
145 const void* qualifierData,
146 UInt32* outDataSize)
const override;
151 const AudioObjectPropertyAddress* address,
152 UInt32 qualifierDataSize,
153 const void* qualifierData,
156 void* outData)
const override;
161 const AudioObjectPropertyAddress* address,
162 UInt32 qualifierDataSize,
163 const void* qualifierData,
165 const void* inData)
override;
170 mutable std::recursive_mutex writeMutex_;
Doubly-buffered value with non-blocking read and blocking write.
Base class for audio objects.
OSStatus GetPropertyData(AudioObjectID objectID, pid_t clientPID, const AudioObjectPropertyAddress *address, UInt32 qualifierDataSize, const void *qualifierData, UInt32 inDataSize, UInt32 *outDataSize, void *outData) const override
Get property value.
virtual std::string GetResourceBundlePath() const
Get resource bundle path. By default returns PluginParameters::ResourceBundlePath.
OSStatus IsPropertySettable(AudioObjectID objectID, pid_t clientPID, const AudioObjectPropertyAddress *address, Boolean *outIsSettable) const override
Check whether given property can be changed.
void AddDevice(std::shared_ptr< Device > device)
Add device to the plugin. Adds device to the owned object list.
AudioClassID GetBaseClass() const override
Get base class ID.
OSStatus SetPropertyData(AudioObjectID objectID, pid_t clientPID, const AudioObjectPropertyAddress *address, UInt32 qualifierDataSize, const void *qualifierData, UInt32 inDataSize, const void *inData) override
Change property value.
virtual AudioObjectID GetDeviceIDByUID(const std::string &uid) const
Get device with given UID. Returns nullptr if there is no such device.
virtual std::string GetManufacturer() const
Get plugin manufacturer. Human readable name of the maker of the plug-in. Can be localized....
std::shared_ptr< Device > GetDeviceByIndex(UInt32 idx) const
Get device with given zero-based index. Returns nullptr if there are less than idx+1 devices.
void RemoveDevice(std::shared_ptr< Device > device)
Remove device from the plugin. Removes device from the owned object list.
virtual std::vector< AudioObjectID > GetDeviceIDs() const
Get devices. Returns the list of owned devices. Default implementation returns all owned objects of k...
Boolean HasProperty(AudioObjectID objectID, pid_t clientPID, const AudioObjectPropertyAddress *address) const override
Check whether given property is present.
AudioClassID GetClass() const override
Get class ID.
std::shared_ptr< Device > GetDeviceByID(AudioObjectID deviceID) const
Get device with given object ID. Returns nullptr if there is no such device.
Plugin(std::shared_ptr< const Context > context, const PluginParameters ¶ms={})
Construct plugin.
bool IsInstance(AudioClassID classID) const override
Check if this object is instance of given base class.
UInt32 GetDeviceCount() const
Get number of devices added.
OSStatus GetPropertyDataSize(AudioObjectID objectID, pid_t clientPID, const AudioObjectPropertyAddress *address, UInt32 qualifierDataSize, const void *qualifierData, UInt32 *outDataSize) const override
Get size of property value in bytes.
bool HasDevice(std::shared_ptr< Device > device) const
Check if device is already added.
std::string Manufacturer
Human readable name of the maker of the plug-in. Used by default implementation of Plugin::GetManufac...
std::string ResourceBundlePath
Resource bundle path. Used by default implementation of Plugin::GetResourceBundlePath()....