GUI improvments and fixes - Alex
authorterminatorX <>
Sat, 3 Aug 2002 00:37:55 +0000 (00:37 +0000)
committerterminatorX <>
Sat, 3 Aug 2002 00:37:55 +0000 (00:37 +0000)
src/gui_icons/Makefile.am
src/tX_mastergui.cc
src/tX_mastergui.h
src/tX_pbutton.cc
src/tX_pbutton.h
src/tX_vtt.cc
src/tX_vtt.h
src/tX_vttgui.cc
src/tX_vttgui.h

index 3b01749e6969603d8a29343df06b951eefcb2f24..fd4dd4b058a83c3a760421c10264ed8a17f8282f 100644 (file)
@@ -11,4 +11,6 @@ SOURCES =     tx_audioengine.xpm\
                tx_minimize.xpm\
                tX_fx_up.xpm\
                tX_fx_down.xpm\
-               tX_fx_close.xpm
+               tX_fx_close.xpm\
+               tX_minimize.xpm\
+               tX_min_control.xpm
index 598374490ef39e031fc20846d30a7b022553d083..032d979e4070638d0f458980b677cfc01791e166 100644 (file)
@@ -51,6 +51,7 @@
 #define TX_SET_ID_11 "terminatorX turntable set file - version 1.1 - data:"
 #define TX_SET_ID_12 "terminatorX turntable set file - version 1.2 - data:"
 #define TX_SET_ID_13 "terminatorX turntable set file - version 1.3 - data:"
+#define TX_SET_ID_14 "terminatorX turntable set file - version 1.4 - data:"
 
 int audioon=0;
 int sequencer_ready=1;
@@ -71,6 +72,10 @@ GtkWidget *seq_stop_btn;
 GtkAdjustment *seq_adj;
 GtkWidget *seq_slider;
 GtkWidget *seq_entry;
+GtkWidget *panel_bar;
+
+int buttons_on_panel_bar=0;
+
 int seq_adj_care=1;
 int seq_stop_override=0;
 
@@ -315,6 +320,10 @@ void load_tt_part(char * buffer)
                {
                        if (vtt_class::load_all_13(in, buffer)) tx_note("Error while reading set.");                    
                }
+               else if (strncmp(idbuff, TX_SET_ID_14, strlen(TX_SET_ID_14))==0)
+               {
+                       if (vtt_class::load_all_14(in, buffer)) tx_note("Error while reading set.");                    
+               }
                else
                {
                        tx_note("Sorry, this file is not a terminatorX set-file.");
@@ -447,7 +456,7 @@ void do_save_tables(GtkWidget *wid)
        
        if (out)
        {
-               strcpy(idbuffer, TX_SET_ID_13);
+               strcpy(idbuffer, TX_SET_ID_14);
                fwrite(idbuffer, strlen(idbuffer), 1, out);
                if (vtt_class::save_all(out)) tx_note("Error while saving set.");
                fclose(out);
@@ -691,11 +700,12 @@ void mplcfitx()
 
 GtkSignalFunc seq_play(GtkWidget *w, void *)
 {
-       if (sequencer.is_empty()) {
-               if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) {
+       if ((sequencer.is_empty()) &&   (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(seq_rec_btn)))) {
+               if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)))
+                {
                        tx_note("Sequencer playback triggered - but no events\nrecorded yet - nothing to playback!\n\nTo perform live with terminatorX just activate the\naudio engine with the \"Power\" button.");
                        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), 0);
-               }
+                }
        } else {
                if (seq_stop_override) return NULL;
                        
@@ -941,7 +951,11 @@ void create_mastergui(int x, int y)
        gtk_widget_show(dummy);
        
        tt_parent=dummy;
-       
+
+    panel_bar=gtk_hbox_new(TRUE,2);
+       gtk_box_pack_start(GTK_BOX(left_hbox), panel_bar, WID_FIX);
+       //gtk_widget_show(panel_bar);
+
        control_parent=gtk_hbox_new(FALSE,0);
        gtk_box_pack_start(GTK_BOX(tt_parent), control_parent, WID_FIX);
        gtk_widget_show(control_parent);
@@ -1216,3 +1230,16 @@ void display_mastergui()
        top=gtk_widget_get_toplevel(main_window);
        xwindow=GDK_WINDOW_XWINDOW(top->window);
 }
