/external/pysoundtouch14/libsoundtouch/STTypes.h

http://echo-nest-remix.googlecode.com/ · C Header · 110 lines · 36 code · 19 blank · 55 comment · 1 complexity · 4bd6d60f9bcefa299c555b11e4dde2b6 MD5 · raw file

  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: 2004/10/30 16:10:15 $
  12. // File revision : $Revision: 1.13 $
  13. //
  14. // $Id: STTypes.h,v 1.13 2004/10/30 16:10:15 Olli Exp $
  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. #ifndef STTypes_H
  39. #define STTypes_H
  40. typedef unsigned int uint;
  41. typedef unsigned long ulong;
  42. #ifndef _WINDEF_
  43. // if these aren't defined already by Windows headers, define now
  44. typedef unsigned int BOOL;
  45. #define FALSE 0
  46. #define TRUE 1
  47. #endif // _WINDEF_
  48. namespace soundtouch
  49. {
  50. /// Enable one of the following defines to choose either 16bit integer or
  51. /// 32bit float sample type. If you don't have opinion, using integer samples
  52. /// is generally faster.
  53. //#define INTEGER_SAMPLES //< 16bit integer samples
  54. #define FLOAT_SAMPLES //< 32bit float samples
  55. /// Define this to allow CPU-specific assembler optimizations. Notice that
  56. /// having this enabled on non-x86 platforms doesn't matter; the compiler can
  57. /// drop unsupported extensions on different platforms automatically.
  58. /// However, if you're having difficulties getting the optimized routines
  59. /// compiled with your compler (e.g. some gcc compiler versions may be picky),
  60. /// you may wish to disable the optimizations to make the library compile.
  61. #define ALLOW_OPTIMIZATIONS 1
  62. #ifdef INTEGER_SAMPLES
  63. // 16bit integer sample type
  64. typedef short SAMPLETYPE;
  65. // data type for sample accumulation: Use 32bit integer to prevent overflows
  66. typedef long LONG_SAMPLETYPE;
  67. #ifdef FLOAT_SAMPLES
  68. // check that only one sample type is defined
  69. #error "conflicting sample types defined"
  70. #endif // FLOAT_SAMPLES
  71. #ifdef ALLOW_OPTIMIZATIONS
  72. #if WIN32 || __i386__
  73. // Allow MMX optimizations
  74. #define ALLOW_MMX 1
  75. #endif
  76. #endif
  77. #else
  78. // floating point samples
  79. typedef float SAMPLETYPE;
  80. // data type for sample accumulation: Use double to utilize full precision.
  81. typedef double LONG_SAMPLETYPE;
  82. #ifdef ALLOW_OPTIMIZATIONS
  83. #ifdef WIN32
  84. // Allow 3DNow! and SSE optimizations
  85. #define ALLOW_3DNOW 1
  86. #define ALLOW_SSE 1
  87. #endif // WIN32
  88. #endif
  89. #endif // INTEGER_SAMPLES
  90. };
  91. #endif