Refine logging infrastructure.

1) Make logging conditional on debug flags.

2) Add command line option for setting these flags.

3) Emit warnings with g_warning() instead of g_message().

4) Added note about how FX_LIB_LEVEL_MAX[1-3] is used.
This commit is contained in:
Tim LaBerge
2012-02-27 20:26:42 -08:00
parent 9fcf6939d0
commit a073f5cde2
6 changed files with 183 additions and 62 deletions

18
gdigi.h
View File

@@ -22,6 +22,19 @@
#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef enum {
DEBUG_MSG2DEV = (1 << 0), // Device bound messages.
DEBUG_MSG2HOST = (1 << 1), // Host bound messages.
DEBUG_STARTUP = (1 << 2),
DEBUG_GROUP = (1 << 3), // Modifier group
DEBUG_HEX = (1 << 4), // Dump message contents in hex.
DEBUG_XML = (1 << 5),
DEBUG_VERBOSE = (1 << 6),
} debug_flags_t;
void debug_msg (debug_flags_t, char *fmt, ...);
gboolean debug_flag_is_set (debug_flags_t flag);
#define GNX_CHANNEL_POSITION 7
#define GNX_CHANNEL_AMP 260
#define GNX_WARP 261
@@ -885,7 +898,10 @@ enum {
#define TONE_LIB_TYPE 8704
#define FX_LIB_TYPE 8705
#define FX_LIB_LEVEL 8706
#define FX_LIB_LEVEL 8706 // This influences pitch shift mix, delay level,
// and reverb level, in proportion, as
// specified by FX_LIB_LEVEL_MAX1,2,3.
//
#define FX_LIB_LEVEL_MAX1 8708
#define FX_LIB_LEVEL_MAX2 8710
#define FX_LIB_LEVEL_MAX3 8712