~ubuntu-branches/ubuntu/vivid/aeolus/vivid

« back to all changes in this revision

Viewing changes to source/global.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2010-04-19 19:12:51 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100419191251-hgarjfcdfl7c0ryl
Tags: 0.8.4-3
debian/patches/01-makefile.patch: Drop -march=native flag, it isn't valid
for Debian packages as the results are unpredictable, thanks to
Bastian Blank for reporting this (Closes: #578278).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net>
 
3
    Copyright (C) 2008 Hans Fugal <hans@fugal.net> (OSX version)
 
4
    
 
5
    This program is free software; you can redistribute it and/or modify
 
6
    it under the terms of the GNU General Public License as published by
 
7
    the Free Software Foundation; either version 2 of the License, or
 
8
    (at your option) any later version.
 
9
 
 
10
    This program is distributed in the hope that it will be useful,
 
11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
    GNU General Public License for more details.
 
14
 
 
15
    You should have received a copy of the GNU General Public License
 
16
    along with this program; if not, write to the Free Software
 
17
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
18
*/
 
19
 
 
20
 
 
21
#ifndef __GLOBAL_H
 
22
#define __GLOBAL_H
 
23
 
 
24
 
 
25
#ifdef __APPLE__
 
26
#include <machine/endian.h>
 
27
#define __LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN
 
28
#define __BIG_ENDIAN    __DARWIN_BIG_ENDIAN
 
29
#define __PDP_ENDIAN    __DARWIN_PDP_ENDIAN
 
30
#define __BYTE_ORDER    __DARWIN_BYTE_ORDER
 
31
#else
 
32
#include <endian.h>
 
33
#endif
 
34
 
 
35
#ifdef __BYTE_ORDER
 
36
#if (__BYTE_ORDER == __LITTLE_ENDIAN)
 
37
#define WR2(p,v) { (p)[0] = v; (p)[1] = v >> 8; }
 
38
#define WR4(p,v) { (p)[0] = v; (p)[1] = v >> 8;  (p)[2] = v >> 16;  (p)[3] = v >> 24; }
 
39
#define RD2(p) ((p)[0] + ((p)[1] << 8));
 
40
#define RD4(p) ((p)[0] + ((p)[1] << 8) + ((p)[2] << 16) + ((p)[3] << 24));
 
41
#elif (__BYTE_ORDER == __BIG_ENDIAN)
 
42
#define WR2(p,v) { (p)[1] = v; (p)[0] = v >> 8; }
 
43
#define WR4(p,v) { (p)[3] = v; (p)[2] = v >> 8;  (p)[1] = v >> 16;  (p)[0] = v >> 24; }
 
44
#define RD2(p) ((p)[1] + ((p)[0] << 8));
 
45
#define RD4(p) ((p)[3] + ((p)[2] << 8) + ((p)[1] << 16) + ((p)[0] << 24));
 
46
#else
 
47
#error Byte order is not supported !
 
48
#endif
 
49
#else
 
50
#error Byte order is undefined !
 
51
#endif
 
52
 
 
53
#include "lfqueue.h"
 
54
 
 
55
 
 
56
enum // GLOBAL LIMITS 
 
57
{
 
58
    NASECT = 4,
 
59
    NDIVIS = 8,
 
60
    NKEYBD = 6,
 
61
    NGROUP = 8,
 
62
    NNOTES = 61,
 
63
    NBANK  = 32,
 
64
    NPRES  = 32
 
65
};
 
66
 
 
67
 
 
68
#define MIDICTL_SWELL 7
 
69
#define SWELL_MIN 0.0f
 
70
#define SWELL_MAX 1.0f
 
71
#define SWELL_DEF 1.0f
 
72
 
 
73
#define MIDICTL_TFREQ 12
 
74
#define TFREQ_MIN 2.0f
 
75
#define TFREQ_MAX 8.0f
 
76
#define TFREQ_DEF 4.0f
 
77
 
 
78
#define MIDICTL_TMODD 13
 
79
#define TMODD_MIN 0.0f
 
80
#define TMODD_MAX 0.6f
 
81
#define TMODD_DEF 0.3f
 
82
 
 
83
#define MIDICTL_BANK   32
 
84
#define MIDICTL_HOLD   64
 
85
#define MIDICTL_IFELM  98
 
86
#define MIDICTL_ASOFF 120
 
87
#define MIDICTL_ANOFF 123
 
88
 
 
89
#define KEYS_MASK 63
 
90
#define HOLD_MASK 64
 
91
#define ALL_MASK 127
 
92
 
 
93
 
 
94
class Fparm
 
95
{
 
96
public:
 
97
 
 
98
    float  _val;
 
99
    float  _min;
 
100
    float  _max;
 
101
};
 
102
 
 
103
 
 
104
#endif
 
105