Remove ambiguity of Gtk and Windows API
[ardour.git] / libs / ardour / region.cc
index 37244c0634bb9f01a0e7ff3da03984a49ccaaf98..d4afb7d9c404729690d98021ac89f22c10d6f4a1 100644 (file)
@@ -183,6 +183,7 @@ Region::register_properties ()
        , _transient_user_start (0) \
        , _transient_analysis_start (0) \
        , _transient_analysis_end (0) \
+       , _soloSelected (false) \
        , _muted (Properties::muted, false) \
        , _opaque (Properties::opaque, true) \
        , _locked (Properties::locked, false) \
@@ -216,6 +217,7 @@ Region::register_properties ()
        , _transients (other->_transients) \
        , _transient_analysis_start (other->_transient_analysis_start) \
        , _transient_analysis_end (other->_transient_analysis_end) \
+       , _soloSelected (false) \
        , _muted (Properties::muted, other->_muted)             \
        , _opaque (Properties::opaque, other->_opaque)          \
        , _locked (Properties::locked, other->_locked)          \
@@ -438,6 +440,25 @@ Region::set_name (const std::string& str)
        return true;
 }
 
+void
+Region::set_selected_for_solo(bool yn)
+{
+       if (_soloSelected != yn) {
+
+               boost::shared_ptr<Playlist> pl (playlist());
+               if (pl){
+                       if (yn) {
+                               pl->AddToSoloSelectedList(this);
+                       } else {
+                               pl->RemoveFromSoloSelectedList(this);
+                       }
+               }
+
+               _soloSelected = yn;
+       }
+       
+}
+
 void
 Region::set_length (samplecnt_t len, const int32_t sub_num)
 {
@@ -1457,7 +1478,14 @@ Region::overlap_equivalent (boost::shared_ptr<const Region> other) const
 }
 
 bool
-Region::equivalent (boost::shared_ptr<const Region> other) const
+Region::enclosed_equivalent (boost::shared_ptr<const Region> other) const
+{
+       return (first_sample() >= other->first_sample() && last_sample() <= other->last_sample()) ||
+              (first_sample() <= other->first_sample() && last_sample() >= other->last_sample()) ;
+}
+
+bool
+Region::exact_equivalent (boost::shared_ptr<const Region> other) const
 {
        return _start == other->_start &&
                _position == other->_position &&
@@ -1791,7 +1819,7 @@ Region::transients (AnalysisFeatureList& afl)
        if (!_user_transients.empty ()) {
                ++cnt;
        }
-       if (cnt > 1 ) {
+       if (cnt > 1) {
                afl.sort ();
                // remove exact duplicates
                TransientDetector::cleanup_transients (afl, _session.sample_rate(), 0);