BEAST - Free Software Audio Synthesizer and Tracker  0.10.0
bsesong.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_SONG_H__
3 #define __BSE_SONG_H__
4 
5 #include <bse/bsesnet.hh>
6 
7 
8 G_BEGIN_DECLS
9 
10 
11 /* --- BSE type macros --- */
12 #define BSE_TYPE_SONG (BSE_TYPE_ID (BseSong))
13 #define BSE_SONG(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), BSE_TYPE_SONG, BseSong))
14 #define BSE_SONG_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), BSE_TYPE_SONG, BseSongClass))
15 #define BSE_IS_SONG(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), BSE_TYPE_SONG))
16 #define BSE_IS_SONG_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), BSE_TYPE_SONG))
17 #define BSE_SONG_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), BSE_TYPE_SONG, BseSongClass))
18 
19 
20 /* --- BseSong object --- */
21 struct BseSongVoice {
22  BseSource *constant;
23  BseSource *sub_synth;
24 };
25 struct BseSong : BseSNet {
26  guint tpqn; /* ticks per querter note */
27  guint numerator;
28  guint denominator;
29  float bpm;
30  Bse::MusicalTuning musical_tuning;
31  SfiRing *parts; /* of type BsePart* */
32  SfiRing *busses; /* of type BseBus* */
33  BseBus *solo_bus;
34  BseSource *postprocess;
35  BseSource *output;
36  BseSNet *pnet;
37  /* song position pointer */
38  SfiInt last_position;
39  guint position_handler;
40  BseMidiReceiver *midi_receiver_SL;
41  /* fields protected by sequencer mutex */
42  gdouble tpsi_SL; /* ticks per stamp increment (sample) */
43  SfiRing *tracks_SL; /* of type BseTrack* */
44  /* sequencer stuff */
45  guint64 sequencer_start_request_SL;
46  guint64 sequencer_start_SL; /* playback start */
47  guint64 sequencer_done_SL;
48  gdouble delta_stamp_SL; /* start + delta_stamp => tick */
49  guint tick_SL; /* tick at stamp_SL */
50  guint sequencer_owns_refcount_SL : 1;
51  guint sequencer_underrun_detected_SL : 1;
52  guint loop_enabled_SL : 1;
53  SfiInt loop_left_SL; /* left loop tick */
54  SfiInt loop_right_SL; /* left loop tick */
55 };
57 {};
58 
59 BseSong* bse_song_lookup (BseProject *project, const char *name);
60 void bse_song_stop_sequencing_SL (BseSong *self);
61 void bse_song_get_timing (BseSong *self, uint tick, Bse::SongTiming *timing);
62 void bse_song_timing_get_default (Bse::SongTiming *timing);
63 BseSource* bse_song_create_summation (BseSong *self);
64 BseBus* bse_song_find_master (BseSong *self);
65 BseSource* bse_song_ensure_master (BseSong *self);
66 void bse_song_set_solo_bus (BseSong *self, BseBus *bus);
67 BseTrack* bse_song_find_first_track (BseSong *self, BsePart *part);
68 
69 G_END_DECLS
70 
71 namespace Bse {
72 
73 class SongImpl : public SNetImpl, public virtual SongIface {
74 protected:
75  virtual ~SongImpl ();
76 public:
77  explicit SongImpl (BseObject*);
78  virtual double bpm () const override;
79  virtual void bpm (double val) override;
80  virtual MusicalTuning musical_tuning () const override;
81  virtual void musical_tuning (MusicalTuning tuning) override;
82  virtual SongTiming get_timing (int tick);
83  virtual TrackIfaceP find_any_track_for_part (PartIface &part) override;
84  virtual BusIfaceP create_bus () override;
85  virtual void remove_bus (BusIface &bus) override;
86  virtual PartIfaceP create_part () override;
87  virtual void remove_part (PartIface &part) override;
88  virtual TrackIfaceP create_track () override;
89  virtual void remove_track (TrackIface &track) override;
90 };
91 
92 } // Bse
93 
94 #endif /* __BSE_SONG_H__ */
virtual BusIfaceP create_bus() override
See Song::create_bus()
Definition: bsesong.cc:779
See also the corresponding IDL class Bus.
Definition: bseserverapi.hh:1230
virtual double bpm() const override
See Song::bpm.
Definition: bsesong.cc:918
Definition: bsetrack.hh:24
The Bse namespace contains all functions of the synthesis engine.
Definition: bstbseutils.cc:88
virtual PartIfaceP create_part() override
See Song::create_part()
Definition: bsesong.cc:824
Definition: bsesnet.hh:109
See also the corresponding IDL class Song.
Definition: bseserverapi.hh:1264
Definition: bsesnet.hh:36
See also the corresponding IDL class Track.
Definition: bseserverapi.hh:1114
Definition: bsesong.hh:56
virtual void remove_track(TrackIface &track) override
See Song::remove_track()
Definition: bsesong.cc:883
Definition: bsesong.hh:21
Definition: bsebus.hh:19
Definition: bseobject.hh:61
virtual TrackIfaceP create_track() override
See Song::create_track()
Definition: bsesong.cc:866
Definition: bsesource.hh:84
Definition: bsesong.hh:73
Definition: sfiring.hh:23
See also the corresponding IDL class Part.
Definition: bseserverapi.hh:777
Definition: bsesong.hh:25
virtual MusicalTuning musical_tuning() const override
See Song::musical_tuning.
Definition: bsesong.cc:939
virtual SongTiming get_timing(int tick)
See Song::get_timing()
Definition: bsesong.cc:909
virtual TrackIfaceP find_any_track_for_part(PartIface &part) override
See Song::find_any_track_for_part()
Definition: bsesong.cc:769
Song timing configuration.
Definition: bseapi.idl:428
Definition: bsesnet.hh:45
Definition: bseproject.hh:26
Definition: bsepart.hh:26
virtual void remove_bus(BusIface &bus) override
See Song::remove_bus()
Definition: bsesong.cc:796
virtual void remove_part(PartIface &part) override
See Song::remove_part()
Definition: bsesong.cc:840