Adding Controller menus - Alex
authorterminatorX <>
Thu, 19 Jun 2003 11:22:14 +0000 (11:22 +0000)
committerterminatorX <>
Thu, 19 Jun 2003 11:22:14 +0000 (11:22 +0000)
14 files changed:
src/tX_extdial.cc
src/tX_extdial.h
src/tX_glade_interface.cc
src/tX_glade_interface.h
src/tX_ladspa.cc
src/tX_mastergui.cc
src/tX_mastergui.h
src/tX_midiin.cc
src/tX_seqpar.cc
src/tX_seqpar.h
src/tX_vttfx.cc
src/tX_vttfx.h
src/tX_vttgui.cc
terminatorX.glade

index 700fc8ee9f04e937947d054ac4138d74960db995..37f6740162212a34e9da8ac503e669d076fa222a 100644 (file)
@@ -1,4 +1,5 @@
 #include "tX_extdial.h"
+#include "tX_seqpar.h"
 #include <string.h>
 
 #define WID_DYN TRUE, TRUE, 0
@@ -21,7 +22,7 @@ GtkSignalFunc tX_extdial :: f_adjustment(GtkWidget *w, tX_extdial *ed)
        return NULL;    
 }
 
-tX_extdial :: tX_extdial(const char *l, GtkAdjustment *a, bool text_below)
+tX_extdial :: tX_extdial(const char *l, GtkAdjustment *a, tX_seqpar * sp, bool text_below)
 {
        adj=a;
        fval=adj->value;
@@ -32,7 +33,10 @@ tX_extdial :: tX_extdial(const char *l, GtkAdjustment *a, bool text_below)
        gtk_entry_set_text(GTK_ENTRY(entry), sval);
        ignore_adj=0;
        
+       eventbox=gtk_event_box_new();           
        mainbox=gtk_vbox_new(FALSE, text_below ? 5 : 0);
+       gtk_container_add(GTK_CONTAINER(eventbox), mainbox);
+       
        subbox=gtk_hbox_new(TRUE, 0);
        gtk_box_pack_start(GTK_BOX(subbox), dial, WID_FIX);
        gtk_box_pack_start(GTK_BOX(mainbox), subbox, WID_FIX);
@@ -45,9 +49,17 @@ tX_extdial :: tX_extdial(const char *l, GtkAdjustment *a, bool text_below)
        gtk_widget_show(dial);
        gtk_widget_show(subbox);
        gtk_widget_show(mainbox);
+       gtk_widget_show(eventbox);
        
        gtk_signal_connect(GTK_OBJECT(entry), "activate", (GtkSignalFunc) tX_extdial::f_entry, (void *) this);
        gtk_signal_connect(GTK_OBJECT(adj), "value_changed", (GtkSignalFunc) tX_extdial::f_adjustment, (void *) this);
+       
+       if (sp) {
+               gtk_signal_connect(GTK_OBJECT(dial), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, sp);
+               gtk_signal_connect(GTK_OBJECT(entry), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, sp);                    
+               gtk_signal_connect(GTK_OBJECT(eventbox), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, sp);                 
+               //if (l) gtk_signal_connect(GTK_OBJECT(label), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, sp);   
+       }
 }
 
 tX_extdial :: ~tX_extdial()
@@ -58,4 +70,5 @@ tX_extdial :: ~tX_extdial()
        gtk_widget_destroy(dial);
        gtk_widget_destroy(subbox);
        gtk_widget_destroy(mainbox);
+       gtk_widget_destroy(eventbox);   
 }
index ea5a76e85a1fe5ffc8e2fe4a2d7ed37014959beb..c1b119a2f80f079fabb051c40d9dfe76313ba3c5 100644 (file)
@@ -5,8 +5,11 @@
 #include "tX_dial.h"
 #include <stdio.h>
 
