91 |
// this is the sampler global volume coefficient that should be obeyed by all |
// this is the sampler global volume coefficient that should be obeyed by all |
92 |
// sampler engine implementations |
// sampler engine implementations |
93 |
double GLOBAL_VOLUME = CONFIG_GLOBAL_ATTENUATION_DEFAULT; |
double GLOBAL_VOLUME = CONFIG_GLOBAL_ATTENUATION_DEFAULT; |
94 |
|
|
95 |
|
int hexToNumber(char hex_digit) { |
96 |
|
switch (hex_digit) { |
97 |
|
case '0': return 0; |
98 |
|
case '1': return 1; |
99 |
|
case '2': return 2; |
100 |
|
case '3': return 3; |
101 |
|
case '4': return 4; |
102 |
|
case '5': return 5; |
103 |
|
case '6': return 6; |
104 |
|
case '7': return 7; |
105 |
|
case '8': return 8; |
106 |
|
case '9': return 9; |
107 |
|
|
108 |
|
case 'a': return 10; |
109 |
|
case 'b': return 11; |
110 |
|
case 'c': return 12; |
111 |
|
case 'd': return 13; |
112 |
|
case 'e': return 14; |
113 |
|
case 'f': return 15; |
114 |
|
|
115 |
|
case 'A': return 10; |
116 |
|
case 'B': return 11; |
117 |
|
case 'C': return 12; |
118 |
|
case 'D': return 13; |
119 |
|
case 'E': return 14; |
120 |
|
case 'F': return 15; |
121 |
|
|
122 |
|
default: return 0; //TODO: we might want to throw an exception here |
123 |
|
} |
124 |
|
} |
125 |
|
|
126 |
|
int hexsToNumber(char hex_digit0, char hex_digit1) { |
127 |
|
return hexToNumber(hex_digit1)*16 + hexToNumber(hex_digit0); |
128 |
|
} |