1#ifndef ROS_AUDIO_MMEBUDDY_DEBUG_H
2#define ROS_AUDIO_MMEBUDDY_DEBUG_H
10#if DBG && !defined(NDEBUG)
15 WCHAR dbg_popup_msg[1024], dbg_popup_title[256]; \
16 wsprintf(dbg_popup_title, L"%hS(%d)", __FILE__, __LINE__); \
17 wsprintf(dbg_popup_msg, __VA_ARGS__); \
18 MessageBoxW(NULL, dbg_popup_msg, dbg_popup_title, MB_OK | MB_TASKMODAL); \
21 #define SND_ERR(...) \
23 WCHAR dbg_popup_msg[1024]; \
24 wsprintf(dbg_popup_msg, __VA_ARGS__); \
25 OutputDebugStringW(dbg_popup_msg); \
28 #define SND_ASSERT(condition) \
30 if ( ! ( condition ) ) \
32 SND_ERR(L"ASSERT FAILED: %hS File %hS Line %u\n", #condition, __FILE__, __LINE__); \
33 POPUP(L"ASSERT FAILED: %hS\n", #condition); \
40 #define SND_ERR(...) do {} while ( 0 )
41 #define SND_ASSERT(condition) do {(void)(condition);} while ( 0 )
45#if DBG && !defined(NDEBUG)
47 #define SND_WARN(...) \
49 WCHAR dbg_popup_msg[1024]; \
50 wsprintf(dbg_popup_msg, __VA_ARGS__); \
51 OutputDebugStringW(dbg_popup_msg); \
54 #define SND_TRACE(...) \
56 WCHAR dbg_popup_msg[1024]; \
57 wsprintf(dbg_popup_msg, __VA_ARGS__); \
58 OutputDebugStringW(dbg_popup_msg); \
61 #define DUMP_WAVEHDR_QUEUE(sound_device_instance) \
63 PWAVEHDR CurrDumpHdr = sound_device_instance->HeadWaveHeader; \
64 SND_TRACE(L"-- Current wave header list --\n"); \
65 while ( CurrDumpHdr ) \
67 SND_TRACE(L"%x | %d bytes | flags: %x\n", CurrDumpHdr, \
68 CurrDumpHdr->dwBufferLength, \
69 CurrDumpHdr->dwFlags); \
70 CurrDumpHdr = CurrDumpHdr->lpNext; \
76 #define SND_WARN(...) do {} while ( 0 )
77 #define SND_TRACE(...) do {} while ( 0 )
78 #define DUMP_WAVEHDR_QUEUE(sound_device_instance) do {} while ( 0 )