most of libardour now actually compiles
[ardour.git] / libs / ardour / ardour / session.h
index 9b25f29c8f3b2d504f04bc78ae9516d6d5c7f125..a782680082ac5f800807d5dfe630eac392fb7f84 100644 (file)
@@ -48,6 +48,7 @@
 #include "midi++/types.h"
 
 #include "timecode/time.h"
+#include "ltc/ltc.h"
 
 #include "ardour/ardour.h"
 #include "ardour/chan_count.h"
@@ -64,9 +65,6 @@
 #include <jack/session.h>
 #endif
 
-#ifdef HAVE_LTC
-#include <ltc.h>
-#endif
 
 class XMLTree;
 class XMLNode;
@@ -197,7 +195,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        std::string new_audio_source_name (const std::string&, uint32_t nchans, uint32_t chan, bool destructive);
        std::string new_midi_source_name (const std::string&);
        std::string new_source_path_from_name (DataType type, const std::string&);
-       RouteList new_route_from_template (uint32_t how_many, const std::string& template_path);
+        RouteList new_route_from_template (uint32_t how_many, const std::string& template_path, const std::string& name);
 
        void process (pframes_t nframes);
 
@@ -394,9 +392,12 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        void rename_state (std::string old_name, std::string new_name);
        void remove_pending_capture_state ();
        int rename (const std::string&);
+       bool get_nsm_state () const { return _under_nsm_control; }
+       void set_nsm_state (bool state) { _under_nsm_control = state; }
 
        PBD::Signal1<void,std::string> StateSaved;
        PBD::Signal0<void> StateReady;
+       PBD::Signal0<void> SaveSession;
 
        std::vector<std::string*>* possible_states() const;
        static std::vector<std::string*>* possible_states (std::string path);
@@ -734,6 +735,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        void request_play_range (std::list<AudioRange>*, bool leave_rolling = false);
        bool get_play_range () const { return _play_range; }
 
+       void maybe_update_session_range (framepos_t, framepos_t);
+
        /* buffers for gain and pan */
 
        gain_t* gain_automation_buffer () const;
@@ -847,6 +850,11 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        /** Emitted when the session wants Ardour to quit */
        static PBD::Signal0<void> Quit;
 
+        /** Emitted when Ardour is asked to load a session in an older session
+        * format, and makes a backup copy.
+        */
+        static PBD::Signal2<void,std::string,std::string> VersionMismatch;
+
         boost::shared_ptr<Port> ltc_input_port() const;
         boost::shared_ptr<Port> ltc_output_port() const;
 
@@ -897,8 +905,6 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        Slave*                  _slave;
        bool                    _silent;
 
-       void maybe_update_session_range (framepos_t, framepos_t);
-
        // varispeed playback
        double                  _transport_speed;
        double                  _default_transport_speed;
@@ -922,6 +928,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        uint32_t                _solo_isolated_cnt;
        bool                    _writable;
        bool                    _was_seamless;
+       bool                    _under_nsm_control;
 
        void initialize_latencies ();
        void set_worst_io_latencies ();
@@ -941,7 +948,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        void process_without_events (pframes_t);
        void process_with_events    (pframes_t);
        void process_audition       (pframes_t);
-       void process_export         (pframes_t);
+        int  process_export         (pframes_t);
        int  process_export_fw      (pframes_t);
 
        void block_processing() { g_atomic_int_set (&processing_prohibited, 1); }
@@ -983,6 +990,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        int  pre_export ();
        int  stop_audio_export ();
        void finalize_audio_export ();
+       void finalize_export_internal (bool stop_freewheel);
        bool _pre_export_mmc_enabled;
 
        PBD::ScopedConnection export_freewheel_connection;
@@ -1170,7 +1178,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        MIDI::byte mtc_msg[16];
        MIDI::byte mtc_timecode_bits;   /* encoding of SMTPE type for MTC */
        MIDI::byte midi_msg[16];
-       framepos_t outbound_mtc_timecode_frame;
+       double outbound_mtc_timecode_frame;
        Timecode::Time transmitting_timecode_time;
        int next_quarter_frame_to_send;
 
@@ -1188,7 +1196,6 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
 
        int send_midi_time_code_for_cycle (framepos_t, framepos_t, pframes_t nframes);
 
-#ifdef HAVE_LTC
        LTCEncoder*       ltc_encoder;
        ltcsnd_sample_t*  ltc_enc_buf;
 
@@ -1206,7 +1213,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        framepos_t        ltc_timecode_offset;
        bool              ltc_timecode_negative_offset;
 
-       jack_latency_range_t ltc_out_latency;
+       LatencyRange      ltc_out_latency;
 
        void ltc_tx_initialize();
        void ltc_tx_cleanup();
@@ -1215,7 +1222,6 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        void ltc_tx_recalculate_position();
        void ltc_tx_parse_offset();
        void ltc_tx_send_time_code_for_cycle (framepos_t, framepos_t, double, double, pframes_t nframes);
-#endif
 
        void reset_record_status ();
 
@@ -1269,6 +1275,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
        SerializedRCUManager<RouteList>  routes;
 
        void add_routes (RouteList&, bool input_auto_connect, bool output_auto_connect, bool save);
+        void add_routes_inner (RouteList&, bool input_auto_connect, bool output_auto_connect);
+        bool _adding_routes_in_progress;
        uint32_t destructive_index;
 
        boost::shared_ptr<Route> XMLRouteFactory (const XMLNode&, int);