Wrap MusicalTime in a class.
[ardour.git] / libs / evoral / evoral / Sequence.hpp
index dbc04d619b206ed9afc73838a0e22d19254481d0..e40c4da925f7c3ce23db3081f496de17d4c9738d 100644 (file)
@@ -26,6 +26,8 @@
 #include <utility>
 #include <boost/shared_ptr.hpp>
 #include <glibmm/threads.h>
+
+#include "evoral/visibility.h"
 #include "evoral/types.hpp"
 #include "evoral/Note.hpp"
 #include "evoral/Parameter.hpp"
@@ -42,7 +44,7 @@ template<typename Time> class Event;
 
 /** An iterator over (the x axis of) a 2-d double coordinate space.
  */
-class ControlIterator {
+class /*LIBEVORAL_API*/ ControlIterator {
 public:
        ControlIterator(boost::shared_ptr<const ControlList> al, double ax, double ay)
                : list(al)
@@ -60,7 +62,7 @@ public:
  * notes (instead of just unassociated note on/off events) and controller data.
  * Controller data is represented as a list of time-stamped float values. */
 template<typename Time>
-class Sequence : virtual public ControlSet {
+class LIBEVORAL_API Sequence : virtual public ControlSet {
 public:
        Sequence(const TypeMap& type_map);
        Sequence(const Sequence<Time>& other);
@@ -103,7 +105,7 @@ public:
                ResolveStuckNotes
        };
 
-       void end_write (StuckNoteOption, Time when = 0);
+       void end_write (StuckNoteOption, Time when = Time());
 
        void append(const Event<Time>& ev, Evoral::event_id_t evid);
 
@@ -125,7 +127,7 @@ public:
        struct EarlierNoteComparator {
                inline bool operator()(const boost::shared_ptr< const Note<Time> > a,
                                       const boost::shared_ptr< const Note<Time> > b) const {
-                       return musical_time_less_than (a->time(), b->time());
+                       return a->time() < b->time();
                }
        };
 
@@ -133,7 +135,6 @@ public:
                typedef const Note<Time>* value_type;
                inline bool operator()(const boost::shared_ptr< const Note<Time> > a,
                                       const boost::shared_ptr< const Note<Time> > b) const {
-                       return musical_time_greater_than (a->time(), b->time());
                        return a->time() > b->time();
                }
        };
@@ -142,7 +143,7 @@ public:
                typedef const Note<Time>* value_type;
                inline bool operator()(const boost::shared_ptr< const Note<Time> > a,
                                       const boost::shared_ptr< const Note<Time> > b) const {
-                       return musical_time_greater_than (a->end_time(), b->end_time());
+                       return a->end_time() > b->end_time();
                }
        };
 
@@ -186,7 +187,7 @@ public:
 
        struct EarlierSysExComparator {
                inline bool operator() (constSysExPtr a, constSysExPtr b) const {
-                       return musical_time_less_than (a->time(), b->time());
+                       return a->time() < b->time();
                }
        };
 
@@ -199,7 +200,7 @@ public:
 
        struct EarlierPatchChangeComparator {
                inline bool operator() (constPatchChangePtr a, constPatchChangePtr b) const {
-                       return musical_time_less_than (a->time(), b->time());
+                       return a->time() < b->time();
                }
        };
 
@@ -214,7 +215,7 @@ private:
 public:
 
        /** Read iterator */
-       class const_iterator {
+       class LIBEVORAL_API /* Added by JE - */ const_iterator {
        public:
                const_iterator();
                const_iterator(const Sequence<Time>& seq, Time t, bool, std::set<Evoral::Parameter> const &);
@@ -261,7 +262,7 @@ public:
        };
 
        const_iterator begin (
-               Time t = 0,
+               Time t = Time(),
                bool force_discrete = false,
                std::set<Evoral::Parameter> const & f = std::set<Evoral::Parameter> ()) const {
                return const_iterator (*this, t, force_discrete, f);
@@ -360,7 +361,8 @@ private:
 
 } // namespace Evoral
 
-template<typename Time> std::ostream& operator<<(std::ostream& o, const Evoral::Sequence<Time>& s) { s.dump (o); return o; }
+template<typename Time> /*LIBEVORAL_API*/ std::ostream& operator<<(std::ostream& o, const Evoral::Sequence<Time>& s) { s.dump (o); return o; }
+
 
 #endif // EVORAL_SEQUENCE_HPP