+
+void add_to_panel_bar(GtkWidget *button) {
+       buttons_on_panel_bar++;
+       gtk_box_pack_start(GTK_BOX(panel_bar), button, WID_DYN);
+       gtk_widget_show(panel_bar);
+}
+
+void remove_from_panel_bar(GtkWidget *button) {
+       buttons_on_panel_bar--;
+       gtk_container_remove(GTK_CONTAINER(panel_bar), button);
+       if (buttons_on_panel_bar==0) gtk_widget_hide(panel_bar);
+}
+
index 7b8cd257d382498f765f0d51aa6ec2361c7acbbf..498b463f7a044e0426a91282078e268be6104597 100644 (file)
@@ -55,4 +55,8 @@ extern GtkWidget *audio_parent;
 extern GtkTooltips *gui_tooltips;
 extern void gui_set_tooltip(GtkWidget *wid, char *tip);
 
+extern GtkWidget *panel_bar;
+
+void add_to_panel_bar(GtkWidget *);
+void remove_from_panel_bar(GtkWidget *);
 #endif
index 049911ca0d51c33f65b3a16b681da49f081436f6..aab30a0f1b7df69d863763cc36f6b10d50b1be4a 100644 (file)
 #include "gui_icons/tX_fx_up.xpm"
 #include "gui_icons/tX_fx_down.xpm"
 #include "gui_icons/tX_fx_close.xpm"
+#include "gui_icons/tX_minimize.xpm"
+#include "gui_icons/tX_min_control.xpm"
 
 gchar ** tx_icons[]={ tx_audioengine_xpm, tx_power_xpm, tx_grab_xpm, tx_smaller_logo_xpm,
                      tx_sequencer_xpm, tx_play_xpm, tx_stop_xpm, tx_record_xpm, 
                      tx_wave_xpm, tx_reload_xpm, tx_minimize_xpm,
-                     tX_fx_up_xpm, tX_fx_down_xpm, tX_fx_close_xpm };
+                     tX_fx_up_xpm, tX_fx_down_xpm, tX_fx_close_xpm, tX_minimize_xpm, tX_min_control_xpm };
 
 GtkWidget *tx_pixmap_widget(int icon_id)
 {
@@ -70,7 +72,7 @@ GtkWidget *tx_pixmap_widget(int icon_id)
     return pixmapwid;
 }
 
-GtkWidget *tx_xpm_label_box(int        icon_id, gchar *label_text )
+GtkWidget *tx_xpm_label_box(int        icon_id, gchar *label_text, GtkWidget **labelwidget=NULL)
 {
     GtkWidget *box1;
     GtkWidget *label;
@@ -88,17 +90,21 @@ GtkWidget *tx_xpm_label_box(int     icon_id, gchar *label_text )
            gtk_widget_show(pixmapwid);
     }
 
-    if (globals.button_type != BUTTON_TYPE_ICON)
+    if ((globals.button_type != BUTTON_TYPE_ICON) || (labelwidget!=NULL))
     {
            label = gtk_label_new (label_text);
            gtk_box_pack_start (GTK_BOX (box1), label, FALSE, FALSE, 3);
            gtk_widget_show(label); 
+               if (labelwidget!=NULL) {
+                       *labelwidget=label;
+               }
     }
 
     return(box1);
 }
 