+class tX_seqpar;
+
 class tX_extdial
 {
+       GtkWidget *eventbox;
        GtkWidget *mainbox;
        GtkWidget *subbox;
        GtkWidget *dial;
@@ -22,9 +25,9 @@ class tX_extdial
        void f2s() { sprintf(sval, "%3f", fval); sval[4]=0; /* printf("f2s(): s:%s, f%f\n", sval, fval); */ };
        
        public:
-       tX_extdial(const char *l, GtkAdjustment *a, bool text_below=false);
+       tX_extdial(const char *l, GtkAdjustment *a, tX_seqpar * sp, bool text_below=false);
        ~tX_extdial();
-       GtkWidget *get_widget() { return mainbox; };
+       GtkWidget *get_widget() { return eventbox; };
        GtkWidget *get_dial() { return dial; }
        GtkWidget *get_entry() { return entry; }
        
@@ -32,4 +35,4 @@ class tX_extdial
        static GtkSignalFunc f_adjustment(GtkWidget *w, tX_extdial *ed);
 };
 
-#endif 
+#endif
index cf4d6dca21a7e518f1a27ec05c6548ff7b12043a..a3b60b4f1289f2a3c73d8a11e68c059bdf945981 100644 (file)
@@ -989,3 +989,49 @@ create_tx_del_mode (void)
   return tx_del_mode;
 }
 
+GtkWidget*
+create_tX_midilearn (void)
+{
+  GtkWidget *tX_midilearn;
+  GtkWidget *dialog_vbox5;
+  GtkWidget *vbox4;
+  GtkWidget *midilabel;
+  GtkWidget *dialog_action_area5;
+  GtkWidget *button1;
+
+  tX_midilearn = gtk_dialog_new ();
+  gtk_window_set_title (GTK_WINDOW (tX_midilearn), "MIDI Learn");
+
+  dialog_vbox5 = GTK_DIALOG (tX_midilearn)->vbox;
+  gtk_widget_show (dialog_vbox5);
+
+  vbox4 = gtk_vbox_new (FALSE, 0);
+  gtk_widget_show (vbox4);
+  gtk_box_pack_start (GTK_BOX (dialog_vbox5), vbox4, TRUE, TRUE, 0);
+  gtk_container_set_border_width (GTK_CONTAINER (vbox4), 4);
+
+  midilabel = gtk_label_new ("Waiting for MIDI event....");
+  gtk_widget_show (midilabel);
+  gtk_box_pack_start (GTK_BOX (vbox4), midilabel, TRUE, TRUE, 0);
+  gtk_label_set_justify (GTK_LABEL (midilabel), GTK_JUSTIFY_LEFT);
+
+  dialog_action_area5 = GTK_DIALOG (tX_midilearn)->action_area;
+  gtk_widget_show (dialog_action_area5);
+  gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area5), GTK_BUTTONBOX_END);
+
+  button1 = gtk_button_new_from_stock ("gtk-cancel");
+  gtk_widget_show (button1);
+  gtk_dialog_add_action_widget (GTK_DIALOG (tX_midilearn), button1, GTK_RESPONSE_CANCEL);
+  GTK_WIDGET_SET_FLAGS (button1, GTK_CAN_DEFAULT);
+
+  /* Store pointers to all widgets, for use by lookup_widget(). */
+  GLADE_HOOKUP_OBJECT_NO_REF (tX_midilearn, tX_midilearn, "tX_midilearn");
+  GLADE_HOOKUP_OBJECT_NO_REF (tX_midilearn, dialog_vbox5, "dialog_vbox5");
+  GLADE_HOOKUP_OBJECT (tX_midilearn, vbox4, "vbox4");
+  GLADE_HOOKUP_OBJECT (tX_midilearn, midilabel, "midilabel");
+  GLADE_HOOKUP_OBJECT_NO_REF (tX_midilearn, dialog_action_area5, "dialog_action_area5");
+  GLADE_HOOKUP_OBJECT (tX_midilearn, button1, "button1");
+
+  return tX_midilearn;
+}
+
index a6419e02d2383f407761abe6de0dba1485f558e7..b835b1097358ade65fd0a34d6752bb0fe8c9fc11 100644 (file)
@@ -5,3 +5,4 @@
 GtkWidget* create_tx_adjust (void);
 GtkWidget* create_tx_options (void);
 GtkWidget* create_tx_del_mode (void);
