Genericificationalizeified AudioFilter (now Filter).
[ardour.git] / libs / ardour / ardour / session.h
index f0a175c624df433ddd8475e0366282d8c4474cbb..63be24d9f797b926afe1bc4568c8f97d9b36ac62 100644 (file)
@@ -87,9 +87,9 @@ class MidiDiskstream;
 class AudioFileSource;
 class MidiSource;
 class Auditioner;
-class Insert;
+class Processor;
 class Send;
-class Redirect;
+class IOProcessor;
 class PortInsert;
 class PluginInsert;
 class Bundle;
@@ -261,9 +261,6 @@ class Session : public PBD::StatefulDestructible
 
        std::string automation_dir () const;
 
-       static string suffixed_search_path (std::string suffix, bool data);
-       static string control_protocol_path ();
-       
        static string change_audio_path_by_name (string oldpath, string oldname, string newname, bool destructive);
        static string change_midi_path_by_name (string oldpath, string oldname, string newname, bool destructive);
        
@@ -275,7 +272,7 @@ class Session : public PBD::StatefulDestructible
 
        BufferSet& get_silent_buffers (ChanCount count = ChanCount::ZERO);
        BufferSet& get_scratch_buffers (ChanCount count = ChanCount::ZERO);
-       BufferSet& get_send_buffers (ChanCount count = ChanCount::ZERO);
+       BufferSet& get_mix_buffers (ChanCount count = ChanCount::ZERO);
        
        void add_diskstream (boost::shared_ptr<Diskstream>);
        boost::shared_ptr<Diskstream> diskstream_by_id (const PBD::ID& id);
@@ -490,7 +487,7 @@ class Session : public PBD::StatefulDestructible
        void   resort_routes ();
        void   resort_routes_using (boost::shared_ptr<RouteList>);
        
-       void    set_remote_control_ids();
+       void   set_remote_control_ids();
 
        AudioEngine &engine() { return _engine; };
 
@@ -541,7 +538,7 @@ class Session : public PBD::StatefulDestructible
        void        request_slave_source (SlaveSource);
        bool        synced_to_jack() const { return Config->get_slave_source() == JACK; }
 
-       float       transport_speed() const { return _transport_speed; }
+       float       transport_speed() const { return _transport_speed; }
        bool        transport_stopped() const { return _transport_speed == 0.0f; }
        bool        transport_rolling() const { return _transport_speed != 0.0f; }
 
@@ -556,7 +553,7 @@ class Session : public PBD::StatefulDestructible
 
        int region_name (string& result, string base = string(""), bool newlevel = false) const;
        string new_region_name (string);
-       string path_from_region_name (string name, string identifier);
+       string path_from_region_name (DataType type, string name, string identifier);
 
        boost::shared_ptr<Region> find_whole_file_parent (boost::shared_ptr<Region const>);
        
@@ -598,8 +595,8 @@ class Session : public PBD::StatefulDestructible
        void remove_source (boost::weak_ptr<Source>);
 
        struct cleanup_report {
-           vector<string> paths;
-           int64_t space;
+               vector<string> paths;
+               int64_t        space;
        };
 
        int  cleanup_sources (cleanup_report&);
@@ -652,9 +649,11 @@ class Session : public PBD::StatefulDestructible
        sigc::signal<void> NamedSelectionAdded;
        sigc::signal<void> NamedSelectionRemoved;
 
-        /* Curves and AutomationLists (TODO when they go away) */
-        void add_curve(Curve*);
-        void add_automation_list(AutomationList*);
+       /* Curves and AutomationLists (TODO when they go away) */
+       void add_curve(Curve*);
+       void add_automation_list(AutomationList*);
+       
+       nframes_t automation_interval () const { return _automation_interval; }
 
        /* fade curves */
 
@@ -674,8 +673,9 @@ class Session : public PBD::StatefulDestructible
 
        /* flattening stuff */
 
-       int write_one_audio_track (AudioTrack&, nframes_t start, nframes_t cnt, bool overwrite, vector<boost::shared_ptr<Source> >&,
-                                  InterThreadInfo& wot);
+       int write_one_audio_track (AudioTrack&, nframes_t start, nframes_t cnt, bool overwrite,
+                       vector<boost::shared_ptr<Source> >&, InterThreadInfo& wot);
+
        int freeze (InterThreadInfo&);
 
        /* session-wide solo/mute/rec-enable */
