diff --git a/client/mumble-plugin/fgcom-mumble.cpp b/client/mumble-plugin/fgcom-mumble.cpp index 2ff449e9..e3fbf112 100644 --- a/client/mumble-plugin/fgcom-mumble.cpp +++ b/client/mumble-plugin/fgcom-mumble.cpp @@ -938,6 +938,14 @@ bool mumble_onAudioSourceFetched(float *outputPCM, uint32_t sampleCount, uint16_ // - we did not have any info on the client // - the client was out of range // - we did not tune the frequency (or radio was broken, or radio squelch cut off) +#ifdef DEBUG + // Debug code: Allow override of signal quality for debugging purposes + if (fgcom_debug_signalstrength >= 0) { + bestSignalStrength = fgcom_debug_signalstrength; + pluginDbg("mumble_onAudioSourceFetched(): signalQuality debug override to "+std::to_string(fgcom_debug_signalstrength)+" in effect!"); + } +#endif + rv = true; // we adjust the stream in any case if (isLandline) { // we got a landline connection! diff --git a/client/mumble-plugin/lib/io_UDPServer.cpp b/client/mumble-plugin/lib/io_UDPServer.cpp index cd54084c..e0ad57e1 100644 --- a/client/mumble-plugin/lib/io_UDPServer.cpp +++ b/client/mumble-plugin/lib/io_UDPServer.cpp @@ -62,6 +62,10 @@ #include "mumble/MumblePlugin_v_1_0_x.h" #include "fgcom-mumble.h" +#ifdef DEBUG + float fgcom_debug_signalstrength = -1; +#endif + /* * Process a received message: @@ -401,6 +405,17 @@ std::map fgcom_udp_parseMsg(char buffer[MAXLINE] if (token_key == "AUDIO_FX_RADIO") { fgcom_cfg.radioAudioEffects = (token_value == "0" || token_value == "false" || token_value == "off")? false : true; } + + +#ifdef DEBUG + // DEBUG: allow override of signal quality for incoming transmissions + if (token_key == "DEBUG_SIGQLY") { + fgcom_debug_signalstrength = std::stof(token_value); + if (fgcom_debug_signalstrength > 1) fgcom_debug_signalstrength = 1; + if (fgcom_debug_signalstrength < 0) fgcom_debug_signalstrength = -1; + pluginDbg("[UDP-server] debug override of signal quality updated to "+std::to_string(fgcom_debug_signalstrength)); + } +#endif } else { diff --git a/client/mumble-plugin/lib/io_UDPServer.h b/client/mumble-plugin/lib/io_UDPServer.h index 5840c99d..85063ab2 100644 --- a/client/mumble-plugin/lib/io_UDPServer.h +++ b/client/mumble-plugin/lib/io_UDPServer.h @@ -25,6 +25,11 @@ #define MAXLINE 1024 // max byte size of a udp packet +#ifdef DEBUG + // Debug code: Allow override of signal quality for debugging purposes + extern float fgcom_debug_signalstrength; // <0 to disable +#endif + /* * Spawn the udp server thread.