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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1200 by iliev, Thu May 24 14:04:18 2007 UTC revision 1792 by persson, Sun Nov 16 19:19:26 2008 UTC
# Line 3  Line 3 
3   *   LinuxSampler - modular, streaming capable sampler                     *   *   LinuxSampler - modular, streaming capable sampler                     *
4   *                                                                         *   *                                                                         *
5   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *
6   *   Copyright (C) 2005, 2006 Christian Schoenebeck                        *   *   Copyright (C) 2005 - 2007 Christian Schoenebeck                       *
7   *                                                                         *   *                                                                         *
8   *   This program is free software; you can redistribute it and/or modify  *   *   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  *   *   it under the terms of the GNU General Public License as published by  *
# Line 21  Line 21 
21   *   MA  02111-1307  USA                                                   *   *   MA  02111-1307  USA                                                   *
22   ***************************************************************************/   ***************************************************************************/
23    
24  // All application global declarations are defined here.  // All application global declarations that HAVE to be exposed to the C++
25    // API are defined here.
26    
27  #ifndef __LS_GLOBAL_H__  #ifndef __LS_GLOBAL_H__
28  #define __LS_GLOBAL_H__  #define __LS_GLOBAL_H__
# Line 31  Line 32 
32  #include <stdio.h>  #include <stdio.h>
33    
34  #include <string>  #include <string>
 #include <sstream>  
   
 // i.e. OSX people using the xcode project file will avoid inclusion of  
 // config.h here and rather use their manually maintained version.h  
 #ifndef OVERRIDE_CONFIG_H  
 # include <config.h>  
 #endif  
   
 // Make sure all mandatory configuration macros are defined.  
 // We don't care about optional configuration macros though.  
 #ifndef CONFIG_MAX_PITCH  
 # error "Configuration macro CONFIG_MAX_PITCH not defined!"  
 #endif // CONFIG_MAX_PITCH  
 #ifndef CONFIG_MAX_EVENTS_PER_FRAGMENT  
 # error "Configuration macro CONFIG_MAX_EVENTS_PER_FRAGMENT not defined!"  
 #endif // CONFIG_MAX_EVENTS_PER_FRAGMENT  
 #ifndef CONFIG_EG_BOTTOM  
 # error "Configuration macro CONFIG_EG_BOTTOM not defined!"  
 #endif // CONFIG_EG_BOTTOM  
 #ifndef CONFIG_EG_MIN_RELEASE_TIME  
 # error "Configuration macro CONFIG_EG_MIN_RELEASE_TIME not defined!"  
 #endif // CONFIG_EG_MIN_RELEASE_TIME  
 #ifndef CONFIG_REFILL_STREAMS_PER_RUN  
 # error "Configuration macro CONFIG_REFILL_STREAMS_PER_RUN not defined!"  
 #endif // CONFIG_REFILL_STREAMS_PER_RUN  
 #ifndef CONFIG_STREAM_MIN_REFILL_SIZE  
 # error "Configuration macro CONFIG_STREAM_MIN_REFILL_SIZE not defined!"  
 #endif // CONFIG_STREAM_MIN_REFILL_SIZE  
 #ifndef CONFIG_STREAM_MAX_REFILL_SIZE  
 # error "Configuration macro CONFIG_STREAM_MAX_REFILL_SIZE not defined!"  
 #endif // CONFIG_STREAM_MAX_REFILL_SIZE  
 #ifndef CONFIG_STREAM_BUFFER_SIZE  
 # error "Configuration macro CONFIG_STREAM_BUFFER_SIZE not defined!"  
 #endif // CONFIG_STREAM_BUFFER_SIZE  
 #ifndef CONFIG_MAX_STREAMS  
 # error "Configuration macro CONFIG_MAX_STREAMS not defined!"  
 #endif // CONFIG_MAX_STREAMS  
 #ifndef CONFIG_MAX_VOICES  
 # error "Configuration macro CONFIG_MAX_VOICES not defined!"  
 #endif // CONFIG_MAX_VOICES  
 #ifndef CONFIG_DEFAULT_SUBFRAGMENT_SIZE  
 # error "Configuration macro CONFIG_DEFAULT_SUBFRAGMENT_SIZE not defined!"  
 #endif // CONFIG_DEFAULT_SUBFRAGMENT_SIZE  
 #ifndef CONFIG_VOICE_STEAL_ALGO  
 # error "Configuration macro CONFIG_VOICE_STEAL_ALGO not defined!"  
 #endif // CONFIG_VOICE_STEAL_ALGO  
 #ifndef CONFIG_SYSEX_BUFFER_SIZE  
 # error "Configuration macro CONFIG_SYSEX_BUFFER_SIZE not defined!"  
 #endif // CONFIG_SYSEX_BUFFER_SIZE  
 #ifndef CONFIG_FILTER_CUTOFF_MIN  
 # error "Configuration macro CONFIG_FILTER_CUTOFF_MIN not defined!"  
 #endif // CONFIG_FILTER_CUTOFF_MIN  
 #ifndef CONFIG_FILTER_CUTOFF_MAX  
 # error "Configuration macro CONFIG_FILTER_CUTOFF_MAX not defined!"  
 #endif // CONFIG_FILTER_CUTOFF_MAX  
 #ifndef CONFIG_PORTAMENTO_TIME_MIN  
 # error "Configuration macro CONFIG_PORTAMENTO_TIME_MIN not defined!"  
 #endif // CONFIG_PORTAMENTO_TIME_MIN  
 #ifndef CONFIG_PORTAMENTO_TIME_MAX  
 # error "Configuration macro CONFIG_PORTAMENTO_TIME_MAX not defined!"  
 #endif // CONFIG_PORTAMENTO_TIME_MAX  
 #ifndef CONFIG_PORTAMENTO_TIME_DEFAULT  
 # error "Configuration macro CONFIG_PORTAMENTO_TIME_DEFAULT not defined!"  
 #endif // CONFIG_PORTAMENTO_TIME_DEFAULT  
   
 #if CONFIG_DEBUG_LEVEL > 0  
 #  define dmsg(debuglevel,x)    if (CONFIG_DEBUG_LEVEL >= debuglevel) {printf x; fflush(stdout);}  
 #else  
 #  define dmsg(debuglevel,x)  
 #endif // CONFIG_DEBUG_LEVEL > 0  
   
 #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")  
   
 /// defines globally the bit depth of used samples  
 typedef int16_t sample_t;  
