add new Graph debug bit ; make adding aux sends really work
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 19 Nov 2009 17:06:00 +0000 (17:06 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 19 Nov 2009 17:06:00 +0000 (17:06 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@6132 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/opts.cc
gtk2_ardour/processor_box.cc
gtk2_ardour/route_ui.cc
gtk2_ardour/route_ui.h
libs/ardour/ardour/debug.h
libs/ardour/delivery.cc
libs/ardour/internal_send.cc
libs/ardour/route.cc
libs/ardour/session.cc

index c35927dad898c951f95afd85f59cf70a48b95578..7ce66c176e7569968cacf6136b3f157b225989d6 100644 (file)
@@ -84,6 +84,7 @@ list_debug_options ()
        cerr << "\tSnapBBT\n";
        cerr << "\tConfiguration\n";
        cerr << "\tLatency\n";
+       cerr << "\tGraph\n";
 }
 
 static int
@@ -123,6 +124,8 @@ parse_debug_options (const char* str)
                        bits |= ARDOUR::DEBUG::Latency;
                } else if (strncasecmp (p, "processors", strlen (p)) == 0) {
                        bits |= ARDOUR::DEBUG::Processors;
+               } else if (strncasecmp (p, "graph", strlen (p)) == 0) {
+                       bits |= ARDOUR::DEBUG::Graph;
                }
 
                p = strtok_r (0, ",", &sp);
index e9d52016ec8ed12617a4898a6741a559ca6419e8..bd84d4ca0a0374134bf764e46e0324387e855651 100644 (file)
@@ -825,7 +825,10 @@ ProcessorBox::choose_aux (boost::weak_ptr<Route> wr)
                return;
        }
 
-       _route->listen_via (target, PreFader, true, true);
+       boost::shared_ptr<RouteList> rlist (new RouteList);
+       rlist->push_back (_route);
+
+       _session.add_internal_sends (target, PreFader, rlist);
 }
 
 void
index 5104601ba727976aa59f48e10b37b1733abb2520..e06b9b18c4327c462193defff0fbc1e67eac0939 100644 (file)
@@ -44,6 +44,7 @@
 #include "latency_gui.h"
 #include "mixer_strip.h"
 #include "automation_time_axis.h"
+#include "route_time_axis.h"
 
 #include "ardour/route.h"
 #include "ardour/event_type_map.h"
@@ -534,6 +535,8 @@ RouteUI::build_sends_menu ()
 
        items.push_back (MenuElem(_("Assign all tracks (prefader)"), bind (mem_fun (*this, &RouteUI::create_sends), PreFader)));
        items.push_back (MenuElem(_("Assign all tracks (postfader)"), bind (mem_fun (*this, &RouteUI::create_sends), PostFader)));
+       items.push_back (MenuElem(_("Assign selected tracks (prefader)"), bind (mem_fun (*this, &RouteUI::create_selected_sends), PreFader)));
+       items.push_back (MenuElem(_("Assign selected tracks (postfader)"), bind (mem_fun (*this, &RouteUI::create_selected_sends), PostFader)));
        items.push_back (MenuElem(_("Copy track gains to sends"), mem_fun (*this, &RouteUI::set_sends_gain_from_track)));
        items.push_back (MenuElem(_("Set sends gain to -inf"), mem_fun (*this, &RouteUI::set_sends_gain_to_zero)));
        items.push_back (MenuElem(_("Set sends gain to 0dB"), mem_fun (*this, &RouteUI::set_sends_gain_to_unity)));
@@ -546,6 +549,27 @@ RouteUI::create_sends (Placement p)
        _session.globally_add_internal_sends (_route, p);
 }
 
+void
+RouteUI::create_selected_sends (Placement p)
+{
+       boost::shared_ptr<RouteList> rlist (new RouteList);
+       TrackSelection& selected_tracks (ARDOUR_UI::instance()->the_editor().get_selection().tracks);
+
+       for (TrackSelection::iterator i = selected_tracks.begin(); i != selected_tracks.end(); ++i) {
+               RouteTimeAxisView* rtv;
+               RouteUI* rui;
+               if ((rtv = dynamic_cast<RouteTimeAxisView*>(*i)) != 0) {
+                       if ((rui = dynamic_cast<RouteUI*>(rtv)) != 0) {
+                               if (boost::dynamic_pointer_cast<AudioTrack>(rui->route())) {
+                                       rlist->push_back (rui->route());
+                               }
+                       }
+               }
+       }
+       
+       _session.add_internal_sends (_route, p, rlist);
+}
+
 void
 RouteUI::set_sends_gain_from_track ()
 {
index 1b2aca16896ec6c6ae7efea14964b1ba546f342b..15eafb4e1834f13272a251568e2fd815ed274d34 100644 (file)
@@ -124,6 +124,7 @@ class RouteUI : public virtual AxisView
        void set_sends_gain_to_zero ();
        void set_sends_gain_to_unity ();
        void create_sends (ARDOUR::Placement);
+       void create_selected_sends (ARDOUR::Placement);
 
        void solo_changed(void*);
        void solo_changed_so_update_mute ();
index 926d5520d7e7a6cef7c9276a4d7da420a1006f7f..f31c42675ed70b698d0bc0059736d7638690ba33 100644 (file)
@@ -41,7 +41,8 @@ namespace ARDOUR {
                        SnapBBT = 0x8,
                        Configuration = 0x10,
                        Latency = 0x20,
-                       Processors = 0x40
+                       Processors = 0x40,
+                       Graph = 0x80
                };
        }
 
