summaryrefslogtreecommitdiff
path: root/gtk2_ardour/route_processor_selection.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-11-04 17:53:21 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-11-04 17:53:21 +0000
commit8f078d7fd40878d08ad4d048f0606a27901c7475 (patch)
tree8eb652e8fcd0769c952b1b85e8cbd39a8d84fce3 /gtk2_ardour/route_processor_selection.cc
parentfd2aea103790a1f49211f3bec7e9cdc246762e77 (diff)
drastic overhaul of keyboard handling in mixer window. real bindings, key events handled at window level, actions for all processor ops. still the confusing mess of old crap for the processor box context menu (it will die, i feel it)
git-svn-id: svn://localhost/ardour2/branches/3.0@10442 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/route_processor_selection.cc')
-rw-r--r--gtk2_ardour/route_processor_selection.cc40
1 files changed, 21 insertions, 19 deletions
diff --git a/gtk2_ardour/route_processor_selection.cc b/gtk2_ardour/route_processor_selection.cc
index b3a6620f6b..9022119729 100644
--- a/gtk2_ardour/route_processor_selection.cc
+++ b/gtk2_ardour/route_processor_selection.cc
@@ -25,8 +25,10 @@
#include "ardour/processor.h"
#include "ardour/route.h"
-#include "route_processor_selection.h"
#include "gui_thread.h"
+#include "mixer_strip.h"
+#include "route_processor_selection.h"
+#include "route_ui.h"
#include "i18n.h"
@@ -68,6 +70,9 @@ RouteRedirectSelection::clear_processors ()
void
RouteRedirectSelection::clear_routes ()
{
+ for (RouteUISelection::iterator i = routes.begin(); i != routes.end(); ++i) {
+ (*i)->set_selected (false);
+ }
routes.clear ();
drop_connections ();
RoutesChanged ();
@@ -90,48 +95,45 @@ RouteRedirectSelection::set (XMLNode* node)
}
void
-RouteRedirectSelection::add (boost::shared_ptr<Route> r)
+RouteRedirectSelection::add (RouteUI* r)
{
if (find (routes.begin(), routes.end(), r) == routes.end()) {
- routes.push_back (r);
- r->DropReferences.connect (*this, MISSING_INVALIDATOR, boost::bind (&RouteRedirectSelection::removed, this, boost::weak_ptr<Route>(r)), gui_context());
- RoutesChanged();
- }
-}
+ if (routes.insert (r).second) {
+ r->set_selected (true);
-void
-RouteRedirectSelection::removed (boost::weak_ptr<Route> wr)
-{
- boost::shared_ptr<Route> r (wr.lock());
+ MixerStrip* ms = dynamic_cast<MixerStrip*> (r);
+
+ if (ms) {
+ ms->CatchDeletion.connect (*this, invalidator (*this), ui_bind (&RouteRedirectSelection::remove, this, _1), gui_context());
+ }
- if (!r) {
- return;
+ RoutesChanged();
+ }
}
-
- remove (r);
}
void
-RouteRedirectSelection::remove (boost::shared_ptr<Route> r)
+RouteRedirectSelection::remove (RouteUI* r)
{
ENSURE_GUI_THREAD (*this, &RouteRedirectSelection::remove, r);
- list<boost::shared_ptr<Route> >::iterator i;
+ RouteUISelection::iterator i;
if ((i = find (routes.begin(), routes.end(), r)) != routes.end()) {
routes.erase (i);
+ (*i)->set_selected (false);
RoutesChanged ();
}
}
void
-RouteRedirectSelection::set (boost::shared_ptr<Route> r)
+RouteRedirectSelection::set (RouteUI* r)
{
clear_routes ();
add (r);
}
bool
-RouteRedirectSelection::selected (boost::shared_ptr<Route> r)
+RouteRedirectSelection::selected (RouteUI* r)
{
return find (routes.begin(), routes.end(), r) != routes.end();
}