Skip to content

Commit

Permalink
Merge branch 'editor_segfault_fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
theabolton committed Jan 2, 2021
2 parents 737dbb0 + 1a953a3 commit 8ec9ec1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ dist_pkgdata_DATA = extra/dx7_roms.dx7 \
extra/tx7_roms.dx7

AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4

5 changes: 3 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT(hexter, 1.1.0, sean-at-smbolton-dot-com)

AC_CONFIG_SRCDIR(src/hexter.c)
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE([subdir-objects])
AM_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIRS([m4])

AC_PROG_CC

Expand Down
25 changes: 17 additions & 8 deletions src/gui_widgy_editor.c
Original file line number Diff line number Diff line change
Expand Up @@ -862,24 +862,33 @@ on_combo_changed(GtkComboBox *widget,
}

static void
place_combo(GtkObject *adj, GtkWidget *table, int x, int y, int type)
combo_box_append_text(GtkWidget *w, const char** labels)
{
const char **labels;
int i;
/* -FIX- this is kinda ugly */
for (i = 0; labels[i]; i++)
{
gtk_combo_box_append_text(GTK_COMBO_BOX(w), labels[i]);
}
}

static void
place_combo(GtkObject *adj, GtkWidget *table, int x, int y, int type)
{
/* -FIX- this is still kinda ugly */
const char* labels_lfo_wave[] = { "Tri", "Saw+", "Saw-", "Square", "Sine", "S/H", 0 };
const char* labels_curve[] = { "-Lin", "-Exp", "+Exp", "+Lin", 0 };

GtkWidget *w = gtk_combo_box_new_text();
switch (type) {
default:
case PEPT_LFOWave:
labels = (const char *[]){ "Tri", "Saw+", "Saw-", "Square", "Sine", "S/H", NULL };
combo_box_append_text(w, labels_lfo_wave);
break;
case PEPT_Curve:
labels = (const char *[]){ "-Lin", "-Exp", "+Exp", "+Lin", NULL };
combo_box_append_text(w, labels_curve);
break;
}

GtkWidget *w = gtk_combo_box_new_text();
for (i = 0; labels[i]; i++)
gtk_combo_box_append_text(GTK_COMBO_BOX(w), labels[i]);
gtk_combo_box_set_active((GtkComboBox *)w, 0);
gtk_table_attach (GTK_TABLE (table), w, x, x + 1, y, y + 1,
(GtkAttachOptions) (0),
Expand Down

0 comments on commit 8ec9ec1

Please sign in to comment.