remove StateManager code entirely and more debugging output cruft
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 26 Oct 2006 00:47:22 +0000 (00:47 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 26 Oct 2006 00:47:22 +0000 (00:47 +0000)
git-svn-id: svn://localhost/ardour2/trunk@1008 d708f5d6-7413-0410-9779-e7cbd77b26cf

36 files changed:
gtk2_ardour/automation_line.cc
gtk2_ardour/automation_line.h
gtk2_ardour/region_gain_line.cc
gtk2_ardour/region_gain_line.h
libs/ardour/SConscript
libs/ardour/ardour/audio_unit.h
libs/ardour/ardour/automation_event.h
libs/ardour/ardour/curve.h
libs/ardour/ardour/insert.h
libs/ardour/ardour/io.h
libs/ardour/ardour/ladspa_plugin.h
libs/ardour/ardour/location.h
libs/ardour/ardour/plugin.h
libs/ardour/ardour/plugin_state.h [deleted file]
libs/ardour/ardour/redirect.h
libs/ardour/ardour/route.h
libs/ardour/ardour/session.h
libs/ardour/ardour/state_manager.h [deleted file]
libs/ardour/ardour/tempo.h
libs/ardour/ardour/vst_plugin.h
libs/ardour/audio_track.cc
libs/ardour/audio_unit.cc
libs/ardour/automation_event.cc
libs/ardour/curve.cc
libs/ardour/insert.cc
libs/ardour/io.cc
libs/ardour/ladspa_plugin.cc
libs/ardour/location.cc
libs/ardour/panner.cc
libs/ardour/playlist.cc
libs/ardour/redirect.cc
libs/ardour/route.cc
libs/ardour/send.cc
libs/ardour/session_state.cc
libs/ardour/state_manager.cc [deleted file]
libs/ardour/tempo.cc

index 371552fbfc1ed37a0b0984a311f11a0475309dc6..339af96d76e1db9b1bfca7ac55c5d6142ffc8b68 100644 (file)
@@ -1168,16 +1168,6 @@ AutomationLine::hide_selection ()
 //     show_selection ();
 }
 
-
-#ifdef STATE_MANAGER
-// This is copied into AudioRegionGainLine
-UndoAction
-AutomationLine::get_memento ()
-{
-       return alist.get_memento();
-}
-#endif
-
 void
 AutomationLine::list_changed (Change ignored)
 {
index 0e44c95a3371940594fd37bd9e49a4f9fc1ec9db..0567ffaa56a0a0f88a71763e418d28f5bb02b70b 100644 (file)
@@ -206,10 +206,6 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulThingWithGoin
        void reset_callback (const ARDOUR::AutomationList&);
        void list_changed (ARDOUR::Change);
 
-#ifdef STATE_MANAGER
-       UndoAction get_memento();
-#endif
-
        virtual bool event_handler (GdkEvent*);
        
   private:
index 58a8a9acad0838f1d924b448289fc5fb0a9ed7d8..a961af5256722edf41a14b84a1636deff1574c1e 100644 (file)
@@ -89,11 +89,3 @@ AudioRegionGainLine::end_drag (ControlPoint* cp)
 }
 
 
-#ifdef STATE_MANAGER
-// This is a copy from AutomationList
-UndoAction
-AudioRegionGainLine::get_memento ()
-{
-       return alist.get_memento();
-}
-#endif
index 916bf78a78dd75314d6055b31a59788f268eac54..ffd64a649133dd2df6ed2f1ece5d66c8508234d8 100644 (file)
@@ -30,10 +30,6 @@ class AudioRegionGainLine : public AutomationLine
   private:
        ARDOUR::Session& session;
        AudioRegionView& rv;
-
-#ifdef STATE_MANAGER
-       UndoAction get_memento();
-#endif
 };
 
 
index 054b251ae749baa03a094ddcf7d7eba9ece4a137..827f2b06e113ee06fc37c75abbc97b9b7b776467 100644 (file)
@@ -91,7 +91,6 @@ sndfile_helpers.cc
 sndfilesource.cc
 source.cc
 source_factory.cc
-state_manager.cc
 tempo.cc
 utils.cc
 version.cc
index aa7c34a2d2bcba6e6c7965386a96e4d408ad75f4..d82425765d9a7d9afc63598c34934791d342fbe2 100644 (file)
@@ -66,8 +66,6 @@ class AUPlugin : public ARDOUR::Plugin
     
        int connect_and_run (vector<Sample*>& bufs, uint32_t maxbuf, int32_t& in, int32_t& out, nframes_t nframes, nframes_t offset);
        std::set<uint32_t> automatable() const;
-       void store_state (ARDOUR::PluginState&);
-       void restore_state (ARDOUR::PluginState&);
        string describe_parameter (uint32_t);
        string state_node_name () const { return "audiounit"; }
        void print_parameter (uint32_t, char*, uint32_t len) const;
index e2940bc2e1ca0aeb6f5e5fc998d44e55be015445..89823bc738d00d2bdb318dd06c3f1510ede4cd73 100644 (file)
@@ -33,7 +33,6 @@
 #include <pbd/statefuldestructible.h> 
 
 #include <ardour/ardour.h>
-#include <ardour/state_manager.h>
 
 namespace ARDOUR {
        
@@ -153,10 +152,6 @@ class AutomationList : public PBD::StatefulDestructible
 
        sigc::signal<void,Change> StateChanged;
 
-#ifdef STATE_MANAGER
-       UndoAction get_memento () const;
-#endif 
-       
        virtual void store_state (XMLNode& node) const;
        virtual void load_state (const XMLNode&);
 
@@ -192,12 +187,6 @@ class AutomationList : public PBD::StatefulDestructible
 
   protected:
 
-       struct State : public ARDOUR::StateManager::State {
-           AutomationEventList events;
-
-           State (std::string why) : ARDOUR::StateManager::State (why) {}
-       };
-
        AutomationEventList events;
        mutable Glib::Mutex lock;
        bool   _frozen;
@@ -246,15 +235,9 @@ class AutomationList : public PBD::StatefulDestructible
 
        virtual double unlocked_eval (double where);
 
-#ifdef STATE_MANAGER
-       Change   restore_state (StateManager::State&);
-       StateManager::State* state_factory (std::string why) const;
-#endif
-
        virtual ControlEvent* point_factory (double,double) const;
        virtual ControlEvent* point_factory (const ControlEvent&) const;
 
-
        AutomationList* cut_copy_clear (double, double, int op);
 };
 
