/[svn]/linuxsampler/trunk/src/common/global.h
ViewVC logotype

Annotation of /linuxsampler/trunk/src/common/global.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 829 - (hide annotations) (download) (as text)
Sat Jan 14 14:07:47 2006 UTC (18 years, 3 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 5652 byte(s)
* implemented portamento mode and solo mode (a.k.a 'mono mode'):
  all modes can be altered via standard GM messages, that is CC5 for
  altering portamento time, CC65 for enabling / disabling portamento
  mode, CC126 for enabling solo mode and CC127 for disabling solo mode
* fixed EG3 (pitch envelope) synthesis which was neutral all the time
* configure.in: do not automatically pick optimized gcc flags if the user
  already provided some on his own (as CXXFLAGS)

1 schoenebeck 53 /***************************************************************************
2     * *
3     * LinuxSampler - modular, streaming capable sampler *
4     * *
5 schoenebeck 56 * Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck *
6 schoenebeck 829 * Copyright (C) 2005, 2006 Christian Schoenebeck *
7 schoenebeck 53 * *
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     // All application global declarations are defined here.
25    
26     #ifndef __GLOBAL_H__
27     #define __GLOBAL_H__
28    
29     #include <stdlib.h>
30     #include <stdint.h>
31     #include <stdio.h>
32    
33     #include <string>
34 senkov 170 #include <sstream>
35 schoenebeck 53
36     #ifdef HAVE_CONFIG_H
37 schoenebeck 554 # include <config.h>
38 schoenebeck 53 #endif
39    
40 schoenebeck 554 // Make sure all mandatory configuration macros are defined.
41     // We don't care about optional configuration macros though.
42     #ifndef CONFIG_MAX_PITCH
43     # error "Configuration macro CONFIG_MAX_PITCH not defined!"
44     #endif // CONFIG_MAX_PITCH
45     #ifndef CONFIG_MAX_EVENTS_PER_FRAGMENT
46     # error "Configuration macro CONFIG_MAX_EVENTS_PER_FRAGMENT not defined!"
47     #endif // CONFIG_MAX_EVENTS_PER_FRAGMENT
48     #ifndef CONFIG_EG_BOTTOM
49     # error "Configuration macro CONFIG_EG_BOTTOM not defined!"
50     #endif // CONFIG_EG_BOTTOM
51     #ifndef CONFIG_EG_MIN_RELEASE_TIME
52     # error "Configuration macro CONFIG_EG_MIN_RELEASE_TIME not defined!"
53     #endif // CONFIG_EG_MIN_RELEASE_TIME
54     #ifndef CONFIG_REFILL_STREAMS_PER_RUN
55     # error "Configuration macro CONFIG_REFILL_STREAMS_PER_RUN not defined!"
56     #endif // CONFIG_REFILL_STREAMS_PER_RUN
57     #ifndef CONFIG_STREAM_MIN_REFILL_SIZE
58     # error "Configuration macro CONFIG_STREAM_MIN_REFILL_SIZE not defined!"
59     #endif // CONFIG_STREAM_MIN_REFILL_SIZE
60     #ifndef CONFIG_STREAM_MAX_REFILL_SIZE
61     # error "Configuration macro CONFIG_STREAM_MAX_REFILL_SIZE not defined!"
62     #endif // CONFIG_STREAM_MAX_REFILL_SIZE
63     #ifndef CONFIG_STREAM_BUFFER_SIZE
64     # error "Configuration macro CONFIG_STREAM_BUFFER_SIZE not defined!"
65     #endif // CONFIG_STREAM_BUFFER_SIZE
66     #ifndef CONFIG_MAX_STREAMS
67     # error "Configuration macro CONFIG_MAX_STREAMS not defined!"
68     #endif // CONFIG_MAX_STREAMS
69     #ifndef CONFIG_MAX_VOICES
70     # error "Configuration macro CONFIG_MAX_VOICES not defined!"
71     #endif // CONFIG_MAX_VOICES
72 schoenebeck 738 #ifndef CONFIG_DEFAULT_SUBFRAGMENT_SIZE
73     # error "Configuration macro CONFIG_DEFAULT_SUBFRAGMENT_SIZE not defined!"
74     #endif // CONFIG_DEFAULT_SUBFRAGMENT_SIZE
75 schoenebeck 554 #ifndef CONFIG_VOICE_STEAL_ALGO
76     # error "Configuration macro CONFIG_VOICE_STEAL_ALGO not defined!"
77     #endif // CONFIG_VOICE_STEAL_ALGO
78     #ifndef CONFIG_SYSEX_BUFFER_SIZE
79     # error "Configuration macro CONFIG_SYSEX_BUFFER_SIZE not defined!"
80     #endif // CONFIG_SYSEX_BUFFER_SIZE
81     #ifndef CONFIG_FILTER_CUTOFF_MIN
82     # error "Configuration macro CONFIG_FILTER_CUTOFF_MIN not defined!"
83     #endif // CONFIG_FILTER_CUTOFF_MIN
84     #ifndef CONFIG_FILTER_CUTOFF_MAX
85     # error "Configuration macro CONFIG_FILTER_CUTOFF_MAX not defined!"
86     #endif // CONFIG_FILTER_CUTOFF_MAX
87 schoenebeck 829 #ifndef CONFIG_PORTAMENTO_TIME_MIN
88     # error "Configuration macro CONFIG_PORTAMENTO_TIME_MIN not defined!"
89     #endif // CONFIG_PORTAMENTO_TIME_MIN
90     #ifndef CONFIG_PORTAMENTO_TIME_MAX
91     # error "Configuration macro CONFIG_PORTAMENTO_TIME_MAX not defined!"
92     #endif // CONFIG_PORTAMENTO_TIME_MAX
93     #ifndef CONFIG_PORTAMENTO_TIME_DEFAULT
94     # error "Configuration macro CONFIG_PORTAMENTO_TIME_DEFAULT not defined!"
95     #endif // CONFIG_PORTAMENTO_TIME_DEFAULT
96 schoenebeck 271
97 schoenebeck 554 #if CONFIG_DEBUG_LEVEL > 0
98     # define dmsg(debuglevel,x) if (CONFIG_DEBUG_LEVEL >= debuglevel) {printf x; fflush(stdout);}
99 schoenebeck 53 #else
100     # define dmsg(debuglevel,x)
101 schoenebeck 554 #endif // CONFIG_DEBUG_LEVEL > 0
102 schoenebeck 53
103 schoenebeck 319 #define EMMS __asm__ __volatile__ ("emms" ::: "st", "st(1)", "st(2)", "st(3)", "st(4)", "st(5)", "st(6)", "st(7)", "mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7")
104    
105 schoenebeck 53 /// defines globally the bit depth of used samples
106     typedef int16_t sample_t;
107    
108     typedef std::string String;
109    
110     /**
111 iliev 724 * Whether a function / method call was successful, or if warnings or even an
112 schoenebeck 53 * error occured.
113     */
114     enum result_type_t {
115     result_type_success,
116     result_type_warning,
117     result_type_error
118     };
119    
120     /**
121     * Used whenever a detailed description of the result of a function / method
122     * call is needed.
123     */
124     struct result_t {
125     result_type_t type; ///< success, warning or error
126     int code; ///< warning or error code
127     String message; ///< detailed warning or error message
128     };
129    
130 senkov 170 template<class T> inline String ToString(T o) {
131     std::stringstream ss;
132     ss << o;
133     return ss.str();
134     }
135    
136 schoenebeck 53 #endif // __GLOBAL_H__

  ViewVC Help
Powered by ViewVC