Skip to content

Instantly share code, notes, and snippets.

@ypujante
Last active June 22, 2020 01:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ypujante/9764910dbc8c331f3a9f518768d69a8f to your computer and use it in GitHub Desktop.
Save ypujante/9764910dbc8c331f3a9f518768d69a8f to your computer and use it in GitHub Desktop.
#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