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 LS_DEBUG_LEVEL 1 ///< the higher this value the higher verbosity, 0 means no debug messages at all |
#if CONFIG_DEBUG_LEVEL > 0 |
41 |
|
# define dmsg(debuglevel,x) if (CONFIG_DEBUG_LEVEL >= debuglevel) {printf x; fflush(stdout);} |
|
#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 |
|
45 |
|
|
46 |
/// Defines how many event objects the modulation system allocates |
#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 MAX_EVENTS_PER_FRAGMENT 1024 |
|
47 |
|
|
48 |
/// defines globally the bit depth of used samples |
/// defines globally the bit depth of used samples |
49 |
typedef int16_t sample_t; |
typedef int16_t sample_t; |
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 |
|
// I read with some Linux kernel versions (between 2.4.18 and 2.4.21) |
88 |
|
// sscanf() might be buggy regarding parsing of hex characters, so ... |
89 |
|
int hexToNumber(char hex_digit); |
90 |
|
int hexsToNumber(char hex_digit0, char hex_digit1 = '0'); |
91 |
|
|
92 |
|
#endif // __LS_GLOBAL_H__ |