add slave,transport and event debugging traces
[ardour.git] / libs / ardour / ardour / types.h
index 1cc619424ecc5fdae92d69bcd4b8f86488f43828..75c4d20db4d5780debbe4b258ad3cba5dd90554c 100644 (file)
 #include "control_protocol/timecode.h"
 #include "pbd/id.h"
 
+#include "ardour/bbt_time.h"
+
 #include <map>
 
 #if __GNUC__ < 3
-
 typedef int intptr_t;
 #endif
 
-/* eventually, we'd like everything (including JACK) to
-   move to this. for now, its a dedicated type.
-*/
-
-typedef int64_t                    nframes64_t;
-
 namespace ARDOUR {
 
        class Source;
@@ -59,6 +54,8 @@ 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.
@@ -130,7 +127,8 @@ namespace ARDOUR {
        enum MeterPoint {
                MeterInput,
                MeterPreFader,
-               MeterPostFader
+               MeterPostFader,
+               MeterCustom
        };
 
        enum TrackMode {
@@ -156,34 +154,7 @@ namespace ARDOUR {
                TrackColor
        };
 
-       struct BBT_Time {
-               uint32_t bars;
-               uint32_t beats;
-               uint32_t ticks;
-
-               BBT_Time() {
-                       bars = 1;
-                       beats = 1;
-                       ticks = 0;
-               }
-
-               /* we can't define arithmetic operators for BBT_Time, because
-                  the results depend on a TempoMap, but we can define
-                  a useful check on the less-than condition.
-                  */
-
-               bool operator< (const BBT_Time& other) const {
-                       return bars < other.bars ||
-                               (bars == other.bars && beats < other.beats) ||
-                               (bars == other.bars && beats == other.beats && ticks < other.ticks);
-               }
-
-               bool operator== (const BBT_Time& other) const {
-                       return bars == other.bars && beats == other.beats && ticks == other.ticks;
-               }
-
-       };
-       enum SmpteFormat {
+       enum TimecodeFormat {
                timecode_23976,
                timecode_24,
                timecode_24976,
@@ -390,10 +361,9 @@ namespace ARDOUR {
                ExportContext
        };
 
-       enum SlaveSource {
-               None = 0,
-               MTC,
+       enum SyncSource {
                JACK,
+               MTC,
                MIDIClock
        };
 
@@ -453,8 +423,18 @@ namespace ARDOUR {
                Groove
        };
 
+       struct CleanupReport {
+               std::vector<std::string> paths;
+               int64_t                  space;
+       };
+
 } // namespace ARDOUR
 
+
+/* these cover types declared above in this header. See enums.cc
+   for the definitions.
+*/
+
 std::istream& operator>>(std::istream& o, ARDOUR::SampleFormat& sf);
 std::istream& operator>>(std::istream& o, ARDOUR::HeaderFormat& sf);
 std::istream& operator>>(std::istream& o, ARDOUR::AutoConnectOption& sf);
@@ -464,28 +444,48 @@ std::istream& operator>>(std::istream& o, ARDOUR::RemoteModel& sf);
 std::istream& operator>>(std::istream& o, ARDOUR::ListenPosition& sf);
 std::istream& operator>>(std::istream& o, ARDOUR::LayerModel& sf);
 std::istream& operator>>(std::istream& o, ARDOUR::CrossfadeModel& sf);
-std::istream& operator>>(std::istream& o, ARDOUR::SlaveSource& sf);
+std::istream& operator>>(std::istream& o, ARDOUR::SyncSource& sf);
 std::istream& operator>>(std::istream& o, ARDOUR::ShuttleBehaviour& sf);
 std::istream& operator>>(std::istream& o, ARDOUR::ShuttleUnits& sf);
-std::istream& operator>>(std::istream& o, ARDOUR::SmpteFormat& sf);
+std::istream& operator>>(std::istream& o, ARDOUR::TimecodeFormat& sf);
 std::istream& operator>>(std::istream& o, ARDOUR::DenormalModel& sf);
 std::istream& operator>>(std::istream& o, ARDOUR::WaveformScale& sf);
 std::istream& operator>>(std::istream& o, ARDOUR::WaveformShape& sf);
 
-using ARDOUR::nframes_t;
-
-static inline nframes_t
-session_frame_to_track_frame (nframes_t session_frame, double speed)
+std::ostream& operator<<(std::ostream& o, const ARDOUR::SampleFormat& sf);
+std::ostream& operator<<(std::ostream& o, const ARDOUR::HeaderFormat& sf);
+std::ostream& operator<<(std::ostream& o, const ARDOUR::AutoConnectOption& sf);
+std::ostream& operator<<(std::ostream& o, const ARDOUR::EditMode& sf);
+std::ostream& operator<<(std::ostream& o, const ARDOUR::MonitorModel& sf);
+std::ostream& operator<<(std::ostream& o, const ARDOUR::RemoteModel& sf);
+std::ostream& operator<<(std::ostream& o, const ARDOUR::ListenPosition& sf);
+std::ostream& operator<<(std::ostream& o, const ARDOUR::LayerModel& sf);
+std::ostream& operator<<(std::ostream& o, const ARDOUR::CrossfadeModel& sf);
+std::ostream& operator<<(std::ostream& o, const ARDOUR::SyncSource& sf);
+std::ostream& operator<<(std::ostream& o, const ARDOUR::ShuttleBehaviour& sf);
+std::ostream& operator<<(std::ostream& o, const ARDOUR::ShuttleUnits& sf);
+std::ostream& operator<<(std::ostream& o, const ARDOUR::TimecodeFormat& sf);
+std::ostream& operator<<(std::ostream& o, const ARDOUR::DenormalModel& sf);
+std::ostream& operator<<(std::ostream& o, const ARDOUR::WaveformScale& sf);
+std::ostream& operator<<(std::ostream& o, const ARDOUR::WaveformShape& sf);
+
+static inline ARDOUR::nframes64_t
+session_frame_to_track_frame (ARDOUR::nframes64_t session_frame, double speed)
 {
-       return (nframes_t)( (double)session_frame * speed );
+       return (ARDOUR::nframes64_t)( (double)session_frame * speed );
 }
 
-static inline nframes_t
-track_frame_to_session_frame (nframes_t track_frame, double speed)
+static inline ARDOUR::nframes64_t
+track_frame_to_session_frame (ARDOUR::nframes64_t track_frame, double speed)
 {
-       return (nframes_t)( (double)track_frame / speed );
+       return (ARDOUR::nframes64_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;
+
 
 #endif /* __ardour_types_h__ */