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 - 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 * |
23 |
|
|
24 |
// All application global declarations are defined here. |
// All application global declarations are defined here. |
25 |
|
|
26 |
#ifndef __GLOBAL_H__ |
#ifndef __LS_GLOBAL_H__ |
27 |
#define __GLOBAL_H__ |
#define __LS_GLOBAL_H__ |
|
|
|
|
//#define DEBUG_HEADERS 1 |
|
|
|
|
|
#if DEBUG_HEADERS |
|
|
# warning global.h included |
|
|
#endif // DEBUG_HEADERS |
|
28 |
|
|
29 |
#include <stdlib.h> |
#include <stdlib.h> |
30 |
#include <stdint.h> |
#include <stdint.h> |
33 |
#include <string> |
#include <string> |
34 |
#include <sstream> |
#include <sstream> |
35 |
|
|
36 |
#ifdef HAVE_CONFIG_H |
#if HAVE_CONFIG_H |
37 |
# include <config.h> |
# include <config.h> |
38 |
#endif |
#endif |
39 |
|
|
40 |
#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 |
#if CONFIG_DEBUG_LEVEL > 0 |
41 |
|
# define dmsg(debuglevel,x) if (CONFIG_DEBUG_LEVEL >= debuglevel) {printf x; fflush(stdout);} |
|
#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);} |
|
42 |
#else |
#else |
43 |
# define dmsg(debuglevel,x) |
# define dmsg(debuglevel,x) |
44 |
#endif // LS_DEBUG |
#endif // CONFIG_DEBUG_LEVEL > 0 |
|
|
|
|
/// 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 |
|
45 |
|
|
46 |
#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") |
#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") |
47 |
|
|
51 |
typedef std::string String; |
typedef std::string String; |
52 |
|
|
53 |
/** |
/** |
54 |
* 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 |
55 |
* error occured. |
* error occured. |
56 |
*/ |
*/ |
57 |
enum result_type_t { |
enum result_type_t { |
76 |
return ss.str(); |
return ss.str(); |
77 |
} |
} |
78 |
|
|
79 |
#endif // __GLOBAL_H__ |
class Runnable { |
80 |
|
public: |
81 |
|
virtual ~Runnable() { } |
82 |
|
virtual void Run() = 0; |
83 |
|
}; |
84 |
|
|
85 |
|
extern double GLOBAL_VOLUME; |
86 |
|
|
87 |
|
#endif // __LS_GLOBAL_H__ |