-GtkWidget *tx_xpm_button_new(int icon_id, char *label, int toggle)
+//GtkWidget *tx_xpm_button_new(int icon_id, char *label, int toggle)
+extern GtkWidget *tx_xpm_button_new(int icon_id, char *label, int toggle, GtkWidget **labelwidget=NULL)
 {
        GtkWidget *box;
        GtkWidget *button;
@@ -106,7 +112,7 @@ GtkWidget *tx_xpm_button_new(int icon_id, char *label, int toggle)
        if (toggle) button=gtk_toggle_button_new();
        else button=gtk_button_new();
        
-       box=tx_xpm_label_box(icon_id, label);
+       box=tx_xpm_label_box(icon_id, label, labelwidget);
        gtk_widget_show(box);
        gtk_container_add (GTK_CONTAINER (button), box);                
        
index 4ec96169bc96ae2e2098c66b3d107e24385ac43e..38a1e018f46a0bd44703227eb1177c2f3effc592 100644 (file)
 #define TX_ICON_STOP 6
 #define TX_ICON_RECORD 7
 #define TX_ICON_EDIT 8
+#define TX_ICON_MIN_AUDIO 8
 #define TX_ICON_RELOAD 9
 #define TX_ICON_MINIMIZE 10
 #define TX_ICON_FX_UP 11
 #define TX_ICON_FX_DOWN 12
 #define TX_ICON_FX_CLOSE 13
+#define TX_ICON_MINIMIZE_PANEL 14
+#define TX_ICON_MIN_CONTROL 15
 
 extern GtkWidget *tx_pixmap_widget(int icon_id);
-extern GtkWidget *tx_xpm_label_box(int icon_id, gchar *label_text );
-extern GtkWidget *tx_xpm_button_new(int icon_id, char *label, int toggle);
+extern GtkWidget *tx_xpm_label_box(int icon_id, gchar *label_text, GtkWidget **labelwidget=NULL);
+extern GtkWidget *tx_xpm_button_new(int icon_id, char *label, int toggle, GtkWidget **labelwidget=NULL);
 #endif
index cd1fcfdf5a330222836d70ab3d3206c78ecebd96..d159924cf04e12c5512118a34c31845ae54e845a 100644 (file)
@@ -187,6 +187,9 @@ vtt_class :: vtt_class (int do_create_gui)
        mix_mute=0;
        res_mute=mute;
        res_mute_old=0;
+       
+       audio_hidden=false;
+       control_hidden=false;\r
 }
 
 vtt_class :: ~vtt_class()
@@ -1614,6 +1617,9 @@ int  vtt_class :: save(FILE * output)
        store(ec_feedback);
        store(ec_pan);
        store(ec_volume);
+       
+       store(audio_hidden);
+       store(control_hidden);
 
        pid=sp_speed.get_persistence_id();
        store(pid);
@@ -2115,6 +2121,168 @@ int vtt_class :: load_13(FILE * input)
        return(res);
 }
 