@@ -774,7 +774,7 @@ class Session : public PBD::StatefulDestructible
        string next_undo() const { return _history.next_undo(); }
        string next_redo() const { return _history.next_redo(); }
 
-       void begin_reversible_command (string cmd_name);
+       void begin_reversible_command (const string& cmd_name);
        void commit_reversible_command (Command* cmd = 0);
 
        void add_command (Command *const cmd) {
@@ -783,9 +783,9 @@ class Session : public PBD::StatefulDestructible
 
        std::map<PBD::ID, PBD::StatefulThingWithGoingAway*> registry;
 
-        // these commands are implemented in libs/ardour/session_command.cc
+       // these commands are implemented in libs/ardour/session_command.cc
        Command* memento_command_factory(XMLNode* n);
-        void register_with_memento_command_factory(PBD::ID, PBD::StatefulThingWithGoingAway*);
+       void register_with_memento_command_factory(PBD::ID, PBD::StatefulThingWithGoingAway*);
 
        Command* global_state_command_factory (const XMLNode& n);
 
@@ -804,8 +804,8 @@ class Session : public PBD::StatefulDestructible
                
        };
 
-        class GlobalSoloStateCommand : public GlobalRouteStateCommand
-        {
+       class GlobalSoloStateCommand : public GlobalRouteStateCommand
+       {
          public:
                GlobalSoloStateCommand (Session &, void *src);
                GlobalSoloStateCommand (Session&, const XMLNode&);
@@ -813,10 +813,10 @@ class Session : public PBD::StatefulDestructible
                void undo();
                XMLNode &get_state();
                void mark();
-        };
+       };
 
-        class GlobalMuteStateCommand : public GlobalRouteStateCommand
-        {
+       class GlobalMuteStateCommand : public GlobalRouteStateCommand
+       {
          public:
                GlobalMuteStateCommand(Session &, void *src);
                GlobalMuteStateCommand (Session&, const XMLNode&);
@@ -824,10 +824,10 @@ class Session : public PBD::StatefulDestructible
                void undo();
                XMLNode &get_state();
                void mark();
-        };
+       };
 
-        class GlobalRecordEnableStateCommand : public GlobalRouteStateCommand
-        {
+       class GlobalRecordEnableStateCommand : public GlobalRouteStateCommand
+       {
          public:
                GlobalRecordEnableStateCommand(Session &, void *src);
                GlobalRecordEnableStateCommand (Session&, const XMLNode&);
@@ -835,10 +835,10 @@ class Session : public PBD::StatefulDestructible
                void undo();
                XMLNode &get_state();
                void mark();
-        };
+       };
 
-        class GlobalMeteringStateCommand : public Command
-        {
+       class GlobalMeteringStateCommand : public Command
+       {
          public:
                GlobalMeteringStateCommand(Session &, void *src);
                GlobalMeteringStateCommand (Session&, const XMLNode&);
@@ -853,7 +853,7 @@ class Session : public PBD::StatefulDestructible
                void* src;
                GlobalRouteMeterState before;
                GlobalRouteMeterState after;
-        };
+       };
 
        /* clicking */
 
@@ -862,14 +862,14 @@ class Session : public PBD::StatefulDestructible
        /* 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<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&);
@@ -920,9 +920,9 @@ class Session : public PBD::StatefulDestructible
 
        /* Controllables */
 
-       PBD::Controllable* controllable_by_id (const PBD::ID&);
+       boost::shared_ptr<PBD::Controllable> controllable_by_id (const PBD::ID&);
 
-       void add_controllable (PBD::Controllable*);
+       void add_controllable (boost::shared_ptr<PBD::Controllable>);
        void remove_controllable (PBD::Controllable*);
 
   protected:
@@ -987,7 +987,7 @@ class Session : public PBD::StatefulDestructible
        nframes_t           last_stop_frame;
        BufferSet*              _scratch_buffers;
        BufferSet*              _silent_buffers;
