deep, somewhat subtle changes for transport control. Everything should use Session...
[ardour.git] / libs / soundtouch / STTypes.h
1 ////////////////////////////////////////////////////////////////////////////////
2 ///
3 /// Common type definitions for SoundTouch audio processing library.
4 ///
5 /// Author        : Copyright (c) Olli Parviainen
6 /// Author e-mail : oparviai @ iki.fi
7 /// SoundTouch WWW: http://www.iki.fi/oparviai/soundtouch
8 ///
9 ////////////////////////////////////////////////////////////////////////////////
10 //
11 // Last changed  : $Date$
12 // File revision : $Revision$
13 //
14 // $Id$
15 //
16 ////////////////////////////////////////////////////////////////////////////////
17 //
18 // License :
19 //
20 //  SoundTouch audio processing library
21 //  Copyright (c) Olli Parviainen
22 //
23 //  This library is free software; you can redistribute it and/or
24 //  modify it under the terms of the GNU Lesser General Public
25 //  License as published by the Free Software Foundation; either
26 //  version 2.1 of the License, or (at your option) any later version.
27 //
28 //  This library is distributed in the hope that it will be useful,
29 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
30 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
31 //  Lesser General Public License for more details.
32 //
33 //  You should have received a copy of the GNU Lesser General Public
34 //  License along with this library; if not, write to the Free Software
35 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
36 //
37 ////////////////////////////////////////////////////////////////////////////////
38
39 #ifndef STTypes_H
40 #define STTypes_H
41
42 typedef unsigned int    uint;
43 typedef unsigned long   ulong;
44
45 #ifndef _WINDEF_
46     // if these aren't defined already by Windows headers, define now
47
48     typedef unsigned int    BOOL;
49
50 #ifndef FALSE
51     #define FALSE   0
52 #endif
53 #ifndef TRUE
54     #define TRUE    1
55 #endif
56
57 #endif  // _WINDEF_
58
59
60 namespace soundtouch
61 {
62     /// Enable one of the following defines to choose either 16bit integer or
63     /// 32bit float sample type. If you don't have opinion, using integer samples
64     /// is generally faster.
65     /// #define INTEGER_SAMPLES       //< 16bit integer samples
66     #define FLOAT_SAMPLES       //< 32bit float samples
67
68
69     /// Define this to allow CPU-specific assembler optimizations. Notice that 
70     /// having this enabled on non-x86 platforms doesn't matter; the compiler can 
71     /// drop unsupported extensions on different platforms automatically. 
72     /// However, if you're having difficulties getting the optimized routines 
73     /// compiled with your compler (e.g. some gcc compiler versions may be picky), 
74     /// you may wish to disable the optimizations to make the library compile.
75     #define ALLOW_OPTIMIZATIONS     1
76
77
78     #ifdef INTEGER_SAMPLES
79         // 16bit integer sample type
80         typedef short SAMPLETYPE;
81         // data type for sample accumulation: Use 32bit integer to prevent overflows
82         typedef long  LONG_SAMPLETYPE;
83
84         #ifdef FLOAT_SAMPLES
85             // check that only one sample type is defined
86             #error "conflicting sample types defined"
87         #endif // FLOAT_SAMPLES
88
89         #ifdef ALLOW_OPTIMIZATIONS
90             #if WIN32 || __i386__
91                 // Allow MMX optimizations
92                 #define ALLOW_MMX   1
93             #endif
94         #endif
95
96     #else
97
98         // floating point samples
99         typedef float  SAMPLETYPE;
100         // data type for sample accumulation: Use double to utilize full precision.
101         typedef double LONG_SAMPLETYPE;
102
103         #ifdef ALLOW_OPTIMIZATIONS
104             #ifdef WIN32
105                 // Allow 3DNow! and SSE optimizations
106                 #define ALLOW_3DNOW     1
107                 #define ALLOW_SSE       1
108             #endif // WIN32
109         #endif
110
111     #endif  // INTEGER_SAMPLES
112 }
113
114 #endif