+int vtt_class :: load_14(FILE * input)
+{
+       int res=0;
+       guint32 pid;
+       int32_t counter;
+       int32_t type;
+       long id;
+       int i,t;
+       LADSPA_Plugin *plugin;
+       char buffer[256];
+       vtt_fx_ladspa *ladspa_effect;
+       guint8 hidden;
+       
+       atload(buffer);
+       this->set_name(buffer);
+       atload(filename);
+       atload(is_sync_master);
+       atload(is_sync_client);
+       atload(sync_cycles);
+       atload(rel_volume);
+       atload(rel_pitch);
+       recalc_pitch();
+       
+       atload(autotrigger);
+       atload(loop);
+       
+       atload(mute);
+       atload(pan);
+       
+       atload(lp_enable);
+       atload(lp_gain);
+       atload(lp_reso);
+       atload(lp_freq);
+       lp_setup(lp_gain, lp_reso, lp_freq);
+       
+       atload(ec_enable);
+       atload(ec_length);
+       ec_set_length(ec_length);
+       atload(ec_feedback);
+       ec_set_feedback(ec_feedback);
+       atload(ec_pan);
+       ec_set_pan(ec_pan);
+       atload(ec_volume);
+       ec_set_volume(ec_volume);
+
+       atload(audio_hidden);
+       hide_audio(audio_hidden);
+       
+       atload(control_hidden);
+       hide_control(control_hidden);
+       
+       recalc_volume();
+
+       atload(pid);
+       sp_speed.set_persistence_id(pid);
+       atload(pid);
+       sp_volume.set_persistence_id(pid);
+       atload(pid);
+       sp_pitch.set_persistence_id(pid);
+       atload(pid);
+       sp_trigger.set_persistence_id(pid);
+       atload(pid);
+       sp_loop.set_persistence_id(pid);
+       atload(pid);
+       sp_sync_client.set_persistence_id(pid);
+       atload(pid);
+       sp_sync_cycles.set_persistence_id(pid);
+       atload(pid);
+       sp_lp_enable.set_persistence_id(pid);
+       atload(pid);
+       sp_lp_gain.set_persistence_id(pid);
+       atload(pid);
+       sp_lp_reso.set_persistence_id(pid);
+       atload(pid);
+       sp_lp_freq.set_persistence_id(pid);
+       atload(pid);
+       sp_ec_enable.set_persistence_id(pid);
+       atload(pid);
+       sp_ec_length.set_persistence_id(pid);
+       atload(pid);
+       sp_ec_feedback.set_persistence_id(pid);
+       atload(pid);
+       sp_ec_volume.set_persistence_id(pid);
+       atload(pid);
+       sp_ec_pan.set_persistence_id(pid);
+       atload(pid);
+       sp_mute.set_persistence_id(pid);
+       atload(pid);
+       sp_spin.set_persistence_id(pid);
+       atload(pid);
+       sp_pan.set_persistence_id(pid);
+               
+       atload(counter);
+       
+       for (i=0; i<counter; i++)
+       {
+               atload(type);
+               switch(type)
+               {
+                       case TX_FX_BUILTINCUTOFF:
+                               for (t=0; t<fx_list.size(); t++) effect_down(lp_fx);
+                       break;
+                       
+                       case TX_FX_BUILTINECHO:
+                               for (t=0; t<fx_list.size(); t++) effect_down(ec_fx);
+                       break;
+                       
+                       case TX_FX_LADSPA:
+                               atload(id);
+                               plugin=LADSPA_Plugin::getPluginByUniqueID(id);
+                               if (plugin)
+                               {
+                                       ladspa_effect=add_effect(plugin);
+                                       ladspa_effect->load(input);
+                               }
+                               else
+                               {
+                                       sprintf(buffer,"Fatal Error: Couldn't find required plugin with ID [%i].", id);
+                                       tx_note(buffer);
+                                       res++;
+                               }
+                       break;
+                       
+                       default:
+                               tx_note("Fatal Error loading set: unknown effect type!");
+                               res++;
+               }               
+       }
+
+       atload(pid);
+       
+       if (pid)
+       {
+               atload(pid);
+               set_x_input_parameter(tX_seqpar :: get_sp_by_persistence_id(pid));
+       }
+       else set_x_input_parameter(NULL);
+       
+       atload(pid);
+       
+       if (pid)
+       {
+               atload(pid);
+               set_y_input_parameter(tX_seqpar :: get_sp_by_persistence_id(pid));
+       }
+       else set_y_input_parameter(NULL);
+
+       atload(hidden);
+       gui.main_panel->hide(hidden);
+
+       atload(hidden);
+       gui.trigger_panel->hide(hidden);
+
+       atload(hidden);
+       gui.lp_panel->hide(hidden);
+
+       atload(hidden);
+       gui.ec_panel->hide(hidden);
+       
+       return(res);
+}
+
 
 int  vtt_class :: save_all(FILE* output)
 {
@@ -2363,6 +2531,63 @@ int  vtt_class :: load_all_13(FILE* input, char *fname)
        return(res);
 }
 
