Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef _KIT_KMIXERALLPRIVATE_H
- #define _KIT_KMIXERALLPRIVATE_H
- #include "../../include/kit_sdl2/kit_macroconst.h"
- #include "../../include/kit_sdl2/kit_kmixer.h"
- #include "_kit_kmixerPrivate.h"
- #include "_kit_kmixerDevicePrivate.h"
- #include "_kit_kmixerVoicePrivate.h"
- //include intrinsic functions
- #include <immintrin.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- #define _CAST_VOICE(_vector) \
- ((_kit_kmixerVoice*)(_vector)->ptr)
- #define _CAST_U32(_vector) \
- ((Uint32*)(_vector)->ptr)
- //assumes device name is "device"
- #define _CAST_RAW \
- ((_kit_kmixerVoice*)device->_voices.raw->ptr)
- #define _CAST_ORD \
- ((_kit_kmixerVoice***)device->_voices.ord->ptr)
- #define _PRINT_AUDIO_SPEC(_pref, _spec) { \
- SDL_Log(_pref".freq =%i",(_spec).freq); \
- SDL_Log(_pref".format =%X",(_spec).format); \
- SDL_Log(_pref".channels=%u",(_spec).channels); \
- SDL_Log(_pref".silence =%u",(_spec).silence); \
- SDL_Log(_pref".samples =%u",(_spec).samples); \
- SDL_Log(_pref".size =%u",(_spec).size); \
- SDL_Log(_pref".callback=%p",(_spec).callback); \
- SDL_Log(_pref".userdata=%p",(_spec).userdata); }
- #define _PRINT_AUDIO_SPEC_P(_pref, _spec_p) { \
- SDL_Log(_pref"->freq =%i",(_spec_p)->freq); \
- SDL_Log(_pref"->format =%X",(_spec_p)->format); \
- SDL_Log(_pref"->channels=%u",(_spec_p)->channels); \
- SDL_Log(_pref"->silence =%u",(_spec_p)->silence); \
- SDL_Log(_pref"->samples =%u",(_spec_p)->samples); \
- SDL_Log(_pref"->size =%u",(_spec_p)->size); \
- SDL_Log(_pref"->callback=%p",(_spec_p)->callback); \
- SDL_Log(_pref"->userdata=%p",(_spec_p)->userdata); }
- #define _PRINT_VOICE(_pref, _voice) { \
- SDL_Log(_pref".lock =%p",(_voice).lock); \
- SDL_Log(_pref".inputs =%p",(_voice).inputs); \
- SDL_Log(_pref".inputRefs =%p",(_voice).inputRefs); \
- SDL_Log(_pref".output =%p",(_voice).output); \
- SDL_Log(_pref".bufferInput =%p",(_voice).bufferInput.v); \
- SDL_Log(_pref".bufferUser =%p",(_voice).bufferUser.v); \
- SDL_Log(_pref".bufferConvert=%p",(_voice).bufferConvert.v); \
- SDL_Log(_pref".bufferOutput =%p",(_voice).bufferOutput.v); \
- SDL_Log(_pref".spec={"); \
- PRINT_VOICE_SPEC(_pref" ", (_voice).spec) \
- SDL_Log(_pref"}"); \
- SDL_Log(_pref".chainStage =%u",(_voice).chainStage); \
- SDL_Log(_pref".index =%u",(_voice).index); \
- SDL_Log(_pref".volL =%f",(_voice).volL); \
- SDL_Log(_pref".volR =%f",(_voice).volR); \
- SDL_Log(_pref".applyVolume =%s",kit_coreBoolStr[(_voice).applyVolume]); \
- SDL_Log(_pref".stereoOutput =%s",kit_coreBoolStr[(_voice).stereoOutput]); }
- #define _PRINT_VOICE_P(_pref, _voice_p) { \
- SDL_Log(_pref"->lock =%p",(_voice_p)->lock); \
- SDL_Log(_pref"->inputs =%p",(_voice_p)->inputs); \
- SDL_Log(_pref"->inputRefs =%p",(_voice_p)->inputRefs); \
- SDL_Log(_pref"->output =%p",(_voice_p)->output); \
- SDL_Log(_pref"->bufferInput =%p",(_voice_p)->bufferInput.v); \
- SDL_Log(_pref"->bufferUser =%p",(_voice_p)->bufferUser.v); \
- SDL_Log(_pref"->bufferConvert=%p",(_voice_p)->bufferConvert.v); \
- SDL_Log(_pref"->bufferOutput =%p",(_voice_p)->bufferOutput.v); \
- SDL_Log(_pref"->spec={"); \
- PRINT_VOICE_SPEC(" ", (_voice_p)->spec) \
- SDL_Log(_pref"}"); \
- SDL_Log(_pref"->chainStage =%u",(_voice_p)->chainStage); \
- SDL_Log(_pref"->index =%u",(_voice_p)->index); \
- SDL_Log(_pref"->volL =%f",(_voice_p)->volL); \
- SDL_Log(_pref"->volR =%f",(_voice_p)->volR); \
- SDL_Log(_pref"->applyVolume =%s",kit_coreBoolStr[(_voice_p)->applyVolume]); \
- SDL_Log(_pref"->stereoOutput =%s",kit_coreBoolStr[(_voice_p)->stereoOutput]); }
- #define _PRINT_DEVICE_P(_pref, _device_p) { \
- SDL_Log(_pref"._magic.num=0x%p",(_device_p)->_magic.num); \
- SDL_Log(_pref"->_spec={"); \
- _PRINT_AUDIO_SPEC(_pref" ",(_device_p)->_spec) \
- SDL_Log(_pref"}"); \
- \
- SDL_Log(_pref"._lock =%p", (_device_p)->_lock); \
- SDL_Log(_pref"._thread.cond =%p", (_device_p)->_thread.cond); \
- SDL_Log(_pref"->_thread.queue =%p {",(_device_p)->_thread.queue->ptr); \
- PRINT_VECTOR(_pref" ", (_device_p)->_thread.queue) \
- SDL_Log(_pref"}"); \
- \
- SDL_Log(_pref"->_thread.pool =%p {",(_device_p)->_thread.pool->ptr); \
- PRINT_VECTOR(_pref" ", (_device_p)->_thread.pool) \
- SDL_Log(_pref"}"); \
- \
- SDL_Log(_pref"->_thread.qread =%u", (_device_p)->_thread.qread); \
- SDL_Log(_pref"->_thread.qwrite =%u", (_device_p)->_thread.qwrite); \
- SDL_Log(_pref"->_voices.raw =%p {",(_device_p)->_voices.raw->ptr); \
- PRINT_VECTOR(_pref" ", (_device_p)->_voices.raw) \
- SDL_Log(_pref"}"); \
- \
- SDL_Log(_pref"->_voices.ord =%p {",(_device_p)->_voices.ord->ptr); \
- PRINT_VECTOR(_pref" ", (_device_p)->_voices.ord) \
- SDL_Log(_pref"}"); \
- \
- SDL_Log(_pref"->_fadeMultiplier=%f", (_device_p)->_fadeMultiplier); \
- SDL_Log(_pref"->_fadeVolume =%f", (_device_p)->_fadeVolume); \
- SDL_Log(_pref"->_fadeInDelay =%u", (_device_p)->_fadeInDelay); \
- SDL_Log(_pref"->_lockCount =%u", (_device_p)->_lockCount); \
- SDL_Log(_pref"->_devID =%u", (_device_p)->_devID); \
- SDL_Log(_pref"->_playing =%s",kit_coreBoolStr[(_device_p)->_playing]); \
- SDL_Log(_pref"->_closing =%s",kit_coreBoolStr[(_device_p)->_closing]); \
- SDL_Log(_pref"->_fadeOut =%s",kit_coreBoolStr[(_device_p)->_fadeOut]); }
- #ifdef __cplusplus
- }
- #endif
- #endif /* _KIT_KMIXERALLPRIVATE_H */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement