substantial part of infrastructure required for track/bus duplication
[ardour.git] / libs / ardour / ardour / types.h
index 8d7fb125a186bc4ee304f3267e476bf58ef83f58..1a17c01f86c0ecb51cf23f918ba17788086db7af 100644 (file)
@@ -140,6 +140,8 @@ namespace ARDOUR {
                EnvelopeAutomation,
                RecEnableAutomation,
                TrimAutomation,
+               PhaseAutomation,
+               SendAutomation,
        };
 
        enum AutoState {
@@ -192,7 +194,8 @@ namespace ARDOUR {
                MeterIEC2EBU   = 0x0200,
                MeterVU        = 0x0400,
                MeterK12       = 0x0800,
-               MeterPeak0dB   = 0x1000
+               MeterPeak0dB   = 0x1000,
+               MeterMCP       = 0x2000
        };
 
        enum TrackMode {
@@ -456,7 +459,7 @@ namespace ARDOUR {
                AutoConnectPhysical = 0x1,
                AutoConnectMaster = 0x2
        };
-        
+
     enum TracksAutoNamingRule {
         UseDefaultNames = 0x1,
         NameAfterDriver = 0x2
@@ -484,7 +487,9 @@ namespace ARDOUR {
                CAF,
                AIFF,
                iXML,
-               RF64
+               RF64,
+               RF64_WAV,
+               MBWF,
        };
 
        struct PeakData {
@@ -607,8 +612,8 @@ namespace ARDOUR {
                   this equality cannot be assumed.
                */
                TransportStopped = 0,
-               TransportRolling = 1, 
-               TransportLooping = 2, 
+               TransportRolling = 1,
+               TransportLooping = 2,
                TransportStarting = 3,
        };
 
@@ -616,7 +621,7 @@ namespace ARDOUR {
                /* these values happen to match the constants used by JACK but
                   this equality cannot be assumed.
                */
-               IsInput = 0x1, 
+               IsInput = 0x1,
                IsOutput = 0x2,
                IsPhysical = 0x4,
                CanMonitor = 0x8,
@@ -635,6 +640,19 @@ namespace ARDOUR {
                Custom,
        };
 
+       enum AutoReturnTarget {
+               LastLocate = 0x1,
+               RangeSelectionStart = 0x2,
+               Loop = 0x4,
+               RegionSelectionStart = 0x8,
+       };
+
+       enum PlaylistDisposition {
+               CopyPlaylist,
+               NewPlaylist,
+               SharePlaylist
+       };
+
 } // namespace ARDOUR
 
 
@@ -662,6 +680,8 @@ std::istream& operator>>(std::istream& o, ARDOUR::PositionLockStyle& sf);
 std::istream& operator>>(std::istream& o, ARDOUR::FadeShape& sf);
 std::istream& operator>>(std::istream& o, ARDOUR::RegionSelectionAfterSplit& sf);
 std::istream& operator>>(std::istream& o, ARDOUR::BufferingPreset& var);
+std::istream& operator>>(std::istream& o, ARDOUR::AutoReturnTarget& sf);
+std::istream& operator>>(std::istream& o, ARDOUR::MeterType& sf);
 
 std::ostream& operator<<(std::ostream& o, const ARDOUR::SampleFormat& sf);
 std::ostream& operator<<(std::ostream& o, const ARDOUR::HeaderFormat& sf);
@@ -684,7 +704,8 @@ std::ostream& operator<<(std::ostream& o, const ARDOUR::PositionLockStyle& sf);
 std::ostream& operator<<(std::ostream& o, const ARDOUR::FadeShape& sf);
 std::ostream& operator<<(std::ostream& o, const ARDOUR::RegionSelectionAfterSplit& sf);
 std::ostream& operator<<(std::ostream& o, const ARDOUR::BufferingPreset& var);
-
+std::ostream& operator<<(std::ostream& o, const ARDOUR::AutoReturnTarget& sf);
+std::ostream& operator<<(std::ostream& o, const ARDOUR::MeterType& sf);
 
 /* because these operators work on types which can be used when making
    a UI_CONFIG_VARIABLE (in gtk2_ardour) we need them to be exported.
@@ -703,13 +724,30 @@ LIBARDOUR_API std::ostream& operator<<(std::ostream& o, const ARDOUR::MeterLineU
 static inline ARDOUR::framepos_t
 session_frame_to_track_frame (ARDOUR::framepos_t session_frame, double speed)
 {
-       return (ARDOUR::framepos_t) ((long double) session_frame * (long double) speed);
+       long double result = (long double) session_frame * (long double) speed;
+
+       if (result >= (long double) ARDOUR::max_framepos) {
+               return ARDOUR::max_framepos;
+       } else if (result <= (long double) (ARDOUR::max_framepos) * (ARDOUR::framepos_t)(-1)) {
+               return (ARDOUR::max_framepos * (ARDOUR::framepos_t)(-1));
+       } else {
+               return result;
+       }
 }
 
 static inline ARDOUR::framepos_t
 track_frame_to_session_frame (ARDOUR::framepos_t track_frame, double speed)
 {
-       return (ARDOUR::framepos_t) ((long double) track_frame / (long double) speed);
+       /* NB - do we need a check for speed == 0 ??? */
+       long double result = (long double) track_frame / (long double) speed;
+
+       if (result >= (long double) ARDOUR::max_framepos) {
+               return ARDOUR::max_framepos;
+       } else if (result <= (long double) (ARDOUR::max_framepos) * (ARDOUR::framepos_t)(-1)) {
+               return (ARDOUR::max_framepos * (ARDOUR::framepos_t)(-1));
+       } else {
+               return result;
+       }
 }
 
 /* for now, break the rules and use "using" to make this "global" */