-       BufferSet*              _send_buffers;
+       BufferSet*              _mix_buffers;
        nframes_t           current_block_size;
        nframes_t          _worst_output_latency;
        nframes_t          _worst_input_latency;
@@ -1089,9 +1089,9 @@ class Session : public PBD::StatefulDestructible
        bool                     session_midi_feedback;
        bool                     play_loop;
        bool                     loop_changing;
-       nframes_t           last_loopend;
+       nframes_t                last_loopend;
 
-       boost::scoped_ptr<SessionDirectory>        _session_dir;
+       boost::scoped_ptr<SessionDirectory> _session_dir;
 
        RingBuffer<Event*> pending_events;
 
@@ -1111,11 +1111,11 @@ class Session : public PBD::StatefulDestructible
        int      load_state (string snapshot_name);
        bool     save_config_options_predicate (ConfigVariableBase::Owner owner) const;
 
-       nframes_t   _last_roll_location;
-       nframes_t   _last_record_location;
-       bool              pending_locate_roll;
-       nframes_t    pending_locate_frame;
+       nframes_t _last_roll_location;
+       nframes_t _last_record_location;
 
+       bool              pending_locate_roll;
+       nframes_t         pending_locate_frame;
        bool              pending_locate_flush;
        bool              pending_abort;
        bool              pending_auto_loop;
@@ -1124,7 +1124,7 @@ class Session : public PBD::StatefulDestructible
        float*            butler_gain_buffer;
        pthread_t         butler_thread;
        Glib::Mutex       butler_request_lock;
-        Glib::Cond        butler_paused;
+       Glib::Cond        butler_paused;
        bool              butler_should_run;
        mutable gint      butler_should_do_transport_work;
        int               butler_request_pipe[2];
@@ -1513,17 +1513,17 @@ class Session : public PBD::StatefulDestructible
 
        /* INSERT AND SEND MANAGEMENT */
        
-       list<PortInsert *>   _port_inserts;
-       list<PluginInsert *> _plugin_inserts;
-       list<Send *>         _sends;
-       boost::dynamic_bitset<uint32_t>  send_bitset;
-       boost::dynamic_bitset<uint32_t>  insert_bitset;
-       uint32_t          send_cnt;
-       uint32_t          insert_cnt;
+       list<PortInsert *>              _port_inserts;
+       list<PluginInsert *>            _plugin_inserts;
+       list<Send *>                    _sends;
+       boost::dynamic_bitset<uint32_t> send_bitset;
+       boost::dynamic_bitset<uint32_t> insert_bitset;
+       uint32_t                        send_cnt;
+       uint32_t                        insert_cnt;
 
 
-       void add_insert (Insert *);
-       void remove_insert (Insert *);
+       void add_processor (Processor *);
+       void remove_processor (Processor *);
 
        /* S/W RAID */
 
@@ -1606,7 +1606,7 @@ class Session : public PBD::StatefulDestructible
                    pool.release (ptr);
            }
 
-          private:
+         private:
            static Pool pool;
        };
  
@@ -1621,9 +1621,9 @@ class Session : public PBD::StatefulDestructible
        nframes_t  click_emphasis_length;
        mutable Glib::RWLock click_lock;
 
-       static const Sample         default_click[];
+       static const Sample    default_click[];
        static const nframes_t default_click_length;
-       static const Sample         default_click_emphasis[];
+       static const Sample    default_click_emphasis[];
        static const nframes_t default_click_emphasis_length;
 
        Click *get_click();
@@ -1651,6 +1651,8 @@ class Session : public PBD::StatefulDestructible
        void allocate_pan_automation_buffers (nframes_t nframes, uint32_t howmany, bool force);
        uint32_t _npan_buffers;
 
+       nframes_t _automation_interval;
+
        /* VST support */
 
        long _vst_callback (VSTPlugin*,
@@ -1675,7 +1677,7 @@ class Session : public PBD::StatefulDestructible
        LayerModel layer_model;
        CrossfadeModel xfade_model;
 
-       typedef std::set<PBD::Controllable*> Controllables;
+       typedef std::set<boost::shared_ptr<PBD::Controllable> > Controllables;
        Glib::Mutex controllables_lock;
        Controllables controllables;