Anklang-0.3.0.dev797+g4e3241f3 anklang-0.3.0.dev797+g4e3241f3
ASE — Anklang Sound Engine (C++)

« « « Anklang Documentation
Loading...
Searching...
No Matches
device.cc
Go to the documentation of this file.
1 // This Source Code Form is licensed MPL-2.0: http://mozilla.org/MPL/2.0
2#include "device.hh"
3#include "internal.hh"
4
5namespace Ase {
6
7// == Device ==
8Device::Device()
9{}
10
11// == DeviceImpl ==
12void
18
19void
21{
22 assert_return (!activated_);
23 activated_ = true;
24}
25
26void
28{
29 assert_return (activated_);
30 activated_ = false;
31}
32
33template<typename E> std::pair<std::shared_ptr<E>,ssize_t>
34find_shared_by_ref (const std::vector<std::shared_ptr<E> > &v, const E &e)
35{
36 for (ssize_t i = 0; i < v.size(); i++)
37 if (&e == &*v[i])
38 return std::make_pair (v[i], i);
40}
41
42void
44{
45 // to be removed
46}
47
49DeviceImpl::extract_info (const String &aseid)
50{
51 DeviceInfo info = {
52 .uri = aseid,
53 };
54 // to be removed
55 return info;
56}
57
58// == Device ==
59void
63
64Track*
66{
67 for (Gadget *parent = _parent(); parent; parent = parent->_parent())
68 {
69 Track *track = dynamic_cast<Track*> (parent);
70 if (track)
71 return track;
72 }
73 return nullptr;
74}
75
76} // Ase
bool is_active() override
Check whether this is the active synthesis engine project.
Definition device.hh:20
void _disconnect_remove() override
Disconnect the device and remove all object references.
Definition device.cc:43
void _deactivate() override
Stop processing the corresponding AudioProcessor.
Definition device.cc:27
void _activate() override
Add AudioProcessor to the Engine and start processing.
Definition device.cc:20
void _set_parent(GadgetImpl *parent) override
Assign parent container.
Definition device.cc:13
void remove_self()
Remove device from its container.
Definition device.cc:60
Track * _track() const
Find Track in parent ancestry.
Definition device.cc:65
Base type for classes that have a Property.
Definition gadget.hh:12
GadgetImpl * _parent() const override
Retrieve parent container.
Definition gadget.hh:30
void _set_parent(GadgetImpl *parent) override
Assign parent container.
Definition gadget.cc:29
Base type for classes that have a Property.
Definition api.hh:174
virtual GadgetImpl * _parent() const =0
Retrieve parent container.
Container for Clip objects and sequencing information.
Definition api.hh:269
#define assert_return(expr,...)
Return from the current function if expr is unmet and issue an assertion warning.
Definition internal.hh:29
#define assert_warn(expr)
Issue an assertion warning if expr evaluates to false.
Definition internal.hh:33
T make_pair(T... args)
The Anklang C++ API namespace.
Definition api.hh:9
Info for device types.
Definition api.hh:199
typedef ssize_t