index 9de7d0ef48b058c6f89c44ccf4052176ed74d311..97601e29eefbcfb431d3f9ae5a6cecd14ffd4ec8 100644 (file)
@@ -66,10 +66,6 @@ class Curve : public AutomationList
        ControlEvent* point_factory (double,double) const;
        ControlEvent* point_factory (const ControlEvent&) const;
 
-#ifdef STATE_MANAGER
-       Change   restore_state (StateManager::State&);
-#endif
-
   private:
        AutomationList::iterator last_bound;
 
index 30378139ab7ee57cce14118e309f80d27aa268a7..885cab445703336897b6823b1702f599f41730b4 100644 (file)
@@ -28,7 +28,6 @@
 #include <sigc++/signal.h>
 #include <ardour/ardour.h>
 #include <ardour/redirect.h>
-#include <ardour/plugin_state.h>
 #include <ardour/types.h>
 
 class XMLNode;
@@ -87,15 +86,6 @@ class PortInsert : public Insert
        int32_t compute_output_streams (int32_t cnt) const;
 };
 
-struct PluginInsertState : public RedirectState
-{
-    PluginInsertState (std::string why) 
-           : RedirectState (why) {}
-    ~PluginInsertState() {}
-
-    PluginState plugin_state;
-};
-
 class PluginInsert : public Insert
 {
   public:
@@ -110,9 +100,6 @@ class PluginInsert : public Insert
        XMLNode& get_state(void);
        int set_state(const XMLNode&);
 
-       StateManager::State* state_factory (std::string why) const;
-       Change restore_state (StateManager::State&);
-
        void run (vector<Sample *>& bufs, uint32_t nbufs, nframes_t nframes, nframes_t offset);
        void silence (nframes_t nframes, nframes_t offset);
        void activate ();
@@ -158,9 +145,6 @@ class PluginInsert : public Insert
 
        void transport_stopped (nframes_t now);
 
-  protected:
-       void store_state (PluginInsertState&) const;
-
   private:
 
        void parameter_changed (uint32_t, float);
index cbac6295932b82adca7fb181e81502cf74d99fba..e1ed7aef9501c9aff6a0310d60550f51f64b4e5d 100644 (file)
@@ -36,7 +36,6 @@
 
 #include <ardour/ardour.h>
 #include <ardour/utils.h>
-#include <ardour/state_manager.h>
 #include <ardour/curve.h>
 #include <ardour/types.h>
 #include <ardour/data_type.h>
@@ -167,20 +166,11 @@ virtual ~IO();
        XMLNode& get_state (void);
        int set_state (const XMLNode&);
 
-#ifdef STATE_MANAGER
-       virtual UndoAction get_memento() const;
-#endif
-
        static int  disable_connecting (void);
-
        static int  enable_connecting (void);
-
        static int  disable_ports (void);
-
        static int  enable_ports (void);
-
        static int  disable_panners (void);
-
        static int  reset_panners (void);
        
        static sigc::signal<int> PortsLegal;
@@ -299,13 +289,6 @@ public:
 
        GainControllable _gain_control;
 
-       /* state management */
-
-#ifdef STATE_MANAGER
-       Change               restore_state (State&);
-       StateManager::State* state_factory (std::string why) const;
-#endif
-
        AutoState      _gain_automation_state;
        AutoStyle      _gain_automation_style;
 
index 291ff41dc8a38365eaf15e788f4fdbf9bc77abf0..aeac7f05c6b3d8b71b0660ec9bfe3367fef0623c 100644 (file)
@@ -33,7 +33,6 @@
 
 #include <jack/types.h>
 #include <ardour/ladspa.h>
-#include <ardour/plugin_state.h>
 #include <ardour/plugin.h>
 #include <ardour/ladspa_plugin.h>
 
@@ -84,8 +83,6 @@ class LadspaPlugin : public ARDOUR::Plugin
        void set_block_size (nframes_t nframes) {}
        
        int connect_and_run (vector<Sample*>& bufs, uint32_t maxbuf, int32_t& in, int32_t& out, nframes_t nframes, nframes_t offset);
-       void store_state (ARDOUR::PluginState&);
-       void restore_state (ARDOUR::PluginState&);
        string describe_parameter (uint32_t);
        string state_node_name() const { return "ladspa"; }
        void print_parameter (uint32_t, char*, uint32_t len) const;
index e618f46dfe881aca0733791f6770667410d57093..94f70bb4e8ecf02fcf249eeca8f0619883975f48 100644 (file)
@@ -36,7 +36,6 @@
 #include <pbd/statefuldestructible.h> 
 
 #include <ardour/ardour.h>
-#include <ardour/state_manager.h>
 
 using std::string;
 
@@ -181,30 +180,14 @@ class Locations : public PBD::StatefulDestructible
                (obj.*method)(locations, arg);
        }
 
-#ifdef STATE_MANAGER
-       UndoAction get_memento () const;
-#endif
-
   private:
 
-#ifdef STATE_MANAGER
-       struct State : public ARDOUR::StateManager::State {
-           LocationList locations;
-           LocationList states;
-
-           State (std::string why) : ARDOUR::StateManager::State (why) {}
-       };
-#endif
        LocationList       locations;
        Location          *current_location;
        mutable Glib::Mutex  lock;
 
        int set_current_unlocked (Location *);
        void location_changed (Location*);
-#ifdef STATE_MANAGER
-       Change   restore_state (StateManager::State&);
-       StateManager::State* state_factory (std::string why) const;
-#endif
 };
 
 } // namespace ARDOUR
index e0b2dfc12b21025c65cf70027208e35aaeaaee97..1521dd929d9ebf4695cf8d43c21308b6055031e0 100644 (file)
@@ -29,7 +29,6 @@
 
 #include <jack/types.h>
 #include <ardour/types.h>
-#include <ardour/plugin_state.h>
 #include <ardour/cycles.h>
 
 #include <vector>
@@ -120,8 +119,6 @@ class Plugin : public PBD::StatefulDestructible
 
        virtual int connect_and_run (vector<Sample*>& bufs, uint32_t maxbuf, int32_t& in, int32_t& out, nframes_t nframes, nframes_t offset) = 0;
        virtual std::set<uint32_t> automatable() const = 0;
-       virtual void store_state (ARDOUR::PluginState&) = 0;
-       virtual void restore_state (ARDOUR::PluginState&) = 0;
        virtual string describe_parameter (uint32_t) = 0;
        virtual string state_node_name() const = 0;
        virtual void print_parameter (uint32_t, char*, uint32_t len) const = 0;
diff --git a/libs/ardour/ardour/plugin_state.h b/libs/ardour/ardour/plugin_state.h
deleted file mode 100644 (file)
index bd499e2..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef __ardour_plugin_state_h__
-#define __ardour_plugin_state_h__
-
-#include <map>
-
-namespace ARDOUR {
-
-struct PluginState {
-    std::map<uint32_t,float> parameters;
-};
-
-} 
-
-#endif /* __ardour_plugin_state_h__ */
index 691e690b47a7de9856888e89a4e4231c5b5978b8..e60438f3ba69e7f16fb201f9d852c98075cab2ce 100644 (file)
@@ -47,14 +47,6 @@ namespace ARDOUR {
 
 class Session;
 
-struct RedirectState : public StateManager::State {
-    RedirectState (string why) 
-           : StateManager::State (why) {}
-    ~RedirectState () {}
-
-    bool active;
-};
-
 class Redirect : public IO
 {
   public:
@@ -99,9 +91,6 @@ class Redirect : public IO
        XMLNode& get_state (void);
        int set_state (const XMLNode&);
 
-       StateManager::State* state_factory (string why) const;
-       Change restore_state (StateManager::State&);
-
        void *get_gui () const { return _gui; }
        void  set_gui (void *p) { _gui = p; }
 
@@ -137,8 +126,6 @@ class Redirect : public IO
        void can_automate (uint32_t);
        set<uint32_t> can_automate_list;
 
-       void store_state (RedirectState&) const;
-
        virtual void automation_list_creation_callback (uint32_t, AutomationList&) {}
 
   private:
index af104bb6eafa7ec7149cb768c90e23805ff67490..c8b135fb6bd4f3593150c6560036cff89c61a13a 100644 (file)
@@ -205,11 +205,6 @@ class Route : public IO
 
        sigc::signal<void,void*> SelectedChanged;
 
-       /* undo */
-
-       UndoAction get_memento() const;
-       void set_state (state_id_t);
-
        int set_control_outs (const vector<std::string>& ports);
        IO* control_outs() { return _control_outs; }
 
@@ -314,7 +309,6 @@ class Route : public IO
        void silence (nframes_t nframes, nframes_t offset);
        sigc::connection input_signal_connection;
 
-       state_id_t _current_state_id;
        uint32_t redirect_max_outs;
        uint32_t _remote_control_id;
 
index da5a098aa06e14541f7989108f78e38b1a2289b7..cdc79164e6184cc5724667092b1eac6653464c11 100644 (file)
@@ -162,7 +162,6 @@ class Session : public PBD::StatefulDestructible
                        void*                ptr;
                        bool                 yes_or_no;
                        SlaveSource slave;
-                       Route*               route;
            };
 
            boost::shared_ptr<Region>   region;
diff --git a/libs/ardour/ardour/state_manager.h b/libs/ardour/ardour/state_manager.h
deleted file mode 100644 (file)
index e123b2c..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef __ardour_state_manager_h__
-#define __ardour_state_manager_h__
-
-#include <list>
-#include <string>
-#include <set>
-
-#include <sigc++/signal.h>
-
-#include <ardour/ardour.h>
-
-namespace ARDOUR {
-
-typedef uint32_t state_id_t;
-
-class StateManager : public virtual sigc::trackable
-{
-  public:
-       struct State {
-           std::string operation;
-           State (std::string why) : operation (why) {}
-           virtual ~State() {}
-       };
-
-       typedef std::list<State*> StateMap;
-
-       StateManager ();
-       virtual ~StateManager ();
-       
-       virtual void drop_all_states ();
-       virtual void use_state (state_id_t);
-       virtual void save_state (std::string why);
-
-       sigc::signal<void,Change> StateChanged;
-
-       state_id_t _current_state_id;
-
-       virtual bool should_save_state () const { return true; }
-
-       static void prohibit_save ();
-       static void allow_save (const char* why, bool dosave);
-
-  protected:
-       static bool _allow_save;
-       static sigc::signal<void,const char*> SaveAllowed;
-
-       StateMap   states;
-
-       virtual Change   restore_state (State&) = 0;
-       virtual State* state_factory (std::string why) const = 0;
-       virtual void   send_state_changed (Change);
-};
-
-} // namespace ARDOUR
-
-#endif /* __ardour_state_manager_h__ */
index eaadcb1c99235279abce1f6c384264b77793797f..f8751b5d2bc8587a460179b0bf75cda1500ec16b 100644 (file)
@@ -34,7 +34,6 @@
 #include <sigc++/signal.h>
 
 #include <ardour/ardour.h>
-#include <ardour/state_manager.h>
 
 class XMLNode;
 
@@ -162,18 +161,6 @@ class TempoSection : public MetricSection, public Tempo {
 
 typedef list<MetricSection*> Metrics;
 
-#ifdef STATE_MANAGER
-class TempoMapState : public StateManager::State {
-  public:
-       TempoMapState (std::string why) 
-               : StateManager::State (why) {
-               metrics = new Metrics;
-       }
-
-       Metrics *metrics;
-};
-#endif
-
 class TempoMap : public PBD::StatefulDestructible
 {
   public:
@@ -248,10 +235,6 @@ class TempoMap : public PBD::StatefulDestructible
        void dump (std::ostream&) const;
        void clear ();
 
-#ifdef STATE_MANAGER
-       UndoAction get_memento() const;
-#endif
-
        /* this is a helper class that we use to be able to keep
           track of which meter *AND* tempo are in effect at
           a given point in time.
@@ -315,17 +298,6 @@ class TempoMap : public PBD::StatefulDestructible
 
        int move_metric_section (MetricSection&, const BBT_Time& to);
        void do_insert (MetricSection* section);
-
-#ifdef STATE_MANAGER
-       Change  restore_state (StateManager::State&);
-       StateManager::State* state_factory (std::string why) const;
-
-       bool        in_set_state;
-
-       /* override state_manager::save_state so we can check in_set_state */
-
-       void save_state (std::string why);
-#endif
 };
 
 }; /* namespace ARDOUR */
index 7b8246868c19f0fd38a497077e2e0f8737674ce7..e7f09a8986f198cb6e481e5c39e722a6f2787901 100644 (file)
@@ -74,8 +74,6 @@ class VSTPlugin : public ARDOUR::Plugin
        void deactivate ();
        void set_block_size (nframes_t nframes);
        int connect_and_run (vector<Sample*>& bufs, uint32_t maxbuf, int32_t& in, int32_t& out, nframes_t nframes, nframes_t offset);
-       void store_state (ARDOUR::PluginState&);
-       void restore_state (ARDOUR::PluginState&);
        string describe_parameter (uint32_t);
        string state_node_name() const { return "vst"; }
        void print_parameter (uint32_t, char*, uint32_t len) const;
index d61ec7b00393ae7fbba959019ffb7629aa90c12d..69e183b66998974bb057c9638ddf34eb393c22da 100644 (file)
@@ -794,7 +794,8 @@ AudioTrack::freeze (InterThreadInfo& itt)
                                FreezeRecordInsertInfo* frii  = new FreezeRecordInsertInfo ((*r)->get_state(), insert);
                                
                                frii->id = insert->id();
-#ifdef STATE_MANAGER
+
+#ifdef FIX_ME_TO_WORK_WITHOUT_STATE_MANAGER
                                frii->memento = (*r)->get_memento();
 #endif                         
                                _freeze_record.insert_info.push_back (frii);
index ac240828b5ac74141fd6319c0235b4a63e2fd890..6879123ff1a24398d14a89293b49bdd36361af20 100644 (file)
@@ -190,18 +190,6 @@ AUPlugin::automatable() const
        return automates;
 }
 
