projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
amend prev commit.
[ardour.git]
/
gtk2_ardour
/
route_processor_selection.cc
diff --git
a/gtk2_ardour/route_processor_selection.cc
b/gtk2_ardour/route_processor_selection.cc
index 552de1b412028c75d3ad8eeb00f618c811f1a0f3..30943e22d04475765a1d4b1b07d7b815e9797b82 100644
(file)
--- a/
gtk2_ardour/route_processor_selection.cc
+++ b/
gtk2_ardour/route_processor_selection.cc
@@
-1,5
+1,5
@@
/*
/*
- Copyright (C) 2002 Paul Davis
+ Copyright (C) 2002 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-19,22
+19,26
@@
#include <algorithm>
#include <sigc++/bind.h>
#include <algorithm>
#include <sigc++/bind.h>
-#include <pbd/error.h>
-
-#include <ardour/playlist.h>
-#include <ardour/processor.h>
-#include <ardour/route.h>
+#include "pbd/error.h"
+#include "gui_thread.h"
+#include "mixer_strip.h"
#include "route_processor_selection.h"
#include "route_processor_selection.h"
+#include "route_ui.h"
#include "i18n.h"
#include "i18n.h"
+using namespace std;
using namespace ARDOUR;
using namespace PBD;
using namespace ARDOUR;
using namespace PBD;
-using namespace sigc;
-RouteRedirectSelection&
-RouteRedirectSelection::operator= (const RouteRedirectSelection& other)
+RouteProcessorSelection::RouteProcessorSelection()
+ : _no_route_change_signal (false)
+{
+}
+
+RouteProcessorSelection&
+RouteProcessorSelection::operator= (const RouteProcessorSelection& other)
{
if (&other != this) {
processors = other.processors;
{
if (&other != this) {
processors = other.processors;
@@
-44,35
+48,41
@@
RouteRedirectSelection::operator= (const RouteRedirectSelection& other)
}
bool
}
bool
-operator== (const Route
RedirectSelection& a, const RouteRedirect
Selection& b)
+operator== (const Route
ProcessorSelection& a, const RouteProcessor
Selection& b)
{
// XXX MUST TEST PROCESSORS SOMEHOW
return a.routes == b.routes;
}
void
{
// XXX MUST TEST PROCESSORS SOMEHOW
return a.routes == b.routes;
}
void
-Route
Redirect
Selection::clear ()
+Route
Processor
Selection::clear ()
{
clear_processors ();
clear_routes ();
}
void
{
clear_processors ();
clear_routes ();
}
void
-Route
Redirect
Selection::clear_processors ()
+Route
Processor
Selection::clear_processors ()
{
processors.clear ();
ProcessorsChanged ();
}
void
{
processors.clear ();
ProcessorsChanged ();
}
void
-Route
Redirect
Selection::clear_routes ()
+Route
Processor
Selection::clear_routes ()
{
{
+ for (RouteUISelection::iterator i = routes.begin(); i != routes.end(); ++i) {
+ (*i)->set_selected (false);
+ }
routes.clear ();
routes.clear ();
- RoutesChanged ();
+ drop_connections ();
+ if (!_no_route_change_signal) {
+ RoutesChanged ();
+ }
}
void
}
void
-Route
Redirect
Selection::add (XMLNode* node)
+Route
Processor
Selection::add (XMLNode* node)
{
// XXX check for duplicate
processors.add (node);
{
// XXX check for duplicate
processors.add (node);
@@
-80,7
+90,7
@@
RouteRedirectSelection::add (XMLNode* node)
}
void
}
void
-Route
Redirect
Selection::set (XMLNode* node)
+Route
Processor
Selection::set (XMLNode* node)
{
clear_processors ();
processors.set (node);
{
clear_processors ();
processors.set (node);
@@
-88,45
+98,61
@@
RouteRedirectSelection::set (XMLNode* node)
}
void
}
void
-Route
RedirectSelection::add (boost::shared_ptr<Route>
r)
+Route
ProcessorSelection::add (RouteUI*
r)
{
if (find (routes.begin(), routes.end(), r) == routes.end()) {
{
if (find (routes.begin(), routes.end(), r) == routes.end()) {
- routes.push_back (r);
+ if (routes.insert (r).second) {
+ r->set_selected (true);
- // XXX SHAREDPTR FIXME
- // void (RouteRedirectSelection::*pmf)(Route*) = &RouteRedirectSelection::remove;
- // r->GoingAway.connect (bind (mem_fun(*this, pmf), r));
+ MixerStrip* ms = dynamic_cast<MixerStrip*> (r);
- RoutesChanged();
+ if (ms) {
+ ms->CatchDeletion.connect (*this, invalidator (*this), boost::bind (&RouteProcessorSelection::remove, this, _1), gui_context());
+ }
+
+ if (!_no_route_change_signal) {
+ RoutesChanged();
+ }
+ }
}
}
void
}
}
void
-Route
RedirectSelection::remove (boost::shared_ptr<Route>
r)
+Route
ProcessorSelection::remove (RouteUI*
r)
{
{
- list<boost::shared_ptr<Route> >::iterator i;
+ ENSURE_GUI_THREAD (*this, &RouteProcessorSelection::remove, r);
+
+ RouteUISelection::iterator i;
if ((i = find (routes.begin(), routes.end(), r)) != routes.end()) {
if ((i = find (routes.begin(), routes.end(), r)) != routes.end()) {
+ (*i)->set_selected (false);
routes.erase (i);
routes.erase (i);
- RoutesChanged ();
+ if (!_no_route_change_signal) {
+ RoutesChanged ();
+ }
}
}
void
}
}
void
-Route
RedirectSelection::set (boost::shared_ptr<Route>
r)
+Route
ProcessorSelection::set (RouteUI*
r)
{
clear_routes ();
add (r);
}
bool
{
clear_routes ();
add (r);
}
bool
-Route
RedirectSelection::selected (boost::shared_ptr<Route>
r)
+Route
ProcessorSelection::selected (RouteUI*
r)
{
return find (routes.begin(), routes.end(), r) != routes.end();
}
bool
{
return find (routes.begin(), routes.end(), r) != routes.end();
}
bool
-Route
Redirect
Selection::empty ()
+Route
Processor
Selection::empty ()
{
return processors.empty () && routes.empty ();
}
{
return processors.empty () && routes.empty ();
}
-
+
+void
+RouteProcessorSelection::block_routes_changed (bool yn)
+{
+ _no_route_change_signal = yn;
+}