remove id and position fields from EffectGroup

This commit is contained in:
Tomasz Moń
2009-05-15 10:20:42 +02:00
parent 2703e79d39
commit 4a7ab848e7
3 changed files with 426 additions and 420 deletions

829
effects.c

File diff suppressed because it is too large Load Diff

View File

@@ -35,8 +35,6 @@ typedef struct {
typedef struct { typedef struct {
guint type; /**< value (type) */ guint type; /**< value (type) */
gchar *label; /**< Effect name */ gchar *label; /**< Effect name */
guint id; /**< ID (to set effect type) */
guint position; /**< position */
EffectSettings *settings; /**< possible parameters */ EffectSettings *settings; /**< possible parameters */
gint settings_amt; /**< possible parameters length */ gint settings_amt; /**< possible parameters length */
} EffectGroup; } EffectGroup;
@@ -44,6 +42,7 @@ typedef struct {
typedef struct { typedef struct {
gchar *label; /**< Group label */ gchar *label; /**< Group label */
guint id; /**< ID to set effect on/off, or if it isn't on/off group then -1 */ guint id; /**< ID to set effect on/off, or if it isn't on/off group then -1 */
guint type; /**< ID to set effect type */
guint position; /**< position */ guint position; /**< position */
EffectGroup *group; /**< possible effect types */ EffectGroup *group; /**< possible effect types */
gint group_amt; /**< possible effect types length */ gint group_amt; /**< possible effect types length */
@@ -56,6 +55,8 @@ typedef struct {
} EffectList; } EffectList;
typedef struct { typedef struct {
guint type; /**< ID to set effect type */
guint position;
EffectGroup *group; EffectGroup *group;
gint group_amt; gint group_amt;
} ModifierGroup; } ModifierGroup;

12
gui.c
View File

@@ -350,12 +350,14 @@ void combo_box_changed_cb(GtkComboBox *widget, gpointer data)
/** /**
* \param group Effect type groups * \param group Effect type groups
* \param amt amount of effect groups * \param amt amount of effect groups
* \param id ID to set effect type
* \param position position
* *
* Creates widget allowing user to choose effect type. * Creates widget allowing user to choose effect type.
* *
* \return widget that allow user to set effect type. * \return widget that allow user to set effect type.
**/ **/
GtkWidget *create_widget_container(EffectGroup *group, gint amt) GtkWidget *create_widget_container(EffectGroup *group, gint amt, gint id, gint position)
{ {
GtkWidget *vbox; GtkWidget *vbox;
GtkWidget *widget; GtkWidget *widget;
@@ -388,12 +390,12 @@ GtkWidget *create_widget_container(EffectGroup *group, gint amt)
widget = NULL; widget = NULL;
settings = g_slice_new(EffectSettingsGroup); settings = g_slice_new(EffectSettingsGroup);
settings->id = group[x].id; settings->id = id;
settings->type = group[x].type; settings->type = group[x].type;
settings->position = group[x].position; settings->position = position;
settings->child = widget; settings->child = widget;
widget_list_add(GTK_OBJECT(combo_box), group[x].id, group[x].position, group[x].type, x); widget_list_add(GTK_OBJECT(combo_box), id, position, group[x].type, x);
name = g_strdup_printf("SettingsGroup%d", cmbox_no); name = g_strdup_printf("SettingsGroup%d", cmbox_no);
g_object_set_data_full(G_OBJECT(combo_box), name, settings, ((GDestroyNotify)effect_settings_group_free)); g_object_set_data_full(G_OBJECT(combo_box), name, settings, ((GDestroyNotify)effect_settings_group_free));
@@ -453,7 +455,7 @@ GtkWidget *create_vbox(Effect *widgets, gint amt, gchar *label)
y = 0; y = 0;
} }
container = create_widget_container(widgets[x].group, widgets[x].group_amt); container = create_widget_container(widgets[x].group, widgets[x].group_amt, widgets[x].type, widgets[x].position);
gtk_table_attach_defaults(GTK_TABLE(table), container, 1-y, 2-y, x+y, x+y+1); gtk_table_attach_defaults(GTK_TABLE(table), container, 1-y, 2-y, x+y, x+y+1);
} }
gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 2); gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 2);