/[svn]/linuxsampler/trunk/src/common/global_private.cpp
ViewVC logotype

Contents of /linuxsampler/trunk/src/common/global_private.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1800 - (show annotations) (download)
Sun Dec 7 01:26:46 2008 UTC (15 years, 4 months ago) by schoenebeck
File size: 6037 byte(s)
* maximum voices and disk streams can now be altered at runtime (added new
  LSCP commands "GET VOICES", "SET VOICES", "GET STREAMS", "SET STREAMS"
  and accordingly new LSCP events "GLOBAL_INFO:VOICES" and
  "GLOBAL_INFO:STREAMS")
* bumped version to 0.5.1.8cvs

1 /***************************************************************************
2 * *
3 * LinuxSampler - modular, streaming capable sampler *
4 * *
5 * Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck *
6 * Copyright (C) 2005 - 2008 Christian Schoenebeck *
7 * *
8 * This program is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This program is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU General Public License *
19 * along with this program; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
21 * MA 02111-1307 USA *
22 ***************************************************************************/
23
24 // Allow to avoid inclusion of config.h
25 // (we used it for the _old_ xcode project file to avoid inclusion of
26 // config.h here and rather used our manually maintained version.h)
27 #ifndef OVERRIDE_CONFIG_H
28 # include <config.h>
29 #endif
30
31 // Make sure all mandatory configuration macros are defined.
32 // We don't care about optional configuration macros though.
33 #ifndef CONFIG_GLOBAL_ATTENUATION_DEFAULT
34 # error "Configuration macro CONFIG_GLOBAL_ATTENUATION_DEFAULT not defined!"
35 #endif // CONFIG_GLOBAL_ATTENUATION_DEFAULT
36 #ifndef CONFIG_MAX_PITCH
37 # error "Configuration macro CONFIG_MAX_PITCH not defined!"
38 #endif // CONFIG_MAX_PITCH
39 #ifndef CONFIG_MAX_EVENTS_PER_FRAGMENT
40 # error "Configuration macro CONFIG_MAX_EVENTS_PER_FRAGMENT not defined!"
41 #endif // CONFIG_MAX_EVENTS_PER_FRAGMENT
42 #ifndef CONFIG_EG_BOTTOM
43 # error "Configuration macro CONFIG_EG_BOTTOM not defined!"
44 #endif // CONFIG_EG_BOTTOM
45 #ifndef CONFIG_EG_MIN_RELEASE_TIME
46 # error "Configuration macro CONFIG_EG_MIN_RELEASE_TIME not defined!"
47 #endif // CONFIG_EG_MIN_RELEASE_TIME
48 #ifndef CONFIG_REFILL_STREAMS_PER_RUN
49 # error "Configuration macro CONFIG_REFILL_STREAMS_PER_RUN not defined!"
50 #endif // CONFIG_REFILL_STREAMS_PER_RUN
51 #ifndef CONFIG_STREAM_MIN_REFILL_SIZE
52 # error "Configuration macro CONFIG_STREAM_MIN_REFILL_SIZE not defined!"
53 #endif // CONFIG_STREAM_MIN_REFILL_SIZE
54 #ifndef CONFIG_STREAM_MAX_REFILL_SIZE
55 # error "Configuration macro CONFIG_STREAM_MAX_REFILL_SIZE not defined!"
56 #endif // CONFIG_STREAM_MAX_REFILL_SIZE
57 #ifndef CONFIG_STREAM_BUFFER_SIZE
58 # error "Configuration macro CONFIG_STREAM_BUFFER_SIZE not defined!"
59 #endif // CONFIG_STREAM_BUFFER_SIZE
60 #ifndef CONFIG_DEFAULT_MAX_STREAMS
61 # error "Configuration macro CONFIG_DEFAULT_MAX_STREAMS not defined!"
62 #endif // CONFIG_DEFAULT_MAX_STREAMS
63 #ifndef CONFIG_DEFAULT_MAX_VOICES
64 # error "Configuration macro CONFIG_DEFAULT_MAX_VOICES not defined!"
65 #endif // CONFIG_DEFAULT_MAX_VOICES
66 #ifndef CONFIG_DEFAULT_SUBFRAGMENT_SIZE
67 # error "Configuration macro CONFIG_DEFAULT_SUBFRAGMENT_SIZE not defined!"
68 #endif // CONFIG_DEFAULT_SUBFRAGMENT_SIZE
69 #ifndef CONFIG_VOICE_STEAL_ALGO
70 # error "Configuration macro CONFIG_VOICE_STEAL_ALGO not defined!"
71 #endif // CONFIG_VOICE_STEAL_ALGO
72 #ifndef CONFIG_SYSEX_BUFFER_SIZE
73 # error "Configuration macro CONFIG_SYSEX_BUFFER_SIZE not defined!"
74 #endif // CONFIG_SYSEX_BUFFER_SIZE
75 #ifndef CONFIG_FILTER_CUTOFF_MIN
76 # error "Configuration macro CONFIG_FILTER_CUTOFF_MIN not defined!"
77 #endif // CONFIG_FILTER_CUTOFF_MIN
78 #ifndef CONFIG_FILTER_CUTOFF_MAX
79 # error "Configuration macro CONFIG_FILTER_CUTOFF_MAX not defined!"
80 #endif // CONFIG_FILTER_CUTOFF_MAX
81 #ifndef CONFIG_PORTAMENTO_TIME_MIN
82 # error "Configuration macro CONFIG_PORTAMENTO_TIME_MIN not defined!"
83 #endif // CONFIG_PORTAMENTO_TIME_MIN
84 #ifndef CONFIG_PORTAMENTO_TIME_MAX
85 # error "Configuration macro CONFIG_PORTAMENTO_TIME_MAX not defined!"
86 #endif // CONFIG_PORTAMENTO_TIME_MAX
87 #ifndef CONFIG_PORTAMENTO_TIME_DEFAULT
88 # error "Configuration macro CONFIG_PORTAMENTO_TIME_DEFAULT not defined!"
89 #endif // CONFIG_PORTAMENTO_TIME_DEFAULT
90
91 // this is the sampler global volume coefficient that should be obeyed by all
92 // sampler engine implementations
93 double GLOBAL_VOLUME = CONFIG_GLOBAL_ATTENUATION_DEFAULT;
94
95 // this is the sampler global setting for maximum voices
96 int GLOBAL_MAX_VOICES = CONFIG_DEFAULT_MAX_VOICES;
97
98 // this is the sampler global setting for maximum disk streams
99 int GLOBAL_MAX_STREAMS = CONFIG_DEFAULT_MAX_STREAMS;
100
101 int hexToNumber(char hex_digit) {
102 switch (hex_digit) {
103 case '0': return 0;
104 case '1': return 1;
105 case '2': return 2;
106 case '3': return 3;
107 case '4': return 4;
108 case '5': return 5;
109 case '6': return 6;
110 case '7': return 7;
111 case '8': return 8;
112 case '9': return 9;
113
114 case 'a': return 10;
115 case 'b': return 11;
116 case 'c': return 12;
117 case 'd': return 13;
118 case 'e': return 14;
119 case 'f': return 15;
120
121 case 'A': return 10;
122 case 'B': return 11;
123 case 'C': return 12;
124 case 'D': return 13;
125 case 'E': return 14;
126 case 'F': return 15;
127
128 default: return 0; //TODO: we might want to throw an exception here
129 }
130 }
131
132 int hexsToNumber(char hex_digit0, char hex_digit1) {
133 return hexToNumber(hex_digit1)*16 + hexToNumber(hex_digit0);
134 }

  ViewVC Help
Powered by ViewVC