BEAST/BSE - Better Audio System and Sound Engine  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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  gfloat bpm;
30  BseMusicalTuningType 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,
60  const gchar *name);
61 void bse_song_stop_sequencing_SL (BseSong *self);
62 void bse_song_get_timing (BseSong *self,
63  guint tick,
64  BseSongTiming *timing);
65 void bse_song_timing_get_default (BseSongTiming *timing);
66 BseSource* bse_song_create_summation (BseSong *self);
67 BseBus* bse_song_find_master (BseSong *self);
68 BseSource* bse_song_ensure_master (BseSong *self);
69 void bse_song_set_solo_bus (BseSong *self,
70  BseBus *bus);
71 
72 G_END_DECLS
73 
74 #endif /* __BSE_SONG_H__ */
Definition: bsesnet.hh:37
Definition: bsesong.hh:56
Definition: bsesong.hh:21
Definition: bsebus.hh:19
Definition: bsesource.hh:84
Definition: sfiring.hh:23
Definition: bsesong.hh:25
Definition: bsesnet.hh:46
Definition: bseproject.hh:26