add session-scope selection ops for Stripables

This commit is contained in:
Paul Davis 2016-07-04 12:44:42 -04:00
parent 5c32fc3bab
commit 57ee61772b
3 changed files with 57 additions and 0 deletions

View File

@ -302,6 +302,10 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
};
void notify_presentation_info_change ();
void clear_stripable_selection ();
void toggle_stripable_selection (boost::shared_ptr<Stripable>);
void add_stripable_selection (boost::shared_ptr<Stripable>);
void set_stripable_selection (boost::shared_ptr<Stripable>);
template<class T> void foreach_route (T *obj, void (T::*func)(Route&), bool sort = true);
template<class T> void foreach_route (T *obj, void (T::*func)(boost::shared_ptr<Route>), bool sort = true);

View File

@ -38,6 +38,7 @@ using std::string;
string PresentationInfo::state_node_name = X_("PresentationInfo");
PBD::Signal0<void> PresentationInfo::Change;
PBD::Signal0<void> PresentationInfo::SelectionChange;
namespace ARDOUR {
namespace Properties {

View File

@ -7004,3 +7004,55 @@ Session::auto_connect_thread_run ()
}
pthread_mutex_unlock (&_auto_connect_mutex);
}
void
Session::clear_stripable_selection ()
{
StripableList sl;
get_stripables (sl);
for (StripableList::iterator si = sl.begin(); si != sl.end(); ++si) {
(*si)->presentation_info().set_selected (false);
}
}
void
Session::toggle_stripable_selection (boost::shared_ptr<Stripable> s)
{
s->presentation_info().set_selected (!s->presentation_info().selected());
}
void
Session::add_stripable_selection (boost::shared_ptr<Stripable> s)
{
if (!s->presentation_info().selected ()) {
s->presentation_info().set_selected (true);
}
}
void
Session::set_stripable_selection (boost::shared_ptr<Stripable> s)
{
StripableList sl;
bool change = false;
get_stripables (sl);
for (StripableList::iterator si = sl.begin(); si != sl.end(); ++si) {
if ((*si)->presentation_info().selected()) {
change = true;
}
(*si)->presentation_info().set_selected (false);
}
if (!s->presentation_info().selected()) {
change = true;
s->presentation_info().set_selected (true);
}
if (change) {
// PresentationInfo::SelectionChange (); /* EMIT SIGNAL */
}
}