+int  vtt_class :: load_all_14(FILE* input, char *fname)
+{
+       int res=0, restmp=0;
+       list <vtt_class *> :: iterator vtt;
+       unsigned int i, max, size;
+       int16_t *newbuffer;
+       vtt_class *newvtt;
+       char ftmp[PATH_MAX];
+       guint32 pid;
+       
+       while (main_list.size())
+       {
+               delete((*main_list.begin()));
+       }
+               
+       atload(max);
+       atload(master_volume);
+       set_master_volume(master_volume);
+       globals.volume=master_volume;
+       atload(globals.pitch);  
+       set_master_pitch(globals.pitch);
+       atload(pid);
+       sp_master_volume.set_persistence_id(pid);
+       atload(pid);
+       sp_master_pitch.set_persistence_id(pid);
+
+       ld_create_loaddlg(TX_LOADDLG_MODE_MULTI, max);
+       ld_set_setname(fname);
+
+       for (i=0; i<max; i++)
+       {
+               newvtt=new vtt_class(1);
+               res+=newvtt->load_14(input);
+               
+               if (strlen(newvtt->filename))
+               {
+                       /* ftmp IS NECESSARY !!! */
+                       strcpy(ftmp, newvtt->filename);
+                       ld_set_filename(ftmp);
+                       
+                       //restmp=load_wav(newvtt->filename, &newbuffer, &size);
+                       restmp=newvtt->load_file(ftmp);
+                       res+=restmp;
+               }
+               gtk_box_pack_start(GTK_BOX(control_parent), newvtt->gui.control_box, TRUE, TRUE, 0);
+               gtk_box_pack_start(GTK_BOX(audio_parent), newvtt->gui.audio_box, TRUE, TRUE, 0);
+               
+       }
+       
+       sequencer.load(input);
+       
+       ld_destroy();
+       
+       return(res);
+}
+
+
 void add_vtt(GtkWidget *ctrl, GtkWidget *audio, char *fn)
 {
        vtt_class *hmmpg;
@@ -2453,3 +2678,15 @@ void vtt_class ::  effect_remove(vtt_fx_ladspa *effect)
        delete effect;
 }
 
+extern void gui_hide_control_panel(vtt_class *vtt, bool hide);
+extern void gui_hide_audio_panel(vtt_class *vtt, bool hide);
+
+void vtt_class :: hide_audio(bool hide) {
+       audio_hidden=hide;
+       gui_hide_audio_panel(this, hide);
+}
+
+void vtt_class :: hide_control(bool hide) {
+       control_hidden=hide;
+       gui_hide_control_panel(this, hide);     
+}
index f7e661563bf3d2774ce9004461f0a6e33e900185..6a1870add5854d74f002946c769e1653c94e6333 100644 (file)
@@ -110,6 +110,9 @@ class vtt_class
        int want_stop;
        int sense_cycles;
        
+       bool control_hidden;
+       bool audio_hidden;
+       
        /* builtin fx */
        vtt_fx* lp_fx;
        vtt_fx* ec_fx;
@@ -300,11 +303,13 @@ class vtt_class
        int load_11(FILE *);
        int load_12(FILE *);
        int load_13(FILE *);
+       int load_14(FILE *);
        
        static int load_all_10(FILE *, char *fname); /* fname is for display only*/
        static int load_all_11(FILE *, char *fname); /* fname is for display only*/
        static int load_all_12(FILE *, char *fname); /* fname is for display only*/
        static int load_all_13(FILE *, char *fname); /* fname is for display only*/
+       static int load_all_14(FILE *, char *fname); /* fname is for display only*/
        static int save_all(FILE *);
        int load_file(char *name);      
 
@@ -316,6 +321,9 @@ class vtt_class
        void effect_down(vtt_fx *effect);
        void effect_remove(vtt_fx_ladspa *effect);
        
+       void hide_audio(bool);
+       void hide_control(bool);
+       
        void set_mix_mute(int newstate);
        void set_mix_solo(int newstate);
        void calc_mute()
index 0b36f66169bf9ac31b355f9501c1f92e5f91e513..5bec0dab0e4c63c206f842e22f536d3acf18a238 100644 (file)
@@ -436,6 +436,26 @@ void solo_vtt(GtkWidget *widget, vtt_class *vtt)
        }
 }      
 
