--- linuxsampler/trunk/src/common/global.h 2004/12/13 00:46:42 319 +++ linuxsampler/trunk/src/common/global.h 2007/05/29 23:59:36 1212 @@ -3,6 +3,7 @@ * LinuxSampler - modular, streaming capable sampler * * * * Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * + * Copyright (C) 2005 - 2007 Christian Schoenebeck * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -22,14 +23,8 @@ // All application global declarations are defined here. -#ifndef __GLOBAL_H__ -#define __GLOBAL_H__ - -//#define DEBUG_HEADERS 1 - -#if DEBUG_HEADERS -# warning global.h included -#endif // DEBUG_HEADERS +#ifndef __LS_GLOBAL_H__ +#define __LS_GLOBAL_H__ #include #include @@ -38,27 +33,15 @@ #include #include -#ifdef HAVE_CONFIG_H -# include +#if HAVE_CONFIG_H +# include #endif -#define DEVMODE 1 ///< in development mode we do some extra sanity checks here and there, so if LS is stable this can be disabled to improve efficiency - -#define USE_EXCEPTIONS 0 ///< wether if we should use exceptions in the _REALTIME_THREAD_ for runtime critical errors or force segfaults instead - -#define LS_DEBUG_LEVEL 1 ///< the higher this value the higher verbosity, 0 means no debug messages at all - -#if LS_DEBUG_LEVEL > 0 -# define dmsg(debuglevel,x) if (LS_DEBUG_LEVEL >= debuglevel) {printf x; fflush(stdout);} +#if CONFIG_DEBUG_LEVEL > 0 +# define dmsg(debuglevel,x) if (CONFIG_DEBUG_LEVEL >= debuglevel) {printf x; fflush(stdout);} #else # define dmsg(debuglevel,x) -#endif // LS_DEBUG - -/// Defines the max. pitch value used in the application (in octaves) -#define MAX_PITCH 4 - -/// Defines how many event objects the modulation system allocates -#define MAX_EVENTS_PER_FRAGMENT 1024 +#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") @@ -68,7 +51,7 @@ typedef std::string String; /** - * Wether a function / method call was successful, or if warnings or even an + * Whether a function / method call was successful, or if warnings or even an * error occured. */ enum result_type_t { @@ -93,4 +76,12 @@ return ss.str(); } -#endif // __GLOBAL_H__ +class Runnable { + public: + virtual ~Runnable() { } + virtual void Run() = 0; +}; + +extern double GLOBAL_VOLUME; + +#endif // __LS_GLOBAL_H__