diff options
Diffstat (limited to 'libs/ardour/stripable.cc')
-rw-r--r-- | libs/ardour/stripable.cc | 24 |
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()); +} |