+GtkWidget* create_tX_midilearn (void);
index 048aa2b50b4b2c40bc93e48dcdc5246873b2f7d5..09c08c04b64b342698c433995547dee3fe224cac 100644 (file)
@@ -180,6 +180,7 @@ void LADSPA_Plugin :: debug_display()
 LADSPA_Plugin :: LADSPA_Plugin (const LADSPA_Descriptor *ld, char *filename)
 {
        ladspa_descriptor = ld;
+       
        plugin_list.push_back(this);
        strcpy(file, filename);
        sprintf (info_string, "   LADSPA-Plugin: %s   \n   Label: %s   \n   File: %s   \n   Unique ID: %li   \n   Maker: %s   \n   Copyright: %s   ", ld->Name, ld->Label, file, ld->UniqueID, ld->Maker, ld->Copyright);
index 65b7e75df4b52976e64138d564a12fdce8023553..b5902eab0a5566efad91a2541f40046c5316d572 100644 (file)
@@ -932,7 +932,7 @@ GCallback menu_delete_all_events_for_vtt(GtkWidget *, vtt_class *vtt)
        
        menu_del_mode=ALL_EVENTS_FOR_TURNTABLE;
        
-       sprintf(label_str, "Delete <b>all</b> events for turntable <b>%s</b> turntables.", vtt->name);
+       sprintf(label_str, "Delete <b>all</b> events for turntable <b>%s</b>.", vtt->name);
        gtk_label_set_markup(GTK_LABEL(label), label_str);
        gtk_widget_show(del_dialog);
 }
@@ -951,7 +951,7 @@ GCallback menu_delete_all_events_for_sp(GtkWidget *, tX_seqpar *sp)
        
        menu_del_mode=ALL_EVENTS_FOR_SP;
        del_sp=sp;
-       sprintf(label_str, "Delete all <b>%s</b> events for turntable <b>%s</b> turntables.", sp->get_name(), ((vtt_class *) sp->vtt)->name);
+       sprintf(label_str, "Delete all <b>%s</b> events for turntable <b>%s</b>.", sp->get_name(), ((vtt_class *) sp->vtt)->name);
        gtk_label_set_markup(GTK_LABEL(label), label_str);
        gtk_widget_show(del_dialog);
 }
@@ -1339,7 +1339,7 @@ void create_mastergui(int x, int y)
        pitch_adj=dumadj;
        connect_adj(dumadj, master_pitch_changed, NULL);
        
-       tX_extdial *pdial=new tX_extdial("Pitch", pitch_adj, true);
+       tX_extdial *pdial=new tX_extdial("Pitch", pitch_adj, &sp_master_pitch, true);
        gtk_box_pack_start(GTK_BOX(right_hbox), pdial->get_widget(), WID_FIX);
        gui_set_tooltip(pdial->get_entry(), "Use this dial to adjust the master pitch (affecting *all* turntables).");
        
@@ -1359,6 +1359,8 @@ void create_mastergui(int x, int y)
        dummy=gtk_vscale_new(dumadj);
        //gtk_range_set_inverted(GTK_RANGE(dummy), TRUE);
        gtk_scale_set_draw_value(GTK_SCALE(dummy), False);
+       gtk_signal_connect(GTK_OBJECT(dummy), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &sp_master_volume);     
+       
        gtk_box_pack_end(GTK_BOX(master_vol_box), dummy, WID_FIX);
        gtk_widget_show(dummy); 
        gui_set_tooltip(dummy, "Adjust the master volume. This parameter will effect *all* turntables in the set.");
index 5b39ad9befe6e50d85f93f0468ee52326dcedde2..03f9b8b27c6b139b1f51c1f603f045cd9445fd5d 100644 (file)
@@ -90,5 +90,6 @@ class tX_cursor {
        static GdkCursor *get_cursor();
 };
 
+extern GCallback menu_delete_all_events_for_sp(GtkWidget *, tX_seqpar *sp);
 extern bool tX_shutdown;
 #endif
index 7d6776ff232a9d97f7fe2e3ffc7ef4f64565f360..7dfe3d4930dc12818df2705057268400cf86e8d6 100644 (file)
@@ -88,8 +88,10 @@ tX_midiin::tX_midiin()
 
 tX_midiin::~tX_midiin()
 {
-       snd_seq_close(ALSASeqHandle);
-       tX_debug("tX_midiin(): sequencer closed."); 
+       if (is_open) {
+               snd_seq_close(ALSASeqHandle);
+               tX_debug("tX_midiin(): sequencer closed.");
+       }
 }
 
 int tX_midiin::check_event()