-void
-AUPlugin::store_state (ARDOUR::PluginState&)
-{
-       
-}
-
-void
-AUPlugin::restore_state (ARDOUR::PluginState&)
-{
-       
-}
-
 string
 AUPlugin::describe_parameter (uint32_t)
 {
index 6b7f0ff0162b5312ab253bc8426b77571aad3795..00a6e638a74c7e86aff5aab63afe7e1a1baad2af 100644 (file)
@@ -63,12 +63,6 @@ AutomationList::AutomationList (double defval, bool with_state)
        lookup_cache.left = -1;
        lookup_cache.range.first = events.end();
 
-       if (!no_state) {
-#ifdef STATE_MANAGER
-               save_state (_("initial"));
-#endif
-       }
-
         AutomationListCreated(this);
 }
 
@@ -140,25 +134,6 @@ AutomationList::~AutomationList()
        for (AutomationEventList::iterator x = events.begin(); x != events.end(); ++x) {
                delete (*x);
        }
-
-#ifdef STATE_MANAGER
-       std::set<ControlEvent*> all_events;
-       AutomationList::State* asp;
-
-       for (StateMap::iterator i = states.begin(); i != states.end(); ++i) {
-
-               if ((asp = dynamic_cast<AutomationList::State*> (*i)) != 0) {
-                       
-                       for (AutomationEventList::iterator x = asp->events.begin(); x != asp->events.end(); ++x) {
-                               all_events.insert (*x);
-                       }
-               }
-       }
-
-       for (std::set<ControlEvent*>::iterator i = all_events.begin(); i != all_events.end(); ++i) {
-               delete (*i);
-       }
-#endif
 }
 
 bool
@@ -240,11 +215,6 @@ AutomationList::clear ()
        {
                Glib::Mutex::Lock lm (lock);
                events.clear ();
-               if (!no_state) {
-#ifdef STATE_MANAGER
-                       save_state (_("cleared"));
-#endif
-               }
                mark_dirty ();
        }
 
@@ -276,9 +246,6 @@ void AutomationList::_x_scale (double factor)
                (*i)->when = floor ((*i)->when * factor);
        }
 
-#ifdef STATE_MANAGER
-       save_state ("x-scaled");
-#endif
        mark_dirty ();
 }
 
@@ -415,12 +382,6 @@ AutomationList::add (double when, double value, bool for_loading)
                } 
 
                mark_dirty ();
-
-               if (!no_state && !for_loading) {
-#ifdef STATE_MANAGER
-                       save_state (_("added event"));
-#endif
-               }
        }
 
        if (!for_loading) {
@@ -452,11 +413,6 @@ AutomationList::erase (AutomationList::iterator start, AutomationList::iterator
                Glib::Mutex::Lock lm (lock);
                events.erase (start, end);
                reposition_for_rt_add (0);
-               if (!no_state) {
-#ifdef STATE_MANAGER
-                       save_state (_("removed multiple events"));
-#endif
-               }
                mark_dirty ();
        }
        maybe_signal_changed ();
@@ -485,12 +441,6 @@ AutomationList::reset_range (double start, double endt)
                        
                        reset = true;
 
-                       if (!no_state) {
-#ifdef STATE_MANAGER
-                               save_state (_("removed range"));
-#endif
-                       }
-
                        mark_dirty ();
                }
        }
@@ -518,11 +468,6 @@ AutomationList::erase_range (double start, double endt)
                        events.erase (s, e);
                        reposition_for_rt_add (0);
                        erased = true;
-                       if (!no_state) {
-#ifdef STATE_MANAGER
-                               save_state (_("removed range"));
-#endif
-                       }
                        mark_dirty ();
                }
                
@@ -550,12 +495,6 @@ AutomationList::move_range (iterator start, iterator end, double xdelta, double
                        ++start;
                }
 
-               if (!no_state) {
-#ifdef STATE_MANAGER
-                       save_state (_("event range adjusted"));
-#endif
-               }
-
                mark_dirty ();
        }
 
@@ -574,12 +513,6 @@ AutomationList::modify (iterator iter, double when, double val)
                Glib::Mutex::Lock lm (lock);
                (*iter)->when = when;
                (*iter)->value = val;
-               if (!no_state) {
-#ifdef STATE_MANAGER
-                       save_state (_("event adjusted"));
-#endif
-               }
-
                mark_dirty ();
        }
        
@@ -635,42 +568,6 @@ AutomationList::thaw ()
        }
 }
 
-#ifdef STATE_MANAGER
-StateManager::State*
-AutomationList::state_factory (std::string why) const
-{
-       State* state = new State (why);
-
-       for (AutomationEventList::const_iterator x = events.begin(); x != events.end(); ++x) {
-               state->events.push_back (point_factory (**x));
-       }
-
-       return state;
-}
-
-Change
-AutomationList::restore_state (StateManager::State& state) 
-{
-       {
-               Glib::Mutex::Lock lm (lock);
-               State* lstate = dynamic_cast<State*> (&state);
-
-               events.clear ();
-               for (AutomationEventList::const_iterator x = lstate->events.begin(); x != lstate->events.end(); ++x) {
-                       events.push_back (point_factory (**x));
-               }
-       }
-
-       return Change (0);
-}
-
-UndoAction
-AutomationList::get_memento () const
-{
-  return sigc::bind (mem_fun (*(const_cast<AutomationList*> (this)), &StateManager::use_state), _current_state_id);
-}
-#endif
-
 void
 AutomationList::set_max_xval (double x)
 {
@@ -1107,11 +1004,6 @@ AutomationList::cut_copy_clear (double start, double end, int op)
 
                if (changed) {
                        reposition_for_rt_add (0);
-                       if (!no_state) {
-#ifdef STATE_MANAGER
-                               save_state (_("cut/copy/clear"));
-#endif
-                       }
                }
 
                mark_dirty ();
@@ -1141,12 +1033,6 @@ AutomationList::copy (iterator start, iterator end)
                        
                        x = tmp;
                }
