projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add EngineControl::stop_engine method to show errors when stopping engine
[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 102cd724ddf6f5b8754b9d7090b7fc6ff9a2397a..30943e22d04475765a1d4b1b07d7b815e9797b82 100644
(file)
--- a/
gtk2_ardour/route_processor_selection.cc
+++ b/
gtk2_ardour/route_processor_selection.cc
@@
-21,12
+21,10
@@
#include <sigc++/bind.h>
#include "pbd/error.h"
#include <sigc++/bind.h>
#include "pbd/error.h"
-#include "ardour/playlist.h"
-#include "ardour/processor.h"
-#include "ardour/route.h"
-
-#include "route_processor_selection.h"
#include "gui_thread.h"
#include "gui_thread.h"
+#include "mixer_strip.h"
+#include "route_processor_selection.h"
+#include "route_ui.h"
#include "i18n.h"
#include "i18n.h"
@@
-34,8
+32,13
@@
using namespace std;
using namespace ARDOUR;
using namespace PBD;
using namespace ARDOUR;
using namespace PBD;
-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;
@@
-45,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);
@@
-81,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);
@@
-89,55
+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);
- r->GoingAway.connect (boost::bind (&RouteRedirectSelection::removed, this, boost::weak_ptr<Route>(r)));
- 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 (!r
) {
-
return
;
- }
+
if (ms
) {
+
ms->CatchDeletion.connect (*this, invalidator (*this), boost::bind (&RouteProcessorSelection::remove, this, _1), gui_context())
;
+
}
- remove (r);
+ if (!_no_route_change_signal) {
+ RoutesChanged();
+ }
+ }
+ }
}
void
}
void
-Route
RedirectSelection::remove (boost::shared_ptr<Route>
r)
+Route
ProcessorSelection::remove (RouteUI*
r)
{
{
- ENSURE_GUI_THREAD (*this, &Route
Redirect
Selection::remove, r);
+ ENSURE_GUI_THREAD (*this, &Route
Processor
Selection::remove, r);
-
list<boost::shared_ptr<Route> >
::iterator i;
+
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;
+}