--- linuxsampler/trunk/src/common/global.h 2004/04/26 17:15:51 53 +++ linuxsampler/trunk/src/common/global.h 2007/11/27 18:03:13 1531 @@ -2,7 +2,8 @@ * * * LinuxSampler - modular, streaming capable sampler * * * - * Copyright (C) 2003 by Benno Senoner and Christian Schoenebeck * + * 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 * @@ -20,16 +21,11 @@ * MA 02111-1307 USA * ***************************************************************************/ -// All application global declarations are defined here. +// All application global declarations that HAVE to be exposed to the C++ +// API 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 @@ -37,47 +33,20 @@ #include -#ifdef HAVE_CONFIG_H -# include -#endif - -#define LS_DEBUG_LEVEL 2 ///< the higher this value the higher verbosity, 0 means no debug messages at all +typedef std::string String; -#if LS_DEBUG_LEVEL > 0 -# define dmsg(debuglevel,x) if (LS_DEBUG_LEVEL >= debuglevel) {printf x; fflush(stdout);} +#if defined(WIN32) +#include +#define usleep(a) Sleep(a/1000) +#define sleep(a) Sleep(a*1000) +typedef unsigned int uint; +// FIXME: define proper functions which do proper alignement under Win32 +#define alignedMalloc(a,b) malloc(b) +#define alignedFree(a) free(a) #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 - -/// defines globally the bit depth of used samples -typedef int16_t sample_t; - -typedef std::string String; +// needed for usleep under POSIX +#include +#endif -/** - * Wether a function / method call was successful, or if warnings or even an - * error occured. - */ -enum result_type_t { - result_type_success, - result_type_warning, - result_type_error -}; - -/** - * Used whenever a detailed description of the result of a function / method - * call is needed. - */ -struct result_t { - result_type_t type; ///< success, warning or error - int code; ///< warning or error code - String message; ///< detailed warning or error message -}; -#endif // __GLOBAL_H__ +#endif // __LS_GLOBAL_H__