-
-               if (!no_state) {
-#ifdef STATE_MANAGER
-                       save_state (_("copy"));
-#endif
-               }
        }
 
        return nal;
@@ -1211,13 +1097,6 @@ AutomationList::paste (AutomationList& alist, double pos, float times)
                }
 
                reposition_for_rt_add (0);
-
-               if (!no_state) {
-#ifdef STATE_MANAGER
-                       save_state (_("paste"));
-#endif
-               }
-
                mark_dirty ();
        }
 
index 5f7d69247161d1521bdce3159afec0d84239bca5..c9c6db7baf81896fd7e9b432d8b1ba54c9251721 100644 (file)
@@ -435,15 +435,6 @@ Curve::point_factory (const ControlEvent& other) const
        return new CurvePoint (other.when, other.value);
 }
 
-#ifdef STATE_MANAGER
-Change
-Curve::restore_state (StateManager::State& state)
-{
-       mark_dirty ();
-       return AutomationList::restore_state (state);
-}
-#endif 
-
 extern "C" {
 
 void 
index 5531e4136b73f4802f6a30156a796281d5294104..ee8fdbcec03f77aa9ebd1066690e98447c227b57 100644 (file)
@@ -81,10 +81,6 @@ PluginInsert::PluginInsert (Session& s, boost::shared_ptr<Plugin> plug, Placemen
        
        init ();
 
-#ifdef STATE_MANAGER
-       save_state (_("initial state"));
-#endif
-
        {
                Glib::Mutex::Lock em (_session.engine().process_lock());
                IO::MoreOutputs (output_streams ());
@@ -102,10 +98,6 @@ PluginInsert::PluginInsert (Session& s, const XMLNode& node)
 
        set_automatable ();
 
-#ifdef STATE_MANAGER
-       save_state (_("initial state"));
-#endif
-
        _plugins[0]->ParameterChanged.connect (mem_fun (*this, &PluginInsert::parameter_changed));
 
        {
@@ -129,10 +121,6 @@ PluginInsert::PluginInsert (const PluginInsert& other)
 
        init ();
 
-#ifdef STATE_MANAGER
-       save_state (_("initial state"));
-#endif
-
        RedirectCreated (this); /* EMIT SIGNAL */
 }
 
@@ -781,35 +769,6 @@ PluginInsert::latency()
        return _plugins[0]->latency ();
 }
        
-void
-PluginInsert::store_state (PluginInsertState& state) const
-{
-       Redirect::store_state (state);
-       _plugins[0]->store_state (state.plugin_state);
-}
-
-Change
-PluginInsert::restore_state (StateManager::State& state)
-{
-       PluginInsertState* pistate = dynamic_cast<PluginInsertState*> (&state);
-
-       Redirect::restore_state (state);
-
-       _plugins[0]->restore_state (pistate->plugin_state);
-
-       return Change (0);
-}
-
-StateManager::State*
-PluginInsert::state_factory (std::string why) const
-{
-       PluginInsertState* state = new PluginInsertState (why);
-
-       store_state (*state);
-
-       return state;
-}
-
 ARDOUR::PluginType
 PluginInsert::type ()
 {
@@ -847,10 +806,7 @@ PortInsert::PortInsert (Session& s, Placement p)
        : Insert (s, p, 1, -1, 1, -1)
 {
        init ();
-#ifdef STATE_MANAGER
-       save_state (_("initial state"));
        RedirectCreated (this); /* EMIT SIGNAL */
-#endif
 
 }
 
@@ -858,11 +814,7 @@ PortInsert::PortInsert (const PortInsert& other)
        : Insert (other._session, other.placement(), 1, -1, 1, -1)
 {
        init ();
-#ifdef STATE_MANAGER
-       save_state (_("initial state"));
        RedirectCreated (this); /* EMIT SIGNAL */
-#endif
-
 }
 
 void
index a9751268ffba557dd9b110683f6d504f4d503375..323c58b65e1e83dbf6d5fcdae6ba87c6e73b3f38 100644 (file)
@@ -2313,27 +2313,6 @@ IO::setup_peak_meters ()
        }
 }
 
-#ifdef STATE_MANAGER
-UndoAction
-IO::get_memento() const
-{
-  return sigc::bind (mem_fun (*(const_cast<IO *>(this)), &StateManager::use_state), _current_state_id);
-}
-
-Change
-IO::restore_state (StateManager::State& state)
-{
-       return Change (0);
-}
-
-StateManager::State*
-IO::state_factory (std::string why) const
-{
-       StateManager::State* state = new StateManager::State (why);
-       return state;
-}
-#endif
-
 /**
     Update the peak meters.
 
@@ -2490,10 +2469,6 @@ IO::load_automation (const string& path)
                }
        }
 
-#ifdef STATE_MANAGER
-       _gain_automation_curve.save_state (_("loaded from disk"));
-#endif
-
        return 0;
 }
        
@@ -2619,12 +2594,6 @@ IO::transport_stopped (nframes_t frame)
 
        if (_gain_automation_curve.automation_state() != Off) {
                
-#ifdef STATE_MANAGER
-               if (gain_automation_recording()) {
-                       _gain_automation_curve.save_state (_("automation write/touch"));
-               }
-#endif
-
                /* the src=0 condition is a special signal to not propagate 
                   automation gain changes into the mix group when locating.
                */
index 0744a62db46e3b75199f2822e4c09ac15162b91d..c96e14e30a3071cdb50d56dcce5cee62741c22fe 100644 (file)
@@ -158,33 +158,6 @@ LadspaPlugin::~LadspaPlugin ()
        }
 }
 
