Beast - Music Synthesizer and Composer  0.11.1+10.g2da35
bsemidireceiver.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_MIDI_RECEIVER_H__
3 #define __BSE_MIDI_RECEIVER_H__
4 
5 #include <bse/bseobject.hh>
6 #include <bse/bsemidievent.hh>
7 
8 
9 /* --- API --- */
10 #define BSE_MIDI_CONTROL_MODULE_N_CHANNELS (4)
11 #define BSE_MIDI_VOICE_MODULE_N_CHANNELS (4)
12 #define BSE_MIDI_VOICE_N_CHANNELS (3)
13 typedef void (*BseMidiControlHandler) (gpointer handler_data,
14  guint64 tick_stamp,
15  Bse::MidiSignal signal_type,
16  gfloat control_value,
17  guint n_modules,
18  BseModule *const *modules,
19  gpointer user_data,
20  BseTrans *trans);
21 typedef void (*BseMidiEventHandler) (gpointer handler_data,
22  BseModule *module,
23  const BseMidiEvent *event,
24  BseTrans *trans);
25 BseMidiReceiver* bse_midi_receiver_new (const gchar *receiver_name);
26 BseMidiReceiver* bse_midi_receiver_ref (BseMidiReceiver *self);
27 void bse_midi_receiver_unref (BseMidiReceiver *self);
28 void bse_midi_receiver_push_event (BseMidiReceiver *self,
29  BseMidiEvent *event);
30 void bse_midi_receiver_process_events (BseMidiReceiver *self,
31  guint64 max_tick_stamp);
32 BseModule* bse_midi_receiver_retrieve_control_module (BseMidiReceiver *self,
33  guint midi_channel,
34  Bse::MidiSignal signals[BSE_MIDI_CONTROL_MODULE_N_CHANNELS],
35  BseTrans *trans);
36 void bse_midi_receiver_discard_control_module (BseMidiReceiver *self,
37  BseModule *cmodule,
38  BseTrans *trans);
39 gboolean bse_midi_receiver_add_control_handler (BseMidiReceiver *self,
40  guint midi_channel,
41  Bse::MidiSignal signal_type,
42  BseMidiControlHandler handler_func,
43  gpointer handler_data,
44  BseModule *module);
45 void bse_midi_receiver_set_control_handler_data(BseMidiReceiver *self,
46  guint midi_channel,
47  Bse::MidiSignal signal_type,
48  BseMidiControlHandler handler_func,
49  gpointer handler_data,
50  gpointer extra_data,
51  BseFreeFunc extra_free); /* UserThread */
52 void bse_midi_receiver_remove_control_handler (BseMidiReceiver *self,
53  guint midi_channel,
54  Bse::MidiSignal signal_type,
55  BseMidiControlHandler handler_func,
56  gpointer handler_data,
57  BseModule *module);
58 void bse_midi_receiver_add_event_handler (BseMidiReceiver *self,
59  guint midi_channel,
60  BseMidiEventHandler handler_func,
61  gpointer handler_data,
62  BseModule *module);
63 void bse_midi_receiver_remove_event_handler (BseMidiReceiver *self,
64  guint midi_channel,
65  BseMidiEventHandler handler_func,
66  gpointer handler_data,
67  BseModule *module);
68 BseModule* bse_midi_receiver_retrieve_mono_voice (BseMidiReceiver *self,
69  guint midi_channel,
70  BseTrans *trans);
71 void bse_midi_receiver_discard_mono_voice (BseMidiReceiver *self,
72  guint midi_channel,
73  BseModule *fmodule,
74  BseTrans *trans);
75 void bse_midi_receiver_channel_enable_poly (BseMidiReceiver *self,
76  guint midi_channel);
77 void bse_midi_receiver_channel_disable_poly (BseMidiReceiver *self,
78  guint midi_channel);
79 guint bse_midi_receiver_create_poly_voice (BseMidiReceiver *self,
80  guint midi_channel,
81  BseTrans *trans);
82 void bse_midi_receiver_discard_poly_voice (BseMidiReceiver *self,
83  guint midi_channel,
84  guint voice_id,
85  BseTrans *trans);
86 BseModule* bse_midi_receiver_get_poly_voice_input (BseMidiReceiver *self,
87  guint midi_channel,
88  guint voice_id);
89 BseModule* bse_midi_receiver_get_poly_voice_output (BseMidiReceiver *self,
90  guint midi_channel,
91  guint voice_id);
92 BseModule* bse_midi_receiver_create_sub_voice (BseMidiReceiver *self,
93  guint midi_channel,
94  guint voice_id,
95  BseTrans *trans);
96 void bse_midi_receiver_discard_sub_voice (BseMidiReceiver *self,
97  guint midi_channel,
98  guint voice_id,
99  BseModule *fmodule,
100  BseTrans *trans);
101 void bse_midi_receiver_set_notifier (BseMidiReceiver *self,
102  BseMidiNotifier *notifier);
103 gboolean bse_midi_receiver_has_notify_events (BseMidiReceiver *self);
104 SfiRing* bse_midi_receiver_fetch_notify_events (BseMidiReceiver *self);
105 gboolean bse_midi_receiver_voices_pending (BseMidiReceiver *self,
106  guint midi_channel);
107 void bse_midi_receiver_enter_farm (BseMidiReceiver *self);
108 void bse_midi_receiver_farm_distribute_event (BseMidiEvent *event);
109 void bse_midi_receiver_farm_process_events (guint64 max_tick_stamp);
110 void bse_midi_receiver_leave_farm (BseMidiReceiver *self);
111 
112 #endif /* __BSE_MIDI_RECEIVER_H__ */
Definition: sfiring.hh:21
Definition: bsemidinotifier.hh:17
Definition: bsemidievent.hh:72