make send GUIs into ArdourDialogs; ensure that panner changes propagate into the...
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 26 Nov 2008 06:57:42 +0000 (06:57 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 26 Nov 2008 06:57:42 +0000 (06:57 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4259 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/panner_ui.cc
gtk2_ardour/send_ui.cc
gtk2_ardour/send_ui.h
libs/ardour/io.cc
libs/ardour/panner.cc
libs/ardour/send.cc

index 27e685d8cb99db5520a5898cb3c1f5169925eb70..b06519d84014a9268d6a1b8ec5e25e624e52065a 100644 (file)
@@ -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
index ee97ae959c0153e3e116ecf7dc2539b84ad2f482..939d3bba747435244e6d104939599c1e78015c20 100644 (file)
@@ -113,22 +113,20 @@ SendUI::fast_update ()
 }
        
 SendUIWindow::SendUIWindow (boost::shared_ptr<Send> 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<Window *> (this)));
-
 }
 
 SendUIWindow::~SendUIWindow ()
index 3d6e9c7fa924c6c3cc403b1c83ab2ca9403a067d..3831841fa217f6041a4b801a6140394688d4657f 100644 (file)
@@ -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::Send>, ARDOUR::Session&);
@@ -68,7 +69,6 @@ class SendUIWindow : public Gtk::Window
        SendUI*     ui;
 
   private:
-       Gtk::VBox vpacker;
        Gtk::HBox hpacker;
 
        void send_going_away ();
index 04a7978ce5c48eb48bc439371ea973749a4a2d86..da0529b9c64f602ebfe5b1f1080b1d327d4b6eea 100644 (file)
@@ -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);
index db802b0921fce4a79645db313ec6fb4ae47712a1..4848f559cc8d4315a96fdc30a32fb024ecceabf5 100644 (file)
@@ -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 */
        }
index 3afb767dd89b3b1b8dc0543e492307f4cdd8203d..20ec4819a15f212685ab690210c3991d92416015 100644 (file)
@@ -24,6 +24,7 @@
 #include <ardour/send.h>
 #include <ardour/session.h>
 #include <ardour/port.h>
+#include <ardour/panner.h>
 
 #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<Send*>(&other)->_panner->get_state());
+       _panner->set_state (other_state);
+       
+       delete &other_state;
 
        RedirectCreated (this); /* EMIT SIGNAL */
 }