Use PBD::copy_file in Session::create() to copy the template file.
[ardour.git] / libs / ardour / ardour / session.h
index 2022b21a05196309cb92919975218a1661c890cd..35f4d32372b6bc80073cb02eda796b5a0e3280a0 100644 (file)
@@ -240,9 +240,6 @@ class Session : public PBD::StatefulDestructible
        
        virtual ~Session ();
 
-
-       static int find_session (string str, string& path, string& snapshot, bool& isnew);
-       
        string path() const { return _path; }
        string name() const { return _name; }
        string snap_name() const { return _current_snapshot_name; }
@@ -336,6 +333,8 @@ class Session : public PBD::StatefulDestructible
        void disable_record (bool rt_context, bool force = false);
        void step_back_from_record ();
        
+       void maybe_write_autosave ();
+
        /* Proxy signal for region hidden changes */
 
        sigc::signal<void,boost::shared_ptr<Region> > RegionHiddenChange;
@@ -371,6 +370,7 @@ class Session : public PBD::StatefulDestructible
        void set_session_start (nframes_t start) { start_location->set_start(start); }
        void set_session_end (nframes_t end) { end_location->set_start(end); _end_location_is_free = false; }
        void use_rf_shuttle_speed ();
+       void allow_auto_play (bool yn);
        void request_transport_speed (float speed);
        void request_overwrite_buffer (Diskstream*);
        void request_diskstream_speed (Diskstream&, float speed);
@@ -424,6 +424,8 @@ class Session : public PBD::StatefulDestructible
        int save_template (string template_name);
         int save_history (string snapshot_name = "");
         int restore_history (string snapshot_name);
+       void remove_state (string snapshot_name);
+       void rename_state (string old_name, string new_name);
 
        static int rename_template (string old_name, string new_name);
 
@@ -757,6 +759,9 @@ class Session : public PBD::StatefulDestructible
 
        /* History (for editors, mixers, UIs etc.) */
 
+       /** Undo some transactions.
+        * @param n Number of transactions to undo.
+        */
        void undo (uint32_t n) {
                _history.undo (n);
        }
@@ -899,12 +904,6 @@ class Session : public PBD::StatefulDestructible
        static int read_favorite_dirs (FavoriteDirs&);
 
        static int write_favorite_dirs (FavoriteDirs&);
-       
-       /* file suffixes */
-
-       static const char* template_suffix() { return _template_suffix; }
-       static const char* statefile_suffix() { return _statefile_suffix; }
-       static const char* pending_suffix() { return _pending_suffix; }
 
        /* buffers for gain and pan */
 
@@ -927,18 +926,6 @@ class Session : public PBD::StatefulDestructible
                                  void* ptr,
                                  float opt);
 
-       typedef float (*compute_peak_t)                 (Sample *, nframes_t, float);
-       typedef void  (*find_peaks_t)                   (Sample *, nframes_t, float *, float*);
-       typedef void  (*apply_gain_to_buffer_t)         (Sample *, nframes_t, float);
-       typedef void  (*mix_buffers_with_gain_t)        (Sample *, Sample *, nframes_t, float);
-       typedef void  (*mix_buffers_no_gain_t)          (Sample *, Sample *, nframes_t);
-
-       static compute_peak_t           compute_peak;
-       static find_peaks_t             find_peaks;
-       static apply_gain_to_buffer_t   apply_gain_to_buffer;
-       static mix_buffers_with_gain_t  mix_buffers_with_gain;
-       static mix_buffers_no_gain_t    mix_buffers_no_gain;
-
        static sigc::signal<void> SendFeedback;
 
        /* Controllables */
@@ -969,10 +956,6 @@ class Session : public PBD::StatefulDestructible
 
        nframes_t compute_initial_length ();
 
-       static const char* _template_suffix;
-       static const char* _statefile_suffix;
-       static const char* _pending_suffix;
-
        enum SubState {
                PendingDeclickIn   = 0x1,
                PendingDeclickOut  = 0x2,
@@ -990,6 +973,7 @@ class Session : public PBD::StatefulDestructible
 
        AudioEngine            &_engine;
        mutable gint            processing_prohibited;
+       /// the function called when the main JACK process callback happens
        process_function_type    process_function;
        process_function_type    last_process_function;
        bool                     waiting_for_sync_offset;
@@ -1004,6 +988,7 @@ class Session : public PBD::StatefulDestructible
        volatile float          _transport_speed;
        volatile float          _desired_transport_speed;
        float                   _last_transport_speed;
+       bool                     auto_play_legal;
        nframes_t          _last_slave_transport_frame;
        nframes_t           maximum_output_latency;
        nframes_t           last_stop_frame;
@@ -1325,13 +1310,13 @@ class Session : public PBD::StatefulDestructible
        /* cache the most-recently requested time conversions. This helps when we
         * have multiple clocks showing the same time (e.g. the transport frame) */
        bool           last_smpte_valid;
-       jack_nframes_t last_smpte_when;
+       nframes_t last_smpte_when;
        SMPTE::Time    last_smpte;
        
        bool _send_smpte_update; ///< Flag to send a full frame (SMPTE) MTC message this cycle
 
-       int send_full_time_code(jack_nframes_t nframes);
-       int send_midi_time_code_for_cycle(jack_nframes_t nframes);
+       int send_full_time_code(nframes_t nframes);
+       int send_midi_time_code_for_cycle(nframes_t nframes);
 
        nframes_t adjust_apparent_position (nframes_t frames);
        
@@ -1610,6 +1595,7 @@ class Session : public PBD::StatefulDestructible
 
        void jack_timebase_callback (jack_transport_state_t, nframes_t, jack_position_t*, int);
        int  jack_sync_callback (jack_transport_state_t, jack_position_t*);
+       void reset_jack_connection (jack_client_t* jack);
        void record_enable_change_all (bool yn);
 
        XMLNode& state(bool);