add ::length() method to Evoral::ControlList
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 25 May 2012 19:59:11 +0000 (19:59 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 25 May 2012 19:59:11 +0000 (19:59 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@12451 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/evoral/evoral/ControlList.hpp

index f7eba87ba6413c10d87ea269641a99e54fa35e4f..40e2e5462506160dd43ba7ea0451123cff541213 100644 (file)
@@ -106,6 +106,10 @@ public:
        void             set_parameter(const Parameter& p) { _parameter = p; }
 
        EventList::size_type size() const { return _events.size(); }
+        double length() const {                
+               Glib::Mutex::Lock lm (_lock);
+               return _events.empty() ? 0.0 : _events.back()->when;
+       }
        bool empty() const { return _events.empty(); }
 
        void reset_default (double val) {