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

« « « Anklang Documentation
Loading...
Searching...
No Matches
track.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_TRACK_HH__
3#define __ASE_TRACK_HH__
4
5#include <ase/device.hh>
6
7namespace Ase {
8
10class TrackImpl : public DeviceImpl, public virtual Track {
11 DeviceP chain_, midi_prod_;
12 ClipImplS clips_;
13 uint midi_channel_ = 0;
15 friend class ProjectImpl;
16 virtual ~TrackImpl ();
17protected:
18 String fallback_name () const override;
19 void serialize (WritNode &xs) override;
20public:
21 class ClipScout;
22 explicit TrackImpl (ProjectImpl&, bool masterflag);
23 void _activate () override;
24 void _deactivate () override;
25 AudioProcessorP _audio_processor () const override;
26 void _set_event_source (AudioProcessorP esource) override;
27 void _set_parent (GadgetImpl *parent) override;
28 DeviceInfo device_info () override;
29 ProjectImpl* project () const;
30 bool is_master () const override { return MASTER_TRACK & gadget_flags(); }
31 int32 midi_channel () const override { return midi_channel_; }
32 void midi_channel (int32 midichannel) override;
33 ClipS launcher_clips () override;
34 DeviceP access_device () override;
35 MonitorP create_monitor (int32 ochannel) override;
36 void update_clips ();
37 ssize_t clip_index (const ClipImpl &clip) const;
38 int clip_succession (const ClipImpl &clip) const;
39 TelemetryFieldS telemetry () const override;
40 enum Cmd { STOP, START, };
41 void queue_cmd (CallbackS&, Cmd cmd, double arg = 0);
42 void queue_cmd (DCallbackS&, Cmd cmd);
43 enum { NONE = -1 };
44};
45
48 friend class TrackImpl;
49 std::vector<int> indices_;
50 int last_ = -1;
51public:
52 enum { NONE = TrackImpl::NONE, };
53 // constructors
54 explicit ClipScout () noexcept;
55 void setup (const std::vector<int> &indices);
56 int advance (int previous);
57 void update (const ClipScout &other);
58 void reset ();
59};
60
61} // Ase
62
63#endif // __ASE_TRACK_HH__
Base type for classes that have a Property.
Definition gadget.hh:12
MIDI clip playback succession generator.
Definition track.hh:47
int advance(int previous)
Determine clip succession.
Definition track.cc:289
void reset()
Reset state (history), preserves succession order.
Definition track.cc:301
void setup(const std::vector< int > &indices)
Setup clip succession order.
Definition track.cc:282
void update(const ClipScout &other)
Assign new succession order, preserves history.
Definition track.cc:308
Ase::Track implementation.
Definition track.hh:10
ClipS launcher_clips() override
Retrieve the list of clips that can be directly played.
Definition track.cc:172
void _activate() override
Add AudioProcessor to the Engine and start processing.
Definition track.cc:115
void serialize(WritNode &xs) override
Serialize members and childern.
Definition track.cc:47
void _deactivate() override
Stop processing the corresponding AudioProcessor.
Definition track.cc:124
void _set_parent(GadgetImpl *parent) override
Assign parent container.
Definition track.cc:81
bool is_master() const override
Flag set on the main output track.
Definition track.hh:30
DeviceP access_device() override
Retrieve Device handle for this track.
Definition track.cc:228
DeviceInfo device_info() override
Describe this Device type.
Definition track.cc:257
TelemetryFieldS telemetry() const override
Create signal monitor for an output channel.
Definition track.cc:240
AudioProcessorP _audio_processor() const override
Retrieve the corresponding AudioProcessor.
Definition track.cc:263
int32 midi_channel() const override
Midi channel assigned to this track, 0 uses internal per-track channel.
Definition track.hh:31
Container for Clip objects and sequencing information.
Definition api.hh:285
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
int32_t int32
A 32-bit signed integer.
Definition cxxaux.hh:28
uint32_t uint
Provide 'uint' as convenience type.
Definition cxxaux.hh:18
Info for device types.
Definition api.hh:203
typedef ssize_t