+void minimize_control_panel(GtkWidget *wid, vtt_class *vtt)
+{
+       vtt->hide_control(true);
+}
+
+void unminimize_control_panel(GtkWidget *wid, vtt_class *vtt)
+{
+       vtt->hide_control(false);
+}
+
+void minimize_audio_panel(GtkWidget *wid, vtt_class *vtt)
+{
+       vtt->hide_audio(true);
+}
+
+void unminimize_audio_panel(GtkWidget *wid, vtt_class *vtt)
+{
+       vtt->hide_audio(false);
+}
+
 void vg_display_xcontrol(vtt_class *vtt)
 {
        char buffer[2048];
@@ -616,8 +636,8 @@ void gui_connect_signals(vtt_class *vtt)
 
        connect_entry(name, name_changed);
        connect_adj(volume, volume_changed);
-       connect_button(edit, edit_vtt_buffer);
-       connect_button(reload, reload_vtt_buffer);
+/*     connect_button(edit, edit_vtt_buffer);
+       connect_button(reload, reload_vtt_buffer);*/
        connect_adj(pitch, pitch_changed);
        connect_adj(pan, pan_changed);
        connect_button(file, load_file);
@@ -645,6 +665,9 @@ void gui_connect_signals(vtt_class *vtt)
        connect_button(x_control, vg_xcontrol_popup);
        connect_button(y_control, vg_ycontrol_popup);
 
+       connect_button(control_minimize, minimize_control_panel);
+       connect_button(audio_minimize, minimize_audio_panel);
+
        static GtkTargetEntry drop_types [] = {
                { "text/uri-list", 0, 0}
        };
@@ -685,17 +708,31 @@ void build_vtt_gui(vtt_class *vtt)
        g->audio_box=gtk_vbox_new(FALSE,2);
        gtk_widget_show(g->audio_box);
        
-       tempbox=gtk_hbox_new(FALSE,2);
-       gtk_widget_show(tempbox);
-       gtk_box_pack_start(GTK_BOX(g->audio_box), tempbox, WID_FIX);
+       tempbox2=gtk_hbox_new(FALSE,2);
+       gtk_widget_show(tempbox2);
+       gtk_box_pack_start(GTK_BOX(g->audio_box), tempbox2, WID_FIX);
        
+       tempbox=gtk_hbox_new(TRUE,2);
+       gtk_widget_show(tempbox);
+       gtk_box_pack_start(GTK_BOX(tempbox2), tempbox, WID_DYN);
+
+       GtkWidget *pixmap;
+       g->audio_minimize=gtk_button_new();
+       pixmap=tx_pixmap_widget(TX_ICON_MINIMIZE_PANEL);
+       gtk_container_add (GTK_CONTAINER (g->audio_minimize), pixmap);  
+       gtk_box_pack_end(GTK_BOX(tempbox2), g->audio_minimize, WID_FIX);
+       gtk_widget_show(pixmap);
+       gtk_widget_show(g->audio_minimize);
+
+
        g->audio_label=gtk_label_new(vtt->name);
+       gtk_misc_set_alignment(GTK_MISC(g->audio_label), 0.1, 0.5);
        gtk_widget_show(g->audio_label);
        gtk_box_pack_start(GTK_BOX(tempbox), g->audio_label, WID_DYN);
 
-       dummy=gtk_vseparator_new();
+       /*dummy=gtk_vseparator_new();
        gtk_widget_show(dummy);
-       gtk_box_pack_start(GTK_BOX(tempbox), dummy, WID_FIX);
+       gtk_box_pack_start(GTK_BOX(tempbox), dummy, WID_FIX);*/
 
        nicer_filename(nice_name, vtt->filename);
        g->file = gtk_button_new_with_label(nice_name);
@@ -703,7 +740,7 @@ void build_vtt_gui(vtt_class *vtt)
        gui_set_tooltip(g->file, "Click here to load an audiofile into this turntable. As an alternative you may drop an audiofile over this button or the audio-data display.");
        gtk_box_pack_start(GTK_BOX(tempbox), g->file, WID_DYN);
 
-       g->edit=tx_xpm_button_new(TX_ICON_EDIT, "Edit", 0);
+       /*g->edit=tx_xpm_button_new(TX_ICON_EDIT, "Edit", 0);
        gtk_widget_show(g->edit);
        gui_set_tooltip(g->edit, "Click this button to run the soundfile editor for the audiofile loaded into this turntable. You can configure which soundfile editor to use in the Options dialog.");
        gtk_box_pack_start(GTK_BOX(tempbox), g->edit, WID_FIX);
@@ -711,9 +748,9 @@ void build_vtt_gui(vtt_class *vtt)
        g->reload=tx_xpm_button_new(TX_ICON_RELOAD, "Reload", 0);
        gtk_widget_show(g->reload);
        gui_set_tooltip(g->reload, "Click here to reload the audiofile loaded into this turntable.");
-       gtk_box_pack_start(GTK_BOX(tempbox), g->reload, WID_FIX);
+       gtk_box_pack_start(GTK_BOX(tempbox), g->reload, WID_FIX);*/
        
-       dummy=gtk_vseparator_new();
+       /*dummy=gtk_vseparator_new();
        gtk_widget_show(dummy);
        gtk_box_pack_start(GTK_BOX(tempbox), dummy, WID_FIX);
 
@@ -728,7 +765,7 @@ void build_vtt_gui(vtt_class *vtt)
 
        dummy=gtk_label_new("Y:");
        gtk_widget_show(dummy);
-       gtk_box_pack_start(GTK_BOX(tempbox), dummy, WID_FIX);
+       gtk_box_pack_start(GTK_BOX(tempbox), dummy, WID_FIX);*/
        
        g->y_control=gtk_button_new_with_label(vtt->y_par->get_name());
        gtk_widget_show(g->y_control);
@@ -744,11 +781,22 @@ void build_vtt_gui(vtt_class *vtt)
        
        g->control_box=gtk_vbox_new(FALSE,2);
        gtk_widget_show(g->control_box);
-       
+
+       tempbox2=gtk_hbox_new(FALSE, 2);
+       gtk_widget_show(tempbox2);
+       gtk_box_pack_start(GTK_BOX(g->control_box), tempbox2, WID_FIX);
+
        g->control_label=gtk_label_new(vtt->name);
        gtk_widget_show(g->control_label);
-       gtk_box_pack_start(GTK_BOX(g->control_box), g->control_label, WID_FIX);
-       
+       gtk_box_pack_start(GTK_BOX(tempbox2), g->control_label, WID_DYN);
+
+       g->control_minimize=gtk_button_new();
+       pixmap=tx_pixmap_widget(TX_ICON_MINIMIZE_PANEL);
+       gtk_container_add (GTK_CONTAINER (g->control_minimize), pixmap);        
+       gtk_box_pack_end(GTK_BOX(tempbox2), g->control_minimize, WID_FIX);
+       gtk_widget_show(pixmap);
+       gtk_widget_show(g->control_minimize);
+
        g->scrolled_win=gtk_scrolled_window_new (NULL, NULL);
        gtk_container_set_border_width (GTK_CONTAINER (g->scrolled_win), 0);
        gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (g->scrolled_win),
@@ -949,6 +997,9 @@ void build_vtt_gui(vtt_class *vtt)
        g->file_dialog=NULL;
 
        gui_connect_signals(vtt);
+       
+       g->audio_minimized_panel_bar_button=NULL;
+       g->control_minimized_panel_bar_button=NULL;
 }
 
 void fx_up(GtkWidget *wid, vtt_fx *effect)
