This should fix the options editor crasher i just made.. thanks Nostar
authorNick Mainsbridge <beatroute@iprimus.com.au>
Sun, 21 May 2006 13:21:25 +0000 (13:21 +0000)
committerNick Mainsbridge <beatroute@iprimus.com.au>
Sun, 21 May 2006 13:21:25 +0000 (13:21 +0000)
git-svn-id: svn://localhost/trunk/ardour2@520 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/gain_meter.cc
gtk2_ardour/gain_meter.h
gtk2_ardour/panner_ui.cc

index 2357739396741fe1a4826ee40bb8c809aed5477b..7d54cfa99c373d3956a7f42d5334c28b50197e4a 100644 (file)
@@ -147,35 +147,39 @@ GainMeter::GainMeter (IO& io, Session& s)
        gain_automation_state_button.set_size_request(10, -1);
        gain_automation_style_button.set_size_request(10, -1);
 
-       using namespace Menu_Helpers;
+       fader_vbox = manage (new Gtk::VBox());
+       fader_vbox->set_spacing (0);
+       fader_vbox->pack_start (*gain_slider, false, false, 0);
+
+       Route* r;
+
+       if ((r = dynamic_cast<Route*> (&_io)) != 0) {
+               using namespace Menu_Helpers;
        
-       gain_astate_menu.items().push_back (MenuElem (_("Manual"), 
-                                                     bind (mem_fun (dynamic_cast<Route*>(&_io), &IO::set_gain_automation_state), (AutoState) Off)));
-       gain_astate_menu.items().push_back (MenuElem (_("Play"),
-                                                     bind (mem_fun (dynamic_cast<Route*>(&_io), &IO::set_gain_automation_state), (AutoState) Play)));
-       gain_astate_menu.items().push_back (MenuElem (_("Write"),
-                                                     bind (mem_fun (dynamic_cast<Route*>(&_io), &IO::set_gain_automation_state), (AutoState) Write)));
-       gain_astate_menu.items().push_back (MenuElem (_("Touch"),
-                                                     bind (mem_fun (dynamic_cast<Route*>(&_io), &IO::set_gain_automation_state), (AutoState) Touch)));
+               gain_astate_menu.items().push_back (MenuElem (_("Manual"), 
+                                                     bind (mem_fun (&_io, &IO::set_gain_automation_state), (AutoState) Off)));
+               gain_astate_menu.items().push_back (MenuElem (_("Play"),
+                                                     bind (mem_fun (&_io, &IO::set_gain_automation_state), (AutoState) Play)));
+               gain_astate_menu.items().push_back (MenuElem (_("Write"),
+                                                     bind (mem_fun (&_io, &IO::set_gain_automation_state), (AutoState) Write)));
+               gain_astate_menu.items().push_back (MenuElem (_("Touch"),
+                                                     bind (mem_fun (&_io, &IO::set_gain_automation_state), (AutoState) Touch)));
        
-       gain_astyle_menu.items().push_back (MenuElem (_("Trim")));
-       gain_astyle_menu.items().push_back (MenuElem (_("Abs")));
-
-       Route* _route = dynamic_cast<Route*>(&_io);
+               gain_astyle_menu.items().push_back (MenuElem (_("Trim")));
+               gain_astyle_menu.items().push_back (MenuElem (_("Abs")));
        
-       gain_astate_menu.set_name ("ArdourContextMenu");
-       gain_astyle_menu.set_name ("ArdourContextMenu");
-
-       gain_automation_style_button.signal_button_press_event().connect (mem_fun(*this, &GainMeter::gain_automation_style_button_event), false);
-       gain_automation_state_button.signal_button_press_event().connect (mem_fun(*this, &GainMeter::gain_automation_state_button_event), false);
+               gain_astate_menu.set_name ("ArdourContextMenu");
+               gain_astyle_menu.set_name ("ArdourContextMenu");
 
-       _route->gain_automation_curve().automation_state_changed.connect (mem_fun(*this, &GainMeter::gain_automation_state_changed));
-       _route->gain_automation_curve().automation_style_changed.connect (mem_fun(*this, &GainMeter::gain_automation_style_changed));
+               gain_automation_style_button.signal_button_press_event().connect (mem_fun(*this, &GainMeter::gain_automation_style_button_event), false);
+               gain_automation_state_button.signal_button_press_event().connect (mem_fun(*this, &GainMeter::gain_automation_state_button_event), false);
+               
+               r->gain_automation_curve().automation_state_changed.connect (mem_fun(*this, &GainMeter::gain_automation_state_changed));
+               r->gain_automation_curve().automation_style_changed.connect (mem_fun(*this, &GainMeter::gain_automation_style_changed));
+               fader_vbox->pack_start (gain_automation_state_button, false, false, 0);
 
-       fader_vbox = manage (new Gtk::VBox());
-       fader_vbox->set_spacing (0);
-       fader_vbox->pack_start (*gain_slider, false, false, 0);
-       fader_vbox->pack_start (gain_automation_state_button, false, false, 0);
+               gain_automation_state_changed ();
+       }
 
        hbox.set_spacing (0);
        hbox.pack_start (*fader_vbox, false, false, 2);
