diff options
author | Carl Hetherington <carl@carlh.net> | 2011-12-29 22:14:15 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2011-12-29 22:14:15 +0000 |
commit | b1775149307a157444c516693ad6b98a404ef1b2 (patch) | |
tree | ffdf04d8396cf53d5378c073a8d249150d5282eb /libs/ardour/ardour | |
parent | cabb76cce6203d34299136371078bd20b6abe1e3 (diff) |
Revert internals of the last layering-related commit, and go back a slightly-cleaned-up version of how it was before. Remove all layering modes; only option now is add-is-higher. Move-add-higher could easily be re-added if anyone uses it.
git-svn-id: svn://localhost/ardour2/branches/3.0@11111 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/playlist.h | 75 | ||||
-rw-r--r-- | libs/ardour/ardour/region.h | 26 | ||||
-rw-r--r-- | libs/ardour/ardour/region_sorters.h | 16 | ||||
-rw-r--r-- | libs/ardour/ardour/session_configuration_vars.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/types.h | 13 |
5 files changed, 13 insertions, 119 deletions
diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h index a8be02a0b9..a7ead83eef 100644 --- a/libs/ardour/ardour/playlist.h +++ b/libs/ardour/ardour/playlist.h @@ -44,9 +44,6 @@ #include "ardour/session_object.h" #include "ardour/data_type.h" -class PlaylistOverlapCacheTest; -class PlaylistLayeringTest; - namespace ARDOUR { class Session; @@ -225,10 +222,7 @@ public: framepos_t find_next_top_layer_position (framepos_t) const; uint32_t combine_ops() const { return _combine_ops; } - void relayer (boost::shared_ptr<Region>); - void relayer (boost::shared_ptr<Region>, double); - void suspend_relayer (); - void resume_relayer (); + uint64_t highest_layering_index () const; protected: friend class Session; @@ -355,7 +349,7 @@ public: boost::shared_ptr<Playlist> cut (framepos_t start, framecnt_t cnt, bool result_is_hidden); boost::shared_ptr<Playlist> copy (framepos_t start, framecnt_t cnt, bool result_is_hidden); - void relayer (RegionList const &); + void relayer (); void begin_undo (); void end_undo (); @@ -382,71 +376,6 @@ public: with its constituent regions */ virtual void pre_uncombine (std::vector<boost::shared_ptr<Region> >&, boost::shared_ptr<Region>) {} - -private: - friend class ::PlaylistOverlapCacheTest; - friend class ::PlaylistLayeringTest; - - /** A class which is used to store temporary (fractional) - * layer assignments for some regions. - */ - class TemporaryLayers - { - public: - void set (boost::shared_ptr<Region>, double); - double get (boost::shared_ptr<Region>) const; - - private: - typedef std::map<boost::shared_ptr<Region>, double> Map; - Map _map; - }; - - /** Class to sort by temporary layer, for use with std::list<>::sort() */ - class SortByTemporaryLayer - { - public: - SortByTemporaryLayer (TemporaryLayers const & t) - : _temporary_layers (t) {} - - bool operator() (boost::shared_ptr<Region> a, boost::shared_ptr<Region> b) const { - return _temporary_layers.get (a) < _temporary_layers.get (b); - } - - private: - Playlist::TemporaryLayers const & _temporary_layers; - }; - - /** A cache of what overlaps what, for a given playlist in a given state. - * Divides a playlist up into time periods and notes which regions cover those - * periods, so that get() is reasonably quick. - */ - class OverlapCache - { - public: - OverlapCache (Playlist *); - - RegionList get (Evoral::Range<framepos_t>) const; - - private: - std::pair<int, int> cache_indices (Evoral::Range<framepos_t>) const; - - double _division_size; - std::vector<RegionList> _cache; - Evoral::Range<framepos_t> _range; - - static int const _divisions; - }; - - TemporaryLayers compute_temporary_layers (RegionList const &); - void commit_temporary_layers (TemporaryLayers const &); - - RegionList recursive_regions_touched (boost::shared_ptr<Region>, OverlapCache const &, boost::shared_ptr<Region>) const; - void recursive_regions_touched_sub (boost::shared_ptr<Region>, OverlapCache const &, boost::shared_ptr<Region>, RegionList &) const; - - void timestamp_layer_op (LayerOp, boost::shared_ptr<Region>); - uint64_t layer_op_counter; - - bool _relayer_suspended; }; } /* namespace ARDOUR */ diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h index 4315ed7aa8..ab1559fc4a 100644 --- a/libs/ardour/ardour/region.h +++ b/libs/ardour/ardour/region.h @@ -65,6 +65,7 @@ namespace Properties { extern PBD::PropertyDescriptor<float> stretch; extern PBD::PropertyDescriptor<float> shift; extern PBD::PropertyDescriptor<PositionLockStyle> position_lock_style; + extern PBD::PropertyDescriptor<uint64_t> layering_index; }; class Playlist; @@ -112,7 +113,6 @@ class Region framepos_t start () const { return _start; } framecnt_t length () const { return _length; } layer_t layer () const { return _layer; } - Evoral::Range<framepos_t> bounds () const; framecnt_t source_length(uint32_t n) const; uint32_t max_source_level () const; @@ -202,7 +202,7 @@ class Region void cut_front (framepos_t new_position); void cut_end (framepos_t new_position); - void set_layer (layer_t l); /* ONLY Playlist should call this */ + void set_layer (layer_t l); /* ONLY Playlist can call this */ void raise (); void lower (); void raise_to_top (); @@ -252,8 +252,8 @@ class Region virtual boost::shared_ptr<Region> get_parent() const; - uint64_t last_layer_op (LayerOp) const; - void set_last_layer_op (LayerOp, uint64_t); + uint64_t layering_index () const { return _layering_index; } + void set_layering_index (uint64_t when) { _layering_index = when; } virtual bool is_dependent() const { return false; } virtual bool depends_on (boost::shared_ptr<Region> /*other*/) const { return false; } @@ -294,12 +294,11 @@ class Region void invalidate_transients (); - void drop_sources (); + void set_pending_layer (double); + bool reset_pending_layer (); + boost::optional<double> pending_layer () const; - /** @return our bounds the last time our relayer() method was called */ - Evoral::Range<framepos_t> last_relayer_bounds () const { - return Evoral::Range<framepos_t> (_last_relayer_bounds_from, _last_relayer_bounds_to); - } + void drop_sources (); protected: friend class RegionFactory; @@ -384,18 +383,15 @@ class Region PBD::Property<float> _stretch; PBD::Property<float> _shift; PBD::EnumProperty<PositionLockStyle> _position_lock_style; + PBD::Property<uint64_t> _layering_index; - /* XXX: could use a Evoral::Range<> but I'm too lazy to make PBD::Property serialize such a thing nicely */ - PBD::Property<framepos_t> _last_relayer_bounds_from; ///< from of our bounds last time relayer() was called - PBD::Property<framepos_t> _last_relayer_bounds_to; ///< to of our bounds last time relayer() was called - PBD::Property<uint64_t> _last_layer_op_add; - PBD::Property<uint64_t> _last_layer_op_bounds_change; - framecnt_t _last_length; framepos_t _last_position; mutable RegionEditState _first_edit; Timecode::BBT_Time _bbt_time; + boost::optional<double> _pending_layer; + void register_properties (); void use_sources (SourceList const &); diff --git a/libs/ardour/ardour/region_sorters.h b/libs/ardour/ardour/region_sorters.h index 0e3203ef20..baa3a3417d 100644 --- a/libs/ardour/ardour/region_sorters.h +++ b/libs/ardour/ardour/region_sorters.h @@ -36,22 +36,6 @@ struct RegionSortByLayer { } }; -struct RegionSortByAdd { - bool operator() (boost::shared_ptr<Region> a, boost::shared_ptr<Region> b) { - return ( - (a->last_layer_op (LayerOpAdd) < b->last_layer_op (LayerOpAdd)) - ); - } -}; - -struct RegionSortByAddOrBounds { - bool operator() (boost::shared_ptr<Region> a, boost::shared_ptr<Region> b) { - uint64_t const p = std::max (a->last_layer_op (LayerOpAdd), a->last_layer_op (LayerOpBoundsChange)); - uint64_t const q = std::max (b->last_layer_op (LayerOpAdd), b->last_layer_op (LayerOpBoundsChange)); - return p < q; - } -}; - } // namespace #endif /* __libardour_region_sorters_h__ */ diff --git a/libs/ardour/ardour/session_configuration_vars.h b/libs/ardour/ardour/session_configuration_vars.h index 57f390f100..87b317d3e8 100644 --- a/libs/ardour/ardour/session_configuration_vars.h +++ b/libs/ardour/ardour/session_configuration_vars.h @@ -47,8 +47,6 @@ CONFIG_VARIABLE_SPECIAL(std::string, audio_search_path, "audio-search-path", "", CONFIG_VARIABLE_SPECIAL(std::string, midi_search_path, "midi-search-path", "", search_path_expand) CONFIG_VARIABLE (std::string, bwf_country_code, "bwf-country-code", "US") CONFIG_VARIABLE (std::string, bwf_organization_code, "bwf-organization-code", "US") -CONFIG_VARIABLE (LayerModel, layer_model, "layer-model", AddOrBoundsChangeHigher) -CONFIG_VARIABLE (bool, relayer_on_all_edits, "relayer-on-all-edits", true) CONFIG_VARIABLE (std::string, auditioner_output_left, "auditioner-output-left", "default") CONFIG_VARIABLE (std::string, auditioner_output_right, "auditioner-output-right", "default") CONFIG_VARIABLE (bool, timecode_source_is_synced, "timecode-source-is-synced", true) diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index b5e5d89cc1..c2c7289329 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -409,12 +409,6 @@ namespace ARDOUR { ShortCrossfade }; - enum LayerModel { - LaterHigher, - AddOrBoundsChangeHigher, - AddHigher - }; - enum ListenPosition { AfterFaderListen, PreFaderListen @@ -592,11 +586,6 @@ namespace ARDOUR { FadeLogB }; - enum LayerOp { - LayerOpAdd, - LayerOpBoundsChange - }; - } // namespace ARDOUR @@ -613,7 +602,6 @@ std::istream& operator>>(std::istream& o, ARDOUR::PFLPosition& sf); std::istream& operator>>(std::istream& o, ARDOUR::AFLPosition& sf); std::istream& operator>>(std::istream& o, ARDOUR::RemoteModel& sf); std::istream& operator>>(std::istream& o, ARDOUR::ListenPosition& sf); -std::istream& operator>>(std::istream& o, ARDOUR::LayerModel& sf); std::istream& operator>>(std::istream& o, ARDOUR::InsertMergePolicy& sf); std::istream& operator>>(std::istream& o, ARDOUR::CrossfadeModel& sf); std::istream& operator>>(std::istream& o, ARDOUR::SyncSource& sf); @@ -634,7 +622,6 @@ std::ostream& operator<<(std::ostream& o, const ARDOUR::PFLPosition& sf); std::ostream& operator<<(std::ostream& o, const ARDOUR::AFLPosition& sf); std::ostream& operator<<(std::ostream& o, const ARDOUR::RemoteModel& sf); std::ostream& operator<<(std::ostream& o, const ARDOUR::ListenPosition& sf); -std::ostream& operator<<(std::ostream& o, const ARDOUR::LayerModel& sf); std::ostream& operator<<(std::ostream& o, const ARDOUR::InsertMergePolicy& sf); std::ostream& operator<<(std::ostream& o, const ARDOUR::CrossfadeModel& sf); std::ostream& operator<<(std::ostream& o, const ARDOUR::SyncSource& sf); |