@@ -1090,6 +1141,14 @@ void gui_set_name(vtt_class *vtt, char *newname)
        gtk_label_set_text(GTK_LABEL(vtt->gui.audio_label), newname);
        gtk_label_set_text(GTK_LABEL(vtt->gui.control_label), newname);
        gtk_entry_set_text(GTK_ENTRY(vtt->gui.name), newname);
+       
+       if (vtt->gui.audio_minimized_panel_bar_button!=NULL) {
+               gtk_label_set_text(GTK_LABEL(vtt->gui.audio_minimized_panel_bar_label), newname);
+       }
+
+       if (vtt->gui.control_minimized_panel_bar_button!=NULL) {
+               gtk_label_set_text(GTK_LABEL(vtt->gui.control_minimized_panel_bar_label), newname);
+       }
 }
 
 void gui_set_filename (vtt_class *vtt, char *newname)
@@ -1112,8 +1171,41 @@ void gui_update_display(vtt_class *vtt)
        gtk_tx_set_data(GTK_TX(vtt->gui.display), vtt->buffer, vtt->samples_in_buffer);
 }
 
+void gui_hide_control_panel(vtt_class *vtt, bool hide) {
+       if (hide) {
+               gtk_widget_hide(vtt->gui.control_box);
+               vtt->gui.control_minimized_panel_bar_button=tx_xpm_button_new(TX_ICON_MIN_CONTROL, vtt->name, 0, &vtt->gui.control_minimized_panel_bar_label);
+               gtk_signal_connect(GTK_OBJECT(vtt->gui.control_minimized_panel_bar_button), "clicked", (GtkSignalFunc) unminimize_control_panel, vtt);
+               gtk_widget_show(vtt->gui.control_minimized_panel_bar_button);
+               add_to_panel_bar(vtt->gui.control_minimized_panel_bar_button);
+       } else {
+               gtk_widget_show(vtt->gui.control_box);
+               remove_from_panel_bar(vtt->gui.control_minimized_panel_bar_button);
+               gtk_widget_destroy(vtt->gui.control_minimized_panel_bar_button);
+               vtt->gui.control_minimized_panel_bar_button=NULL;
+       }
+}
+
+void gui_hide_audio_panel(vtt_class *vtt, bool hide) {
+       if (hide) {
+               gtk_widget_hide(vtt->gui.audio_box);
+               vtt->gui.audio_minimized_panel_bar_button=tx_xpm_button_new(TX_ICON_MIN_AUDIO, vtt->name, 0, &vtt->gui.audio_minimized_panel_bar_label);
+               gtk_signal_connect(GTK_OBJECT(vtt->gui.audio_minimized_panel_bar_button), "clicked", (GtkSignalFunc) unminimize_audio_panel, vtt);              
+               gtk_widget_show(vtt->gui.audio_minimized_panel_bar_button);
+               add_to_panel_bar(vtt->gui.audio_minimized_panel_bar_button);
+       } else {
+               gtk_widget_show(vtt->gui.audio_box);
+               remove_from_panel_bar(vtt->gui.audio_minimized_panel_bar_button);
+               gtk_widget_destroy(vtt->gui.audio_minimized_panel_bar_button);
+               vtt->gui.audio_minimized_panel_bar_button=NULL;
+       }
+}
+
 void delete_gui(vtt_class *vtt)
 {
+       if (vtt->gui.control_minimized_panel_bar_button!=NULL) gui_hide_control_panel(vtt, false);
+       if (vtt->gui.audio_minimized_panel_bar_button!=NULL) gui_hide_audio_panel(vtt, false);
+
        delete vtt->gui.main_panel;
        delete vtt->gui.trigger_panel;
        
@@ -1211,3 +1303,4 @@ void vg_init_all_non_seqpars()
                gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON((*vtt)->gui.sync_master), (*vtt)->is_sync_master);
        }       
 }
