Beast - Music Synthesizer and Composer  0.11.1+10.g2da35
bseserver.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_SERVER_H__
3 #define __BSE_SERVER_H__
4 #include <bse/bsesuper.hh>
5 #include <bse/bsepcmdevice.hh>
6 #include <bse/bsemididevice.hh>
7 #include <bse/testobject.hh>
8 
9 /* --- BSE type macros --- */
10 #define BSE_TYPE_SERVER (BSE_TYPE_ID (BseServer))
11 #define BSE_SERVER_CAST(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), BSE_TYPE_SERVER, BseServer))
12 #define BSE_SERVER_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), BSE_TYPE_SERVER, BseServerClass))
13 #define BSE_IS_SERVER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), BSE_TYPE_SERVER))
14 #define BSE_IS_SERVER_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), BSE_TYPE_SERVER))
15 #define BSE_SERVER_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), BSE_TYPE_SERVER, BseServerClass))
16 
18  GSource *engine_source;
19  GList *projects;
20  GSList *children;
21  gchar *wave_file;
22  double wave_seconds;
23  guint dev_use_count;
24  guint log_messages : 1;
25  guint pcm_input_checked : 1;
26  BsePcmDevice *pcm_device;
27  BseModule *pcm_imodule;
28  BseModule *pcm_omodule;
29  BsePcmWriter *pcm_writer;
30  BseMidiDevice *midi_device;
31  GSList *watch_list;
32 };
34 {};
35 
37 BseProject* bse_server_find_project (BseServer *server,
38  const gchar *name);
39 void bse_server_stop_recording (BseServer *server);
40 void bse_server_start_recording (BseServer *server,
41  const char *wave_file,
42  double n_seconds);
43 Bse::Error bse_server_open_devices (BseServer *server);
44 void bse_server_close_devices (BseServer *server);
45 BseModule* bse_server_retrieve_pcm_output_module (BseServer *server,
46  BseSource *source,
47  const gchar *uplink_name);
48 void bse_server_discard_pcm_output_module (BseServer *server,
49  BseModule *module);
50 BseModule* bse_server_retrieve_pcm_input_module (BseServer *server,
51  BseSource *source,
52  const gchar *uplink_name);
53 void bse_server_discard_pcm_input_module (BseServer *server,
54  BseModule *module);
55 void bse_server_require_pcm_input (BseServer *server);
56 BseModule* bse_server_retrieve_midi_input_module (BseServer *server,
57  const gchar *downlink_name,
58  guint midi_channel_id,
59  guint nth_note,
60  guint signals[4]);
61 void bse_server_discard_midi_input_module (BseServer *server,
62  BseModule *module);
63 void bse_server_add_io_watch (BseServer *server,
64  gint fd,
65  GIOCondition events,
66  BseIOWatch watch_func,
67  gpointer data);
68 void bse_server_remove_io_watch (BseServer *server,
69  BseIOWatch watch_func,
70  gpointer data);
71 
72 /* --- internal --- */
73 void bse_server_registration (BseServer *server,
74  BseRegistrationType rtype,
75  const gchar *what,
76  const gchar *error);
78  BseJanitor *janitor);
80  const gchar *script_name,
81  const gchar *proc_name,
82  const gchar *reason);
83 Bse::Error bse_server_run_remote (BseServer *server,
84  const gchar *process_name,
85  SfiRing *params,
86  const gchar *script_name,
87  const gchar *proc_name,
88  BseJanitor **janitor_p);
89 void bse_server_queue_kill_wire (BseServer *server,
90  SfiComWire *wire);
91 void bse_server_notify_gconfig (BseServer *server);
92 
93 #define BSE_SERVER (Bse::ServerImpl::instance())
94 
95 namespace Bse {
96 
97 class ServerImpl : public virtual ServerIface, public virtual ObjectImpl {
98  TestObjectImplP test_object_;
99 protected:
100  virtual ~ServerImpl ();
101 public:
102  explicit ServerImpl (BseObject*);
103  virtual TestObjectIfaceP get_test_object () override;
104  virtual ObjectIfaceP from_proxy (int64_t proxyid) override;
105  virtual String get_mp3_version () override;
106  virtual String get_vorbis_version () override;
107  virtual String get_ladspa_path () override;
108  virtual String get_plugin_path () override;
109  virtual String get_script_path () override;
110  virtual String get_instrument_path () override;
111  virtual String get_sample_path () override;
112  virtual String get_effect_path () override;
113  virtual String get_demo_path () override;
114  virtual String get_version () override;
115  virtual String get_custom_effect_dir () override;
116  virtual String get_custom_instrument_dir () override;
117  virtual void save_preferences () override;
118  virtual void register_ladspa_plugins () override;
119  virtual void register_core_plugins () override;
120  virtual void start_recording (const String &wave_file, double n_seconds) override;
121  virtual void register_scripts () override;
122  virtual void load_assets () override;
123  virtual bool preferences_locked () override;
124  virtual int n_scripts () override;
125  virtual bool can_load (const String &file_name) override;
126  virtual ProjectIfaceP create_project (const String &project_name) override;
127  virtual void destroy_project (ProjectIface &project) override;
128  virtual AuxDataSeq list_module_types () override;
129  virtual AuxData find_module_type (const String &module_type) override;
130  virtual Icon module_type_icon (const String &module_type) override;
131  virtual SampleFileInfo sample_file_info (const String &filename) override;
132  virtual NoteDescription note_describe_from_freq (MusicalTuning musical_tuning, double freq) override;
133  virtual NoteDescription note_describe (MusicalTuning musical_tuning, int note, int fine_tune) override;
134  virtual NoteDescription note_construct (MusicalTuning musical_tuning, int semitone, int octave, int fine_tune) override;
135  virtual NoteDescription note_from_string (MusicalTuning musical_tuning, const String &name) override;
136  virtual int note_from_freq (MusicalTuning musical_tuning, double frequency) override;
137  virtual double note_to_freq (MusicalTuning musical_tuning, int note, int fine_tune) override;
138  virtual CategorySeq category_match_typed (const String &pattern, const String &type_name) override;
139  virtual CategorySeq category_match (const String &pattern) override;
140  virtual int64 tick_stamp_from_systime (int64 systime_usecs) override;
141  void send_user_message (const UserMessage &umsg);
142  static void register_source_module (const String &type, const String &title, const String &tags, const uint8 *pixstream);
143  static ServerImpl& instance ();
144 };
145 
146 } // Bse
147 
148 #endif /* __BSE_SERVER_H__ */
Sequence of Category records.
Definition: bseapi.idl:904
Definition: bsecontainer.hh:24
The Bse namespace contains all functions of the synthesis engine.
Definition: bstbseutils.cc:91
typedef int64_t
Representation of an icon pixel image.
Definition: bseapi.idl:387
Definition: bsepcmdevice.hh:40
void bse_server_script_error(BseServer *server, const gchar *script_name, const gchar *proc_name, const gchar *reason)
Definition: bseserver.cc:727
A note description provides all needed details about a specific note. ".
Definition: bseapi.idl:442
Definition: bsepcmwriter.hh:17
AuxData - record to describe entity attributes with "key=value" strings.
Definition: bseapi.idl:394
STL class.
Definition: bseserver.hh:17
Definition: bsecontainer.hh:27
Structure containing meta data for multi wave samples.
Definition: bseapi.idl:788
Definition: bseobject.hh:57
Definition: bsejanitor.hh:17
Definition: bsesource.hh:82
Definition: sfiring.hh:21
int64_t int64
uint8_t uint8
Definition: bseproject.hh:17
Definition: bsemididevice.hh:23
Definition: bseserver.hh:33
BseServer * bse_server_get(void)
Definition: bseserver.cc:351
void bse_server_script_start(BseServer *server, BseJanitor *janitor)
Definition: bseserver.cc:699
AuxDataSeq - a variable length list of AuxData records.
Definition: bseapi.idl:400
Structure for submission of user interface messages from BSE.
Definition: bseapi.idl:418
Definition: bseserver.hh:97