index 09ac06cd4db353dc4fb5c8b974ca44e6b2ed6c54..5ee87501c358aceba1700492e31db8d53388ac18 100644 (file)
@@ -887,7 +887,7 @@ void tX_seqpar_vttfx_float :: create_widget()
        *fx_value=min_value;
        //myadj=GTK_ADJUSTMENT(gtk_adjustment_new(*fx_value, min_value+tmp/10, max_value-tmp/10, tmp, tmp, tmp));
        myadj=GTK_ADJUSTMENT(gtk_adjustment_new(*fx_value, min_value, max_value, tmp, tmp, tmp));
-       mydial=new tX_extdial(label_name, myadj);
+       mydial=new tX_extdial(label_name, myadj, this);
        gtk_signal_connect(GTK_OBJECT(myadj), "value_changed", (GtkSignalFunc) tX_seqpar_vttfx_float :: gtk_callback, this);
        widget = mydial->get_widget();  
 }
@@ -923,17 +923,25 @@ void tX_seqpar_vttfx_int :: create_widget()
 
        *fx_value=min_value;
        myadj=GTK_ADJUSTMENT(gtk_adjustment_new(*fx_value, min_value, max_value, 1, 10, tmp));
-       widget=gtk_vbox_new(FALSE, 2);
-
+       GtkWidget *box=gtk_vbox_new(FALSE, 2);
+       
        tmpwid=gtk_spin_button_new(myadj,1.0,0);
        gtk_widget_show(tmpwid);
-       gtk_box_pack_start(GTK_BOX(widget), tmpwid, WID_DYN);
+       gtk_box_pack_start(GTK_BOX(box), tmpwid, WID_DYN);
+       gtk_signal_connect(GTK_OBJECT(tmpwid), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, this);
        
        gtk_signal_connect(GTK_OBJECT(myadj), "value_changed", (GtkSignalFunc) tX_seqpar_vttfx_int :: gtk_callback, this);
 
     tmpwid=gtk_label_new(label_name);
        gtk_widget_show(tmpwid);
-       gtk_box_pack_start(GTK_BOX(widget), tmpwid, WID_FIX);
+       gtk_box_pack_start(GTK_BOX(box), tmpwid, WID_FIX);
+       
+       gtk_widget_show(box);
+       
+       widget=gtk_event_box_new();
+       gtk_signal_connect(GTK_OBJECT(widget), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, this);
+       
+       gtk_container_add(GTK_CONTAINER(widget), box);
 }
 
 tX_seqpar_vttfx_int :: ~tX_seqpar_vttfx_int()
@@ -962,6 +970,7 @@ void tX_seqpar_vttfx_bool :: create_widget()
        *fx_value=min_value;
        widget=gtk_check_button_new_with_label(label_name);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), 0);
+       gtk_signal_connect(GTK_OBJECT(widget), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, this);
        gtk_signal_connect(GTK_OBJECT(widget), "clicked", (GtkSignalFunc) tX_seqpar_vttfx_bool :: gtk_callback, this);
 }
 
@@ -985,3 +994,72 @@ void tX_seqpar_vttfx_bool :: do_update_graphics()
 {
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), *fx_value==max_value);
 }
