Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#include <JukeboxTypes.h>
/**
Replace code like this:
TJBox_Value values[] = {noteCVValue, gateCVValue};
JBOX_TRACEVALUES("Note CV ^0 Gate CV ^1 ", values, 2);
with
JBOX_LOGVALUES("Note CV ^0 Gate CV ^1 ", noteCVValue, gateCVValue);
*/
namespace impl {
template<typename... Args>
inline void JBox_LogValues(const char iFile[], TJBox_Int32 iLine, char const *iMessage, Args&& ...iValues)
{
TJBox_Value values[sizeof...(iValues)] { iValues... };
JBox_TraceValues(iFile, iLine, iMessage, values, sizeof...(iValues));
}
}
#if DEBUG
#define JBOX_LOGVALUES(iMessage, ...) \
impl::JBox_LogValues(__FILE__, __LINE__, iMessage, __VA_ARGS__)
#else
#define JBOX_LOGVALUES(iMessage, ...)
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment