projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Work around silence-trim config 0dBFS (7b1f97bf)
[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 30943e22d04475765a1d4b1b07d7b815e9797b82..7428267b50b4d77d8d7398f10ca90d390a9ca77c 100644
(file)
--- a/
gtk2_ardour/route_processor_selection.cc
+++ b/
gtk2_ardour/route_processor_selection.cc
@@
-26,14
+26,14
@@
#include "route_processor_selection.h"
#include "route_ui.h"
#include "route_processor_selection.h"
#include "route_ui.h"
-#include "i18n.h"
+#include "
pbd/
i18n.h"
using namespace std;
using namespace ARDOUR;
using namespace PBD;
using namespace std;
using namespace ARDOUR;
using namespace PBD;
+unsigned int RouteProcessorSelection::_no_route_change_signal = 0;
RouteProcessorSelection::RouteProcessorSelection()
RouteProcessorSelection::RouteProcessorSelection()
- : _no_route_change_signal (false)
{
}
{
}
@@
-42,7
+42,7
@@
RouteProcessorSelection::operator= (const RouteProcessorSelection& other)
{
if (&other != this) {
processors = other.processors;
{
if (&other != this) {
processors = other.processors;
-
routes = other.rout
es;
+
axes = other.ax
es;
}
return *this;
}
}
return *this;
}
@@
-51,7
+51,7
@@
bool
operator== (const RouteProcessorSelection& a, const RouteProcessorSelection& b)
{
// XXX MUST TEST PROCESSORS SOMEHOW
operator== (const RouteProcessorSelection& a, const RouteProcessorSelection& b)
{
// XXX MUST TEST PROCESSORS SOMEHOW
- return a.
routes == b.rout
es;
+ return a.
axes == b.ax
es;
}
void
}
void
@@
-71,12
+71,12
@@
RouteProcessorSelection::clear_processors ()
void
RouteProcessorSelection::clear_routes ()
{
void
RouteProcessorSelection::clear_routes ()
{
- for (
RouteUISelection::iterator i = routes.begin(); i != rout
es.end(); ++i) {
+ for (
AxisViewSelection::iterator i = axes.begin(); i != ax
es.end(); ++i) {
(*i)->set_selected (false);
}
(*i)->set_selected (false);
}
-
rout
es.clear ();
+
ax
es.clear ();
drop_connections ();
drop_connections ();
- if (
!
_no_route_change_signal) {
+ if (
0 ==
_no_route_change_signal) {
RoutesChanged ();
}
}
RoutesChanged ();
}
}
@@
-98,61
+98,65
@@
RouteProcessorSelection::set (XMLNode* node)
}
void
}
void
-RouteProcessorSelection::add (
RouteUI
* r)
+RouteProcessorSelection::add (
AxisView
* r)
{
{
- if (find (routes.begin(), routes.end(), r) == routes.end()) {
- if (routes.insert (r).second) {
- r->set_selected (true);
+ if (axes.insert (r).second) {
-
MixerStrip* ms = dynamic_cast<MixerStrip*> (r
);
+
r->set_selected (true
);
- if (ms) {
- ms->CatchDeletion.connect (*this, invalidator (*this), boost::bind (&RouteProcessorSelection::remove, this, _1), gui_context());
- }
+ MixerStrip* ms = dynamic_cast<MixerStrip*> (r);
- if (!_no_route_change_signal) {
- RoutesChanged();
- }
+ if (ms) {
+ ms->CatchDeletion.connect (*this, invalidator (*this), boost::bind (&RouteProcessorSelection::remove, this, _1), gui_context());
+ }
+
+ if (0 == _no_route_change_signal) {
+ RoutesChanged();
}
}
}
void
}
}
}
void
-RouteProcessorSelection::remove (
RouteUI
* r)
+RouteProcessorSelection::remove (
AxisView
* r)
{
ENSURE_GUI_THREAD (*this, &RouteProcessorSelection::remove, r);
{
ENSURE_GUI_THREAD (*this, &RouteProcessorSelection::remove, r);
-
RouteUI
Selection::iterator i;
- if ((i = find (
routes.begin(), routes.end(), r)) != rout
es.end()) {
+
AxisView
Selection::iterator i;
+ if ((i = find (
axes.begin(), axes.end(), r)) != ax
es.end()) {
(*i)->set_selected (false);
(*i)->set_selected (false);
-
rout
es.erase (i);
- if (
!
_no_route_change_signal) {
+
ax
es.erase (i);
+ if (
0 ==
_no_route_change_signal) {
RoutesChanged ();
}
}
}
void
RoutesChanged ();
}
}
}
void
-RouteProcessorSelection::set (
RouteUI
* r)
+RouteProcessorSelection::set (
AxisView
* r)
{
clear_routes ();
add (r);
}
bool
{
clear_routes ();
add (r);
}
bool
-RouteProcessorSelection::selected (
RouteUI
* r)
+RouteProcessorSelection::selected (
AxisView
* r)
{
{
- return find (
routes.begin(), routes.end(), r) != rout
es.end();
+ return find (
axes.begin(), axes.end(), r) != ax
es.end();
}
bool
RouteProcessorSelection::empty ()
{
}
bool
RouteProcessorSelection::empty ()
{
- return processors.empty () &&
rout
es.empty ();
+ return processors.empty () &&
ax
es.empty ();
}
void
RouteProcessorSelection::block_routes_changed (bool yn)
{
}
void
RouteProcessorSelection::block_routes_changed (bool yn)
{
- _no_route_change_signal = yn;
+ if (yn) {
+ ++_no_route_change_signal;
+ } else {
+ assert (_no_route_change_signal > 0);
+ --_no_route_change_signal;
+ }
}
}