new tempo handling from drmoore; don't follow playhead when doing requested_return...
[ardour.git] / libs / ardour / ardour / session.h
index 2dde901708660051b1704c966cdee10ddf3bab78..8aea4929105ed65452da92126a3c8c5bcc72c4cc 100644 (file)
@@ -125,6 +125,7 @@ class Session : public PBD::StatefulDestructible
                    SetDiskstreamSpeed,
                    Locate,
                    LocateRoll,
+                   LocateRollLocate,
                    SetLoop,
                    PunchIn,
                    PunchOut,
@@ -210,9 +211,9 @@ class Session : public PBD::StatefulDestructible
        /* creating from an XML file */
 
        Session (AudioEngine&,
-                string fullpath,
-                string snapshot_name,
-                string* mix_template = 0);
+                const string& fullpath,
+                const string& snapshot_name,
+                string mix_template = "");
 
        /* creating a new Session */
 
@@ -252,7 +253,7 @@ class Session : public PBD::StatefulDestructible
        std::string dead_sound_dir () const;
        std::string automation_dir () const;
 
-       string peak_path_from_audio_path (string) const;
+       Glib::ustring peak_path (Glib::ustring) const;
 
        static string suffixed_search_path (std::string suffix, bool data);
        static string control_protocol_path ();
@@ -347,7 +348,7 @@ class Session : public PBD::StatefulDestructible
 
        sigc::signal<void,RouteList&> RouteAdded;
 
-       void request_roll ();
+       void request_roll_at_and_return (nframes_t start, nframes_t return_to);
        void request_bounded_roll (nframes_t start, nframes_t end);
        void request_stop (bool abort = false);
        void request_locate (nframes_t frame, bool with_roll = false);
@@ -493,6 +494,7 @@ class Session : public PBD::StatefulDestructible
 
        nframes_t transport_frame () const {return _transport_frame; }
        nframes_t audible_frame () const;
+       nframes64_t requested_return_frame() const { return _requested_return_frame; }
 
        enum PullupFormat {
                pullup_Plus4Plus1,
@@ -537,6 +539,9 @@ class Session : public PBD::StatefulDestructible
        bool        transport_stopped() const { return _transport_speed == 0.0f; }
        bool        transport_rolling() const { return _transport_speed != 0.0f; }
 
+       void set_silent (bool yn);
+       bool silent () { return _silent; }
+
        int jack_slave_sync (nframes_t);
 
        TempoMap& tempo_map() { return *_tempo_map; }
@@ -564,6 +569,7 @@ class Session : public PBD::StatefulDestructible
            
            /* control info */
            bool sample_convert;
+           SrcQuality quality;
            volatile bool freeze;
            std::vector<Glib::ustring> paths;
            
@@ -844,21 +850,6 @@ class Session : public PBD::StatefulDestructible
 
        boost::shared_ptr<IO>  click_io() { return _click_io; }
                
-       /* tempo FX */
-
-       struct TimeStretchRequest {
-           boost::shared_ptr<ARDOUR::AudioRegion> region;
-           float                fraction; /* session: read ; GUI: write */
-           float                progress; /* session: write ; GUI: read */
-           bool                 running;  /* read/write */
-           bool                 quick_seek; /* GUI: write */
-           bool                 antialias;  /* GUI: write */
-
-           TimeStretchRequest () {} 
-       };
-
-       boost::shared_ptr<AudioRegion> tempoize_region (TimeStretchRequest&);
-
        /* disk, buffer loads */
 
        uint32_t playback_load ();
@@ -951,7 +942,7 @@ class Session : public PBD::StatefulDestructible
        void update_latency_compensation (bool, bool);
        
   private:
-       int  create (bool& new_session, string* mix_template, nframes_t initial_length);
+       int  create (bool& new_session, const string& mix_template, nframes_t initial_length);
        void destroy ();
 
        nframes_t compute_initial_length ();
@@ -975,33 +966,35 @@ class Session : public PBD::StatefulDestructible
 
        typedef void (Session::*process_function_type)(nframes_t);
 
-       AudioEngine            &_engine;
-       mutable gint            processing_prohibited;
+       AudioEngine&            _engine;
+       mutable gint             processing_prohibited;
        process_function_type    process_function;
        process_function_type    last_process_function;
        bool                     waiting_for_sync_offset;
-       nframes_t          _base_frame_rate;
-       nframes_t          _current_frame_rate;  //this includes video pullup offset
+       nframes_t               _base_frame_rate;
+       nframes_t               _current_frame_rate;  //this includes video pullup offset
        int                      transport_sub_state;
-       mutable gint           _record_status;
-       nframes_t          _transport_frame;
+       mutable gint            _record_status;
+       volatile nframes_t      _transport_frame;
        Location*                end_location;
        Location*                start_location;
-       Slave                  *_slave;
+       Slave*                  _slave;
+       bool                    _silent;
        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;
+       nframes_t               _last_slave_transport_frame;
+       nframes_t                maximum_output_latency;
+       nframes_t                last_stop_frame;
+       volatile nframes64_t    _requested_return_frame;
        vector<Sample *>        _passthru_buffers;
        vector<Sample *>        _silent_buffers;
        vector<Sample *>        _send_buffers;
-       nframes_t           current_block_size;
-       nframes_t          _worst_output_latency;
-       nframes_t          _worst_input_latency;
-       nframes_t          _worst_track_latency;
+       nframes_t                current_block_size;
+       nframes_t               _worst_output_latency;
+       nframes_t               _worst_input_latency;
+       nframes_t               _worst_track_latency;
        bool                    _have_captured;
        float                   _meter_hold;
        float                   _meter_falloff;
@@ -1695,8 +1688,8 @@ class Session : public PBD::StatefulDestructible
           based on max (requested,available)
        */
 
-       uint32_t n_physical_outputs;
-       uint32_t n_physical_inputs;
+       uint32_t n_physical_audio_outputs;
+       uint32_t n_physical_audio_inputs;
 
        int find_all_sources (std::string path, std::set<std::string>& result);
        int find_all_sources_across_snapshots (std::set<std::string>& result, bool exclude_this_snapshot);