@@ -193,8 +197,6 @@ GainMeter::GainMeter (IO& io, Session& s)
        peak_display.signal_button_release_event().connect (mem_fun(*this, &GainMeter::peak_button_release));
 
        _session.MeterHoldChanged.connect (mem_fun(*this, &GainMeter::meter_hold_changed));
-       
-       gain_automation_state_changed ();
 
        gain_changed (0);
        update_gain_sensitive ();
index 5113407de581b3e737791a9b19f75702adcecacc..ddf93b579f03ad512aa3db69dda746738ed65fb8 100644 (file)
@@ -142,7 +142,7 @@ class GainMeter : public Gtk::VBox
        vector<MeterInfo>    meters;
        float       max_peak;
        
-Gtk::VBox*   fader_vbox;
+       Gtk::VBox*   fader_vbox;
        Gtk::HBox   hbox;
        Gtk::HBox   meter_packer;
 
index 6c10137548f65061b754c5b88cae18cdc40b5f9a..e799083e134bc1cb1b1b66fbd18aa2b5d3e9528f 100644 (file)
@@ -103,13 +103,6 @@ PannerUI::PannerUI (IO& io, Session& s)
        pan_automation_style_button.signal_button_press_event().connect (mem_fun(*this, &PannerUI::pan_automation_style_button_event), false);
        pan_automation_state_button.signal_button_press_event().connect (mem_fun(*this, &PannerUI::pan_automation_state_button_event), false);
 
-       Gtk::HBox* pan_button_hbox = manage (new Gtk::HBox());
-
-       panning_link_box.pack_start (panning_link_button, true, true);
-       panning_link_box.pack_start (panning_link_direction_button, true, true);
-       pan_button_hbox->pack_start (panning_link_box, true, true);
-       pan_button_hbox->pack_start (pan_automation_state_button, true, true);
-
        panning_link_button.set_name (X_("PanningLinkButton"));
        panning_link_direction_button.set_name (X_("PanningLinkDirectionButton"));
 
@@ -117,6 +110,13 @@ PannerUI::PannerUI (IO& io, Session& s)
           we need a pixmap in the button just to get started.
        */
 
+       Gtk::HBox* pan_button_hbox = manage (new Gtk::HBox());
+
+       panning_link_box.pack_start (panning_link_button, true, true);
+       panning_link_box.pack_start (panning_link_direction_button, true, true);
+       pan_button_hbox->pack_start (panning_link_box, true, true);
+       pan_button_hbox->pack_start (pan_automation_state_button, true, true);
+
        panning_link_direction_button.add (*(manage (new Image (get_xpm("forwardblarrow.xpm")))));
 
        panning_link_direction_button.signal_clicked().connect