diff --git a/gtk2_ardour/panner_ui.cc b/gtk2_ardour/panner_ui.cc index 27e685d8cb..b06519d840 100644 --- a/gtk2_ardour/panner_ui.cc +++ b/gtk2_ardour/panner_ui.cc @@ -210,14 +210,12 @@ PannerUI::get_controllable() bool PannerUI::panning_link_button_press (GdkEventButton* ev) { - cerr << "link press\n"; return true; } bool PannerUI::panning_link_button_release (GdkEventButton* ev) { - cerr << "link release\n"; if (!ignore_toggle) { _io->panner().set_linked (!_io->panner().linked()); } @@ -244,7 +242,7 @@ PannerUI::update_pan_linkage () bool x = _io->panner().linked(); bool bx = panning_link_button.get_active(); - + if (x != bx) { ignore_toggle = true; @@ -313,6 +311,7 @@ PannerUI::panner_changed () { ENSURE_GUI_THREAD (mem_fun(*this, &PannerUI::panner_changed)); setup_pan (); + pan_changed (0); } void diff --git a/gtk2_ardour/send_ui.cc b/gtk2_ardour/send_ui.cc index ee97ae959c..939d3bba74 100644 --- a/gtk2_ardour/send_ui.cc +++ b/gtk2_ardour/send_ui.cc @@ -113,22 +113,20 @@ SendUI::fast_update () } SendUIWindow::SendUIWindow (boost::shared_ptr s, Session& ss) + : ArdourDialog (string("Ardour: send ") + s->name()) { ui = new SendUI (s, ss); - vpacker.set_border_width (5); - hpacker.pack_start (*ui, true, true); - vpacker.pack_start (hpacker); + get_vbox()->set_border_width (5); + get_vbox()->pack_start (hpacker); - add (vpacker); set_name ("SendUIWindow"); going_away_connection = s->GoingAway.connect (mem_fun (*this, &SendUIWindow::send_going_away)); signal_delete_event().connect (bind (ptr_fun (just_hide_it), reinterpret_cast (this))); - } SendUIWindow::~SendUIWindow () diff --git a/gtk2_ardour/send_ui.h b/gtk2_ardour/send_ui.h index 3d6e9c7fa9..3831841fa2 100644 --- a/gtk2_ardour/send_ui.h +++ b/gtk2_ardour/send_ui.h @@ -22,6 +22,7 @@ #include "gain_meter.h" #include "panner_ui.h" +#include "ardour_dialog.h" namespace ARDOUR { class Send; @@ -59,7 +60,7 @@ class SendUI : public Gtk::HBox void outs_changed (ARDOUR::IOChange, void*); }; -class SendUIWindow : public Gtk::Window +class SendUIWindow : public ArdourDialog { public: SendUIWindow(boost::shared_ptr, ARDOUR::Session&); @@ -68,7 +69,6 @@ class SendUIWindow : public Gtk::Window SendUI* ui; private: - Gtk::VBox vpacker; Gtk::HBox hpacker; void send_going_away (); diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index 04a7978ce5..da0529b9c6 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -2604,7 +2604,10 @@ void IO::set_gain (gain_t val, void *src) { // max gain at about +6dB (10.0 ^ ( 6 dB * 0.05)) - if (val>1.99526231f) val=1.99526231f; + + if (val > 1.99526231f) { + val = 1.99526231f; + } { Glib::Mutex::Lock dm (declick_lock); diff --git a/libs/ardour/panner.cc b/libs/ardour/panner.cc index db802b0921..4848f559cc 100644 --- a/libs/ardour/panner.cc +++ b/libs/ardour/panner.cc @@ -806,8 +806,14 @@ Panner::reset (uint32_t nouts, uint32_t npans) { uint32_t n; bool changed = false; + bool do_not_and_did_not_need_panning = ((nouts < 2) && (outputs.size() < 2)); - if (nouts < 2 || (nouts == outputs.size() && npans == size())) { + /* if new and old config don't need panning, or if + the config hasn't changed, we're done. + */ + + if (do_not_and_did_not_need_panning || + ((nouts == outputs.size()) && (npans == size()))) { return; } @@ -825,6 +831,10 @@ Panner::reset (uint32_t nouts, uint32_t npans) changed = true; } + if (nouts < 2) { + goto send_changed; + } + switch (nouts) { case 0: break; @@ -926,6 +936,7 @@ Panner::reset (uint32_t nouts, uint32_t npans) } } + send_changed: if (changed) { Changed (); /* EMIT SIGNAL */ } diff --git a/libs/ardour/send.cc b/libs/ardour/send.cc index 3afb767dd8..20ec4819a1 100644 --- a/libs/ardour/send.cc +++ b/libs/ardour/send.cc @@ -24,6 +24,7 @@ #include #include #include +#include #include "i18n.h" @@ -60,6 +61,7 @@ Send::Send (const Send& other) expected_inputs = 0; /* set up the same outputs, and connect them to the same places */ + no_panner_reset = true; for (uint32_t i = 0; i < other.n_outputs (); ++i) { add_output_port ("", 0); Port* p = other.output (i); @@ -73,10 +75,17 @@ Send::Send (const Send& other) } } } + + /* setup panner */ - if (other.active()) { - set_active (true, this); - } + no_panner_reset = false; + + /* copy state */ + + XMLNode& other_state (const_cast(&other)->_panner->get_state()); + _panner->set_state (other_state); + + delete &other_state; RedirectCreated (this); /* EMIT SIGNAL */ }