+
+gboolean tX_seqpar::tX_seqpar_press(GtkWidget *widget, GdkEventButton *event, gpointer data) {
+       tX_seqpar *sp=(tX_seqpar *) data;
+       
+       if (event->button==3) {
+               GtkWidget *menu=gtk_menu_new();
+               
+               GtkWidget *item=gtk_menu_item_new_with_label(sp->get_name());
+               gtk_widget_set_sensitive(item, FALSE);
+               gtk_menu_append(menu, item);
+               gtk_widget_show(item);
+               
+               item = gtk_menu_item_new();
+               gtk_menu_append(menu, item);
+               gtk_widget_set_sensitive (item, FALSE);
+               gtk_widget_show (item);
+               
+               item = gtk_menu_item_new_with_label("MIDI Learn");
+               gtk_menu_append(menu, item);
+               gtk_widget_show(item);
+               g_signal_connect(item, "activate", (GCallback) tX_seqpar::learn_midi_binding, sp);              
+
+               item = gtk_menu_item_new_with_label("Remove MIDI Binding");
+               gtk_menu_append(menu, item);
+               gtk_widget_show(item);          
+
+               if (sp->bound_midi_event.type!=tX_midievent::NONE) {
+                       gtk_widget_set_sensitive(item, FALSE);
+               }
+               g_signal_connect(item, "activate", (GCallback) tX_seqpar::remove_midi_binding, sp);             
+               
+               item = gtk_menu_item_new();
+               gtk_menu_append(menu, item);
+               gtk_widget_set_sensitive (item, FALSE);
+               gtk_widget_show (item);
+               
+               item = gtk_menu_item_new_with_label("Delete Sequencer Events");
+               gtk_menu_append(menu, item);
+               gtk_widget_show(item);
+               g_signal_connect(item, "activate", (GCallback) menu_delete_all_events_for_sp, sp);              
+                               
+               gtk_widget_show(menu);
+               
+               gtk_menu_popup (GTK_MENU(menu), NULL, NULL, NULL, NULL, event->button, event->time);
+               gtk_grab_remove(gtk_grab_get_current());
+
+               return TRUE;
+       } 
+       
+       return FALSE;
+}
+
+gboolean tX_seqpar::remove_midi_binding(GtkWidget *widget, gpointer data) {
+       tX_seqpar *sp=(tX_seqpar *) data;
+       
+       sp->bound_midi_event.type=tX_midievent::NONE;
+       sp->bound_midi_event.number=0;
+       sp->bound_midi_event.channel=0;
+       
+       return TRUE;
+}
+
+gboolean tX_seqpar::learn_midi_binding(GtkWidget *widget, gpointer data) {
+       tX_seqpar *sp=(tX_seqpar *) data;
+
+       /* THIS NEEDS CODE. */
+       
+       return TRUE;
+}
index 7ebbb907691b12816220c2ea1f52687219e8ca2f..1b7ef14fd380fd9ce9f5fa0ca7e8bb548f2fa5ee 100644 (file)
@@ -133,6 +133,10 @@ class tX_seqpar
        int is_mappable;        
        void restore_meta(xmlNodePtr node);
        void store_meta(FILE *rc, gzFile rz);
+       
+       static gboolean tX_seqpar_press(GtkWidget *widget, GdkEventButton *event, gpointer data);
+       static gboolean remove_midi_binding(GtkWidget *widget, gpointer data);
+       static gboolean learn_midi_binding(GtkWidget *widget, gpointer data);
 };
 
 class tX_seqpar_update : public tX_seqpar
@@ -446,4 +450,5 @@ class tX_seqpar_vttfx_int : public tX_seqpar_vttfx
 
        static GtkSignalFunc gtk_callback(GtkWidget*, tX_seqpar_vttfx_int *);
 };
+
 #endif
index 4f6d003fc2c94cd2d29cd42ad8087a4d8cbcc31d..d673a3293e0ccae6cc2678ce4a6509d3c0e560a8 100644 (file)
@@ -154,6 +154,16 @@ vtt_fx_ladspa :: vtt_fx_ladspa(LADSPA_Plugin *p, void *v)
        sp->set_vtt(vtt);
        controls.push_back(sp); 
 
+       if (plugin->getDescriptor()->run_adding && plugin->getDescriptor()->set_run_adding_gain) {      
+               sp = sp_outgain = new tX_seqpar_vttfx_float();
+               sp->set_mapping_parameters(3, 0, 0.01, 1);
+               sprintf(buffer, "%s: Out Gain", plugin->getName());
+               sp->set_name(buffer, "Out Gain");
+               sp->set_vtt(vtt);
+               controls.push_back(sp);
+       } else {
+               sp_outgain = NULL;
+       }
        
        /* connecting ports */
        for (port=0; port < plugin->getPortCount(); port++)
@@ -223,7 +233,12 @@ void vtt_fx_ladspa :: deactivate()
 
 void vtt_fx_ladspa :: run()
 {
-       plugin->getDescriptor()->run(instance, (vtt_class :: samples_in_mix_buffer)>>1);
+       if (sp_outgain) {
+               plugin->getDescriptor()->set_run_adding_gain(instance, sp_outgain->get_value());
+               plugin->getDescriptor()->run_adding(instance, (vtt_class :: samples_in_mix_buffer)>>1);
+       } else {
+               plugin->getDescriptor()->run(instance, (vtt_class :: samples_in_mix_buffer)>>1);
+       }
 }
 
 int vtt_fx_ladspa :: isEnabled()
