More logging changes.
This commit is contained in:
13
effects.c
13
effects.c
@@ -709,8 +709,8 @@ static EffectValues values_rp_mix = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static EffectSettings usb_settings[] = {
|
static EffectSettings usb_settings[] = {
|
||||||
{"USB/RP Mix", USB_AUDIO_PLAYBACK_MIX, USB_POSITION, &values_rp_mix},
|
{"USB/RP Mix", USB_AUDIO_PLAYBACK_MIX, GLOBAL_POSITION, &values_rp_mix},
|
||||||
{"USB Level", USB_AUDIO_LEVEL, USB_POSITION, &values_m12_to_24},
|
{"USB Level", USB_AUDIO_LEVEL, GLOBAL_POSITION, &values_m12_to_24},
|
||||||
};
|
};
|
||||||
|
|
||||||
static EffectSettings misc_settings[] = {
|
static EffectSettings misc_settings[] = {
|
||||||
@@ -4119,7 +4119,10 @@ ModifierGroup *modifier_linkable_list()
|
|||||||
modifier_group->type = EXP_TYPE;
|
modifier_group->type = EXP_TYPE;
|
||||||
modifier_group->position = EXP_POSITION;
|
modifier_group->position = EXP_POSITION;
|
||||||
|
|
||||||
g_message("Group %d count %d", group_id, count);
|
debug_msg(DEBUG_MSG2HOST|DEBUG_GROUP,
|
||||||
|
"RECEIVE_MODIFIER_LINKABLE_LIST: Group %d count %d",
|
||||||
|
group_id, count);
|
||||||
|
|
||||||
EffectGroup *group = g_slice_alloc(count * sizeof(EffectGroup));
|
EffectGroup *group = g_slice_alloc(count * sizeof(EffectGroup));
|
||||||
|
|
||||||
for (i=0; i<count; i++) {
|
for (i=0; i<count; i++) {
|
||||||
@@ -4141,7 +4144,9 @@ ModifierGroup *modifier_linkable_list()
|
|||||||
if (group[i].settings == NULL)
|
if (group[i].settings == NULL)
|
||||||
group[i].settings_amt = 0;
|
group[i].settings_amt = 0;
|
||||||
|
|
||||||
g_message("ID: %4d Position: %2d Label: %s", id, position, modifier ? modifier->label : NULL);
|
debug_msg(DEBUG_MSG2HOST|DEBUG_GROUP,
|
||||||
|
"ID: %4d Position: %2d Label: %s",
|
||||||
|
id, position, modifier ? modifier->label : NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
modifier_group->group = group;
|
modifier_group->group = group;
|
||||||
|
|||||||
164
gdigi.c
164
gdigi.c
@@ -35,6 +35,63 @@ static GQueue *message_queue = NULL;
|
|||||||
static GMutex *message_queue_mutex = NULL;
|
static GMutex *message_queue_mutex = NULL;
|
||||||
static GCond *message_queue_cond = NULL;
|
static GCond *message_queue_cond = NULL;
|
||||||
|
|
||||||
|
static guint DebugFlags;
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
debug_flag_is_set (debug_flags_t flags)
|
||||||
|
{
|
||||||
|
if (DebugFlags & flags) {
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
gboolean set_debug_flags (const gchar *option_name, const gchar *value,
|
||||||
|
gpointer data, GError **error)
|
||||||
|
{
|
||||||
|
if (strchr(value, 'd')) {
|
||||||
|
DebugFlags |= DEBUG_MSG2DEV;
|
||||||
|
}
|
||||||
|
if (strchr(value, 'h')) {
|
||||||
|
DebugFlags |= DEBUG_MSG2HOST;
|
||||||
|
}
|
||||||
|
if (strchr(value, 's')) {
|
||||||
|
DebugFlags |= DEBUG_STARTUP;
|
||||||
|
}
|
||||||
|
if (strchr(value, 'H')) {
|
||||||
|
DebugFlags |= DEBUG_HEX;
|
||||||
|
}
|
||||||
|
if (strchr(value, 'g')) {
|
||||||
|
DebugFlags |= DEBUG_GROUP;
|
||||||
|
}
|
||||||
|
if (strchr(value, 'x')) {
|
||||||
|
DebugFlags |= DEBUG_XML;
|
||||||
|
}
|
||||||
|
if (strchr(value, 'v')) {
|
||||||
|
DebugFlags |= DEBUG_VERBOSE;
|
||||||
|
}
|
||||||
|
if (strchr(value, 'a')) {
|
||||||
|
DebugFlags = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
debug_msg (debug_flags_t flags, char *fmt, ...)
|
||||||
|
{
|
||||||
|
char buf[1024];
|
||||||
|
if (flags & DebugFlags) {
|
||||||
|
va_list ap;
|
||||||
|
|
||||||
|
va_start(ap, fmt);
|
||||||
|
vsnprintf(buf, 1024, fmt, ap);
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
|
g_message("%s", buf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers an error quark for gdigi if necessary.
|
* Registers an error quark for gdigi if necessary.
|
||||||
*
|
*
|
||||||
@@ -225,21 +282,23 @@ void push_message(GString *msg)
|
|||||||
{
|
{
|
||||||
MessageID msgid = get_message_id(msg);
|
MessageID msgid = get_message_id(msg);
|
||||||
if (((unsigned char)msg->str[0] == 0xF0) && ((unsigned char)msg->str[msg->len-1] == 0xF7))
|
if (((unsigned char)msg->str[0] == 0xF0) && ((unsigned char)msg->str[msg->len-1] == 0xF7))
|
||||||
g_message("Pushing correct message!");
|
debug_msg(DEBUG_VERBOSE, "Pushing correct message!");
|
||||||
else
|
else
|
||||||
g_warning("Pushing incorrect message!");
|
g_warning("Pushing incorrect message!");
|
||||||
|
|
||||||
int x;
|
int x;
|
||||||
for (x = 0; x<msg->len; x++) {
|
if (debug_flag_is_set(DEBUG_HEX)) {
|
||||||
if (x && (x % 26) == 0) {
|
for (x = 0; x<msg->len; x++) {
|
||||||
|
if (x && (x % 26) == 0) {
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
printf("%02x ", (unsigned char)msg->str[x]);
|
||||||
|
}
|
||||||
|
if (x % 26) {
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
printf("%02x ", (unsigned char)msg->str[x]);
|
|
||||||
}
|
}
|
||||||
if (x % 26) {
|
debug_msg(DEBUG_VERBOSE, "Received %s", get_message_name(msgid));
|
||||||
printf("\n");
|
|
||||||
}
|
|
||||||
g_message("Received %s", get_message_name(msgid));
|
|
||||||
|
|
||||||
SettingParam *param;
|
SettingParam *param;
|
||||||
switch (msgid) {
|
switch (msgid) {
|
||||||
@@ -248,6 +307,7 @@ void push_message(GString *msg)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
case NACK:
|
case NACK:
|
||||||
|
g_warning("Received NACK!");
|
||||||
g_string_free(msg, TRUE);
|
g_string_free(msg, TRUE);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -257,7 +317,11 @@ void push_message(GString *msg)
|
|||||||
param = setting_param_new_from_data(&msg->str[8], NULL);
|
param = setting_param_new_from_data(&msg->str[8], NULL);
|
||||||
XmlSettings *xml = get_xml_settings(param->id, param->position);
|
XmlSettings *xml = get_xml_settings(param->id, param->position);
|
||||||
char *label = xml ? xml->label : "NULL";
|
char *label = xml ? xml->label : "NULL";
|
||||||
g_message("ID: %5d Position: %2d Value: %.1d: %s", param->id, param->position, param->value, label);
|
debug_msg(DEBUG_MSG2HOST,
|
||||||
|
"RECEIVE_PARAMETER_VALUE: ID: %5d Position: %2d "
|
||||||
|
"Value: %6.1d: %s",
|
||||||
|
param->id, param->position,
|
||||||
|
param->value, label);
|
||||||
|
|
||||||
GDK_THREADS_ENTER();
|
GDK_THREADS_ENTER();
|
||||||
apply_setting_param_to_gui(param);
|
apply_setting_param_to_gui(param);
|
||||||
@@ -274,28 +338,40 @@ void push_message(GString *msg)
|
|||||||
switch (str[8]) {
|
switch (str[8]) {
|
||||||
case NOTIFY_PRESET_MOVED:
|
case NOTIFY_PRESET_MOVED:
|
||||||
if (str[11] == PRESETS_EDIT_BUFFER && str[12] == 0) {
|
if (str[11] == PRESETS_EDIT_BUFFER && str[12] == 0) {
|
||||||
g_message("Loaded preset %d from bank %d", str[10], str[9]);
|
|
||||||
|
|
||||||
GDK_THREADS_ENTER();
|
GDK_THREADS_ENTER();
|
||||||
g_timeout_add(0, apply_current_preset_to_gui, NULL);
|
g_timeout_add(0, apply_current_preset_to_gui, NULL);
|
||||||
GDK_THREADS_LEAVE();
|
GDK_THREADS_LEAVE();
|
||||||
|
debug_msg(DEBUG_MSG2HOST,
|
||||||
|
"RECEIVE_DEVICE_NOTIFICATION: Loaded preset "
|
||||||
|
"%d from bank %d",
|
||||||
|
str[10], str[9]);
|
||||||
} else {
|
} else {
|
||||||
g_message("%d %d moved to %d %d", str[9], str[10], str[11], str[12]);
|
debug_msg(DEBUG_MSG2HOST,
|
||||||
|
"RECEIVE_DEVICE_NOTIFICATION: %d %d moved to "
|
||||||
|
"%d %d",
|
||||||
|
str[9], str[10],
|
||||||
|
str[11], str[12]);
|
||||||
}
|
}
|
||||||
case NOTIFY_MODIFIER_GROUP_CHANGED:
|
case NOTIFY_MODIFIER_GROUP_CHANGED:
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
printf("\n");
|
if (debug_flag_is_set(DEBUG_HEX)) {
|
||||||
for (i = 0; i < msg->len; i++) {
|
printf("\n");
|
||||||
printf(" %02x", (unsigned char) str[i]);
|
for (i = 0; i < msg->len; i++) {
|
||||||
|
printf(" %02x", (unsigned char) str[i]);
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
}
|
}
|
||||||
printf("\n");
|
debug_msg(DEBUG_MSG2HOST,
|
||||||
g_message("Modifier group id %d changed",
|
"NOTIFY_MODIFIER_GROUP_CHANGED: Modifier group "
|
||||||
(str[9] << 8) | (str[10]));
|
"id %d changed",
|
||||||
|
(str[9] << 8) | (str[10]));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
g_message("Received unhandled device notification 0x%x", str[11]);
|
g_warning("Received unhandled device notification 0x%x",
|
||||||
|
str[11]);
|
||||||
}
|
}
|
||||||
g_string_free(msg, TRUE);
|
g_string_free(msg, TRUE);
|
||||||
return;
|
return;
|
||||||
@@ -303,17 +379,22 @@ void push_message(GString *msg)
|
|||||||
unpack_message(msg);
|
unpack_message(msg);
|
||||||
gint tot, n, x;
|
gint tot, n, x;
|
||||||
tot = (unsigned char)msg->str[9];
|
tot = (unsigned char)msg->str[9];
|
||||||
for (n = 0; n < msg->len; n++) {
|
if (debug_flag_is_set(DEBUG_HEX)) {
|
||||||
printf("%02x ",(unsigned char) msg->str[n]);
|
for (n = 0; n < msg->len; n++) {
|
||||||
|
printf("%02x ",(unsigned char) msg->str[n]);
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
}
|
}
|
||||||
printf("\n");
|
|
||||||
|
|
||||||
n = 0;
|
n = 0;
|
||||||
x = 10;
|
x = 10;
|
||||||
do {
|
do {
|
||||||
param = setting_param_new_from_data(&msg->str[x], &x);
|
param = setting_param_new_from_data(&msg->str[x], &x);
|
||||||
g_message("Received global param ID: %5d Position: %2.1d Value: %6.1d: %s",
|
debug_msg(DEBUG_MSG2HOST,
|
||||||
param->id, param->position, param->value);
|
"RECEIVE_GLOBAL_PARAMETERS ID: %5d "
|
||||||
|
"Position: %2.1d Value: %6.1d: %s",
|
||||||
|
param->id,
|
||||||
|
param->position, param->value, "XXX");
|
||||||
setting_param_free(param);
|
setting_param_free(param);
|
||||||
} while ( (x < msg->len) && n < tot);
|
} while ( (x < msg->len) && n < tot);
|
||||||
|
|
||||||
@@ -324,10 +405,13 @@ void push_message(GString *msg)
|
|||||||
case RECEIVE_MODIFIER_LINKABLE_LIST:
|
case RECEIVE_MODIFIER_LINKABLE_LIST:
|
||||||
unpack_message(msg);
|
unpack_message(msg);
|
||||||
tot = (unsigned char)msg->str[9];
|
tot = (unsigned char)msg->str[9];
|
||||||
for (n = 0; n < msg->len; n++) {
|
|
||||||
printf("%02x ",(unsigned char) msg->str[n]);
|
if (debug_flag_is_set(DEBUG_HEX)) {
|
||||||
|
for (n = 0; n < msg->len; n++) {
|
||||||
|
printf("%02x ",(unsigned char) msg->str[n]);
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
}
|
}
|
||||||
printf("\n");
|
|
||||||
|
|
||||||
modifier_linkable_list(msg);
|
modifier_linkable_list(msg);
|
||||||
|
|
||||||
@@ -461,7 +545,8 @@ void send_message(gint procedure, gchar *data, gint len)
|
|||||||
g_string_append_printf(msg, "%c\xF7",
|
g_string_append_printf(msg, "%c\xF7",
|
||||||
calculate_checksum(&msg->str[1], msg->len - 1));
|
calculate_checksum(&msg->str[1], msg->len - 1));
|
||||||
|
|
||||||
g_message("Sending message %s len %d", get_message_name(procedure), len);
|
debug_msg(DEBUG_VERBOSE, "Sending message %s len %d",
|
||||||
|
get_message_name(procedure), len);
|
||||||
send_data(msg->str, msg->len);
|
send_data(msg->str, msg->len);
|
||||||
|
|
||||||
g_string_free(msg, TRUE);
|
g_string_free(msg, TRUE);
|
||||||
@@ -682,7 +767,7 @@ SectionID get_genetx_section_id(gint version, gint type)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_message("This version of gdigi don't know what to do with this "
|
g_warning("This version of gdigi don't know what to do with this "
|
||||||
"GeNetX version (%d) and type (%d)", version, type);
|
"GeNetX version (%d) and type (%d)", version, type);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@@ -698,7 +783,8 @@ SectionID get_genetx_section_id(gint version, gint type)
|
|||||||
void get_option(guint id, guint position)
|
void get_option(guint id, guint position)
|
||||||
{
|
{
|
||||||
GString *msg = g_string_sized_new(9);
|
GString *msg = g_string_sized_new(9);
|
||||||
g_message("Requesting parameter id %d position %d", id, position);
|
debug_msg(DEBUG_MSG2DEV, "REQUEST_PARAMETER_VALUE: id %d position %d",
|
||||||
|
id, position);
|
||||||
g_string_append_printf(msg, "%c%c%c",
|
g_string_append_printf(msg, "%c%c%c",
|
||||||
((id & 0xFF00) >> 8), (id & 0xFF),
|
((id & 0xFF00) >> 8), (id & 0xFF),
|
||||||
position);
|
position);
|
||||||
@@ -719,7 +805,8 @@ void set_option(guint id, guint position, guint value)
|
|||||||
((id & 0xFF00) >> 8), (id & 0xFF),
|
((id & 0xFF00) >> 8), (id & 0xFF),
|
||||||
position);
|
position);
|
||||||
append_value(msg, value);
|
append_value(msg, value);
|
||||||
g_message("Sending id %d position %d value %d", id, position, value);
|
debug_msg(DEBUG_MSG2DEV, "Sending id %d position %d value %d",
|
||||||
|
id, position, value);
|
||||||
send_message(RECEIVE_PARAMETER_VALUE, msg->str, msg->len);
|
send_message(RECEIVE_PARAMETER_VALUE, msg->str, msg->len);
|
||||||
g_string_free(msg, TRUE);
|
g_string_free(msg, TRUE);
|
||||||
}
|
}
|
||||||
@@ -930,7 +1017,7 @@ GList *get_message_list(MessageID id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (amt) {
|
while (amt) {
|
||||||
g_message("%d messages left", amt);
|
debug_msg(DEBUG_VERBOSE, "%d messages left", amt);
|
||||||
data = g_queue_pop_nth(message_queue, x);
|
data = g_queue_pop_nth(message_queue, x);
|
||||||
if (data == NULL) {
|
if (data == NULL) {
|
||||||
g_cond_wait(message_queue_cond, message_queue_mutex);
|
g_cond_wait(message_queue_cond, message_queue_mutex);
|
||||||
@@ -1185,6 +1272,9 @@ static void request_device_configuration()
|
|||||||
|
|
||||||
static GOptionEntry options[] = {
|
static GOptionEntry options[] = {
|
||||||
{"device", 'd', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_STRING, &device_port, "MIDI device port to use", NULL},
|
{"device", 'd', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_STRING, &device_port, "MIDI device port to use", NULL},
|
||||||
|
{"debug-flags", 'D', G_OPTION_FLAG_IN_MAIN, G_OPTION_ARG_CALLBACK, set_debug_flags,
|
||||||
|
"Set debug flags: any combination of a, d, h, s:\n",
|
||||||
|
NULL},
|
||||||
{NULL}
|
{NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1229,7 +1319,7 @@ int main(int argc, char *argv[]) {
|
|||||||
g_option_context_add_group(context, gtk_get_option_group(TRUE));
|
g_option_context_add_group(context, gtk_get_option_group(TRUE));
|
||||||
|
|
||||||
if (!g_option_context_parse(context, &argc, &argv, &error)) {
|
if (!g_option_context_parse(context, &argc, &argv, &error)) {
|
||||||
g_message("option parsing failed: %s\n", error->message);
|
g_warning("option parsing failed: %s\n", error->message);
|
||||||
g_error_free(error);
|
g_error_free(error);
|
||||||
g_option_context_free(context);
|
g_option_context_free(context);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
@@ -1256,9 +1346,9 @@ int main(int argc, char *argv[]) {
|
|||||||
device_port = g_strdup_printf("hw:%d,0,0",
|
device_port = g_strdup_printf("hw:%d,0,0",
|
||||||
GPOINTER_TO_INT(device->data));
|
GPOINTER_TO_INT(device->data));
|
||||||
g_list_free(devices);
|
g_list_free(devices);
|
||||||
g_message("Found device %s", device_port);
|
debug_msg(DEBUG_STARTUP, "Found device %s\n", device_port);
|
||||||
} else {
|
} else {
|
||||||
g_message("Using device %s", device_port);
|
debug_msg(DEBUG_STARTUP, "Using device %s\n", device_port);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_option_context_free(context);
|
g_option_context_free(context);
|
||||||
@@ -1286,14 +1376,14 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
if (device != NULL) {
|
if (device != NULL) {
|
||||||
/* enable GUI mode */
|
/* enable GUI mode */
|
||||||
set_option(GUI_MODE_ON_OFF, USB_POSITION, 1);
|
set_option(GUI_MODE_ON_OFF, GLOBAL_POSITION, 1);
|
||||||
|
|
||||||
gui_create(device);
|
gui_create(device);
|
||||||
gtk_main();
|
gtk_main();
|
||||||
gui_free();
|
gui_free();
|
||||||
|
|
||||||
/* disable GUI mode */
|
/* disable GUI mode */
|
||||||
set_option(GUI_MODE_ON_OFF, USB_POSITION, 0);
|
set_option(GUI_MODE_ON_OFF, GLOBAL_POSITION, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1308,7 +1398,7 @@ int main(int argc, char *argv[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (message_queue != NULL) {
|
if (message_queue != NULL) {
|
||||||
g_message("%d unread messages in queue",
|
g_warning("%d unread messages in queue",
|
||||||
g_queue_get_length(message_queue));
|
g_queue_get_length(message_queue));
|
||||||
g_queue_foreach(message_queue, (GFunc) message_free_func, NULL);
|
g_queue_foreach(message_queue, (GFunc) message_free_func, NULL);
|
||||||
g_queue_free(message_queue);
|
g_queue_free(message_queue);
|
||||||
|
|||||||
26
gdigi.h
26
gdigi.h
@@ -22,6 +22,19 @@
|
|||||||
|
|
||||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
#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_POSITION 7
|
||||||
#define GNX_CHANNEL_AMP 260
|
#define GNX_CHANNEL_AMP 260
|
||||||
#define GNX_WARP 261
|
#define GNX_WARP 261
|
||||||
@@ -885,7 +898,10 @@ enum {
|
|||||||
|
|
||||||
#define TONE_LIB_TYPE 8704
|
#define TONE_LIB_TYPE 8704
|
||||||
#define FX_LIB_TYPE 8705
|
#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_MAX1 8708
|
||||||
#define FX_LIB_LEVEL_MAX2 8710
|
#define FX_LIB_LEVEL_MAX2 8710
|
||||||
#define FX_LIB_LEVEL_MAX3 8712
|
#define FX_LIB_LEVEL_MAX3 8712
|
||||||
@@ -962,12 +978,18 @@ enum {
|
|||||||
EFFECTS_LIB_CUSTOM = 1856
|
EFFECTS_LIB_CUSTOM = 1856
|
||||||
};
|
};
|
||||||
|
|
||||||
#define USB_POSITION 0
|
#define GLOBAL_POSITION 0
|
||||||
|
|
||||||
|
#define TUNING_REFERENCE 12288
|
||||||
|
|
||||||
#define USB_AUDIO_PLAYBACK_MIX 12297
|
#define USB_AUDIO_PLAYBACK_MIX 12297
|
||||||
#define USB_AUDIO_LEVEL 12307
|
#define USB_AUDIO_LEVEL 12307
|
||||||
|
|
||||||
#define GUI_MODE_ON_OFF 12298
|
#define GUI_MODE_ON_OFF 12298
|
||||||
|
|
||||||
|
#define EXP_PEDAL_LEVEL 12300
|
||||||
|
#define STOMP_MODE 12370
|
||||||
|
|
||||||
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
|
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|||||||
12
gui.c
12
gui.c
@@ -249,7 +249,7 @@ static gboolean custom_value_output_cb(GtkSpinButton *spin, EffectValues *values
|
|||||||
if (values->type & VALUE_TYPE_EXTRA) {
|
if (values->type & VALUE_TYPE_EXTRA) {
|
||||||
values = values->extra;
|
values = values->extra;
|
||||||
} else {
|
} else {
|
||||||
g_message("custom_value_output_cb called with out of bounds value");
|
g_warning("custom_value_output_cb called with out of bounds value");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -993,7 +993,7 @@ static void action_open_preset_cb(GtkAction *action)
|
|||||||
for (x=0; x<n_file_types; x++) {
|
for (x=0; x<n_file_types; x++) {
|
||||||
GtkFileFilter *current_filter = gtk_file_filter_new();
|
GtkFileFilter *current_filter = gtk_file_filter_new();
|
||||||
if (file_types[x].name == NULL) {
|
if (file_types[x].name == NULL) {
|
||||||
g_message("Skipping NULL array entry");
|
g_warning("Skipping NULL array entry");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1255,7 +1255,7 @@ static void add_menubar(GtkWidget *window, GtkWidget *vbox)
|
|||||||
gtk_window_add_accel_group(GTK_WINDOW(window), gtk_ui_manager_get_accel_group(ui));
|
gtk_window_add_accel_group(GTK_WINDOW(window), gtk_ui_manager_get_accel_group(ui));
|
||||||
|
|
||||||
if (!gtk_ui_manager_add_ui_from_string(ui, menu_info, -1, &error)) {
|
if (!gtk_ui_manager_add_ui_from_string(ui, menu_info, -1, &error)) {
|
||||||
g_message("building menus failed: %s", error->message);
|
g_warning("building menus failed: %s", error->message);
|
||||||
g_error_free(error);
|
g_error_free(error);
|
||||||
error = NULL;
|
error = NULL;
|
||||||
}
|
}
|
||||||
@@ -1353,9 +1353,6 @@ void gui_create(Device *device)
|
|||||||
|
|
||||||
g_signal_connect(G_OBJECT(window), "delete_event", G_CALLBACK(gtk_main_quit), NULL);
|
g_signal_connect(G_OBJECT(window), "delete_event", G_CALLBACK(gtk_main_quit), NULL);
|
||||||
|
|
||||||
/* Not part of the preset, but update from the device. */
|
|
||||||
get_option(USB_AUDIO_LEVEL, USB_POSITION);
|
|
||||||
get_option(USB_AUDIO_PLAYBACK_MIX, USB_POSITION);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1414,7 +1411,8 @@ gboolean unsupported_device_dialog(Device **device)
|
|||||||
if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
|
if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
|
||||||
gint number = gtk_combo_box_get_active(GTK_COMBO_BOX(combo_box));
|
gint number = gtk_combo_box_get_active(GTK_COMBO_BOX(combo_box));
|
||||||
if (number != -1 && number <n_supported_devices) {
|
if (number != -1 && number <n_supported_devices) {
|
||||||
g_message("Starting %s compability mode", supported_devices[number]->name);
|
g_message("Starting %s compability mode",
|
||||||
|
supported_devices[number]->name);
|
||||||
*device = supported_devices[number];
|
*device = supported_devices[number];
|
||||||
gtk_widget_destroy(dialog);
|
gtk_widget_destroy(dialog);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|||||||
33
preset.c
33
preset.c
@@ -69,7 +69,7 @@ static void XMLCALL start(void *data, const char *el, const char **attr) {
|
|||||||
if (g_strcmp0(el, "Params") == 0) {
|
if (g_strcmp0(el, "Params") == 0) {
|
||||||
ad->section = SECTION_PARAMS;
|
ad->section = SECTION_PARAMS;
|
||||||
if (ad->preset->params != NULL)
|
if (ad->preset->params != NULL)
|
||||||
g_message("Params aleady exists!");
|
g_warning("Params aleady exists!");
|
||||||
} else if (g_strcmp0(el, "Param") == 0) {
|
} else if (g_strcmp0(el, "Param") == 0) {
|
||||||
SettingParam *param = setting_param_new();
|
SettingParam *param = setting_param_new();
|
||||||
ad->preset->params = g_list_prepend(ad->preset->params, param);
|
ad->preset->params = g_list_prepend(ad->preset->params, param);
|
||||||
@@ -84,7 +84,7 @@ static void XMLCALL start(void *data, const char *el, const char **attr) {
|
|||||||
} else if (g_strcmp0(el, "Genetx") == 0) {
|
} else if (g_strcmp0(el, "Genetx") == 0) {
|
||||||
ad->section = SECTION_GENETX;
|
ad->section = SECTION_GENETX;
|
||||||
if (ad->preset->genetxs != NULL)
|
if (ad->preset->genetxs != NULL)
|
||||||
g_message("Genetx already exists!");
|
g_warning("Genetx already exists!");
|
||||||
} else if (g_strcmp0(el, "GenetxModel") == 0) {
|
} else if (g_strcmp0(el, "GenetxModel") == 0) {
|
||||||
SettingGenetx *genetx = setting_genetx_new();
|
SettingGenetx *genetx = setting_genetx_new();
|
||||||
ad->preset->genetxs = g_list_prepend(ad->preset->genetxs, genetx);
|
ad->preset->genetxs = g_list_prepend(ad->preset->genetxs, genetx);
|
||||||
@@ -160,7 +160,7 @@ static void XMLCALL text_cb(void *data, const char* text, int len)
|
|||||||
} else if (g_strcmp0(value, "Version2") == 0) {
|
} else if (g_strcmp0(value, "Version2") == 0) {
|
||||||
genetx->version = GENETX_VERSION_2;
|
genetx->version = GENETX_VERSION_2;
|
||||||
} else {
|
} else {
|
||||||
g_message("Unknown GeNetX version: %s", value);
|
g_warning("Unknown GeNetX version: %s", value);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PARSER_TYPE_GENETX_TYPE:
|
case PARSER_TYPE_GENETX_TYPE:
|
||||||
@@ -169,7 +169,7 @@ static void XMLCALL text_cb(void *data, const char* text, int len)
|
|||||||
} else if (g_strcmp0(value, "Cabinet") == 0) {
|
} else if (g_strcmp0(value, "Cabinet") == 0) {
|
||||||
genetx->type = GENETX_TYPE_CABINET;
|
genetx->type = GENETX_TYPE_CABINET;
|
||||||
} else {
|
} else {
|
||||||
g_message("Unknown GeNetX type: %s", value);
|
g_warning("Unknown GeNetX type: %s", value);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PARSER_TYPE_GENETX_CHANNEL:
|
case PARSER_TYPE_GENETX_CHANNEL:
|
||||||
@@ -178,7 +178,7 @@ static void XMLCALL text_cb(void *data, const char* text, int len)
|
|||||||
} else if (g_strcmp0(value, "Channel2") == 0) {
|
} else if (g_strcmp0(value, "Channel2") == 0) {
|
||||||
genetx->channel = GENETX_CHANNEL2;
|
genetx->channel = GENETX_CHANNEL2;
|
||||||
} else {
|
} else {
|
||||||
g_message("Unknown GeNetX channel: %s", value);
|
g_warning("Unknown GeNetX channel: %s", value);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PARSER_TYPE_GENETX_NAME:
|
case PARSER_TYPE_GENETX_NAME:
|
||||||
@@ -219,7 +219,7 @@ Preset *create_preset_from_xml_file(gchar *filename, GError **error)
|
|||||||
gchar *contents;
|
gchar *contents;
|
||||||
|
|
||||||
if (g_file_get_contents(filename, &contents, NULL, &err) == FALSE) {
|
if (g_file_get_contents(filename, &contents, NULL, &err) == FALSE) {
|
||||||
g_message("Failed to get %s contents: %s", filename, err->message);
|
g_warning("Failed to get %s contents: %s", filename, err->message);
|
||||||
*error = g_error_copy(err);
|
*error = g_error_copy(err);
|
||||||
g_error_free(err);
|
g_error_free(err);
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -308,12 +308,16 @@ Preset *create_preset_from_data(GList *list)
|
|||||||
modified = (unsigned char)data->str[11+strlen(name)];
|
modified = (unsigned char)data->str[11+strlen(name)];
|
||||||
|
|
||||||
if ((bank == PRESETS_EDIT_BUFFER) && (number == 0)) {
|
if ((bank == PRESETS_EDIT_BUFFER) && (number == 0)) {
|
||||||
g_message("Received current edit buffer");
|
debug_msg(DEBUG_MSG2HOST,
|
||||||
|
"RECEIVE_PRESET_START: current edit buffer");
|
||||||
} else {
|
} else {
|
||||||
g_message("Received preset %d from bank %d", number, bank);
|
debug_msg(DEBUG_MSG2HOST,
|
||||||
|
"RECEIVE_PRESET_START: preset %d from bank %d",
|
||||||
|
number, bank);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_message("Modified flag: %d Name: %s", modified, name);
|
debug_msg(DEBUG_MSG2HOST, "Name: %s, %sodified",
|
||||||
|
name, modified ? "M" : "Not m");
|
||||||
preset->name = name;
|
preset->name = name;
|
||||||
break;
|
break;
|
||||||
case RECEIVE_PRESET_PARAMETERS:
|
case RECEIVE_PRESET_PARAMETERS:
|
||||||
@@ -326,16 +330,19 @@ Preset *create_preset_from_data(GList *list)
|
|||||||
SettingParam *param = setting_param_new_from_data(&data->str[x], &x);
|
SettingParam *param = setting_param_new_from_data(&data->str[x], &x);
|
||||||
n++;
|
n++;
|
||||||
preset->params = g_list_prepend(preset->params, param);
|
preset->params = g_list_prepend(preset->params, param);
|
||||||
g_message("%3d ID %4d Position %2d Value %6.1d",
|
debug_msg(DEBUG_MSG2HOST, "%3d ID %4d Position %2d "
|
||||||
n, param->id, param->position, param->value);
|
"Value %6.1d",
|
||||||
|
n, param->id, param->position,
|
||||||
|
param->value);
|
||||||
} while ((x < data->len) && n<total);
|
} while ((x < data->len) && n<total);
|
||||||
g_message("TOTAL %d", total);
|
debug_msg(DEBUG_MSG2HOST, "TOTAL %d", total);
|
||||||
preset->params = g_list_sort(preset->params, params_cmp);
|
preset->params = g_list_sort(preset->params, params_cmp);
|
||||||
break;
|
break;
|
||||||
case RECEIVE_PRESET_END:
|
case RECEIVE_PRESET_END:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
g_message("Unhandled message in preset messages list");
|
g_warning("Unhandled message 0x%x in preset messages list",
|
||||||
|
get_message_id(data));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
14
preset_xml.c
14
preset_xml.c
@@ -57,11 +57,12 @@ map_xml_value(XmlSettings *xml, gint value)
|
|||||||
switch (xml->values->type) {
|
switch (xml->values->type) {
|
||||||
case VALUE_TYPE_LABEL:
|
case VALUE_TYPE_LABEL:
|
||||||
if ((xml->values == &values_on_off) && (value > 1)) {
|
if ((xml->values == &values_on_off) && (value > 1)) {
|
||||||
g_message("Skipping modifier->label %s\n", xml->label);
|
g_warning("Skipping modifier->label %s\n", xml->label);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (value > xml->values->max || value < xml->values->min) {
|
if (value > xml->values->max || value < xml->values->min) {
|
||||||
g_message("%s value %d out of range %0.1f %0.1f", xml->label, value, xml->values->min, xml->values->max);
|
g_warning("%s value %d out of range %0.1f %0.1f",
|
||||||
|
xml->label, value, xml->values->min, xml->values->max);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
XmlLabel *labels = xml->xml_labels;
|
XmlLabel *labels = xml->xml_labels;
|
||||||
@@ -144,7 +145,7 @@ write_preset_to_xml(Preset *preset, gchar *filename)
|
|||||||
SettingParam *param = (SettingParam *) iter_params->data;
|
SettingParam *param = (SettingParam *) iter_params->data;
|
||||||
|
|
||||||
if (param->id == last_id && param->position == last_position) {
|
if (param->id == last_id && param->position == last_position) {
|
||||||
g_message("Skipping duplicate parameter id %d position %d",
|
g_warning("Skipping duplicate parameter id %d position %d",
|
||||||
last_id, last_position);
|
last_id, last_position);
|
||||||
iter_params = iter_params->next;
|
iter_params = iter_params->next;
|
||||||
continue;
|
continue;
|
||||||
@@ -208,8 +209,9 @@ write_preset_to_xml(Preset *preset, gchar *filename)
|
|||||||
{
|
{
|
||||||
char *textp = map_xml_value(xml, param->value);
|
char *textp = map_xml_value(xml, param->value);
|
||||||
if (!textp) {
|
if (!textp) {
|
||||||
g_message("Unable to map %s value %d for id %d position %d",
|
g_warning("Unable to map %s value %d for id %d position %d",
|
||||||
xml->label, param->value, param->id, param->position);
|
xml->label, param->value, param->id,
|
||||||
|
param->position);
|
||||||
textp = "";
|
textp = "";
|
||||||
}
|
}
|
||||||
rc = xmlTextWriterWriteElement(writer, BAD_CAST "Text",
|
rc = xmlTextWriterWriteElement(writer, BAD_CAST "Text",
|
||||||
@@ -237,7 +239,7 @@ write_preset_to_xml(Preset *preset, gchar *filename)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
g_message("Unhandled value type %d", type);
|
g_warning("Unhandled value type %d", type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user