예제 #1
0
GtkWidget* envelope_box_new(const gchar *label)
{
    EnvelopeBox *e;
    GtkWidget *box2, *thing, *box3, *box4;

    e = gtk_type_new(envelope_box_get_type());
    GTK_BOX(e)->spacing = 2;
    GTK_BOX(e)->homogeneous = FALSE;

    box2 = gtk_hbox_new(FALSE, 2);
    gtk_box_pack_start(GTK_BOX(e), box2, FALSE, TRUE, 0);
    gtk_widget_show(box2);

    thing = gtk_check_button_new_with_label(label);
    gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(thing), 0);
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    gtk_widget_show(thing);
    gtk_signal_connect(GTK_OBJECT(thing), "toggled",
		       GTK_SIGNAL_FUNC(handle_toggle_button), e);
    e->enable = GTK_TOGGLE_BUTTON(thing);

    add_empty_hbox(box2);

    box2 = gtk_hbox_new(FALSE, 5);
    gtk_box_pack_start(GTK_BOX(e), box2, FALSE, TRUE, 0);
    gtk_widget_show(box2);

    /* Numerical list editing fields */
    box3 = gtk_vbox_new(FALSE, 2);
    gtk_box_pack_start(GTK_BOX(box2), box3, FALSE, TRUE, 0);
    gtk_widget_show(box3);

    put_labelled_spin_button(box3, "Env length", 1, 12, &e->spin_length, spin_length_changed, e);
    put_labelled_spin_button(box3, "Current pos", 0, 11, &e->spin_pos, spin_pos_changed, e);
    put_labelled_spin_button(box3, "Offset", 0, 65535, &e->spin_offset, spin_offset_changed, e);
    put_labelled_spin_button(box3, "Value", 0, 64, &e->spin_value, spin_value_changed, e);

    box4 = gtk_hbox_new(TRUE, 4);
    gtk_box_pack_start(GTK_BOX(box3), box4, FALSE, TRUE, 0);
    gtk_widget_show(box4);

    thing = gtk_button_new_with_label("Insert");
    gtk_box_pack_start(GTK_BOX(box4), thing, TRUE, TRUE, 0);
    gtk_widget_show(thing);
    gtk_signal_connect(GTK_OBJECT(thing), "clicked",
		       GTK_SIGNAL_FUNC(insert_clicked), e);
    
    thing = gtk_button_new_with_label("Delete");
    gtk_box_pack_start(GTK_BOX(box4), thing, TRUE, TRUE, 0);
    gtk_widget_show(thing);
    gtk_signal_connect(GTK_OBJECT(thing), "clicked",
		       GTK_SIGNAL_FUNC(delete_clicked), e);

    thing = gtk_vseparator_new();
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    gtk_widget_show(thing);

