fix visual focus indication in IOSelector; import pays attention to audio file embedd...
[ardour.git] / libs / ardour / ardour / session.h
index f6d5e9cc8d2f2d6d2e1be4f3cd7b513fe18cb251..93c093ec859d0d13cb4db3a21dd6bc38c7860ce2 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;
@@ -346,7 +346,10 @@ class Session : public sigc::trackable, public PBD::StatefulDestructible
        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);
+
        void request_play_loop (bool yn);
+       bool get_play_loop () const { return play_loop; }
+
        nframes_t  last_transport_start() const { return _last_roll_location; }
        void goto_end ()   { request_locate (end_location->start(), false);}
        void goto_start () { request_locate (start_location->start(), false); }
@@ -415,7 +418,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 {
@@ -539,8 +542,8 @@ class Session : public sigc::trackable, public PBD::StatefulDestructible
        
        /* region info  */
 
-       sigc::signal<void,boost::shared_ptr<AudioRegion> > AudioRegionAdded;
-       sigc::signal<void,boost::shared_ptr<AudioRegion> > AudioRegionRemoved;
+       sigc::signal<void,boost::weak_ptr<AudioRegion> > AudioRegionAdded;
+       sigc::signal<void,boost::weak_ptr<AudioRegion> > AudioRegionRemoved;
 
        int region_name (string& result, string base = string(""), bool newlevel = false) const;
        string new_region_name (string);
@@ -627,6 +630,7 @@ class Session : public sigc::trackable, public PBD::StatefulDestructible
        uint32_t n_playlists() const;
 
        template<class T> void foreach_playlist (T *obj, void (T::*func)(Playlist *));
+       void get_playlists (std::vector<Playlist*>&);
 
        /* named selections */
 
@@ -756,11 +760,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 +908,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);
@@ -922,6 +929,8 @@ class Session : public sigc::trackable, public PBD::StatefulDestructible
   private:
        int  create (bool& new_session, string* mix_template, nframes_t initial_length);
 
+       nframes_t compute_initial_length ();
+
        static const char* _template_suffix;
        static const char* _statefile_suffix;
        static const char* _pending_suffix;
@@ -1419,7 +1428,7 @@ class Session : public sigc::trackable, public PBD::StatefulDestructible
        bool       currently_soloing;
        
        void route_mute_changed (void *src);
-       void route_solo_changed (void *src, boost::shared_ptr<Route>);
+       void route_solo_changed (void *src, boost::weak_ptr<Route>);
        void catch_up_on_solo ();
        void update_route_solo_state ();
        void modify_solo_mute (bool, bool);
@@ -1431,10 +1440,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 +1675,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