-void
-LadspaPlugin::store_state (PluginState& state)
-{
-       state.parameters.clear ();
-       
-       for (uint32_t i = 0; i < parameter_count(); ++i){
-
-               if (LADSPA_IS_PORT_INPUT(port_descriptor (i)) && 
-                   LADSPA_IS_PORT_CONTROL(port_descriptor (i))){
-                       pair<uint32_t,float> datum;
-
-                       datum.first = i;
-                       datum.second = shadow_data[i];
-
-                       state.parameters.insert (datum);
-               }
-       }
-}
-
-void
-LadspaPlugin::restore_state (PluginState& state)
-{
-       for (map<uint32_t,float>::iterator i = state.parameters.begin(); i != state.parameters.end(); ++i) {
-               set_parameter (i->first, i->second);
-       }
-}
-
 float
 LadspaPlugin::default_value (uint32_t port)
 {
index f9bcd76a0b4b4bc33fa65ebe2fa5e291c37c8723..579a0e2820d2eb9faf31ae4662fd8e33134457f1 100644 (file)
@@ -372,9 +372,6 @@ Locations::Locations ()
 
 {
        current_location = 0;
-#ifdef STATE_MANAGER
-       save_state (_("initial"));
-#endif
 }
 
 Locations::~Locations () 
@@ -385,27 +382,6 @@ Locations::~Locations ()
                delete *i;
                i = tmp;
        }
-
-#ifdef STATE_MANAGER
-
-       std::set<Location*> all_locations;
-       
-
-       for (StateMap::iterator siter = states.begin(); siter != states.end(); ++siter) {
-
-               State* lstate = dynamic_cast<State*> (*siter);
-
-               for (LocationList::iterator liter = lstate->locations.begin(); liter != lstate->locations.end(); ++liter) {
-                       all_locations.insert (*liter);
-               }
-
-               for (LocationList::iterator siter = lstate->states.begin(); siter != lstate->states.end(); ++siter) {
-                       all_locations.insert (*siter);
-               }
-       }
-
-       set_delete (&all_locations);
-#endif
 }
 
 int
@@ -458,10 +434,6 @@ Locations::clear ()
                current_location = 0;
        }
 
-#ifdef STATE_MANAGER
-       save_state (_("clear"));
-#endif
-       
        changed (); /* EMIT SIGNAL */
        current_changed (0); /* EMIT SIGNAL */
 }      
@@ -485,10 +457,6 @@ Locations::clear_markers ()
                }
        }
 
-#ifdef STATE_MANAGER
-       save_state (_("clear markers"));
-#endif
-       
        changed (); /* EMIT SIGNAL */
 }      
 
@@ -515,10 +483,6 @@ Locations::clear_ranges ()
                current_location = 0;
        }
 
-#ifdef STATE_MANAGER
-       save_state (_("clear ranges"));
-#endif
-
        changed (); /* EMIT SIGNAL */
        current_changed (0); /* EMIT SIGNAL */
 }      
@@ -535,10 +499,6 @@ Locations::add (Location *loc, bool make_current)
                }
        }
        
-#ifdef STATE_MANAGER
-       save_state (_("add"));
-#endif
-
        added (loc); /* EMIT SIGNAL */
 
        if (make_current) {
@@ -575,11 +535,8 @@ Locations::remove (Location *loc)
        }
        
        if (was_removed) {
-#ifdef STATE_MANAGER
-               save_state (_("remove"));
-#endif
-
-                removed (loc); /* EMIT SIGNAL */
+               
+               removed (loc); /* EMIT SIGNAL */
 
                if (was_current) {
                         current_changed (0); /* EMIT SIGNAL */
@@ -592,9 +549,6 @@ Locations::remove (Location *loc)
 void
 Locations::location_changed (Location* loc)
 {
-#ifdef STATE_MANAGER
-       save_state (X_("location changed"));
-#endif
        changed (); /* EMIT SIGNAL */
 }
 
@@ -834,47 +788,6 @@ Locations::auto_punch_location () const
        return 0;
 }      
 
-#ifdef STATE_MANAGER
-StateManager::State*
-Locations::state_factory (std::string why) const
-{
-       State* state = new State (why);
-
-       state->locations = locations;
-       
-       for (LocationList::const_iterator i = locations.begin(); i != locations.end(); ++i) {
-               state->states.push_back (new Location (**i));
-       }
-
-       return state;
-}
-
-Change
-Locations::restore_state (StateManager::State& state) 
-{
-       {
-               Glib::Mutex::Lock lm (lock);
-               State* lstate = dynamic_cast<State*> (&state);
-
-               locations = lstate->locations;
-               LocationList& states = lstate->states;
-               LocationList::iterator l, s;
-
-               for (l = locations.begin(), s = states.begin(); s != states.end(); ++s, ++l) {
-                       (*l) = (*s);
-               }
-       }
-
-       return Change (0);
-}
-
-UndoAction
-Locations::get_memento () const
-{
-  return sigc::bind (mem_fun (*(const_cast<Locations*> (this)), &StateManager::use_state), _current_state_id);
-}
-#endif
-
 uint32_t
 Locations::num_range_markers () const
 {
index 229c4c5e1cf753ab81a1cad565ddabd424148d97..4b0bd25ba405758fe390126dfdf1b3962482e8d0 100644 (file)
@@ -206,13 +206,6 @@ BaseStereoPanner::transport_stopped (nframes_t frame)
        _automation.reposition_for_rt_add (frame);
 
        if (_automation.automation_state() != Off) {
-               
-               if (_automation.automation_write()) {
-#ifdef STATE_MANAGER
-                       _automation.save_state (_("automation write pass"));
-#endif
-               }
-
                set_position (_automation.eval (frame));
        }
 }
@@ -287,9 +280,6 @@ BaseStereoPanner::load (istream& in, string path, uint32_t& linecnt)
 
        /* now that we are done loading */
 
-#ifdef STATE_MANAGER
-       _automation.save_state (_("loaded from disk"));
-#endif
        _automation.StateChanged (Change (0));
 
        return 0;
index 87eed692b6881a6f127fc28a13e01cb97624d4c1..139f62cb91d3bdefff3a8be1df263bd88d951206 100644 (file)
@@ -1427,12 +1427,7 @@ Playlist::state (bool full_state)
 
        if (full_state) {
                RegionLock rlock (this, false);
-
-               cerr << _name << " getting region state for " << regions.size() << endl;
-
                for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
-                       cerr << "\t" << " now at " << (*i) << endl;
-                       cerr << "\t\t" << (*i)->name() << endl;
                        node->add_child_nocopy ((*i)->get_state());
                }
        }
index 18b16eaa73e4291c3189f8ddd47f0d32a0704490..e6096876624804af0fcdfc6ea514d5b8af891540 100644 (file)
@@ -144,12 +144,6 @@ Redirect::load_automation (string path)
                tosave.insert (port);
        }
        