+
index f64b147fb22a608547fce324ca9975bdc4f9cb6f..75ec4be074cab4ace988841af0f5d9fbbe296205 100644 (file)
@@ -46,6 +46,7 @@ typedef struct vtt_gui
 
        /* Control Box Widgets */
        GtkWidget *control_label;
+       GtkWidget *control_minimize;
        GtkWidget *scrolled_win;
        GtkWidget *control_subbox;
        GtkWidget *ladspa_menu;
@@ -74,8 +75,8 @@ typedef struct vtt_gui
        GtkAdjustment *pitch;
        GtkAdjustment *pan;
        GtkAdjustment *volume; 
-        GtkWidget *mute;
-        GtkWidget *solo;
+    GtkWidget *mute;
+    GtkWidget *solo;
        GtkWidget *flash;
 
        /* Widgets in Lowpass Panel */
@@ -107,12 +108,19 @@ typedef struct vtt_gui
 
        /* Audio Box Widgets */
        GtkWidget *audio_label;
+       GtkWidget *audio_minimize;
        GtkWidget *display;
        GtkWidget *file;
-       GtkWidget *edit;
-       GtkWidget *reload;
+//     GtkWidget *edit;
+//     GtkWidget *reload;
        GtkWidget *x_control;
-       GtkWidget *y_control;   
+       GtkWidget *y_control;
+       
+       GtkWidget *audio_minimized_panel_bar_button;
+       GtkWidget *control_minimized_panel_bar_button;
+
+       GtkWidget *audio_minimized_panel_bar_label;
+       GtkWidget *control_minimized_panel_bar_label;
 };
 
 extern void cleanup_all_vtts();