35    
36  typedef std::string String;  typedef std::string String;
37    
38  /**  #if defined(WIN32)
39   * Whether a function / method call was successful, or if warnings or even an  #include <windows.h>
40   * error occured.  #define usleep(a) Sleep(a/1000)
41   */  #define sleep(a) Sleep(a*1000)
42  enum result_type_t {  typedef unsigned int uint;
43      result_type_success,  // FIXME: define proper functions which do proper alignement under Win32
44      result_type_warning,  #define alignedMalloc(a,b) malloc(b)
45      result_type_error  #define alignedFree(a) free(a)
46  };  #else
47    // needed for usleep under POSIX
48  /**  #include <stdio.h>
49   * Used whenever a detailed description of the result of a function / method  // for uint
50   * call is needed.  #include <sys/types.h>
51   */  #endif
 struct result_t {  
     result_type_t type;     ///< success, warning or error  
     int           code;     ///< warning or error code  
     String        message;  ///< detailed warning or error message  
 };  
   
 template<class T> inline String ToString(T o) {  
         std::stringstream ss;  
         ss << o;  
         return ss.str();  
 }  
   
 class Runnable {  
     public:  
         virtual ~Runnable() { }  
         virtual void Run() = 0;  
 };  
52    
 extern double GLOBAL_VOLUME;  
53    
54  #endif // __LS_GLOBAL_H__  #endif // __LS_GLOBAL_H__

Legend:
Removed from v.1200  
changed lines
  Added in v.1792

  ViewVC Help
Powered by ViewVC