index 3494be2cf5c35bfacb0a20c0006f2a3b5ece68ab..a3d8903f34156bc66edf9f55f4079e0fd07ea02d 100644 (file)
@@ -362,6 +362,8 @@ Delivery::state (bool full_state)
                node.add_property("type", "delivery");
        }
 
+       std::cerr << "delivery " << _name << " storing role " << _role << " as " << enum_2_string (_role) << std::endl;
+
        node.add_property("role", enum_2_string(_role));
        node.add_child_nocopy (_panner->state (full_state));
 
index d70889a27c922445a5a65ecf83461d12cf183b74..dd67d541eaa19b5064378121b5b55071c7f0d8e8 100644 (file)
@@ -109,7 +109,6 @@ InternalSend::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame,
                Amp::apply_simple_gain (mixbufs, nframes, tgain);
        }
 
-
        // Can't automate gain for sends or returns yet because we need different buffers
        // so that we don't overwrite the main automation data for the route amp
        // _amp->setup_gain_automation (start_frame, end_frame, nframes);
@@ -153,7 +152,7 @@ InternalSend::state (bool full)
 {
        XMLNode& node (Send::state (full));
 
-       /* this replaces any existing property */
+       /* this replaces any existing "type" property */
 
        node.add_property ("type", "intsend");
 
index e0543bdda963f2ad7d5fce17422e6384378826e2..02890808b73c2f66af0a0e5d3c4be7abcb50b675 100644 (file)
@@ -2399,11 +2399,10 @@ Route::set_comment (string cmt, void *src)
 bool
 Route::feeds (boost::shared_ptr<Route> other, bool* only_send)
 {
-       // cerr << _name << endl;
+       DEBUG_TRACE (DEBUG::Graph, string_compose ("Feeds? %1\n", _name));
 
        if (_output->connected_to (other->input())) {
-               // cerr << "\tdirect FEEDS " << other->name() << endl;
-
+               DEBUG_TRACE (DEBUG::Graph, string_compose ("\tdirect FEEDS %2\n", other->name()));
                if (only_send) {
                        *only_send = false;
                }
@@ -2418,18 +2417,21 @@ Route::feeds (boost::shared_ptr<Route> other, bool* only_send)
 
                if ((iop = boost::dynamic_pointer_cast<IOProcessor>(*r)) != 0) {
                        if (iop->feeds (other)) {
-                               // cerr << "\tIOP " << iop->name() << " feeds " << other->name() << endl;
+                               DEBUG_TRACE (DEBUG::Graph,  string_compose ("\tIOP %1 does feed %2\n", iop->name(), other->name()));
                                if (only_send) {
                                        *only_send = true;
                                }
                                return true;
                        } else {
-                               // cerr << "\tIOP " << iop->name() << " does NOT feeds " << other->name() << endl;
+                               DEBUG_TRACE (DEBUG::Graph,  string_compose ("\tIOP %1 does NOT feed %2\n", iop->name(), other->name()));
                        }
+               } else {
+                       DEBUG_TRACE (DEBUG::Graph,  string_compose ("\tPROC %1 is not an IOP\n", (*r)->name()));
                }
+                       
        }
 
-       // cerr << "\tdoes NOT FEED " << other->name() << endl;
+       DEBUG_TRACE (DEBUG::Graph,  string_compose ("\tdoes NOT feed %1\n", other->name()));
        return false;
 }
 
index 7edde902ea647794a53d7fb0d939bb7554e53bb4..0d5cdcacb5869c2b2e15780de9961d76bd5f2747 100644 (file)
@@ -2258,7 +2258,6 @@ Session::globally_add_internal_sends (boost::shared_ptr<Route> dest, Placement p
        add_internal_sends (dest, p, t);
 }
 
-
 void
 Session::add_internal_sends (boost::shared_ptr<Route> dest, Placement p, boost::shared_ptr<RouteList> senders)
 {
@@ -2278,6 +2277,8 @@ Session::add_internal_sends (boost::shared_ptr<Route> dest, Placement p, boost::
 
                (*i)->listen_via (dest, p, true, true);
        }
+
+       graph_reordered ();
 }
 
 void