index be32e6e636e42d52e0286d23c61377c23e40eccc..c0d22c312d4de85bbde962f4de85775ddcad52e5 100644 (file)
@@ -111,6 +111,7 @@ class vtt_fx_ladspa : public vtt_fx
        list <tX_seqpar_vttfx *> controls;
        private:
        tX_seqpar_vttfx *sp_enable;
+       tX_seqpar_vttfx *sp_outgain;
        int input_port, output_port;
        LADSPA_Handle *instance;
        LADSPA_Plugin *plugin;
index 9c7e9a8e2d976e254bf89ea21bd5d2c58436ae24..7072e1368759d151e8cd60155838101d40526293 100644 (file)
@@ -909,16 +909,19 @@ void build_vtt_gui(vtt_class *vtt)
        g->stop=gtk_button_new_with_label("Stop.");
        gui_set_tooltip(g->stop, "Stop this turntable's playback.");
        p->add_client_widget(g->stop);
+       gtk_signal_connect(GTK_OBJECT(g->trigger), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &vtt->sp_trigger);         
+       gtk_signal_connect(GTK_OBJECT(g->stop), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &vtt->sp_trigger);            
        
        g->autotrigger=gtk_check_button_new_with_label("Auto");
        p->add_client_widget(g->autotrigger);
        gui_set_tooltip(g->autotrigger, "If turned on, this turntable will be automagically triggered whenever the audio engine is turned on.");
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g->autotrigger), vtt->autotrigger);
-       
+
        g->loop=gtk_check_button_new_with_label("Loop");
        p->add_client_widget(g->loop);
        gui_set_tooltip(g->loop, "Enable this option to make the turntable loop the audio data.");
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g->loop), vtt->loop);
+       gtk_signal_connect(GTK_OBJECT(g->loop), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &vtt->sp_loop);               
        
        g->sync_master=gtk_check_button_new_with_label("Master");
        p->add_client_widget(g->sync_master);
@@ -929,11 +932,13 @@ void build_vtt_gui(vtt_class *vtt)
        p->add_client_widget(g->sync_client);
        gui_set_tooltip(g->sync_client, "If enabled this turntable will be (re-)triggerd in relation to the sync-master turntable.");
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g->sync_client), vtt->is_sync_client);
+       gtk_signal_connect(GTK_OBJECT(g->sync_client), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &vtt->sp_sync_client); 
        
        g->cycles=GTK_ADJUSTMENT(gtk_adjustment_new(vtt->sync_cycles, 0, 10.0, 1,1,1));
        dummy=gtk_spin_button_new(g->cycles, 1.0, 0);
        p->add_client_widget(dummy);
        gui_set_tooltip(dummy, "Determines how often a sync-client turntable gets triggered. 0 -> this turntable will be triggered with every trigger of the sync-master table, 1 -> the table will be triggered every 2nd master trigger and so on.");
+       gtk_signal_connect(GTK_OBJECT(dummy), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &vtt->sp_sync_cycles);  
 
        gtk_box_pack_start(GTK_BOX(g->control_subbox), p->get_widget(), WID_FIX);
 
@@ -953,6 +958,7 @@ void build_vtt_gui(vtt_class *vtt)
        gui_set_tooltip(g->lp_enable, "Click here to enable the built-in lowpass effect.");
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g->lp_enable), vtt->lp_enable);
        p->add_client_widget(vg_create_fx_bar(vtt, vtt->lp_fx, 0));
+       gtk_signal_connect(GTK_OBJECT(g->lp_enable), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &vtt->sp_ec_enable);     
 
        p->add_client_widget(g->lp_enable);
 
@@ -960,15 +966,15 @@ void build_vtt_gui(vtt_class *vtt)
        g->lp_reso=GTK_ADJUSTMENT(gtk_adjustment_new(vtt->lp_reso, 0, 0.99, 0.1, 0.01, 0.01));
        g->lp_freq=GTK_ADJUSTMENT(gtk_adjustment_new(vtt->lp_freq, 0, 1, 0.1, 0.01, 0.01));
 
-       g->lp_gaind=new tX_extdial("Input Gain", g->lp_gain);
+       g->lp_gaind=new tX_extdial("Input Gain", g->lp_gain, &vtt->sp_lp_gain);
        p->add_client_widget(g->lp_gaind->get_widget());
        gui_set_tooltip(g->lp_gaind->get_entry(), "Adjust the input gain. with this parameter you can either amplify or damp the input-signal for the lowpass effect.");
 
