position+width panning improvements (reverse width now works); relabel pan automation...
[ardour.git] / libs / ardour / ardour / types.h
index 435cf8d4167888f0117bc8e3a3f0578699ff670c..d452cd6b541e2cc8fcc77a9f3b7d1391fc6e09ad 100644 (file)
 #ifndef __ardour_types_h__
 #define __ardour_types_h__
 
-#ifndef __STDC_FORMAT_MACROS
-#define __STDC_FORMAT_MACROS /* PRI<foo>; C++ requires explicit requesting of these */
-#endif
-
 #include <istream>
 #include <vector>
 #include <boost/shared_ptr.hpp>
 #include <sys/types.h>
+#include <stdint.h>
 
 #include <inttypes.h>
 #include <jack/types.h>
@@ -56,21 +53,25 @@ namespace ARDOUR {
        typedef uint32_t                    layer_t;
        typedef uint64_t                    microseconds_t;
        typedef uint32_t                    nframes_t;
-       typedef int64_t                     nframes64_t;
-
 
-       /** "Session frames", frames relative to the session timeline.
-        * Everything related to transport position etc. should be of this type.
-        * We might want to make this a compile time option for 32-bitters who
-        * don't want to pay for extremely long session times they don't need...
-        */
-       typedef int64_t sframes_t;
+        /* Any position measured in audio frames.
+           Assumed to be non-negative but not enforced.
+         */
        typedef int64_t framepos_t;
-       /* any offset from a framepos_t, measured in audio frames */
+
+        /* Any distance from a given framepos_t.
+           Maybe positive or negative.
+        */
        typedef int64_t frameoffset_t;
-       /* any count of audio frames */
+
+       /* Any count of audio frames. 
+           Assumed to be positive but not enforced.
+        */
        typedef int64_t framecnt_t;
 
+        static const framepos_t max_framepos = INT64_MAX;
+        static const framecnt_t max_framecnt = INT64_MAX;
+
        struct IOChange {
 
                enum Type {
@@ -428,7 +429,7 @@ namespace ARDOUR {
                int   opts; // really RubberBandStretcher::Options
        };
 
-       typedef std::list<nframes64_t> AnalysisFeatureList;
+       typedef std::list<framepos_t> AnalysisFeatureList;
 
        typedef std::list<boost::shared_ptr<Route> >      RouteList;
 
@@ -494,6 +495,14 @@ namespace ARDOUR {
             uint32_t requested_physical_out; /* now many of the available physical inputs to consider usable */
         };
 
+       enum FadeShape {
+               FadeLinear,
+               FadeFast,
+               FadeSlow,
+               FadeLogA,
+               FadeLogB
+       };
+
 } // namespace ARDOUR
 
 
@@ -539,22 +548,22 @@ std::ostream& operator<<(std::ostream& o, const ARDOUR::WaveformScale& sf);
 std::ostream& operator<<(std::ostream& o, const ARDOUR::WaveformShape& sf);
 std::ostream& operator<<(std::ostream& o, const ARDOUR::PositionLockStyle& sf);
 
-static inline ARDOUR::nframes64_t
-session_frame_to_track_frame (ARDOUR::nframes64_t session_frame, double speed)
+static inline ARDOUR::framepos_t
+session_frame_to_track_frame (ARDOUR::framepos_t session_frame, double speed)
 {
-       return (ARDOUR::nframes64_t)( (double)session_frame * speed );
+       return (ARDOUR::framepos_t)( (double)session_frame * speed );
 }
 
-static inline ARDOUR::nframes64_t
-track_frame_to_session_frame (ARDOUR::nframes64_t track_frame, double speed)
+static inline ARDOUR::framepos_t
+track_frame_to_session_frame (ARDOUR::framepos_t track_frame, double speed)
 {
-       return (ARDOUR::nframes64_t)( (double)track_frame / speed );
+       return (ARDOUR::framepos_t)( (double)track_frame / speed );
 }
 
 /* for now, break the rules and use "using" to make these "global" */
 
 using ARDOUR::nframes_t;
-using ARDOUR::nframes64_t;
+using ARDOUR::framepos_t;
 
 
 #endif /* __ardour_types_h__ */