#if 0    
    /* Graphical editing stuff to be inserted here */
    thing = gtk_hbox_new(FALSE, 0);
    gtk_box_pack_start(GTK_BOX(box2), thing, TRUE, TRUE, 0);
    gtk_widget_show(thing);

    thing = gtk_vseparator_new();
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    gtk_widget_show(thing);
#endif
    /* Sustain / Loop widgets */
    box3 = gtk_vbox_new(FALSE, 2);
    gtk_box_pack_start(GTK_BOX(box2), box3, FALSE, TRUE, 0);
    gtk_widget_show(box3);

    thing = gtk_check_button_new_with_label("Sustain");
    gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(thing), 0);
    gtk_box_pack_start(GTK_BOX(box3), thing, FALSE, TRUE, 0);
    gtk_widget_show(thing);
    gtk_signal_connect(GTK_OBJECT(thing), "toggled",
		       GTK_SIGNAL_FUNC(handle_toggle_button), e);
    e->sustain = GTK_TOGGLE_BUTTON(thing);

    put_labelled_spin_button(box3, "Point", 0, 11, &e->spin_sustain, handle_spin_button, e);

    thing = gtk_check_button_new_with_label("Loop");
    gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(thing), 0);
    gtk_box_pack_start(GTK_BOX(box3), thing, FALSE, TRUE, 0);
    gtk_widget_show(thing);
    gtk_signal_connect(GTK_OBJECT(thing), "toggled",
		       GTK_SIGNAL_FUNC(handle_toggle_button), e);
    e->loop = GTK_TOGGLE_BUTTON(thing);

    put_labelled_spin_button(box3, "Start", 0, 11, &e->spin_loop_start, handle_spin_button, e);
    put_labelled_spin_button(box3, "End", 0, 11, &e->spin_loop_end, handle_spin_button, e);

    return GTK_WIDGET(e);
}
예제 #2
0
static void
alsa_make_config_widgets (alsa_driver *d)
{
    GtkWidget *thing, *mainbox, *box2;
    GtkListStore *ls;
    GtkCellRenderer *cell;

    static const char *resolutionlabels[] = { "8 bits", "16 bits", NULL };
    static const char *channelslabels[] = { "Mono", "Stereo", NULL };

    d->configwidget = mainbox = gtk_vbox_new(FALSE, 2);

    thing = gtk_label_new(_("These changes won't take effect until you restart playing."));
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(mainbox), thing, FALSE, TRUE, 0);
    
    thing = gtk_hseparator_new();
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(mainbox), thing, FALSE, TRUE, 0);

    box2 = gtk_hbox_new(FALSE, 4);
    gtk_widget_show(box2);
    gtk_box_pack_start(GTK_BOX(mainbox), box2, FALSE, TRUE, 0);

    thing = gtk_label_new(_("Device:"));
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    thing = gtk_button_new_with_label("Test");
    gtk_widget_show(thing);
    gtk_box_pack_end(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    g_signal_connect(thing, "clicked",
		     G_CALLBACK(device_test), d);
    d->alsa_device = gtk_combo_box_entry_new_text();
    gtk_widget_show(d->alsa_device);
    gtk_box_pack_end(GTK_BOX(box2), d->alsa_device, FALSE, TRUE, 0);

    box2 = gtk_hbox_new(FALSE, 4);
    gtk_widget_show(box2);
    gtk_box_pack_start(GTK_BOX(mainbox), box2, FALSE, TRUE, 0);

    thing = gtk_label_new(_("Resolution:"));
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    add_empty_hbox(box2);
    make_radio_group_full(resolutionlabels, box2, d->prefs_resolution_w, FALSE, TRUE, (void(*)())prefs_resolution_changed, d);

    box2 = gtk_hbox_new(FALSE, 4);
    gtk_widget_show(box2);
    gtk_box_pack_start(GTK_BOX(mainbox), box2, FALSE, TRUE, 0);

    thing = gtk_label_new(_("Channels:"));
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    add_empty_hbox(box2);
    make_radio_group_full(channelslabels, box2, d->prefs_channels_w, FALSE, TRUE, (void(*)())prefs_channels_changed, d);

    box2 = gtk_hbox_new(FALSE, 4);
    gtk_widget_show(box2);
    gtk_box_pack_start(GTK_BOX(mainbox), box2, FALSE, TRUE, 0);

    thing = gtk_label_new(_("Frequency [Hz]:"));
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    ls = gtk_list_store_new(1, G_TYPE_UINT);
    d->model = GTK_TREE_MODEL(ls);
    thing = d->prefs_mixfreq = gtk_combo_box_new_with_model(GTK_TREE_MODEL(ls));
    g_object_unref(ls);
    cell = gtk_cell_renderer_text_new();
    gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(thing), cell, TRUE);
    gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(thing), cell, "text", 0, NULL);
    gtk_box_pack_end(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    gtk_widget_show(thing);
    g_signal_connect(thing, "changed",
		     G_CALLBACK(prefs_mixfreq_changed), d);

    box2 = gtk_hbox_new(FALSE, 4);
    gtk_widget_show(box2);
    gtk_box_pack_start(GTK_BOX(mainbox), box2, FALSE, TRUE, 0);

    thing = gtk_label_new(_("Buffer Size:"));
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    add_empty_hbox(box2);

    thing = gtk_label_new("2^");
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);

    d->bufsizespin = thing = gtk_spin_button_new_with_range(8.0, 16.0, 1.0);
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    gtk_widget_show(thing);
    g_signal_connect(thing, "value-changed",
			G_CALLBACK(prefs_bufsize_changed), d);

    d->bufsizelabel = thing = gtk_label_new(" = ");
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    gtk_widget_show(thing);

    box2 = gtk_hbox_new(FALSE, 4);
    gtk_widget_show(box2);
    gtk_box_pack_start(GTK_BOX(mainbox), box2, FALSE, TRUE, 0);

    thing = gtk_label_new(_("Number of Periods:"));
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    add_empty_hbox(box2);

    thing = gtk_label_new("2^");
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);

    d->periodspin = thing = gtk_spin_button_new_with_range(1.0, 4.0, 1.0);
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    gtk_widget_show(thing);
    g_signal_connect(thing, "value-changed",
			G_CALLBACK(prefs_periods_changed), d);

    d->periodlabel = thing = gtk_label_new(" = ");
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    gtk_widget_show(thing);

    box2 = gtk_hbox_new(FALSE, 4);
    gtk_widget_show(box2);
    gtk_box_pack_start(GTK_BOX(mainbox), box2, FALSE, TRUE, 0);

    d->estimatelabel = thing = gtk_label_new("");
    gtk_box_pack_end(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    gtk_widget_show(thing);
}
예제 #3
0
static void
alsa_make_config_widgets (alsa_driver *d)
{
    GtkWidget *thing, *mainbox, *box2, *box3, *alsa_card, *alsa_device;
    static const char *resolutionlabels[] = { "8 bits", "16 bits", NULL };
    static const char *channelslabels[] = { "Mono", "Stereo", NULL };
    static const char *mixfreqlabels[] = { "8000", "16000", "22050", "44100", NULL };

    d->configwidget = mainbox = gtk_vbox_new(FALSE, 2);

    thing = gtk_label_new(_("These changes won't take effect until you restart playing."));
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(mainbox), thing, FALSE, TRUE, 0);
    
    thing = gtk_hseparator_new();
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(mainbox), thing, FALSE, TRUE, 0);

    box2 = gtk_hbox_new(FALSE, 4);
    gtk_widget_show(box2);
    gtk_box_pack_start(GTK_BOX(mainbox), box2, FALSE, TRUE, 0);

    thing = gtk_label_new(_("Resolution:"));
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    add_empty_hbox(box2);
    make_radio_group_full(resolutionlabels, box2, d->prefs_resolution_w, FALSE, TRUE, (void(*)())prefs_resolution_changed, d);

    box2 = gtk_hbox_new(FALSE, 4);
    gtk_widget_show(box2);
    gtk_box_pack_start(GTK_BOX(mainbox), box2, FALSE, TRUE, 0);

    thing = gtk_label_new(_("Channels:"));
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    add_empty_hbox(box2);
    make_radio_group_full(channelslabels, box2, d->prefs_channels_w, FALSE, TRUE, (void(*)())prefs_channels_changed, d);

    box2 = gtk_hbox_new(FALSE, 4);
    gtk_widget_show(box2);
    gtk_box_pack_start(GTK_BOX(mainbox), box2, FALSE, TRUE, 0);

    thing = gtk_label_new(_("Frequency [Hz]:"));
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    add_empty_hbox(box2);
    make_radio_group_full(mixfreqlabels, box2, d->prefs_mixfreq_w, FALSE, TRUE, (void(*)())prefs_mixfreq_changed, d);

    box2 = gtk_hbox_new(FALSE, 4);
    gtk_widget_show(box2);
    gtk_box_pack_start(GTK_BOX(mainbox), box2, FALSE, TRUE, 0);

    thing = gtk_label_new(_("Buffer Size:"));
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    add_empty_hbox(box2);

    box3 = gtk_vbox_new(FALSE, 2);
    gtk_box_pack_start(GTK_BOX(box2), box3, FALSE, TRUE, 0);
    gtk_widget_show(box3);

    d->bufsizespin_w = thing = gtk_spin_button_new(GTK_ADJUSTMENT(gtk_adjustment_new(d->fragsize, 64.0, 16384.0, 64.0, 0.0, 0.0)), 0, 0);
    gtk_box_pack_start(GTK_BOX(box3), thing, FALSE, TRUE, 0);
    gtk_widget_show(thing);
    g_signal_connect(thing, "value-changed",
			G_CALLBACK(prefs_fragsize_changed), d);

    d->bufsizelabel_w = thing = gtk_label_new("");
    gtk_box_pack_start(GTK_BOX(box3), thing, FALSE, TRUE, 0);
    gtk_widget_show(thing);

    box2 = gtk_hbox_new(FALSE, 4);
    gtk_widget_show(box2);
    gtk_box_pack_start(GTK_BOX(mainbox), box2, FALSE, TRUE, 0);

    add_empty_hbox(box2);
    d->estimatelabel_w = thing = gtk_label_new("");
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    gtk_widget_show(thing);
    add_empty_hbox(box2);

    box2 = gtk_hbox_new(FALSE, 4);
    gtk_widget_show(box2);
    gtk_box_pack_start(GTK_BOX(mainbox), box2, FALSE, TRUE, 0);

    alsa_card = gtk_label_new(_("ALSA card number:"));
    gtk_widget_show(alsa_card);
    gtk_box_pack_start(GTK_BOX(box2), alsa_card, FALSE, TRUE, 0);
    add_empty_hbox(box2);

    d->alsacardspin_w = alsa_card = gtk_spin_button_new(GTK_ADJUSTMENT(gtk_adjustment_new(d->card_number, 0.0, 256.0, 1.0, 1.0, 0.0)), 0, 0);
    gtk_box_pack_start(GTK_BOX(box2), alsa_card, FALSE, TRUE, 0);
    gtk_widget_show(alsa_card);
    g_signal_connect(alsa_card, "value-changed",
			G_CALLBACK(prefs_alsacard_changed), d);

    box2 = gtk_hbox_new(FALSE, 4);
    gtk_widget_show(box2);
    gtk_box_pack_start(GTK_BOX(mainbox), box2, FALSE, TRUE, 0);

    alsa_device = gtk_label_new(_("ALSA device number:"));
    gtk_widget_show(alsa_device);
    gtk_box_pack_start(GTK_BOX(box2), alsa_device, FALSE, TRUE, 0);
    add_empty_hbox(box2);

    d->alsadevicespin_w = alsa_device = gtk_spin_button_new(GTK_ADJUSTMENT(gtk_adjustment_new(d->device_number, 0.0, 256.0, 1.0, 1.0, 0.0)), 0, 0);
    gtk_box_pack_start(GTK_BOX(box2), alsa_device, FALSE, TRUE, 0);
    gtk_widget_show(alsa_device);
    g_signal_connect(alsa_device, "value-changed",
			G_CALLBACK(prefs_alsadevice_changed), d);

    prefs_init_from_structure(d);
}
예제 #4
0
static void
oss_make_config_widgets (oss_driver *d)
{
    GtkWidget *thing, *mainbox, *box2, *box3;
    static const char *resolutionlabels[] = { "8 bits", "16 bits", NULL };
    static const char *channelslabels[] = { "Mono", "Stereo", NULL };
    static const char *mixfreqlabels[] = { "8000", "16000", "22050", "44100", NULL };

    d->configwidget = mainbox = gtk_vbox_new(FALSE, 2);

    thing = gtk_label_new(_("These changes won't take effect until you restart playing."));
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(mainbox), thing, FALSE, TRUE, 0);
    
    thing = gtk_hseparator_new();
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(mainbox), thing, FALSE, TRUE, 0);

    box2 = gtk_hbox_new(FALSE, 4);
    gtk_widget_show(box2);
    gtk_box_pack_start(GTK_BOX(mainbox), box2, FALSE, TRUE, 0);

    thing = gtk_label_new(_("Output device (e.g. '/dev/dsp'):"));
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    add_empty_hbox(box2);
    thing = gtk_entry_new_with_max_length(126);
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    gtk_entry_set_text(GTK_ENTRY(thing), d->p_devdsp);
    g_signal_connect_after(thing, "changed",
			     G_CALLBACK(oss_devdsp_changed), d);
    d->prefs_devdsp_w = thing;

    box2 = gtk_hbox_new(FALSE, 4);
    gtk_widget_show(box2);
    gtk_box_pack_start(GTK_BOX(mainbox), box2, FALSE, TRUE, 0);

    thing = gtk_label_new(_("Resolution:"));
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    add_empty_hbox(box2);
    make_radio_group_full(resolutionlabels, box2, d->prefs_resolution_w, FALSE, TRUE, (void(*)())prefs_resolution_changed, d);

    box2 = gtk_hbox_new(FALSE, 4);
    gtk_widget_show(box2);
    gtk_box_pack_start(GTK_BOX(mainbox), box2, FALSE, TRUE, 0);

    thing = gtk_label_new(_("Channels:"));
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    add_empty_hbox(box2);
    make_radio_group_full(channelslabels, box2, d->prefs_channels_w, FALSE, TRUE, (void(*)())prefs_channels_changed, d);

    box2 = gtk_hbox_new(FALSE, 4);
    gtk_widget_show(box2);
    gtk_box_pack_start(GTK_BOX(mainbox), box2, FALSE, TRUE, 0);

    thing = gtk_label_new(_("Frequency [Hz]:"));
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    add_empty_hbox(box2);
    make_radio_group_full(mixfreqlabels, box2, d->prefs_mixfreq_w, FALSE, TRUE, (void(*)())prefs_mixfreq_changed, d);

    box2 = gtk_hbox_new(FALSE, 4);
    gtk_widget_show(box2);
    gtk_box_pack_start(GTK_BOX(mainbox), box2, FALSE, TRUE, 0);

    thing = gtk_label_new(_("Buffer Size:"));
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    add_empty_hbox(box2);

    box3 = gtk_vbox_new(FALSE, 2);
    gtk_box_pack_start(GTK_BOX(box2), box3, FALSE, TRUE, 0);
    gtk_widget_show(box3);

    d->bufsizespin_w = thing = gtk_spin_button_new(GTK_ADJUSTMENT(gtk_adjustment_new(5.0, 5.0, 15.0, 1.0, 1.0, 0.0)), 0, 0);
    gtk_box_pack_start(GTK_BOX(box3), thing, FALSE, TRUE, 0);
    gtk_widget_show(thing);
    g_signal_connect(thing, "value-changed",
			G_CALLBACK(prefs_fragsize_changed), d);

    d->bufsizelabel_w = thing = gtk_label_new("");
    gtk_box_pack_start(GTK_BOX(box3), thing, FALSE, TRUE, 0);
    gtk_widget_show(thing);

    box2 = gtk_hbox_new(FALSE, 4);
    gtk_widget_show(box2);
    gtk_box_pack_start(GTK_BOX(mainbox), box2, FALSE, TRUE, 0);

    add_empty_hbox(box2);
    d->estimatelabel_w = thing = gtk_label_new("");
    gtk_box_pack_start(GTK_BOX(box2), thing, FALSE, TRUE, 0);
    gtk_widget_show(thing);
    add_empty_hbox(box2);

    prefs_init_from_structure(d);
}
예제 #5
0
void
transposition_dialog (void)
{
    gint i;
    GtkWidget *mainbox, *thing, *box1, *box2, *frame, *hbox;
    const char *labels1[] = {
	_("Whole Song"),
	_("All Patterns"),
	_("Current Pattern"),
	_("Current Track"),
	NULL
    };
    const char *labels2[] = {
	_("Current Instrument"),
	_("All Instruments"),
	NULL
    };
    const char *labels3[] = {
	_("Half note up"),
	_("Half note down"),
	_("Octave up"),
	_("Octave down")
    };
    const char *labels4[] = {
	_("Exchange 1 <-> 2"),
	_("Change 1 -> 2")
    };

    if(transposition_window != NULL) {
	gdk_window_raise(transposition_window->window);
	return;
    }
    
#ifdef USE_GNOME
    transposition_window = gnome_app_new("SoundTracker", _("Transposition Tools"));
#else
    transposition_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_window_set_title(GTK_WINDOW(transposition_window), _("Transposition Tools"));
#endif
    g_signal_connect(transposition_window, "delete_event",
			G_CALLBACK(transposition_close_requested), NULL);

    gtk_window_set_transient_for(GTK_WINDOW(transposition_window), GTK_WINDOW(mainwindow));
    gtk_window_set_policy(GTK_WINDOW(transposition_window), FALSE, FALSE, FALSE);

    mainbox = gtk_vbox_new(FALSE, 2);
    gtk_container_border_width(GTK_CONTAINER(mainbox), 4);
#ifdef USE_GNOME
    gnome_app_set_contents(GNOME_APP(transposition_window), mainbox);
#else
    gtk_container_add(GTK_CONTAINER(transposition_window), mainbox);
#endif
    gtk_widget_show(mainbox);

    box1 = gtk_hbox_new(FALSE, 4);
    gtk_widget_show(box1);
    gtk_box_pack_start(GTK_BOX(mainbox), box1, FALSE, TRUE, 0);

    thing = gtk_label_new(_("Scope of the operation:"));
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(box1), thing, FALSE, TRUE, 0);
    add_empty_hbox(box1);
    make_radio_group_full(labels1, box1, transposition_scope_w, FALSE, TRUE, NULL, NULL);

    frame = gtk_frame_new(NULL);
    gtk_frame_set_label(GTK_FRAME(frame), _("Note Transposition"));
    gtk_box_pack_start(GTK_BOX(mainbox), frame, FALSE, TRUE, 0);
    gtk_widget_show(frame);

    box2 = gtk_vbox_new(FALSE, 2);
    gtk_widget_show(box2);
    gtk_container_add (GTK_CONTAINER(frame), box2);
    gtk_container_border_width(GTK_CONTAINER(box2), 4);

    box1 = gtk_hbox_new(FALSE, 4);
    gtk_widget_show(box1);
    gtk_box_pack_start(GTK_BOX(box2), box1, FALSE, TRUE, 0);

    add_empty_hbox(box1);
    make_radio_group_full(labels2, box1, transposition_instrument_mode_w, FALSE, TRUE, NULL, NULL);
    add_empty_hbox(box1);

    box1 = gtk_hbox_new(TRUE, 4);
    gtk_widget_show(box1);
    gtk_box_pack_start(GTK_BOX(box2), box1, FALSE, TRUE, 0);

    for(i = 0; i < 4; i++) {
	thing = gtk_button_new_with_label(labels3[i]);
	gtk_widget_show(thing);
	gtk_box_pack_start(GTK_BOX(box1), thing, TRUE, TRUE, 0);
	g_signal_connect(thing, "clicked",
			   G_CALLBACK(transposition_transpose_notes),
			   GINT_TO_POINTER(i));
    }

    frame = gtk_frame_new(NULL);
    gtk_frame_set_label(GTK_FRAME(frame), _("Instrument Changing"));
    gtk_box_pack_start(GTK_BOX(mainbox), frame, FALSE, TRUE, 0);
    gtk_widget_show(frame);

    box2 = gtk_vbox_new(FALSE, 2);
    gtk_widget_show(box2);
    gtk_container_add (GTK_CONTAINER(frame), box2);
    gtk_container_border_width(GTK_CONTAINER(box2), 4);

    box1 = gtk_hbox_new(FALSE, 4);
    gtk_widget_show(box1);
    gtk_box_pack_start(GTK_BOX(box2), box1, FALSE, TRUE, 0);

    add_empty_hbox(box1);

    gui_put_labelled_spin_button(box1, _("Instrument 1:"), 1, 128, &transposition_instrument_w[0], NULL, NULL);

    thing = gtk_button_new_with_label(_("Current instrument"));
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(box1), thing, FALSE, TRUE, 0);
    g_signal_connect(thing, "clicked",
		       G_CALLBACK(transposition_current_instrument_clicked), (gpointer)0);

    add_empty_hbox(box1);

    gui_put_labelled_spin_button(box1, _("Instrument 2:"), 1, 128, &transposition_instrument_w[1], NULL, NULL);

    thing = gtk_button_new_with_label(_("Current instrument"));
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(box1), thing, FALSE, TRUE, 0);
    g_signal_connect(thing, "clicked",
		       G_CALLBACK(transposition_current_instrument_clicked), (gpointer)1);

    add_empty_hbox(box1);

    box1 = gtk_hbox_new(TRUE, 4);
    gtk_widget_show(box1);
    gtk_box_pack_start(GTK_BOX(box2), box1, FALSE, TRUE, 0);

    for(i = 0; i < 2; i++) {
	thing = gtk_button_new_with_label(labels4[i]);
	gtk_widget_show(thing);
	gtk_box_pack_start(GTK_BOX(box1), thing, TRUE, TRUE, 0);
	g_signal_connect(thing, "clicked",
			   G_CALLBACK(transposition_change_instruments),
			   GINT_TO_POINTER(i));
    }

    /* The button area */
    hbox = gtk_hbutton_box_new ();
    gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbox), 4);
    gtk_button_box_set_layout (GTK_BUTTON_BOX (hbox), GTK_BUTTONBOX_END);
    gtk_box_pack_start (GTK_BOX (mainbox), hbox,
			FALSE, FALSE, 0);
    gtk_widget_show (hbox);

    thing = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
    GTK_WIDGET_SET_FLAGS(thing, GTK_CAN_DEFAULT);
    gtk_window_set_default(GTK_WINDOW(transposition_window), thing);
    g_signal_connect(thing, "clicked",
			G_CALLBACK(transposition_close_requested), NULL);
    gtk_box_pack_start (GTK_BOX (hbox), thing, FALSE, FALSE, 0);
    gtk_widget_show (thing);

    gtk_widget_show(transposition_window);
}
void
instrument_page_create (GtkNotebook *nb)
{
    GtkWidget *mainbox, *vbox, *thing, *box, *box2, *box3, *box4, *frame;
    static const char *vibtypelabels[] = { N_("Sine"), N_("Square"), N_("Saw Down"), N_("Saw Up"), NULL };

    mainbox = gtk_vbox_new(FALSE, 4);
    gtk_container_border_width(GTK_CONTAINER(mainbox), 10);
    gtk_notebook_append_page(nb, mainbox, gtk_label_new(_("Instrument Editor")));
    gtk_widget_show(mainbox);

    add_empty_vbox(mainbox);

    disableboxes[0] = vbox = gtk_hbox_new(FALSE, 4);
    gtk_box_pack_start(GTK_BOX(mainbox), vbox, FALSE, TRUE, 0);
    gtk_widget_show(vbox);

    volenv = envelope_box_new(_("Volume envelope"));
    gtk_box_pack_start(GTK_BOX(vbox), volenv, TRUE, TRUE, 0);
    gtk_widget_show(volenv);

    thing = gtk_vseparator_new();
    gtk_box_pack_start(GTK_BOX(vbox), thing, FALSE, TRUE, 0);
    gtk_widget_show(thing);

    panenv = envelope_box_new(_("Panning envelope"));
    gtk_box_pack_start(GTK_BOX(vbox), panenv, TRUE, TRUE, 0);
    gtk_widget_show(panenv);

    thing = gtk_hseparator_new();
    gtk_box_pack_start(GTK_BOX(mainbox), thing, FALSE, TRUE, 0);
    gtk_widget_show(thing);


    box = gtk_hbox_new(FALSE, 4);
    gtk_box_pack_start(GTK_BOX(mainbox), box, FALSE, TRUE, 0);
    gtk_widget_show(box);

    box2 = gtk_vbox_new(TRUE, 2);
    gtk_box_pack_start(GTK_BOX(box), box2, TRUE, TRUE, 0);
    gtk_widget_show(box2);

    fileops_dialogs[DIALOG_LOAD_INSTRUMENT] = file_selection_create(_("Load Instrument..."), instrument_editor_file_selected);
    gtk_file_selection_set_filename(GTK_FILE_SELECTION(fileops_dialogs[DIALOG_LOAD_INSTRUMENT]), gui_settings.loadinstr_path);
    fileops_dialogs[DIALOG_SAVE_INSTRUMENT] = file_selection_create(_("Save Instrument..."), instrument_editor_file_selected);

    thing = gtk_button_new_with_label(_("Load XI"));
    gtk_box_pack_start(GTK_BOX(box2), thing, TRUE, TRUE, 0);
    gtk_widget_show(thing);
    g_signal_connect(thing, "clicked",
		       G_CALLBACK(fileops_open_dialog), (void*)DIALOG_LOAD_INSTRUMENT);

    disableboxes[3] = thing = gtk_button_new_with_label(_("Save XI"));
    gtk_box_pack_start(GTK_BOX(box2), thing, TRUE, TRUE, 0);
    gtk_widget_show(thing);
    g_signal_connect(thing, "clicked",
		       G_CALLBACK(fileops_open_dialog), (void*)DIALOG_SAVE_INSTRUMENT);

    thing = gtk_vseparator_new();
    gtk_box_pack_start(GTK_BOX(box), thing, FALSE, TRUE, 0);
    gtk_widget_show(thing);

    disableboxes[1] = box2 = gtk_vbox_new(TRUE, 2);
    gtk_box_pack_start(GTK_BOX(box), box2, TRUE, TRUE, 0);
    gtk_widget_show(box2);

    box3 = gtk_hbox_new(FALSE, 4);
    gtk_box_pack_start(GTK_BOX(box2), box3, FALSE, TRUE, 0);
    gtk_widget_show(box3);

    add_empty_hbox(box3);
    thing = make_labelled_radio_group_box(_("Vibrato Type:"), vibtypelabels, instrument_editor_vibtype_w, instrument_editor_vibtype_changed);
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(box3), thing, FALSE, TRUE, 0);
    thing = gui_subs_create_slider(&instrument_page_sliders[0]);
    gtk_box_pack_start(GTK_BOX(box3), thing, FALSE, TRUE, 0);
    gtk_widget_show(thing);
    add_empty_hbox(box3);

    box3 = gtk_hbox_new(FALSE, 4);
    gtk_box_pack_start(GTK_BOX(box2), box3, FALSE, TRUE, 0);
    gtk_widget_show(box3);

    add_empty_hbox(box3);
    thing = gui_subs_create_slider(&instrument_page_sliders[1]);
    gtk_box_pack_start(GTK_BOX(box3), thing, FALSE, TRUE, 0);
    gtk_widget_show(thing);
    thing = gui_subs_create_slider(&instrument_page_sliders[2]);
    gtk_box_pack_start(GTK_BOX(box3), thing, FALSE, TRUE, 0);
    gtk_widget_show(thing);
    thing = gui_subs_create_slider(&instrument_page_sliders[3]);
    gtk_box_pack_start(GTK_BOX(box3), thing, FALSE, TRUE, 0);
    gtk_widget_show(thing);
    add_empty_hbox(box3);

    thing = gtk_hseparator_new();
    gtk_box_pack_start(GTK_BOX(mainbox), thing, FALSE, TRUE, 0);
    gtk_widget_show(thing);

    // Sample map editor coming up
    disableboxes[2] = box2 = gtk_hbox_new(FALSE, 4);
    gtk_box_pack_start(GTK_BOX(mainbox), box2, FALSE, TRUE, 0);
    gtk_widget_show(box2);

    box3 = gtk_vbox_new(FALSE, 2);
    gtk_box_pack_start(GTK_BOX(box2), box3, TRUE, TRUE, 0);
    gtk_widget_show(box3);

    box = gtk_scrolled_window_new(NULL, NULL);
    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(box), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
    gtk_widget_show(box);
    gtk_box_pack_start(GTK_BOX(box3), box, TRUE, TRUE, 0);

    clavier = clavier_new();
    gtk_widget_show(clavier);
    gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(box), clavier);

    gtk_drawing_area_size (GTK_DRAWING_AREA (clavier), 96 * 7, 50);

    clavier_set_clavier_type(CLAVIER(clavier), CLAVIER_TYPE_SEQUENCER);
    clavier_set_range(CLAVIER(clavier), 0, 95);
    clavier_set_show_middle_c(CLAVIER(clavier), FALSE);
    clavier_set_show_transpose(CLAVIER(clavier), FALSE);

    g_signal_connect(clavier, "clavierkey_press",
			G_CALLBACK(instrument_editor_clavierkey_press_event),
			NULL);
    g_signal_connect(clavier, "clavierkey_release",
			G_CALLBACK(instrument_editor_clavierkey_release_event),
			NULL);
    g_signal_connect(clavier, "clavierkey_enter",
			G_CALLBACK(instrument_editor_clavierkey_enter_event),
			NULL);
    g_signal_connect(clavier, "clavierkey_leave",
			G_CALLBACK(instrument_editor_clavierkey_leave_event),
			NULL);

    box3 = gtk_vbox_new(FALSE, 2);
    gtk_box_pack_start(GTK_BOX(box2), box3, FALSE, TRUE, 0);
    gtk_widget_show(box3);

    add_empty_vbox(box3);

    thing = gtk_label_new(_("Note:"));
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(box3), thing, FALSE, TRUE, 0);

    frame = gtk_frame_new(NULL);
    gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
    gtk_box_pack_start(GTK_BOX(box3), frame, FALSE, TRUE, 0);
    gtk_widget_show(frame);

    box4 = gtk_vbox_new(FALSE, 2);
    gtk_widget_show(box4);
    gtk_container_add (GTK_CONTAINER(frame), box4);
    gtk_container_border_width(GTK_CONTAINER(box4), 4);

    curnote_label = thing = gtk_label_new("");
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(box4), thing, FALSE, TRUE, 0);

    thing = gtk_button_new_with_label(_("Initialize"));
    gtk_widget_show(thing);
    gtk_box_pack_start(GTK_BOX(box3), thing, FALSE, TRUE, 0);
    g_signal_connect(thing, "clicked",
			G_CALLBACK(instrument_editor_init_samplemap), NULL);

    add_empty_vbox(box3);

    add_empty_vbox(mainbox);
}