WASAPI failure debug message counter

Hi Jules,

Currently in debug, when a connection to a WASAPI device is lost, a debug string “WASAPI FAIL!” is printed ad infinitum. Once the debug window fills up, it’s hard to see if anything further is changing. To monitor the status, I modified our local copy as such (see juce_win32_WASAPI.cpp, line 70):

static long failCount = 1; 
#define logFailure(hr) { if (FAILED (hr)) { DBG ("[" + String(failCount++) + "] WASAPI FAIL! " + getAudioErrorDesc (hr)); jassertfalse } }

Any chance of getting that into the tip?

Thanks,
B

hmm… I prefer to avoid static variables where possible, but I will tweak it to add a timestamp in the message.

Even better. Thanks Jules.