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