-       g->lp_freqd=new tX_extdial("Frequency", g->lp_freq);
+       g->lp_freqd=new tX_extdial("Frequency", g->lp_freq, &vtt->sp_lp_freq);
        p->add_client_widget(g->lp_freqd->get_widget());
        gui_set_tooltip(g->lp_freqd->get_entry(), "Adjust the cutoff frequency of the lowpass filter. 0 is 0 Hz, 1 is 22.1 kHz.");
 
-       g->lp_resod=new tX_extdial("Resonance", g->lp_reso);
+       g->lp_resod=new tX_extdial("Resonance", g->lp_reso, &vtt->sp_lp_reso);
        p->add_client_widget(g->lp_resod->get_widget());
        gui_set_tooltip(g->lp_resod->get_entry(), "Adjust the resonance of the lowpass filter. This value determines how much the signal at the cutoff frequency will be amplified.");
 
@@ -985,25 +991,26 @@ void build_vtt_gui(vtt_class *vtt)
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g->ec_enable), vtt->ec_enable);
        p->add_client_widget(g->ec_enable);
        gui_set_tooltip(g->ec_enable, "Enable the built-in echo effect.");
+       gtk_signal_connect(GTK_OBJECT(g->ec_enable), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &vtt->sp_ec_enable);     
 
        g->ec_length=GTK_ADJUSTMENT(gtk_adjustment_new(vtt->ec_length, 0, 1, 0.1, 0.01, 0.001));
        g->ec_feedback=GTK_ADJUSTMENT(gtk_adjustment_new(vtt->ec_feedback, 0, 1, 0.1, 0.01, 0.001));
        g->ec_pan=GTK_ADJUSTMENT(gtk_adjustment_new(vtt->ec_pan, -1.0, 1, 0.1, 0.01, 0.001));
        g->ec_volume=GTK_ADJUSTMENT(gtk_adjustment_new(vtt->ec_volume, 0.0, 3.0, 0.1, 0.01, 0.001));
 
-       g->ec_lengthd=new tX_extdial("Duration", g->ec_length);
+       g->ec_lengthd=new tX_extdial("Duration", g->ec_length, &vtt->sp_ec_length);
        p->add_client_widget(g->ec_lengthd->get_widget());
        gui_set_tooltip(g->ec_lengthd->get_entry(), "Adjust the length of the echo buffer.");
 
-       g->ec_feedbackd=new tX_extdial("Feedback", g->ec_feedback);
+       g->ec_feedbackd=new tX_extdial("Feedback", g->ec_feedback, &vtt->sp_ec_feedback);
        p->add_client_widget(g->ec_feedbackd->get_widget());
        gui_set_tooltip(g->ec_feedbackd->get_entry(), "Adjust the feedback of the echo effect. Note that a value of 1 will result in a constant signal.");
 
-       g->ec_volumed=new tX_extdial("Volume", g->ec_volume);
+       g->ec_volumed=new tX_extdial("Volume", g->ec_volume, &vtt->sp_ec_volume);
        p->add_client_widget(g->ec_volumed->get_widget());
        gui_set_tooltip(g->ec_volumed->get_entry(), "Adjust the volume of the echo effect.");
 
-       g->ec_pand=new tX_extdial("Pan", g->ec_pan);
+       g->ec_pand=new tX_extdial("Pan", g->ec_pan, &vtt->sp_ec_pan);
        p->add_client_widget(g->ec_pand->get_widget());
        gui_set_tooltip(g->ec_pand->get_entry(), "Adjust the panning of the echo effect.");
 
@@ -1022,12 +1029,12 @@ void build_vtt_gui(vtt_class *vtt)
        g->pitch=GTK_ADJUSTMENT(gtk_adjustment_new(vtt->rel_pitch, -3, +3, 0.1, 0.01, 0.001));
        g->pan=GTK_ADJUSTMENT(gtk_adjustment_new(0, -1, 1, 0.1, 0.01, 0.001));
 
