Anklang-0.3.0.dev886+g785567a1 anklang-0.3.0.dev886+g785567a1
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 void remove_self () override;
47 int32 midi_channel () const override { return midi_channel_; }
48 void midi_channel (int32 midichannel) override;
49 ClipS launcher_clips () override;
50 DeviceP access_device () override;
51 MonitorP create_monitor (int32 ochannel) override;
52 ssize_t clip_index (const ClipImpl &clip) const;
53 int clip_succession (const ClipImpl &clip) const;
54 TelemetryFieldS telemetry () const override;
55 enum { NONE = -1 };
56 ClipP create_midi_clip (const String &name, double start, double length) override;
57 ClipP create_audio_clip (const String &name, double start, double length) override;
58 static TrackImplP from_trkn (tracktion::Track&);
59};
60
63 friend class TrackImpl;
64 std::vector<int> indices_;
65 int last_ = -1;
66public:
67 enum { NONE = TrackImpl::NONE, };
68 // constructors
69 explicit ClipScout () noexcept;
70 void setup (const std::vector<int> &indices);
71 int advance (int previous);
72 void update (const ClipScout &other);
73 void reset ();
74};
75
76} // Ase
77
78#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:62
int advance(int previous)
Determine clip succession.
Definition track.cc:402
void reset()
Reset state (history), preserves succession order.
Definition track.cc:413
void setup(const std::vector< int > &indices)
Setup clip succession order.
Definition track.cc:395
void update(const ClipScout &other)
Assign new succession order, preserves history.
Definition track.cc:420
Ase::Track implementation.
Definition track.hh:11
double volume() const override
Get track volume in dB.
Definition track.cc:255
double pan() const override
Get track pan (-1.0 to 1.0).
Definition track.cc:274
ClipS launcher_clips() override
Retrieve the list of clips that can be directly played.
Definition track.cc:293
bool is_muted() const override
Check if track is muted.
Definition track.cc:217
void _activate() override
Add AudioProcessor to the Engine and start processing.
Definition track.cc:194
void serialize(WritNode &xs) override
Serialize members and childern.
Definition track.cc:189
void set_muted(bool muted) override
Set track muted state.
Definition track.cc:225
void _deactivate() override
Stop processing the corresponding AudioProcessor.
Definition track.cc:201
ClipP create_audio_clip(const String &name, double start, double length) override
Create a new audio clip on this track.
Definition track.cc:446
bool is_master() const override
Flag set on the main output track.
Definition track.cc:247
DeviceP access_device() override
Retrieve Device handle for this track.
Definition track.cc:334
DeviceInfo device_info() override
Describe this Device type.
Definition track.cc:367
TelemetryFieldS telemetry() const override
Create signal monitor for an output channel.
Definition track.cc:346
ClipP create_midi_clip(const String &name, double start, double length) override
Create a new MIDI clip on this track.
Definition track.cc:426
bool is_solo() const override
Check if track is soloed.
Definition track.cc:232
int32 midi_channel() const override
Midi channel assigned to this track, 0 uses internal per-track channel.
Definition track.hh:47
void set_solo(bool solo) override
Set track solo state.
Definition track.cc:240
void remove_self() override
Remove self from parent container.
Definition track.cc:373
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:275
The Anklang C++ API namespace.
Definition api.hh:8
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:200
typedef ssize_t