Anklang-0.3.0.dev797+g4e3241f3 anklang-0.3.0.dev797+g4e3241f3
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/trkn-utils.hh>
6#include <ase/device.hh>
7
8namespace Ase {
9
11class TrackImpl : public DeviceImpl, public virtual Track {
13 ProjectImpl *project_ = nullptr;
16 std::string te_type_;
17 uint midi_channel_ = 0;
19 friend class ProjectImpl;
20 friend class TrackStateListener;
21 virtual ~TrackImpl ();
22protected:
23 String fallback_name () const override;
24 void serialize (WritNode &xs) override;
25 void update_telemetry ();
26public:
27 class ClipScout;
28 explicit TrackImpl (ProjectImpl&, bool masterflag);
29 explicit TrackImpl (tracktion::Track &track);
30 bool is_folder () const { return "Folder" == te_type_; }
31 String name () const override;
32 void name (const std::string &n) override;
33 void _activate () override;
34 void _deactivate () override;
35 DeviceInfo device_info () override;
36 ProjectImpl* project () const;
37 bool is_master () const override;
38 bool is_muted () const override;
39 void set_muted (bool muted) override;
40 bool is_solo () const override;
41 void set_solo (bool solo) override;
42 double volume () const override;
43 void volume (double db) override;
44 double pan () const override;
45 void pan (double pan) override;
46 int32 midi_channel () const override { return midi_channel_; }
47 void midi_channel (int32 midichannel) override;
48 ClipS launcher_clips () override;
49 DeviceP access_device () override;
50 MonitorP create_monitor (int32 ochannel) override;
51 ssize_t clip_index (const ClipImpl &clip) const;
52 int clip_succession (const ClipImpl &clip) const;
53 TelemetryFieldS telemetry () const override;
54 enum { NONE = -1 };
55 ClipImplP create_midi_clip (const String &name, double start, double length);
56 ClipImplP create_audio_clip (const String &name, double start, double length);
57 static TrackImplP from_trkn (tracktion::Track&);
58};
59
62 friend class TrackImpl;
63 std::vector<int> indices_;
64 int last_ = -1;
65public:
66 enum { NONE = TrackImpl::NONE, };
67 // constructors
68 explicit ClipScout () noexcept;
69 void setup (const std::vector<int> &indices);
70 int advance (int previous);
71 void update (const ClipScout &other);
72 void reset ();
73};
74
75} // Ase
76
77#endif // __ASE_TRACK_HH__
Mimick tracktion::engine::SafeSelectable<> for tracktion::Selectable descendants.
Definition trkn-utils.hh:27
MIDI clip playback succession generator.
Definition track.hh:61
int advance(int previous)
Determine clip succession.
Definition track.cc:374
void reset()
Reset state (history), preserves succession order.
Definition track.cc:385
void setup(const std::vector< int > &indices)
Setup clip succession order.
Definition track.cc:367
void update(const ClipScout &other)
Assign new succession order, preserves history.
Definition track.cc:392
Ase::Track implementation.
Definition track.hh:11
double volume() const override
Get track volume in dB.
Definition track.cc:243
double pan() const override
Get track pan (-1.0 to 1.0).
Definition track.cc:262
ClipS launcher_clips() override
Retrieve the list of clips that can be directly played.
Definition track.cc:281
bool is_muted() const override
Check if track is muted.
Definition track.cc:205
void _activate() override
Add AudioProcessor to the Engine and start processing.
Definition track.cc:182
void serialize(WritNode &xs) override
Serialize members and childern.
Definition track.cc:177
void set_muted(bool muted) override
Set track muted state.
Definition track.cc:213
void _deactivate() override
Stop processing the corresponding AudioProcessor.
Definition track.cc:189
bool is_master() const override
Flag set on the main output track.
Definition track.cc:235
DeviceP access_device() override
Retrieve Device handle for this track.
Definition track.cc:321
DeviceInfo device_info() override
Describe this Device type.
Definition track.cc:354
TelemetryFieldS telemetry() const override
Create signal monitor for an output channel.
Definition track.cc:333
bool is_solo() const override
Check if track is soloed.
Definition track.cc:220
int32 midi_channel() const override
Midi channel assigned to this track, 0 uses internal per-track channel.
Definition track.hh:46
void set_solo(bool solo) override
Set track solo state.
Definition track.cc:228
Container for Clip objects and sequencing information.
Definition api.hh:269
One entry in a Writ serialization document.
Definition serialize.hh:24
#define ASE_DEFINE_MAKE_SHARED(CLASS)
Define a member function static shared_ptr<CLASS> make_shared(ctorargs...);.
Definition cxxaux.hh:274
The Anklang C++ API namespace.
Definition api.hh:9
int32_t int32
A 32-bit signed integer.
Definition cxxaux.hh:28
std::string String
Convenience alias for std::string.
Definition cxxaux.hh:35
uint32_t uint
Provide 'uint' as convenience type.
Definition cxxaux.hh:18
Info for device types.
Definition api.hh:199
typedef ssize_t