-#ifdef STATE_MANAGER
-       for (set<uint32_t>::iterator i = tosave.begin(); i != tosave.end(); ++i) {
-               automation_list (*i).save_state (_("loaded from disk"));
-       }
-#endif
-       
        return 0;
 
   bad:
@@ -438,37 +432,10 @@ Redirect::find_next_event (nframes_t now, nframes_t end, ControlEvent& next_even
        return next_event.when != max_frames;
 }
 
-void
-Redirect::store_state (RedirectState& state) const
-{
-       state.active = _active;
-}
-
-Change
-Redirect::restore_state (StateManager::State& state)
-{
-       RedirectState* rstate = dynamic_cast<RedirectState*> (&state);
-       set_active (rstate->active, this);
-       return Change (0);
-}
-
-StateManager::State*
-Redirect::state_factory (std::string why) const
-{
-       RedirectState* state = new RedirectState (why);
-
-       store_state (*state);
-
-       return state;
-}
-
 void
 Redirect::set_active (bool yn, void* src)
 {
        _active = yn; 
-#ifdef STATE_MANAGER
-       save_state (_("active_changed"));
-#endif
        active_changed (this, src); 
        _session.set_dirty ();
 }
index 782cb1c69e7144ebdf10ebc89facc40989fc7c5b..82f1c4b31c786eb0906d7a3cbbf6c88789d30212 100644 (file)
@@ -1976,19 +1976,6 @@ Route::handle_transport_stopped (bool abort_ignored, bool did_locate, bool can_f
        _roll_delay = _initial_delay;
 }
 
-UndoAction
-Route::get_memento() const
-{
-       void (Route::*pmf)(state_id_t) = &Route::set_state;
-       return sigc::bind (mem_fun (*(const_cast<Route *>(this)), pmf), _current_state_id);
-}
-
-void
-Route::set_state (state_id_t id)
-{
-       return;
-}
-
 void
 Route::input_change_handler (IOChange change, void *ignored)
 {
index 1479eab420566fe5247d7c9ef0a9b406cad1541c..51d41a93b1d921332d542ee4d74c83d8bfea9d61 100644 (file)
@@ -36,10 +36,7 @@ Send::Send (Session& s, Placement p)
 {
        _metering = false;
        expected_inputs = 0;
-#ifdef STATE_MANAGER
-       save_state (_("initial state"));
-#endif
-        RedirectCreated (this); /* EMIT SIGNAL */
+       RedirectCreated (this); /* EMIT SIGNAL */
 }
 
 Send::Send (Session& s, const XMLNode& node)
@@ -52,11 +49,7 @@ Send::Send (Session& s, const XMLNode& node)
                throw failed_constructor();
        }
 
-#ifdef STATE_MANAGER
-       save_state (_("initial state"));
-#endif
-
-        RedirectCreated (this); /* EMIT SIGNAL */
+       RedirectCreated (this); /* EMIT SIGNAL */
 }
 
 Send::Send (const Send& other)
@@ -64,9 +57,6 @@ Send::Send (const Send& other)
 {
        _metering = false;
        expected_inputs = 0;
-#ifdef STATE_MANAGER
-       save_state (_("initial state"));
-#endif
 
        RedirectCreated (this); /* EMIT SIGNAL */
 }
index d742186d6b60a933f8138c3cf14bfa50504c380f..8a49636941e5c4327cff48bae548caf58019c31c 100644 (file)
@@ -1010,8 +1010,6 @@ Session::set_state (const XMLNode& node)
                return -1;
        }
 
-       StateManager::prohibit_save ();
-
        if ((prop = node.property ("name")) != 0) {
                _name = prop->value ();
        }
@@ -1147,10 +1145,6 @@ Session::set_state (const XMLNode& node)
                start_location = location;
        }
 
-#ifdef STATE_MANAGER
-       _locations.save_state (_("initial state"));
-#endif
-
        if ((child = find_named_node (node, "EditGroups")) == 0) {
                error << _("Session: XML state has no edit groups section") << endmsg;
                goto out;
@@ -1195,8 +1189,6 @@ Session::set_state (const XMLNode& node)
 
        _state_of_the_state = Clean;
 
-       StateManager::allow_save (_("initial state"), true);
-
        if (state_was_pending) {
                save_state (_current_snapshot_name);
                remove_pending_capture_state ();
@@ -1206,8 +1198,6 @@ Session::set_state (const XMLNode& node)
        return 0;
 
   out:
-       /* we failed, re-enable state saving but don't actually save internal state */
-       StateManager::allow_save (X_("ignored"), false);
        return ret;
 }
 
diff --git a/libs/ardour/state_manager.cc b/libs/ardour/state_manager.cc
deleted file mode 100644 (file)
index 153773e..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-#include <pbd/error.h>
-#include <ardour/state_manager.h>
-
-#include "i18n.h"
-
-using namespace ARDOUR;
-using namespace std;
-using namespace PBD;
-
-bool StateManager::_allow_save = true;
-sigc::signal<void,const char*> StateManager::SaveAllowed;
-
-StateManager::StateManager ()
-{
-       _current_state_id = 0;
-}
-
-StateManager::~StateManager()
-{
-}
-
-void
-StateManager::prohibit_save ()
-{
-       _allow_save = false;
-}
-
-void
-StateManager::allow_save (const char* why, bool do_save)
-{
-       _allow_save = true;
-       if (do_save) {
-               SaveAllowed (why);
-               SaveAllowed.slots().erase (SaveAllowed.slots().begin(), SaveAllowed.slots().end());
-       }
-}
-
-void
-StateManager::drop_all_states ()
-{
-       for (StateMap::iterator i = states.begin(); i != states.end(); ++i) {
-               delete *i;
-       }
-
-       states.clear ();
-
-       save_state (_("cleared history"));
-}
-
-void
-StateManager::use_state (state_id_t id)
-{
-       Change what_changed;
-       state_id_t n;
-       StateMap::iterator i;
-
-       for (n = 0, i = states.begin(); n < id && i != states.end(); ++n, ++i);
-
-       if (n != id || i == states.end()) {
-               fatal << string_compose (_("programming error: illegal state ID (%1) passed to "
-                                   "StateManager::set_state() (range = 0-%2)"), id, states.size()-1)
-                     << endmsg;
-               /*NOTREACHED*/
-               return;
-       }
-
-       what_changed = restore_state (**i);
-       _current_state_id = id;
-       send_state_changed (what_changed);
-}
-
-void
-StateManager::save_state (std::string why)
-{
-       if (!should_save_state())
-               return;
-
-       if (!_allow_save) {
-               SaveAllowed.connect (mem_fun (*this, &StateManager::save_state));
-               return;
-       }
-
-       states.push_back (state_factory (why));
-       _current_state_id = states.size() - 1;
-}
-
-void
-StateManager::send_state_changed (Change what_changed)
-{
-       StateChanged (what_changed);
-}
index e9d46f83e3736177cb84a9d6cb9f1f24f5f3820c..0ff94324bb088f369c92835006d9335791919708 100644 (file)
@@ -206,9 +206,6 @@ TempoMap::TempoMap (nframes_t fr)
        _frame_rate = fr;
        last_bbt_valid = false;
        BBT_Time start;
-#ifdef STATE_MANAGER
-       in_set_state = false;
-#endif
        
        start.bars = 1;
        start.beats = 1;
@@ -224,10 +221,6 @@ TempoMap::TempoMap (nframes_t fr)
        
        metrics->push_back (t);
        metrics->push_back (m);
-       
-#ifdef STATE_MANAGER
-       save_state (_("initial"));
-#endif
 }
 
 TempoMap::~TempoMap ()
