Merge branch 'global'
Conflicts:
.gitignore
effects.c
gdigi.c
gdigi.h
gdigi_xml.h
gui.c
gui.h
preset.c
preset_xml.c
effects.c: More effect_values_0_to_* arrays for various effects.
VALUE_TYPE_POSID for linkable effects.
Add the rest of the global settings (need to change USB_POSITION
to GLOBAL_POSITION throughout).
A few label typos.
New settings, groups, and effects for linkables.
Make the display three rows instead of two.
Add missing modifiers.
Add missing xml settings.
Code for handling/updating the global modifier linkable list.
effects.h Add VALUE_TYPE_POSID.
gdigi.c Tweaks for value formatting.
Use NOTIFY_MODIFIER_GROUP_CHANGED to drive the update of the combo
boxes for linkable effects.
Use RECEIVE_MODIFIER_LINKABLE_LIST to handle the update of the
combo boxes for linkable effects.
gdigi.h Minor changes.
gui.c Deprecate gtk_vbox_new().
Use simpler API gtk_combo_box_text_append_text().
Minor reformatting/whitespace changes.
Code to update combo boxes for linkable effects.
Code to retrieve global parameters from device at startup.
preset_xml.c
Some tweaks to map_xml_value() so that it's passed resolved
EffectValues for settings of type EXTRA.
This commit is contained in:
17
preset_xml.c
17
preset_xml.c
@@ -30,6 +30,7 @@
|
||||
extern XmlSettings xml_settings[];
|
||||
extern guint n_xml_settings;
|
||||
extern EffectValues values_on_off;
|
||||
|
||||
/**
|
||||
* \param id modifier ID
|
||||
* \param position modifier position
|
||||
@@ -52,18 +53,19 @@ XmlSettings *get_xml_settings (guint id, guint position)
|
||||
}
|
||||
|
||||
gchar *
|
||||
map_xml_value (XmlSettings *xml, gint value)
|
||||
map_xml_value (XmlSettings *xml, EffectValues *values, gint value)
|
||||
{
|
||||
switch (xml->values->type) {
|
||||
switch (values->type) {
|
||||
case VALUE_TYPE_LABEL:
|
||||
if ((xml->values == &values_on_off) && (value > 1)) {
|
||||
if ((values == &values_on_off) && (value > 1)) {
|
||||
g_warning("Skipping modifier->label %s\n", xml->label);
|
||||
return NULL;
|
||||
}
|
||||
if (value > xml->values->max || value < xml->values->min) {
|
||||
}
|
||||
|
||||
if (value > values->max || value < values->min) {
|
||||
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;
|
||||
guint labels_amt = xml->xml_labels_amt;
|
||||
@@ -96,6 +98,7 @@ gboolean value_is_extra (EffectValues *val, int value)
|
||||
void
|
||||
write_preset_to_xml(Preset *preset, gchar *filename)
|
||||
{
|
||||
|
||||
int rc;
|
||||
xmlTextWriterPtr writer;
|
||||
GList *iter_params = preset->params;
|
||||
@@ -205,7 +208,7 @@ write_preset_to_xml(Preset *preset, gchar *filename)
|
||||
switch (type) {
|
||||
case VALUE_TYPE_LABEL:
|
||||
{
|
||||
char *textp = map_xml_value(xml, param->value);
|
||||
char *textp = map_xml_value(xml, values, param->value);
|
||||
if (!textp) {
|
||||
g_warning("Unable to map %s value %d for id %d position %d",
|
||||
xml->label, param->value, param->id,
|
||||
|
||||
Reference in New Issue
Block a user