2 |
* * |
* * |
3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003 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 * |
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 __GLOBAL_H__ |
#ifndef __LS_GLOBAL_H__ |
28 |
#define __GLOBAL_H__ |
#define __LS_GLOBAL_H__ |
|
|
|
|
//#define DEBUG_HEADERS 1 |
|
|
|
|
|
#if DEBUG_HEADERS |
|
|
# warning global.h included |
|
|
#endif // DEBUG_HEADERS |
|
29 |
|
|
30 |
#include <stdlib.h> |
#include <stdlib.h> |
31 |
#include <stdint.h> |
#include <stdint.h> |
33 |
|
|
34 |
#include <string> |
#include <string> |
35 |
|
|
36 |
#ifdef HAVE_CONFIG_H |
typedef std::string String; |
|
# include <config.h> |
|
|
#endif |
|
|
|
|
|
#define LS_DEBUG_LEVEL 2 ///< the higher this value the higher verbosity, 0 means no debug messages at all |
|
37 |
|
|
38 |
#if LS_DEBUG_LEVEL > 0 |
#if defined(WIN32) |
39 |
# define dmsg(debuglevel,x) if (LS_DEBUG_LEVEL >= debuglevel) {printf x; fflush(stdout);} |
#include <windows.h> |
40 |
|
#define usleep(a) Sleep(a/1000) |
41 |
|
#define sleep(a) Sleep(a*1000) |
42 |
|
typedef unsigned int uint; |
43 |
|
// FIXME: define proper functions which do proper alignement under Win32 |
44 |
|
#define alignedMalloc(a,b) malloc(b) |
45 |
|
#define alignedFree(a) free(a) |
46 |
#else |
#else |
47 |
# define dmsg(debuglevel,x) |
// needed for usleep under POSIX |
48 |
#endif // LS_DEBUG |
#include <stdio.h> |
49 |
|
// for uint |
50 |
/// Defines the max. pitch value used in the application (in octaves) |
#include <sys/types.h> |
51 |
#define MAX_PITCH 4 |
#endif |
|
|
|
|
/// 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; |
|
52 |
|
|
|
/** |
|
|
* 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 |
|
|
}; |
|
53 |
|
|
54 |
#endif // __GLOBAL_H__ |
#endif // __LS_GLOBAL_H__ |