@@ -260,9 +253,6 @@ TempoMap::move_metric_section (MetricSection& section, const BBT_Time& when)
        section.set_start (corrected);
        metrics->sort (cmp);
        timestamp_metrics ();
-#ifdef STATE_MANAGER
-       save_state (_("move metric"));
-#endif
 
        return 0;
 }
@@ -331,12 +321,6 @@ TempoMap::remove_meter (const MeterSection& tempo)
                                }
                        }
                }
-
-               if (removed) {
-#ifdef STATE_MANAGER
-                       save_state (_("metric removed"));
-#endif
-               }
        }
 
        if (removed) {
@@ -377,10 +361,6 @@ TempoMap::add_tempo (const Tempo& tempo, BBT_Time where)
                where.ticks = 0;
                
                do_insert (new TempoSection (where, tempo.beats_per_minute()));
-
-#ifdef STATE_MANAGER
-               save_state (_("add tempo"));
-#endif
        }
 
        StateChanged (Change (0));
@@ -407,12 +387,6 @@ TempoMap::replace_tempo (TempoSection& existing, const Tempo& replacement)
                                break;
                        }
                }
-
-               if (replaced) {
-#ifdef STATE_MANAGER
-                       save_state (_("replace tempo"));
-#endif
-               }
        }
        
        if (replaced) {
@@ -443,10 +417,6 @@ TempoMap::add_meter (const Meter& meter, BBT_Time where)
                where.ticks = 0;
 
                do_insert (new MeterSection (where, meter.beats_per_bar(), meter.note_divisor()));
-
-#ifdef STATE_MANAGER
-               save_state (_("add meter"));
-#endif
        }
 
        StateChanged (Change (0));
@@ -472,12 +442,6 @@ TempoMap::replace_meter (MeterSection& existing, const Meter& replacement)
                                break;
                        }
                }
-
-               if (replaced) {
-#ifdef STATE_MANAGER
-                       save_state (_("replaced meter"));
-#endif
-               }
        }
        
        if (replaced) {
@@ -1282,10 +1246,6 @@ TempoMap::set_state (const XMLNode& node)
                XMLNodeConstIterator niter;
                Metrics old_metrics (*metrics);
                
-#ifdef STATE_MANAGER
-               in_set_state = true;
-#endif
-               
                metrics->clear();
 
                nlist = node.children();
@@ -1325,24 +1285,8 @@ TempoMap::set_state (const XMLNode& node)
                        metrics->sort (cmp);
                        timestamp_metrics ();
                }
-
-#ifdef STATE_MANAGER
-               in_set_state = false;
-#endif
        }
        
-       /* This state needs to be saved. This string will never be a part of the 
-          object's history though, because the allow_save flag is false during 
-          session load. This state will eventually be tagged "initial state", 
-          by a call to StateManager::allow_save from Session::set_state.
-
-          If this state is not saved, there is no way to reach it through undo actions.
-       */
-
-#ifdef STATE_MANAGER
-       save_state(_("load XML data"));
-#endif
-       
        StateChanged (Change (0));
 
        return 0;
@@ -1366,67 +1310,3 @@ TempoMap::dump (std::ostream& o) const
        }
 }
 
-#ifdef STATE_MANAGER
-UndoAction
-TempoMap::get_memento () const
-{
-       return sigc::bind (mem_fun (*(const_cast<TempoMap *> (this)), &StateManager::use_state), _current_state_id);
-}
-
-Change
-TempoMap::restore_state (StateManager::State& state)
-{
-       Glib::RWLock::ReaderLock lm (lock);
-
-       TempoMapState* tmstate = dynamic_cast<TempoMapState*> (&state);
-
-       /* We can't just set the metrics pointer to the address of the metrics list 
-          stored in the state, cause this would ruin this state for restoring in
-          the future. If they have the same address, they are the same list.
-          Thus we need to copy all the elements from the state metrics list to the 
-          current metrics list.
-       */
-       metrics->clear();
-       for (Metrics::iterator i = tmstate->metrics->begin(); i != tmstate->metrics->end(); ++i) {
-               TempoSection *ts;
-               MeterSection *ms;
-               
-               if ((ts = dynamic_cast<TempoSection*>(*i)) != 0) {
-                       metrics->push_back (new TempoSection (*ts));
-               } else if ((ms = dynamic_cast<MeterSection*>(*i)) != 0) {
-                       metrics->push_back (new MeterSection (*ms));
-               }
-       }
-       
-       last_bbt_valid = false;
-
-       return Change (0);
-}
-
-StateManager::State* 
-TempoMap::state_factory (std::string why) const
-{
-       TempoMapState* state = new TempoMapState (why);
-
-       for (Metrics::iterator i = metrics->begin(); i != metrics->end(); ++i) {
-               TempoSection *ts;
-               MeterSection *ms;
-               
-               if ((ts = dynamic_cast<TempoSection*>(*i)) != 0) {
-                       state->metrics->push_back (new TempoSection (*ts));
-               } else if ((ms = dynamic_cast<MeterSection*>(*i)) != 0) {
-                       state->metrics->push_back (new MeterSection (*ms));
-               }
-       }
-               
-       return state;
-}
-
-void
-TempoMap::save_state (std::string why)
-{
-       if (!in_set_state) {
-               StateManager::save_state (why);
-       }
-}
-#endif