summaryrefslogtreecommitdiff
path: root/libs/ardour/stripable.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2017-05-05 12:31:21 +0100
committerPaul Davis <paul@linuxaudiosystems.com>2017-05-05 18:56:25 +0100
commit0c035778e162bd5934fc0070e43a26ffb4c8825a (patch)
tree0fa5ae935d4d5effc9e3ae372d8b2905f1578110 /libs/ardour/stripable.cc
parentccd19ed0615bfb300bedc23ac48de7f426a7948e (diff)
libardour now has CoreSelection object to manage selection status of Stripables and AutomationControls
Diffstat (limited to 'libs/ardour/stripable.cc')
-rw-r--r--libs/ardour/stripable.cc24
1 files changed, 22 insertions, 2 deletions
diff --git a/libs/ardour/stripable.cc b/libs/ardour/stripable.cc
index c2f5b7239a..c4f128b4e8 100644
--- a/libs/ardour/stripable.cc
+++ b/libs/ardour/stripable.cc
@@ -21,24 +21,32 @@
#include "pbd/compose.h"
#include "pbd/convert.h"
+#include "pbd/i18n.h"
+
#include "ardour/debug.h"
#include "ardour/rc_configuration.h"
+#include "ardour/session.h"
+#include "ardour/selection.h"
#include "ardour/stripable.h"
-#include "pbd/i18n.h"
-
using namespace ARDOUR;
using namespace PBD;
using std::string;
Stripable::Stripable (Session& s, string const & name, PresentationInfo const & pi)
: SessionObject (s, name)
+ , Automatable (s)
, _presentation_info (pi)
, _active_color_picker (0)
{
}
+Stripable::~Stripable ()
+{
+ _session.selection().remove_stripable_by_id (id());
+}
+
void
Stripable::set_presentation_order (PresentationInfo::order_t order)
{
@@ -103,3 +111,15 @@ Stripable::set_state (XMLNode const& node, int version)
return 0;
}
+
+bool
+Stripable::is_selected() const
+{
+ try {
+ boost::shared_ptr<const Stripable> s (shared_from_this());
+ } catch (...) {
+ std::cerr << "cannot shared-from-this for " << this << std::endl;
+ abort ();
+ }
+ return _session.selection().selected (shared_from_this());
+}