-       g->pitchd=new tX_extdial("Pitch", g->pitch);
+       g->pitchd=new tX_extdial("Pitch", g->pitch, &vtt->sp_pitch);
        gui_set_tooltip(g->pitchd->get_entry(), "Adjust this turntable's pitch.");
 
        gtk_box_pack_start(GTK_BOX(tempbox2), g->pitchd->get_widget(), WID_FIX);
 
-       g->pand=new tX_extdial("Pan", g->pan);
+       g->pand=new tX_extdial("Pan", g->pan, &vtt->sp_pan);
        gtk_box_pack_start(GTK_BOX(tempbox2), g->pand->get_widget(), WID_FIX);
        gui_set_tooltip(g->pand->get_entry(), "Specifies the position of this turntable within the stereo spectrum: -1 -> left, 0-> center, 1->right.");
 
@@ -1056,6 +1063,7 @@ void build_vtt_gui(vtt_class *vtt)
        dummy=gtk_vscale_new(GTK_ADJUSTMENT(g->volume)); 
        gtk_scale_set_draw_value(GTK_SCALE(dummy), False);
        gui_set_tooltip(dummy, "Adjust this turntable's volume.");
+       gtk_signal_connect(GTK_OBJECT(dummy), "button_press_event", (GtkSignalFunc) tX_seqpar::tX_seqpar_press, &vtt->sp_volume);       
 
        gtk_box_pack_start(GTK_BOX(tempbox2), dummy, WID_FIX);
        gtk_widget_show(dummy);
index fbf2f6d0b4d3dd79b4c9286d53a7813776dc7421..4bc5a3c183369713631d2c670504460477762a00 100644 (file)
   </child>
 </widget>
 
+<widget class="GtkDialog" id="tX_midilearn">
+  <property name="visible">True</property>
+  <property name="title" translatable="yes">MIDI Learn</property>
+  <property name="type">GTK_WINDOW_TOPLEVEL</property>
+  <property name="window_position">GTK_WIN_POS_NONE</property>
+  <property name="modal">False</property>
+  <property name="resizable">True</property>
+  <property name="destroy_with_parent">False</property>
+  <property name="has_separator">True</property>
+
+  <child internal-child="vbox">
+    <widget class="GtkVBox" id="dialog-vbox5">
+      <property name="visible">True</property>
+      <property name="homogeneous">False</property>
+      <property name="spacing">0</property>
+
+      <child internal-child="action_area">
+       <widget class="GtkHButtonBox" id="dialog-action_area5">
+         <property name="visible">True</property>
+         <property name="layout_style">GTK_BUTTONBOX_END</property>
+
+         <child>
+           <widget class="GtkButton" id="button1">
+             <property name="visible">True</property>
+             <property name="can_default">True</property>
+             <property name="can_focus">True</property>
+             <property name="label">gtk-cancel</property>
+             <property name="use_stock">True</property>
+             <property name="relief">GTK_RELIEF_NORMAL</property>
+             <property name="response_id">-6</property>
+           </widget>
+         </child>
+       </widget>
+       <packing>
+         <property name="padding">0</property>
+         <property name="expand">False</property>
+         <property name="fill">True</property>
+         <property name="pack_type">GTK_PACK_END</property>
+       </packing>
+      </child>
+
+      <child>
+       <widget class="GtkVBox" id="vbox4">
+         <property name="border_width">4</property>
+         <property name="visible">True</property>
+         <property name="homogeneous">False</property>
+         <property name="spacing">0</property>
+
+         <child>
+           <widget class="GtkLabel" id="midilabel">
+             <property name="visible">True</property>
+             <property name="label" translatable="yes">Waiting for MIDI event....</property>
+             <property name="use_underline">False</property>
+             <property name="use_markup">False</property>
+             <property name="justify">GTK_JUSTIFY_LEFT</property>
+             <property name="wrap">False</property>
+             <property name="selectable">False</property>
+             <property name="xalign">0.5</property>
+             <property name="yalign">0.5</property>
+             <property name="xpad">0</property>
+             <property name="ypad">0</property>
+           </widget>
+           <packing>
+             <property name="padding">0</property>
+             <property name="expand">True</property>
+             <property name="fill">True</property>
+           </packing>
+         </child>
+       </widget>
+       <packing>
+         <property name="padding">0</property>
+         <property name="expand">True</property>
+         <property name="fill">True</property>
+       </packing>
+      </child>
+    </widget>
+  </child>
+</widget>
+
 </glade-interface>