Anklang 0.3.0-460-gc4ef46ba
ASE — Anklang Sound Engine (C++)

« « « Anklang Documentation
Loading...
Searching...
No Matches
nativedevice.hh
Go to the documentation of this file.
1 // This Source Code Form is licensed MPL-2.0: http://mozilla.org/MPL/2.0
2#ifndef __ASE_NATIVE_DEVICE_HH__
3#define __ASE_NATIVE_DEVICE_HH__
4
5#include <ase/device.hh>
6#include <ase/processor.hh>
7
8namespace Ase {
9
10class NativeDeviceImpl : public DeviceImpl, public virtual NativeDevice {
11 AudioProcessorP const proc_;
12 AudioComboP combo_; // maybe null
13 DeviceS children_;
14 DeviceInfo const info_;
16 using DeviceFunc = std::function<void (DeviceP)>;
17 DeviceP insert_device (const String &uri, Device *sibling, const DeviceFunc &loader);
18protected:
19 static DeviceP create_native_device (AudioEngine &engine, const String &registryuri);
20 void serialize (WritNode &xs) override;
21 void _set_parent (GadgetImpl *parent) override;
22 void _activate () override;
23 void _deactivate () override;
24 explicit NativeDeviceImpl (const String &aseid, AudioProcessor::StaticInfo, AudioProcessorP);
25public:
26 PropertyS access_properties () override;
27 AudioProcessorP _audio_processor () const override { return proc_; }
28 AudioComboP audio_combo () const { return combo_; }
29 bool is_combo_device () override { return combo_ != nullptr; }
30 DeviceInfo device_info () override { return info_; }
31 // handle sub Devices
32 DeviceS list_devices () override { return children_; }
33 void remove_device (Device &sub) override;
34 DeviceP append_device (const String &uri) override;
35 DeviceP insert_device (const String &uri, Device &beforesibling) override;
36 void remove_all_devices ();
37 void _set_event_source (AudioProcessorP esource) override;
38 void _disconnect_remove () override;
39};
40
41DeviceP create_processor_device (AudioEngine &engine, const String &uri, bool engineproducer);
42
43} // Ase
44
45#endif // __ASE_NATIVE_DEVICE_HH__
Interface to access Device instances.
Definition api.hh:214
Base type for classes that have a Property.
Definition gadget.hh:12
PropertyS access_properties() override
Retrieve handles for all properties.
AudioProcessorP _audio_processor() const override
Retrieve the corresponding AudioProcessor.
void _disconnect_remove() override
Disconnect the device and remove all object references.
void _activate() override
Add AudioProcessor to the Engine and start processing.
void remove_device(Device &sub) override
Remove a directly contained device.
DeviceP append_device(const String &uri) override
Append a new device, see list_device_types().
bool is_combo_device() override
Retrieve wether this NativeDevice handles sub devices.
void _deactivate() override
Stop processing the corresponding AudioProcessor.
DeviceInfo device_info() override
Describe this Device type.
void serialize(WritNode &xs) override
Serialize members and childern.
void _set_parent(GadgetImpl *parent) override
Assign parent container.
Interface to access NativeDevice instances.
Definition api.hh:239
One entry in a Writ serialization document.
Definition serialize.hh:24
#define ASE_DEFINE_MAKE_SHARED(CLASS)
Definition cxxaux.hh:269
The Anklang C++ API namespace.
Definition api.hh:9
std::string String
Convenience alias for std::string.
Definition cxxaux.hh:35
Info for device types.
Definition api.hh:203