Fix vari-speed and non-locked slave modes
[ardour.git] / libs / ardour / ardour / session.h
index 49ee8cbb7d0fac7565e65bbef87b993ac744b9ba..0ade34a0e709e1a76d58ec14695299208a3983cb 100644 (file)
@@ -199,7 +199,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
 
        virtual ~Session ();
 
-       static int get_info_from_path (const std::string& xmlpath, float& sample_rate, SampleFormat& data_format);
+       static int get_info_from_path (const std::string& xmlpath, float& sample_rate, SampleFormat& data_format, std::string& program_version);
        static std::string get_snapshot_from_instant (const std::string& session_dir);
 
        /** a monotonic counter used for naming user-visible things uniquely
@@ -655,7 +655,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
                );
 
        std::list<boost::shared_ptr<MidiTrack> > new_midi_track (
-               const ChanCount& input, const ChanCount& output,
+               const ChanCount& input, const ChanCount& output, bool strict_io,
                boost::shared_ptr<PluginInfo> instrument,
                Plugin::PresetRecord* pset,
                RouteGroup* route_group, uint32_t how_many, std::string name_template,
@@ -664,7 +664,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
                );
 
        RouteList new_audio_route (int input_channels, int output_channels, RouteGroup* route_group, uint32_t how_many, std::string name_template, PresentationInfo::Flag, PresentationInfo::order_t);
-       RouteList new_midi_route (RouteGroup* route_group, uint32_t how_many, std::string name_template, boost::shared_ptr<PluginInfo> instrument, Plugin::PresetRecord*, PresentationInfo::Flag, PresentationInfo::order_t);
+       RouteList new_midi_route (RouteGroup* route_group, uint32_t how_many, std::string name_template, bool strict_io, boost::shared_ptr<PluginInfo> instrument, Plugin::PresetRecord*, PresentationInfo::Flag, PresentationInfo::order_t);
 
        void remove_routes (boost::shared_ptr<RouteList>);
        void remove_route (boost::shared_ptr<Route>);
@@ -681,7 +681,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
 
        framepos_t transport_frame () const {return _transport_frame; }
        framepos_t record_location () const {return _last_record_location; }
-       framepos_t audible_frame () const;
+       framepos_t audible_frame (bool* latent_locate = NULL) const;
        framepos_t requested_return_frame() const { return _requested_return_frame; }
        void set_requested_return_frame(framepos_t return_to);
 
@@ -720,9 +720,9 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
        bool   synced_to_mtc () const { return config.get_external_sync() && Config->get_sync_source() == MTC && g_atomic_int_get (const_cast<gint*>(&_mtc_active)); }
        bool   synced_to_ltc () const { return config.get_external_sync() && Config->get_sync_source() == LTC && g_atomic_int_get (const_cast<gint*>(&_ltc_active)); }
 
-       double transport_speed() const { return _transport_speed; }
+       double transport_speed() const { return _count_in_samples > 0 ? 0. : _transport_speed; }
        bool   transport_stopped() const { return _transport_speed == 0.0; }
-       bool   transport_rolling() const { return _transport_speed != 0.0; }
+       bool   transport_rolling() const { return _transport_speed != 0.0 && _count_in_samples == 0; }
 
        bool silent () { return _silent; }
 
@@ -823,6 +823,8 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
        uint32_t registered_lua_function_count () const { return _n_lua_scripts; }
        void scripts_changed (); // called from lua, updates _n_lua_scripts
 
+       PBD::Signal0<void> LuaScriptsChanged;
+
        /* flattening stuff */
 
        boost::shared_ptr<Region> write_one_track (Track&, framepos_t start, framepos_t end,
@@ -851,6 +853,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
 
        PBD::Signal1<void,bool> SoloActive;
        PBD::Signal0<void> SoloChanged;
+       PBD::Signal0<void> MuteChanged;
        PBD::Signal0<void> IsolatedChanged;
        PBD::Signal0<void> MonitorChanged;
 
@@ -998,9 +1001,17 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
 
        void maybe_update_session_range (framepos_t, framepos_t);
 
-       void request_preroll_record (framepos_t);
-       framepos_t preroll_record_in () const { return _preroll_record_in; }
-       bool preroll_record_enabled () const { return _preroll_record_in >= 0; }
+       /* preroll */
+       framecnt_t preroll_samples (framepos_t) const;
+
+       void request_preroll_record_punch (framepos_t start, framecnt_t preroll);
+       void request_preroll_record_trim (framepos_t start, framecnt_t preroll);
+       void request_count_in_record ();
+
+       framepos_t preroll_record_punch_pos () const { return _preroll_record_punch_pos; }
+       bool preroll_record_punch_enabled () const { return _preroll_record_punch_pos >= 0; }
+
+       framecnt_t preroll_record_trim_len () const { return _preroll_record_trim_len; }
 
        /* temporary hacks to allow selection to be pushed from GUI into backend.
           Whenever we move the selection object into libardour, these will go away.
@@ -1135,6 +1146,10 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
        */
        static PBD::Signal3<int,Session*,std::string,DataType> MissingFile;
 
+       void set_missing_file_replacement (const std::string& mfr) {
+               _missing_file_replacement = mfr;
+       }
+
        /** Emitted when the session wants Ardour to quit */
        static PBD::Signal0<void> Quit;
 
@@ -1250,6 +1265,8 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
        bool                    _under_nsm_control;
        unsigned int            _xrun_count;
 
+       std::string             _missing_file_replacement;
+
        void mtc_status_changed (bool);
        PBD::ScopedConnection mtc_status_connection;
        void ltc_status_changed (bool);
@@ -1426,7 +1443,6 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
        static const PostTransportWork ProcessCannotProceedMask =
                PostTransportWork (
                        PostTransportInputChange|
-                       PostTransportSpeed|
                        PostTransportReverse|
                        PostTransportCurveRealloc|
                        PostTransportAudition|
@@ -1698,7 +1714,6 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
 
        TempoMap    *_tempo_map;
        void          tempo_map_changed (const PBD::PropertyChange&);
-       void          gui_tempo_map_changed ();
 
        /* edit/mix groups */
 
@@ -1881,6 +1896,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
        typedef std::list<Click*> Clicks;
        Clicks                  clicks;
        bool                   _clicking;
+       bool                   _click_rec_only;
        boost::shared_ptr<IO>  _click_io;
        boost::shared_ptr<Amp> _click_gain;
        Sample*                 click_data;
@@ -1919,8 +1935,12 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
        Evoral::Range<framepos_t> _range_selection;
        Evoral::Range<framepos_t> _object_selection;
 
-       void unset_preroll_record ();
-       framepos_t _preroll_record_in;
+       void unset_preroll_record_punch ();
+       void unset_preroll_record_trim ();
+
+       framepos_t _preroll_record_punch_pos;
+       framecnt_t _preroll_record_trim_len;
+       bool _count_in_once;
 
        /* main outs */
        uint32_t main_outs;
@@ -1930,17 +1950,6 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
 
        void auto_connect_master_bus ();
 
-       /* Windows VST support */
-
-       long _windows_vst_callback (
-               WindowsVSTPlugin*,
-               long opcode,
-               long index,
-               long value,
-               void* ptr,
-               float opt
-               );
-
        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);