new automation state model, sort of working, but not really
[ardour.git] / libs / ardour / ardour / session.h
index 79fd4429958cb1f13f8b269e00d32d5de98227da..cdc79164e6184cc5724667092b1eac6653464c11 100644 (file)
@@ -93,7 +93,7 @@ class AudioRegion;
 class Region;
 class Playlist;
 class VSTPlugin;
-class ControlProtocolManager;
+class ControlProtocolInfo;
 
 struct AudioExportSpecification;
 struct RouteGroup;
@@ -103,7 +103,7 @@ using std::string;
 using std::map;
 using std::set;
 
-class Session : public sigc::trackable, public PBD::StatefulDestructible
+class Session : public PBD::StatefulDestructible
 
 {
   private:
@@ -162,7 +162,6 @@ class Session : public sigc::trackable, public PBD::StatefulDestructible
                        void*                ptr;
                        bool                 yes_or_no;
                        SlaveSource slave;
-                       Route*               route;
            };
 
            boost::shared_ptr<Region>   region;
@@ -243,6 +242,7 @@ class Session : public sigc::trackable, public PBD::StatefulDestructible
        void set_dirty ();
        void set_clean ();
        bool dirty() const { return _state_of_the_state & Dirty; }
+       bool deletion_in_progress() const { return _state_of_the_state & Deletion; }
        sigc::signal<void> DirtyChanged;
 
        std::string sound_dir (bool with_path = true) const;
@@ -415,7 +415,7 @@ class Session : public sigc::trackable, public PBD::StatefulDestructible
        XMLNode& get_state();
        int      set_state(const XMLNode& node); // not idempotent
        XMLNode& get_template();
-
+       
        void add_instant_xml (XMLNode&, const std::string& dir);
 
        enum StateOfTheState {
@@ -756,11 +756,11 @@ class Session : public sigc::trackable, public PBD::StatefulDestructible
                current_trans->add_command (cmd);
        }
 
-       std::map<PBD::ID, PBD::StatefulDestructible*> registry;
+       std::map<PBD::ID, PBD::StatefulThingWithGoingAway*> registry;
 
         // 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::StatefulDestructible *);
+        void register_with_memento_command_factory(PBD::ID, PBD::StatefulThingWithGoingAway *);
 
         class GlobalSoloStateCommand : public Command
         {
@@ -904,6 +904,9 @@ class Session : public sigc::trackable, public PBD::StatefulDestructible
 
        PBD::Controllable* controllable_by_id (const PBD::ID&);
 
+       void add_controllable (PBD::Controllable*);
+       void remove_controllable (PBD::Controllable*);
+
   protected:
        friend class AudioEngine;
        void set_block_size (nframes_t nframes);
@@ -1431,10 +1434,9 @@ class Session : public sigc::trackable, public PBD::StatefulDestructible
        typedef map<PBD::ID,boost::shared_ptr<AudioRegion> > AudioRegionList;
        AudioRegionList audio_regions;
        
-       void region_renamed (boost::shared_ptr<Region>);
-       void region_changed (Change, boost::shared_ptr<Region>);
        void add_region (boost::shared_ptr<Region>);
-       void remove_region (boost::shared_ptr<Region>);
+       void region_changed (Change, boost::weak_ptr<Region>);
+       void remove_region (boost::weak_ptr<Region>);
 
        int load_regions (const XMLNode& node);
 
@@ -1667,19 +1669,19 @@ class Session : public sigc::trackable, public PBD::StatefulDestructible
        LayerModel layer_model;
        CrossfadeModel xfade_model;
 
-       typedef std::list<PBD::Controllable*> Controllables;
+       typedef std::set<PBD::Controllable*> Controllables;
        Glib::Mutex controllables_lock;
        Controllables controllables;
 
-       void add_controllable (PBD::Controllable*);
-       void remove_controllable (PBD::Controllable*);
-
-
        void reset_native_file_format();
        bool first_file_data_format_reset;
        bool first_file_header_format_reset;
 
        void config_changed (const char*);
+
+       void add_control_protocol (const ControlProtocolInfo* const, XMLNode*);
+       XMLNode& get_control_protocol_state ();
+       
 };
 
 } // namespace ARDOUR