1/******************************************************************************* 2 * Copyright 2009-2016 Jörg Müller 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 ******************************************************************************/ 16 17#pragma once 18 19/** 20 * @file Audaspace.h 21 * @ingroup general 22 * The main header file of the library defining the namespace and basic data types. 23 */ 24 25/** 26 * \def AUD_API 27 * Used for exporting symbols in the shared library. 28 */ 29 30/** 31 * \def AUD_PLUGIN_API 32 * Used for exporting symbols in the shared library. 33 */ 34 35/** 36 * \def AUD_EXPORT_API 37 * Used for using exporting symbols of the shared library. 38 */ 39 40/** 41 * \def AUD_USE_API 42 * Used for using exporting symbols of the shared library. 43 */ 44 45/** 46 * \def AUD_LOCAL 47 * Used for hiding symbols from export in the shared library. 48 */ 49 50// the following two defines and undefines are a hack to silence an error by doxygen 51 52/** 53 * \def AUD_SHARED_LIBRARY 54 * Defined when audaspace was built as a shared library. 55 */ 56#define AUD_SHARED_LIBRARY 57#undef AUD_SHARED_LIBRARY 58 59/** 60 * \def AUD_STATIC_LIBRARY 61 * Defined when audaspace was built as a static library. 62 */ 63 #define AUD_STATIC_LIBRARY 64 #undef AUD_STATIC_LIBRARY 65 66#define @AUD_LIBRARY_TYPE@ 67 68#ifdef _MSC_VER 69 #define AUD_EXPORT_API __declspec(dllexport) 70 #define AUD_USE_API __declspec(dllimport) 71 #define AUD_LOCAL 72#else 73 #ifdef __GNUC__ 74 #define AUD_EXPORT_API __attribute__((visibility ("default"))) 75 #define AUD_USE_API AUD_EXPORT_API 76 #define AUD_LOCAL __attribute__((visibility ("hidden"))) 77 #else 78 #define AUD_EXPORT_API 79 #define AUD_USE_API 80 #define AUD_LOCAL 81 #endif 82#endif 83 84#ifdef AUD_SHARED_LIBRARY 85 #ifdef AUD_BUILD_PLUGIN 86 #define AUD_API AUD_USE_API 87 #define AUD_PLUGIN_API AUD_EXPORT_API 88 #else 89 #ifdef AUD_BUILD_SHARED_LIBRARY 90 #define AUD_API AUD_EXPORT_API 91 #define AUD_PLUGIN_API AUD_EXPORT_API 92 #else 93 #define AUD_API AUD_USE_API 94 #define AUD_PLUGIN_API AUD_USE_API 95 #endif 96 #endif 97#else 98 #define AUD_API 99 #define AUD_PLUGIN_API 100#endif 101 102/// The default playback buffer size of a device. 103#define AUD_DEFAULT_BUFFER_SIZE 1024 104 105#ifdef __cplusplus 106 107/// Opens the audaspace namespace aud. 108#define AUD_NAMESPACE_BEGIN namespace aud { 109 110/// Closes the audaspace namespace aud. 111#define AUD_NAMESPACE_END } 112 113#else 114 115/// Opens the audaspace namespace aud. 116#define AUD_NAMESPACE_BEGIN 117 118/// Closes the audaspace namespace aud. 119#define AUD_NAMESPACE_END 120 121#endif 122 123AUD_NAMESPACE_BEGIN 124 125/// Sample type.(float samples) 126typedef float sample_t; 127 128/// Sample data type (format samples) 129typedef unsigned char data_t; 130 131AUD_NAMESPACE_END 132