MuseScore  3.4
Music composition and notation
messages.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18 
19 
20 #ifndef __MESSAGES_H
21 #define __MESSAGES_H
22 
23 #include "rankwave.h"
24 #include "asection.h"
25 #include "addsynth.h"
26 #include "global.h"
27 
28 
29 class ITC_mesg {
30  public:
31  ITC_mesg() {}
32  ITC_mesg(int) {};
33  };
34 
35 enum
36 {
37  FM_SLAVE = 8,
38  FM_IFACE = 9,
39  FM_MODEL = 10,
40  FM_IMIDI = 11,
41  FM_AUDIO = 12,
42  FM_TXTIP = 13,
43  TO_SLAVE = 8,
44  TO_IFACE = 9,
45  TO_MODEL = 10,
46  TO_IMIDI = 11,
47  TO_AUDIO = 12,
48  EV_RLINE = 0,
49  EV_XWIN = 16,
50  EV_QMIDI = 24,
51  EV_SYNC = 30,
52  EV_EXIT = 31
53 };
54 
55 
56 enum
57 {
65 
68  MT_IFC_ELCLR, // must be in this order
90 };
91 
92 
93 #define SRC_GUI_DRAG 100
94 #define SRC_GUI_DONE 101
95 #define SRC_MIDI_PAR 200
96 
97 class M_midi_info : public ITC_mesg
98 {
99 public:
100 
102 
103  int _client;
104  int _ipport;
105  uint16_t _chbits [16];
106 };
107 
108 
109 class M_new_divis : public ITC_mesg
110 {
111 public:
112 
114 
115  int _flags;
116  int _dmask;
117  int _asect;
118  float _swell;
119  float _tfreq;
120  float _tmodd;
121 };
122 
123 
124 class M_def_rank : public ITC_mesg
125 {
126 public:
127 
128  M_def_rank (int type) : ITC_mesg (type) {}
129 
130  int _divis;
131  int _rank;
132  int _group;
133  int _ifelm;
134  float _fsamp;
135  float _fbase;
136  float *_scale;
139  const char *_path;
140 };
141 
142 //---------------------------------------------------------
143 // M_ifc_init
144 //---------------------------------------------------------
145 
146 class M_ifc_init : public ITC_mesg
147  {
148  public:
149 
151 
152  const char *_stops;
153  const char *_waves;
154  const char *_instr;
155  const char *_appid;
156  int _client;
157  int _ipport;
158  int _nasect;
159  int _nkeybd;
160  int _ndivis;
161  int _ngroup;
162  int _ntempe;
163  struct {
164  const char *_label;
165  int _flags;
166  } _keybdd [NKEYBD];
167  struct {
168  const char *_label;
169  int _asect;
170  int _flags;
171  } _divisd [NDIVIS];
172  struct {
173  const char *_label;
174  int _nifelm;
175  struct {
176  const char *_label;
177  const char *_mnemo;
178  int _type;
179  } _ifelmd [32];
180  } _groupd [8];
181  struct {
182  const char *_label;
183  const char *_mnemo;
184  } _temped [16];
185  };
186 
187 
188 class M_ifc_ifelm : public ITC_mesg
189 {
190 public:
191 
192  M_ifc_ifelm (int type, int g, int i) :
193  ITC_mesg (type),
194  _group (g),
195  _ifelm (i)
196  {}
197 
198  int _group;
199  int _ifelm;
200 };
201 
202 
203 class M_ifc_aupar : public ITC_mesg
204 {
205 public:
206 
207  M_ifc_aupar (int s, int a, int p, float v) :
209  _srcid (s),
210  _asect (a),
211  _parid (p),
212  _value (v)
213  {}
214 
215  int _srcid;
216  int _asect;
217  int _parid;
218  float _value;
219 };
220 
221 
222 class M_ifc_dipar : public ITC_mesg
223 {
224 public:
225 
226  M_ifc_dipar (int s, int d, int p, float v) :
228  _srcid (s),
229  _divis (d),
230  _parid (p),
231  _value (v)
232  {}
233 
234  int _srcid;
235  int _divis;
236  int _parid;
237  float _value;
238 };
239 
240 
241 class M_ifc_retune : public ITC_mesg
242 {
243 public:
244 
245  M_ifc_retune (float f, int t) :
247  _freq (f),
248  _temp (t)
249  {}
250 
251  float _freq;
252  int _temp;
253 };
254 
255 
256 class M_ifc_anoff : public ITC_mesg
257 {
258 public:
259 
260  M_ifc_anoff (int bits) :
262  _bits (bits)
263  {
264  }
265 
266  int _bits;
267 };
268 
269 
270 class M_ifc_chconf : public ITC_mesg
271 {
272 public:
273 
274  M_ifc_chconf (int type, int index, uint16_t *bits) :
275  ITC_mesg (type),
276  _index (index)
277  {
278  if (bits) memcpy (_bits, bits, 16 * sizeof (uint16_t));
279  else memset (_bits, 0, 16 * sizeof (uint16_t));
280  }
281 
282  int _index;
283  uint16_t _bits [16];
284 };
285 
286 
287 class M_ifc_preset : public ITC_mesg
288 {
289 public:
290 
291  M_ifc_preset (int type, int bank, int pres, int stat, uint32_t *bits) :
292  ITC_mesg (type),
293  _bank (bank),
294  _pres (pres),
295  _stat (stat)
296  {
297  if (bits) memcpy (_bits, bits, NGROUP * sizeof (uint32_t));
298  else memset (_bits, 0, NGROUP * sizeof (uint32_t));
299  }
300 
301  int _bank;
302  int _pres;
303  int _stat;
304  uint32_t _bits [NGROUP];
305 };
306 
307 
308 class M_ifc_edit : public ITC_mesg
309 {
310 public:
311 
312  M_ifc_edit (int type, int group, int ifelm, Addsynth *synth) :
313  ITC_mesg (type),
314  _group (group),
315  _ifelm (ifelm),
316  _synth (synth)
317  {}
318 
319  int _group;
320  int _ifelm;
322 };
323 
324 
325 class M_ifc_txtip : public ITC_mesg
326 {
327 public:
328 
329  M_ifc_txtip (void) :
331  _line (0)
332  {}
333 
334  char *_line;
335 };
336 
337 
338 #endif
339 
Definition: messages.h:75
Definition: messages.h:58
Definition: messages.h:48
const char * _waves
Definition: messages.h:153
int _client
Definition: messages.h:103
ITC_mesg()
Definition: messages.h:31
float _swell
Definition: messages.h:118
int _type
Definition: messages.h:178
int _group
Definition: messages.h:198
Definition: global.h:62
int _ntempe
Definition: messages.h:162
int _ifelm
Definition: messages.h:320
Definition: messages.h:74
int _ndivis
Definition: messages.h:160
const char * _appid
Definition: messages.h:155
Definition: messages.h:51
Definition: messages.h:73
M_def_rank(int type)
Definition: messages.h:128
Definition: messages.h:84
float _fsamp
Definition: messages.h:134
Definition: messages.h:66
Definition: messages.h:60
Definition: messages.h:85
M_ifc_init()
Definition: messages.h:150
Definition: messages.h:61
int _asect
Definition: messages.h:216
Definition: messages.h:47
Definition: messages.h:71
const char * _label
Definition: messages.h:164
int _group
Definition: messages.h:132
int _temp
Definition: messages.h:252
Definition: messages.h:146
Definition: messages.h:40
Definition: messages.h:29
Addsynth * _sdef
Definition: messages.h:137
Definition: messages.h:287
Definition: messages.h:68
Definition: messages.h:62
Definition: addsynth.h:85
Definition: messages.h:50
int _parid
Definition: messages.h:217
int _client
Definition: messages.h:156
int _divis
Definition: messages.h:235
Definition: messages.h:63
Definition: messages.h:124
M_new_divis(void)
Definition: messages.h:113
Definition: messages.h:69
Definition: messages.h:308
Definition: messages.h:97
Definition: messages.h:188
Definition: messages.h:89
Definition: messages.h:82
char * _line
Definition: messages.h:334
ITC_mesg(int)
Definition: messages.h:32
M_ifc_preset(int type, int bank, int pres, int stat, uint32_t *bits)
Definition: messages.h:291
int _group
Definition: messages.h:319
int _stat
Definition: messages.h:303
Definition: messages.h:80
int _flags
Definition: messages.h:115
const char * _instr
Definition: messages.h:154
M_ifc_txtip(void)
Definition: messages.h:329
Definition: messages.h:325
int _asect
Definition: messages.h:169
Definition: messages.h:241
int _flags
Definition: messages.h:165
int _bits
Definition: messages.h:266
Definition: messages.h:38
Definition: messages.h:109
Definition: messages.h:43
int _index
Definition: messages.h:282
M_ifc_chconf(int type, int index, uint16_t *bits)
Definition: messages.h:274
Definition: messages.h:72
const char * _stops
Definition: messages.h:152
int _ifelm
Definition: messages.h:199
Definition: rankwave.h:88
Definition: messages.h:88
int _nifelm
Definition: messages.h:174
Definition: messages.h:46
Definition: messages.h:41
Definition: messages.h:49
Definition: messages.h:77
Definition: messages.h:87
Definition: messages.h:86
float * _scale
Definition: messages.h:136
Definition: messages.h:203
Definition: global.h:61
float _tmodd
Definition: messages.h:120
Definition: messages.h:81
Definition: messages.h:37
M_ifc_edit(int type, int group, int ifelm, Addsynth *synth)
Definition: messages.h:312
Addsynth * _synth
Definition: messages.h:321
Definition: messages.h:67
Definition: messages.h:45
float _tfreq
Definition: messages.h:119
int _ipport
Definition: messages.h:104
int _bank
Definition: messages.h:301
Definition: messages.h:222
M_ifc_anoff(int bits)
Definition: messages.h:260
M_ifc_dipar(int s, int d, int p, float v)
Definition: messages.h:226
int _nkeybd
Definition: messages.h:159
Definition: messages.h:270
Definition: global.h:60
int _divis
Definition: messages.h:130
Definition: messages.h:44
int _srcid
Definition: messages.h:215
const char * _path
Definition: messages.h:139
Definition: messages.h:52
Definition: messages.h:76
int _pres
Definition: messages.h:302
Definition: messages.h:59
Definition: messages.h:78
const char * _mnemo
Definition: messages.h:177
Definition: messages.h:79
M_midi_info(void)
Definition: messages.h:101
float _value
Definition: messages.h:237
Definition: messages.h:64
int _ngroup
Definition: messages.h:161
Definition: messages.h:70
int _ipport
Definition: messages.h:157
Rankwave * _wave
Definition: messages.h:138
int _parid
Definition: messages.h:236
Definition: messages.h:83
int _srcid
Definition: messages.h:234
float _freq
Definition: messages.h:251
int _nasect
Definition: messages.h:158
float _fbase
Definition: messages.h:135
float _value
Definition: messages.h:218
M_ifc_retune(float f, int t)
Definition: messages.h:245
int _ifelm
Definition: messages.h:133
int _dmask
Definition: messages.h:116
int _asect
Definition: messages.h:117
Definition: messages.h:42
int _rank
Definition: messages.h:131
M_ifc_aupar(int s, int a, int p, float v)
Definition: messages.h:207
Definition: messages.h:256
M_ifc_ifelm(int type, int g, int i)
Definition: messages.h:192
Definition: messages.h:39