1#ifndef SOUND_CHEF_COMMON
2#define SOUND_CHEF_COMMON
4#ifdef sound_chef_shared_EXPORTS
15 #define SC_CALL __stdcall
21 #define SC_DLL_IMPORT __declspec(dllimport)
22 #define SC_DLL_EXPORT __declspec(dllexport)
23 #define SC_DLL_PRIVATE static
24#elif defined(__APPLE__) || defined(__ANDROID__) || defined(__linux__)
25 #define SC_DLL_IMPORT __attribute__((visibility("default")))
26 #define SC_DLL_EXPORT __attribute__((visibility("default")))
27 #define SC_DLL_PRIVATE __attribute__((visibility("hidden")))
31 #define SC_DLL_PRIVATE
35 #define SC_API SC_DLL_EXPORT SC_CALL
36 #define SC_CLASS SC_DLL_EXPORT
38 #define SC_API SC_CALL
42#define SC_CHECK(condition, result) \
43 if ((condition) == MA_FALSE) \
45#define SC_CHECK_RESULT(result) \
46 if ((result) != MA_SUCCESS) \
48#define SC_CHECK_ARG(condition) \
49 if ((condition) == MA_FALSE) \
50 return MA_INVALID_ARGS
51#define SC_CHECK_MEM(ptr) \
53 return MA_OUT_OF_MEMORY
54#define SC_CHECK_MEM_FREE(ptr, freePtr) \
57 ma_free((freePtr), NULL); \
58 return MA_OUT_OF_MEMORY; \
61#define SC_ZERO_OBJECT(p) memset((p), 0, sizeof(*(p)))
68typedef ma_bool32 sc_bool;
69typedef ma_result sc_result;
84typedef enum sc_sound_mode
86 SC_SOUND_MODE_DEFAULT = 0x00000000,
87 SC_SOUND_MODE_DECODE = 0x00000001,
88 SC_SOUND_MODE_ASYNC = 0x00000002,
89 SC_SOUND_MODE_STREAM = 0x00000004,
92typedef enum sc_dsp_type
101typedef enum sc_dsp_index
103 SC_DSP_INDEX_TAIL = -2,
104 SC_DSP_INDEX_HEAD = -1
108typedef sc_result(SC_CALL* SC_DSP_CREATE_CALLBACK)(
sc_dsp_state* dspState);
109typedef sc_result(SC_CALL* SC_DSP_RELEASE_CALLBACK)(
sc_dsp_state* dspState);
110typedef sc_result(SC_CALL* SC_DSP_SET_PARAM_FLOAT_CALLBACK)(
sc_dsp_state* dspState,
int index,
float value);
111typedef sc_result(SC_CALL* SC_DSP_GET_PARAM_FLOAT_CALLBACK)(
sc_dsp_state* dspState,
int index,
float* value);
115 SC_DSP_CREATE_CALLBACK create;
116 SC_DSP_RELEASE_CALLBACK release;
117 SC_DSP_SET_PARAM_FLOAT_CALLBACK setFloat;
118 SC_DSP_GET_PARAM_FLOAT_CALLBACK getFloat;
201 ma_resource_manager resourceManager;
Definition sound_chef_common.h:140
Definition sound_chef_dsp.h:34
Holds instance data for a single sc_dsp.
Definition sound_chef_common.h:132
Definition sound_chef_common.h:114
ma_node with an additional enum descriptor.
Definition sound_chef_common.h:152
Groups nodes/DSPs together into one.
Definition sound_chef_common.h:177
Definition sound_chef_common.h:161
Object that manages the node graph, sounds, output etc.
Definition sound_chef_common.h:198