Beast - Music Synthesizer and Composer  0.11.1+10.g2da35
bsetrack.hh
Go to the documentation of this file.
1  // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
2 #ifndef __BSE_TRACK_H__
3 #define __BSE_TRACK_H__
4 
5 #include <bse/bseitem.hh>
6 #include <bse/bsesnet.hh>
8 
9 /* --- BSE type macros --- */
10 #define BSE_TYPE_TRACK (BSE_TYPE_ID (BseTrack))
11 #define BSE_TRACK(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), BSE_TYPE_TRACK, BseTrack))
12 #define BSE_TRACK_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), BSE_TYPE_TRACK, BseTrackClass))
13 #define BSE_IS_TRACK(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), BSE_TYPE_TRACK))
14 #define BSE_IS_TRACK_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), BSE_TYPE_TRACK))
15 #define BSE_TRACK_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), BSE_TYPE_TRACK, BseTrackClass))
16 
17 struct BseTrackEntry {
18  guint tick;
19  guint id;
20  BsePart *part;
21 };
23  guint channel_id;
24  guint max_voices;
25  BseSNet *snet;
26  BseSNet *pnet;
27  /* wave synthesis */
28  BseWave *wave;
29  BseSNet *wnet;
30 
31  /* sound font synthesis */
32  BseSoundFontPreset *sound_font_preset;
33  BseSNet *sound_font_net;
34 
35  /* playback intergration */
36  BseSource *sub_synth;
37  BseSource *voice_input;
38  BseSource *voice_switch;
39  BseSource *postprocess;
40  SfiRing *bus_outputs; /* maintained by bsebus.[hc] */
41  /* fields protected by sequencer mutex */
42  guint n_entries_SL : 30;
43  guint muted_SL : 1;
44  BseTrackEntry *entries_SL;
45  guint midi_channel_SL;
46  gboolean track_done_SL;
47 };
49 {};
50 
51 /* --- prototypes -- */
52 void bse_track_add_modules (BseTrack *self,
53  BseContainer *container,
54  BseMidiReceiver *midi_receiver);
55 void bse_track_remove_modules (BseTrack *self,
56  BseContainer *container);
57 void bse_track_clone_voices (BseTrack *self,
58  BseSNet *snet,
59  guint context,
60  BseMidiContext mcontext,
61  BseTrans *trans);
62 BseSource* bse_track_get_output (BseTrack *self);
63 guint bse_track_get_last_tick(BseTrack *self);
64 guint bse_track_insert_part (BseTrack *self,
65  guint tick,
66  BsePart *part);
67 void bse_track_remove_tick (BseTrack *self,
68  guint tick);
69 Bse::TrackPartSeq bse_track_list_parts (BseTrack *self);
70 Bse::TrackPartSeq bse_track_list_part (BseTrack *self,
71  BsePart *part);
72 gboolean bse_track_find_part (BseTrack *self,
73  BsePart *part,
74  guint *start_p);
75 BseTrackEntry* bse_track_lookup_tick (BseTrack *self,
76  guint tick);
77 BseTrackEntry* bse_track_find_link (BseTrack *self,
78  guint id);
79 BsePart* bse_track_get_part_SL (BseTrack *self,
80  guint tick,
81  guint *start,
82  guint *next);
83 namespace Bse {
84 
85 class TrackImpl : public ContextMergerImpl, public virtual TrackIface {
86 protected:
87  virtual ~TrackImpl ();
88 public:
89  explicit TrackImpl (BseObject*);
90  virtual SongTiming get_timing (int tick) override;
91  virtual int insert_part (int tick, PartIface &part) override;
92  virtual void remove_tick (int tick) override;
93  virtual void remove_link (int id) override;
94  virtual PartSeq list_parts_uniq () override;
95  virtual TrackPartSeq list_parts () override;
96  virtual PartIfaceP get_part (int tick) override;
97  virtual int get_last_tick () override;
98  virtual Error ensure_output () override;
99  virtual SourceIfaceP get_output_source () override;
100 };
101 
102 } // Bse
103 
104 #endif /* __BSE_TRACK_H__ */
Definition: bsetrack.hh:22
Definition: bsecontextmerger.hh:19
Definition: bsecontainer.hh:24
The Bse namespace contains all functions of the synthesis engine.
Definition: bstbseutils.cc:91
Definition: bsesnet.hh:46
Definition: bsesnet.hh:34
Definition: bsesoundfontpreset.hh:16
Definition: bsecontextmerger.hh:26
Definition: bsecontextmerger.hh:16
Definition: bsetrack.hh:85
Definition: bseobject.hh:57
Definition: bsewave.hh:24
Definition: bsesource.hh:82
Definition: sfiring.hh:21
Definition: bsetrack.hh:48
Definition: bsetrack.hh:17
A list of Part or derived types.
Definition: bseapi.idl:576
Song timing configuration.
Definition: bseapi.idl:428
Definition: bsepart.hh:24
Sequence of TrackPart records.
Definition: bseapi.idl:722