summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r--libs/ardour/ardour/audioplaylist.h31
-rw-r--r--libs/ardour/ardour/audioregion.h20
-rw-r--r--libs/ardour/ardour/crossfade.h24
-rw-r--r--libs/ardour/ardour/playlist.h18
-rw-r--r--libs/ardour/ardour/region.h29
5 files changed, 17 insertions, 105 deletions
diff --git a/libs/ardour/ardour/audioplaylist.h b/libs/ardour/ardour/audioplaylist.h
index 341b08930c..6d67e0f793 100644
--- a/libs/ardour/ardour/audioplaylist.h
+++ b/libs/ardour/ardour/audioplaylist.h
@@ -38,19 +38,6 @@ class AudioPlaylist : public ARDOUR::Playlist
{
public:
typedef std::list<Crossfade*> Crossfades;
-
- private:
-
- struct State : public ARDOUR::StateManager::State {
- RegionList regions;
- std::list<UndoAction> region_states;
-
- Crossfades crossfades;
- std::list<UndoAction> crossfade_states;
-
- State (std::string why) : ARDOUR::StateManager::State (why) {}
- ~State ();
- };
public:
AudioPlaylist (Session&, const XMLNode&, bool hidden = false);
@@ -58,35 +45,21 @@ class AudioPlaylist : public ARDOUR::Playlist
AudioPlaylist (const AudioPlaylist&, string name, bool hidden = false);
AudioPlaylist (const AudioPlaylist&, nframes_t start, nframes_t cnt, string name, bool hidden = false);
- void clear (bool with_save = true);
+ void clear ();
nframes_t read (Sample *dst, Sample *mixdown, float *gain_buffer, nframes_t start, nframes_t cnt, uint32_t chan_n=0);
int set_state (const XMLNode&);
- UndoAction get_memento() const;
sigc::signal<void,Crossfade *> NewCrossfade;
template<class T> void foreach_crossfade (T *t, void (T::*func)(Crossfade *));
void crossfades_at (nframes_t frame, Crossfades&);
- template<class T> void apply_to_history (T& obj, void (T::*method)(const ARDOUR::StateManager::StateMap&, state_id_t)) {
- RegionLock rlock (this);
- (obj.*method) (states, _current_state_id);
- }
-
bool destroy_region (boost::shared_ptr<Region>);
- void drop_all_states ();
-
protected:
- /* state management */
-
- StateManager::State* state_factory (std::string) const;
- Change restore_state (StateManager::State&);
- void send_state_change (Change);
-
/* playlist "callbacks" */
void notify_crossfade_added (Crossfade *);
void flush_notifications ();
@@ -101,7 +74,7 @@ class AudioPlaylist : public ARDOUR::Playlist
~AudioPlaylist (); /* public should use unref() */
private:
- Crossfades _crossfades;
+ Crossfades _crossfades; /* xfades currently in use */
Crossfades _pending_xfade_adds;
void crossfade_invalidated (Crossfade*);
diff --git a/libs/ardour/ardour/audioregion.h b/libs/ardour/ardour/audioregion.h
index c9cb2b8152..4be5d27a6b 100644
--- a/libs/ardour/ardour/audioregion.h
+++ b/libs/ardour/ardour/audioregion.h
@@ -42,18 +42,6 @@ class Session;
class AudioFilter;
class AudioSource;
-struct AudioRegionState : public RegionState
-{
- AudioRegionState (std::string why);
-
- Curve _fade_in;
- Curve _fade_out;
- Curve _envelope;
- gain_t _scale_amplitude;
- uint32_t _fade_in_disabled;
- uint32_t _fade_out_disabled;
-};
-
class AudioRegion : public Region
{
public:
@@ -131,8 +119,6 @@ class AudioRegion : public Region
int separate_by_channel (ARDOUR::Session&, vector<AudioRegion*>&) const;
- UndoAction get_memento() const;
-
/* filter */
int apply (AudioFilter&);
@@ -167,9 +153,6 @@ class AudioRegion : public Region
void set_default_fade_out ();
void set_default_envelope ();
- StateManager::State* state_factory (std::string why) const;
- Change restore_state (StateManager::State&);
-
void recompute_gain_at_end ();
void recompute_gain_at_start ();
@@ -204,6 +187,9 @@ class AudioRegion : public Region
gain_t _scale_amplitude;
uint32_t _fade_in_disabled;
uint32_t _fade_out_disabled;
+
+ protected:
+ int set_live_state (const XMLNode&, Change&, bool send);
};
} /* namespace ARDOUR */
diff --git a/libs/ardour/ardour/crossfade.h b/libs/ardour/ardour/crossfade.h
index 7fd7323b36..d1b2e8f1e1 100644
--- a/libs/ardour/ardour/crossfade.h
+++ b/libs/ardour/ardour/crossfade.h
@@ -33,7 +33,6 @@
#include <ardour/ardour.h>
#include <ardour/curve.h>
#include <ardour/audioregion.h>
-#include <ardour/state_manager.h>
#include <ardour/crossfade_compare.h>
namespace ARDOUR {
@@ -41,19 +40,7 @@ namespace ARDOUR {
class AudioRegion;
class Playlist;
-struct CrossfadeState : public StateManager::State {
- CrossfadeState (std::string reason) : StateManager::State (reason) {}
-
- UndoAction fade_in_memento;
- UndoAction fade_out_memento;
- nframes_t position;
- nframes_t length;
- AnchorPoint anchor_point;
- bool follow_overlap;
- bool active;
-};
-
-class Crossfade : public PBD::StatefulDestructible, public StateManager
+class Crossfade : public PBD::StatefulDestructible
{
public:
@@ -122,6 +109,7 @@ class Crossfade : public PBD::StatefulDestructible, public StateManager
nframes_t position() const { return _position; }
sigc::signal<void,Crossfade*> Invalidated;
+ sigc::signal<void,Change> StateChanged;
bool covers (nframes_t frame) const {
return _position <= frame && frame < _position + _length;
@@ -129,8 +117,6 @@ class Crossfade : public PBD::StatefulDestructible, public StateManager
OverlapType coverage (nframes_t start, nframes_t end) const;
- UndoAction get_memento() const;
-
static void set_buffer_size (nframes_t);
bool active () const { return _active; }
@@ -172,15 +158,11 @@ class Crossfade : public PBD::StatefulDestructible, public StateManager
static Sample* crossfade_buffer_out;
static Sample* crossfade_buffer_in;
- void initialize (bool savestate=true);
+ void initialize ();
int compute (boost::shared_ptr<ARDOUR::AudioRegion>, boost::shared_ptr<ARDOUR::AudioRegion>, CrossfadeModel);
bool update (bool force);
- StateManager::State* state_factory (std::string why) const;
- Change restore_state (StateManager::State&);
-
void member_changed (ARDOUR::Change);
-
};
diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h
index 4c2e75c6c9..8f08c58466 100644
--- a/libs/ardour/ardour/playlist.h
+++ b/libs/ardour/ardour/playlist.h
@@ -40,14 +40,13 @@
#include <ardour/ardour.h>
#include <ardour/crossfade_compare.h>
#include <ardour/location.h>
-#include <ardour/state_manager.h>
namespace ARDOUR {
class Session;
class Region;
-class Playlist : public StateManager, public PBD::StatefulDestructible {
+class Playlist : public PBD::StatefulDestructible {
public:
typedef list<boost::shared_ptr<Region> > RegionList;
@@ -56,9 +55,8 @@ class Playlist : public StateManager, public PBD::StatefulDestructible {
Playlist (const Playlist&, string name, bool hidden = false);
Playlist (const Playlist&, nframes_t start, nframes_t cnt, string name, bool hidden = false);
- virtual void clear (bool with_save = true);
+ virtual void clear ();
virtual void dump () const;
- virtual UndoAction get_memento() const = 0;
void ref();
void unref();
@@ -80,7 +78,7 @@ class Playlist : public StateManager, public PBD::StatefulDestructible {
/* Editing operations */
- void add_region (boost::shared_ptr<Region>, nframes_t position, float times = 1, bool with_save = true);
+ void add_region (boost::shared_ptr<Region>, nframes_t position, float times = 1);
void remove_region (boost::shared_ptr<Region>);
void get_equivalent_regions (boost::shared_ptr<Region>, std::vector<boost::shared_ptr<Region> >&);
void get_region_list_equivalent_regions (boost::shared_ptr<Region>, std::vector<boost::shared_ptr<Region> >&);
@@ -111,8 +109,6 @@ class Playlist : public StateManager, public PBD::StatefulDestructible {
int set_state (const XMLNode&);
XMLNode& get_template ();
- sigc::signal<void,boost::shared_ptr<Region> > RegionAdded;
- sigc::signal<void,boost::shared_ptr<Region> > RegionRemoved;
sigc::signal<void,Playlist*,bool> InUse;
sigc::signal<void> Modified;
sigc::signal<void> NameChanged;
@@ -169,13 +165,12 @@ class Playlist : public StateManager, public PBD::StatefulDestructible {
friend class RegionLock;
RegionList regions; /* the current list of regions in the playlist */
+ std::set<boost::shared_ptr<Region> > all_regions; /* all regions ever added to this playlist */
string _name;
Session& _session;
mutable gint block_notifications;
mutable gint ignore_state_changes;
mutable Glib::Mutex region_lock;
- RegionList pending_removals;
- RegionList pending_adds;
RegionList pending_bounds;
bool pending_modified;
bool pending_length;
@@ -244,10 +239,7 @@ class Playlist : public StateManager, public PBD::StatefulDestructible {
virtual XMLNode& state (bool);
- /* override state_manager::save_state so we can check in_set_state() */
-
- void save_state (std::string why);
- void maybe_save_state (std::string why);
+ boost::shared_ptr<Region> region_by_id (PBD::ID);
void add_region_internal (boost::shared_ptr<Region>, nframes_t position, bool delay_sort = false);
diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h
index 30cd3267df..67e00d0ee8 100644
--- a/libs/ardour/ardour/region.h
+++ b/libs/ardour/ardour/region.h
@@ -28,7 +28,6 @@
#include <pbd/statefuldestructible.h>
#include <ardour/ardour.h>
-#include <ardour/state_manager.h>
class XMLNode;
@@ -42,21 +41,7 @@ enum RegionEditState {
EditChangesID = 2
};
-struct RegionState : public StateManager::State
-{
- RegionState (std::string why) : StateManager::State (why) {}
-
- nframes_t _start;
- nframes_t _length;
- nframes_t _position;
- uint32_t _flags;
- nframes_t _sync_position;
- layer_t _layer;
- string _name;
- mutable RegionEditState _first_edit;
-};
-
-class Region : public PBD::StatefulDestructible, public StateManager, public boost::enable_shared_from_this<Region>
+class Region : public PBD::StatefulDestructible, public boost::enable_shared_from_this<Region>
{
public:
enum Flag {
@@ -92,6 +77,8 @@ class Region : public PBD::StatefulDestructible, public StateManager, public boo
static Change LayerChanged;
static Change HiddenChanged;
+ sigc::signal<void,Change> StateChanged;
+
virtual ~Region();
/* Note: changing the name of a Region does not constitute an edit */
@@ -176,8 +163,6 @@ class Region : public PBD::StatefulDestructible, public StateManager, public boo
ARDOUR::Playlist* playlist() const { return _playlist; }
- virtual UndoAction get_memento() const = 0;
-
void set_playlist (ARDOUR::Playlist*);
virtual void lock_sources () {}
@@ -188,6 +173,7 @@ class Region : public PBD::StatefulDestructible, public StateManager, public boo
XMLNode& get_state ();
virtual XMLNode& state (bool);
virtual int set_state (const XMLNode&);
+ virtual int set_live_state (const XMLNode&, Change&, bool send);
virtual boost::shared_ptr<Region> get_parent() = 0;
@@ -207,15 +193,8 @@ class Region : public PBD::StatefulDestructible, public StateManager, public boo
protected:
XMLNode& get_short_state (); /* used only by Session */
- /* state management */
-
void send_change (Change);
- /* derived classes need these during their own state management calls */
-
- void store_state (RegionState&) const;
- Change restore_and_return_flags (RegionState&);
-
void trim_to_internal (nframes_t position, nframes_t length, void *src);
bool copied() const { return _flags & Copied; }