View Issue Details

IDProjectCategoryView StatusLast Update
0002052ardourotherpublic2008-01-24 23:29
Reportertimblech Assigned To 
PrioritynormalSeveritytweakReproducibilityalways
Status newResolutionopen 
Product VersionSVN/2.0-ongoing 
Summary0002052: patch: pass shared_ptr's by reference
Descriptionhi all,

currently ardour's interface passes shared pointers by value, which results in a local copy of the shared pointer, and thus invokes the reference counting ... passing the shared pointer by const-reference, the reference counting wouldn't be necessary ...

the attached patch passes shared_pointer<Region> in the interface of the Playlist class by reference ....
TagsNo tags attached.

Activities

2008-01-24 23:29

 

0001-passing-shared_ptr-Region-by-reference.patch (28,105 bytes)   
From 3268817029d620cb5b5d49e1e6db2e4fc8fcaa9e Mon Sep 17 00:00:00 2001
From: Tim Blechmann <tim@klingt.org>
Date: Fri, 25 Jan 2008 00:18:44 +0100
Subject: [PATCH] passing shared_ptr<Region> by reference

---
 gtk2_ardour/audio_streamview.cc         |    2 +-
 gtk2_ardour/audio_streamview.h          |    2 +-
 gtk2_ardour/streamview.cc               |    2 +-
 gtk2_ardour/streamview.h                |    4 +-
 libs/ardour/ardour/audioplaylist.h      |   12 +++---
 libs/ardour/ardour/playlist.h           |   72 +++++++++++++++---------------
 libs/ardour/ardour/playlist_templates.h |    4 +-
 libs/ardour/audio_playlist.cc           |   14 +++---
 libs/ardour/playlist.cc                 |   56 ++++++++++++------------
 9 files changed, 84 insertions(+), 84 deletions(-)

diff --git a/gtk2_ardour/audio_streamview.cc b/gtk2_ardour/audio_streamview.cc
index abfecce..877312f 100644
--- a/gtk2_ardour/audio_streamview.cc
+++ b/gtk2_ardour/audio_streamview.cc
@@ -129,7 +129,7 @@ AudioStreamView::set_amplitude_above_axis (gdouble app)
 }
 
 void
-AudioStreamView::add_region_view_internal (boost::shared_ptr<Region> r, bool wait_for_waves)
+AudioStreamView::add_region_view_internal (boost::shared_ptr<Region> const & r, bool wait_for_waves)
 {
 	AudioRegionView *region_view = 0;
 
diff --git a/gtk2_ardour/audio_streamview.h b/gtk2_ardour/audio_streamview.h
index d7bd4de..9c6ef32 100644
--- a/gtk2_ardour/audio_streamview.h
+++ b/gtk2_ardour/audio_streamview.h
@@ -83,7 +83,7 @@ class AudioStreamView : public StreamView
 	void rec_peak_range_ready (nframes_t start, nframes_t cnt, boost::weak_ptr<ARDOUR::Source> src); 
 	void update_rec_regions ();
 	
-	void add_region_view_internal (boost::shared_ptr<ARDOUR::Region>, bool wait_for_waves);
+    void add_region_view_internal (boost::shared_ptr<ARDOUR::Region> const &, bool wait_for_waves);
 	void remove_region_view (boost::weak_ptr<ARDOUR::Region> );
 	void remove_audio_region_view (boost::shared_ptr<ARDOUR::AudioRegion> );
 
diff --git a/gtk2_ardour/streamview.cc b/gtk2_ardour/streamview.cc
index d8afa18..e29f8e5 100644
--- a/gtk2_ardour/streamview.cc
+++ b/gtk2_ardour/streamview.cc
@@ -158,7 +158,7 @@ StreamView::set_samples_per_unit (gdouble spp)
 }
 
 void
-StreamView::add_region_view (boost::shared_ptr<Region> r)
+StreamView::add_region_view (boost::shared_ptr<Region> const & r)
 {
 	add_region_view_internal (r, true);
 }
diff --git a/gtk2_ardour/streamview.h b/gtk2_ardour/streamview.h
index f1e0ee2..35f938d 100644
--- a/gtk2_ardour/streamview.h
+++ b/gtk2_ardour/streamview.h
@@ -89,7 +89,7 @@ public:
 	void get_selectables (nframes_t start, nframes_t end, list<Selectable* >&);
 	void get_inverted_selectables (Selection&, list<Selectable* >& results);
 
-	void add_region_view (boost::shared_ptr<ARDOUR::Region>);
+    void add_region_view (boost::shared_ptr<ARDOUR::Region> const &);
 	void region_layered (RegionView*);
 	
 	sigc::signal<void,RegionView*> RegionViewAdded;
@@ -107,7 +107,7 @@ protected:
 	void         update_rec_box ();
 	virtual void update_rec_regions () = 0;
 	
-	virtual void add_region_view_internal (boost::shared_ptr<ARDOUR::Region>, bool wait_for_waves) = 0;
+    virtual void add_region_view_internal (boost::shared_ptr<ARDOUR::Region> const &, bool wait_for_waves) = 0;
 	virtual void remove_region_view (boost::weak_ptr<ARDOUR::Region> );
 	//void         remove_rec_region (boost::shared_ptr<ARDOUR::Region>); (unused)
 
diff --git a/libs/ardour/ardour/audioplaylist.h b/libs/ardour/ardour/audioplaylist.h
index 38084a1..8f98ed0 100644
--- a/libs/ardour/ardour/audioplaylist.h
+++ b/libs/ardour/ardour/audioplaylist.h
@@ -57,7 +57,7 @@ class AudioPlaylist : public ARDOUR::Playlist
 	template<class T> void foreach_crossfade (T *t, void (T::*func)(boost::shared_ptr<Crossfade>));
 	void crossfades_at (nframes_t frame, Crossfades&);
 
-	bool destroy_region (boost::shared_ptr<Region>);
+    bool destroy_region (boost::shared_ptr<Region> const &);
 
     protected:
 
@@ -65,11 +65,11 @@ class AudioPlaylist : public ARDOUR::Playlist
 	void notify_crossfade_added (boost::shared_ptr<Crossfade>);
 	void flush_notifications ();
 
-	void finalize_split_region (boost::shared_ptr<Region> orig, boost::shared_ptr<Region> left, boost::shared_ptr<Region> right);
+    void finalize_split_region (boost::shared_ptr<Region> const & orig, boost::shared_ptr<Region> const & left, boost::shared_ptr<Region> const & right);
 	
-        void refresh_dependents (boost::shared_ptr<Region> region);
-        void check_dependents (boost::shared_ptr<Region> region, bool norefresh);
-        void remove_dependents (boost::shared_ptr<Region> region);
+        void refresh_dependents (boost::shared_ptr<Region> const & region);
+        void check_dependents (boost::shared_ptr<Region> const & region, bool norefresh);
+        void remove_dependents (boost::shared_ptr<Region> const & region);
 
     private:
        Crossfades      _crossfades;
@@ -79,7 +79,7 @@ class AudioPlaylist : public ARDOUR::Playlist
        XMLNode& state (bool full_state);
        void dump () const;
 
-       bool region_changed (Change, boost::shared_ptr<Region>);
+       bool region_changed (Change, boost::shared_ptr<Region> const &);
        void crossfade_changed (Change);
        void add_crossfade (boost::shared_ptr<Crossfade>);
 
diff --git a/libs/ardour/ardour/playlist.h b/libs/ardour/ardour/playlist.h
index 402e021..1b185d0 100644
--- a/libs/ardour/ardour/playlist.h
+++ b/libs/ardour/ardour/playlist.h
@@ -52,8 +52,8 @@ class Playlist : public PBD::StatefulDestructible, public boost::enable_shared_f
 
 	Playlist (Session&, const XMLNode&, bool hidden = false);
 	Playlist (Session&, string name, bool hidden = false);
-	Playlist (boost::shared_ptr<const Playlist>, string name, bool hidden = false);
-	Playlist (boost::shared_ptr<const Playlist>, nframes_t start, nframes_t cnt, string name, bool hidden = false);
+    Playlist (boost::shared_ptr<const Playlist> const &, string name, bool hidden = false);
+    Playlist (boost::shared_ptr<const Playlist> const &, nframes_t start, nframes_t cnt, string name, bool hidden = false);
 
 	virtual ~Playlist ();  
 
@@ -83,16 +83,16 @@ class Playlist : public PBD::StatefulDestructible, public boost::enable_shared_f
 
 	/* Editing operations */
 
-	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> >&);
-	void replace_region (boost::shared_ptr<Region> old, boost::shared_ptr<Region> newr, nframes_t pos);
-	void split_region (boost::shared_ptr<Region>, nframes_t position);
+    void add_region (boost::shared_ptr<Region> const &, nframes_t position, float times = 1);
+    void remove_region (boost::shared_ptr<Region> const &);
+    void get_equivalent_regions (boost::shared_ptr<Region> const &, std::vector<boost::shared_ptr<Region> >&);
+    void get_region_list_equivalent_regions (boost::shared_ptr<Region> const &, std::vector<boost::shared_ptr<Region> >&);
+    void replace_region (boost::shared_ptr<Region> const & old, boost::shared_ptr<Region> const & newr, nframes_t pos);
+    void split_region (boost::shared_ptr<Region> const &, nframes_t position);
 	void partition (nframes_t start, nframes_t end, bool just_top_level);
-	void duplicate (boost::shared_ptr<Region>, nframes_t position, float times);
+    void duplicate (boost::shared_ptr<Region> const &, nframes_t position, float times);
 	void nudge_after (nframes_t start, nframes_t distance, bool forwards);
-	void shuffle (boost::shared_ptr<Region>, int dir);
+    void shuffle (boost::shared_ptr<Region> const &, int dir);
 
 	boost::shared_ptr<Playlist> cut  (list<AudioRange>&, bool result_is_hidden = true);
 	boost::shared_ptr<Playlist> copy (list<AudioRange>&, bool result_is_hidden = true);
@@ -105,10 +105,10 @@ class Playlist : public PBD::StatefulDestructible, public boost::enable_shared_f
 	boost::shared_ptr<Region>  top_region_at (nframes_t frame);
 	boost::shared_ptr<Region>  find_next_region (nframes_t frame, RegionPoint point, int dir);
 	nframes64_t                find_next_region_boundary (nframes64_t frame, int dir);
-	bool                       region_is_shuffle_constrained (boost::shared_ptr<Region>);
+    bool                       region_is_shuffle_constrained (boost::shared_ptr<Region> const &);
 
-	template<class T> void foreach_region (T *t, void (T::*func)(boost::shared_ptr<Region>, void *), void *arg);
-	template<class T> void foreach_region (T *t, void (T::*func)(boost::shared_ptr<Region>));
+    template<class T> void foreach_region (T *t, void (T::*func)(boost::shared_ptr<Region> const &, void *), void *arg);
+    template<class T> void foreach_region (T *t, void (T::*func)(boost::shared_ptr<Region> const &));
 
 	XMLNode& get_state ();
 	int set_state (const XMLNode&);
@@ -126,10 +126,10 @@ class Playlist : public PBD::StatefulDestructible, public boost::enable_shared_f
 	void freeze ();
 	void thaw ();
 
-	void raise_region (boost::shared_ptr<Region>);
-	void lower_region (boost::shared_ptr<Region>);
-	void raise_region_to_top (boost::shared_ptr<Region>);
-	void lower_region_to_bottom (boost::shared_ptr<Region>);
+    void raise_region (boost::shared_ptr<Region> const &);
+    void lower_region (boost::shared_ptr<Region> const &);
+    void raise_region_to_top (boost::shared_ptr<Region> const &);
+    void lower_region_to_bottom (boost::shared_ptr<Region> const &);
 
 	uint32_t read_data_count() const { return _read_data_count; }
 
@@ -140,7 +140,7 @@ class Playlist : public PBD::StatefulDestructible, public boost::enable_shared_f
 
 	/* destructive editing */
 	
-	virtual bool destroy_region (boost::shared_ptr<Region>) = 0;
+    virtual bool destroy_region (boost::shared_ptr<Region> const &) = 0;
 
 	/* special case function used by UI selection objects, which have playlists that actually own the regions
 	   within them.
@@ -218,8 +218,8 @@ class Playlist : public PBD::StatefulDestructible, public boost::enable_shared_f
 	void release_notifications ();
 	virtual void flush_notifications ();
 
-	void notify_region_removed (boost::shared_ptr<Region>);
-	void notify_region_added (boost::shared_ptr<Region>);
+    void notify_region_removed (boost::shared_ptr<Region> const &);
+    void notify_region_added (boost::shared_ptr<Region> const &);
 	void notify_length_changed ();
 	void notify_layering_changed ();
 	void notify_modified ();
@@ -228,33 +228,33 @@ class Playlist : public PBD::StatefulDestructible, public boost::enable_shared_f
 	void mark_session_dirty();
 
 	void region_changed_proxy (Change, boost::weak_ptr<Region>);
-	virtual bool region_changed (Change, boost::shared_ptr<Region>);
+    virtual bool region_changed (Change, boost::shared_ptr<Region> const &);
 
-	void region_bounds_changed (Change, boost::shared_ptr<Region>);
-	void region_deleted (boost::shared_ptr<Region>);
+    void region_bounds_changed (Change, boost::shared_ptr<Region> const &);
+    void region_deleted (boost::shared_ptr<Region> const &);
 
 	void sort_regions ();
 
-	void possibly_splice (nframes_t at, nframes64_t distance, boost::shared_ptr<Region> exclude = boost::shared_ptr<Region>());
-	void possibly_splice_unlocked(nframes_t at, nframes64_t distance, boost::shared_ptr<Region> exclude = boost::shared_ptr<Region>());
+    void possibly_splice (nframes_t at, nframes64_t distance, boost::shared_ptr<Region> const & exclude = boost::shared_ptr<Region>());
+    void possibly_splice_unlocked(nframes_t at, nframes64_t distance, boost::shared_ptr<Region> const & exclude = boost::shared_ptr<Region>());
 
-	void core_splice (nframes_t at, nframes64_t distance, boost::shared_ptr<Region> exclude);
-	void splice_locked (nframes_t at, nframes64_t distance, boost::shared_ptr<Region> exclude);
-	void splice_unlocked (nframes_t at, nframes64_t distance, boost::shared_ptr<Region> exclude);
+    void core_splice (nframes_t at, nframes64_t distance, boost::shared_ptr<Region> const & exclude);
+    void splice_locked (nframes_t at, nframes64_t distance, boost::shared_ptr<Region> const & exclude);
+    void splice_unlocked (nframes_t at, nframes64_t distance, boost::shared_ptr<Region> const & exclude);
 
-	virtual void finalize_split_region (boost::shared_ptr<Region> original, boost::shared_ptr<Region> left, boost::shared_ptr<Region> right) {}
+    virtual void finalize_split_region (boost::shared_ptr<Region> const & original, boost::shared_ptr<Region> const & left, boost::shared_ptr<Region> const & right) {}
 	
-	virtual void check_dependents (boost::shared_ptr<Region> region, bool norefresh) {}
-	virtual void refresh_dependents (boost::shared_ptr<Region> region) {}
-	virtual void remove_dependents (boost::shared_ptr<Region> region) {}
+    virtual void check_dependents (boost::shared_ptr<Region> const & region, bool norefresh) {}
+    virtual void refresh_dependents (boost::shared_ptr<Region> const & region) {}
+    virtual void remove_dependents (boost::shared_ptr<Region> const & region) {}
 
 	virtual XMLNode& state (bool);
 
 	boost::shared_ptr<Region> region_by_id (PBD::ID);
 
-	void add_region_internal (boost::shared_ptr<Region>, nframes_t position);
+    void add_region_internal (boost::shared_ptr<Region> const &, nframes_t position);
 	
-	int remove_region_internal (boost::shared_ptr<Region>);
+    int remove_region_internal (boost::shared_ptr<Region> const &);
 	RegionList *find_regions_at (nframes_t frame);
 	void copy_regions (RegionList&) const;
 	void partition_internal (nframes_t start, nframes_t end, bool cutting, RegionList& thawlist);
@@ -267,13 +267,13 @@ class Playlist : public PBD::StatefulDestructible, public boost::enable_shared_f
 	boost::shared_ptr<Playlist> copy (nframes_t start, nframes_t cnt, bool result_is_hidden);
 
 
-	int move_region_to_layer (layer_t, boost::shared_ptr<Region> r, int dir);
+    int move_region_to_layer (layer_t, boost::shared_ptr<Region> const & r, int dir);
 	void relayer ();
 	
 	void unset_freeze_parent (Playlist*);
 	void unset_freeze_child (Playlist*);
 
-	void timestamp_layer_op (boost::shared_ptr<Region>);
+    void timestamp_layer_op (boost::shared_ptr<Region> const &);
 };
 
 } /* namespace ARDOUR */
diff --git a/libs/ardour/ardour/playlist_templates.h b/libs/ardour/ardour/playlist_templates.h
index bf072a7..0bc6330 100644
--- a/libs/ardour/ardour/playlist_templates.h
+++ b/libs/ardour/ardour/playlist_templates.h
@@ -29,14 +29,14 @@ template<class T> void AudioPlaylist::foreach_crossfade (T *t, void (T::*func)(b
 	}
 }
 
-template<class T> void Playlist::foreach_region (T *t, void (T::*func)(boost::shared_ptr<Region>, void *), void *arg) {
+template<class T> void Playlist::foreach_region (T *t, void (T::*func)(boost::shared_ptr<Region> const &, void *), void *arg) {
 	RegionLock rlock (this, false);
 	for (RegionList::iterator i = regions.begin(); i != regions.end(); i++) {	
 		(t->*func) ((*i), arg);
 	}
 	}
 
-template<class T> void Playlist::foreach_region (T *t, void (T::*func)(boost::shared_ptr<Region>)) {
+template<class T> void Playlist::foreach_region (T *t, void (T::*func)(boost::shared_ptr<Region> const &)) {
 	RegionLock rlock (this, false);
 	for (RegionList::const_iterator i = regions.begin(); i != regions.end(); i++) {
 		(t->*func) (*i);
diff --git a/libs/ardour/audio_playlist.cc b/libs/ardour/audio_playlist.cc
index c883856..c2d66d0 100644
--- a/libs/ardour/audio_playlist.cc
+++ b/libs/ardour/audio_playlist.cc
@@ -111,7 +111,7 @@ AudioPlaylist::~AudioPlaylist ()
 }
 
 struct RegionSortByLayer {
-    bool operator() (boost::shared_ptr<Region>a, boost::shared_ptr<Region>b) {
+    bool operator() (boost::shared_ptr<Region> const &a, boost::shared_ptr<Region> const &b) {
 	    return a->layer() < b->layer();
     }
 };
@@ -214,7 +214,7 @@ AudioPlaylist::read (Sample *buf, Sample *mixdown_buffer, float *gain_buffer, nf
 
 
 void
-AudioPlaylist::remove_dependents (boost::shared_ptr<Region> region)
+AudioPlaylist::remove_dependents (boost::shared_ptr<Region> const & region)
 {
 	boost::shared_ptr<AudioRegion> r = boost::dynamic_pointer_cast<AudioRegion> (region);
 
@@ -261,7 +261,7 @@ AudioPlaylist::flush_notifications ()
 }
 
 void
-AudioPlaylist::refresh_dependents (boost::shared_ptr<Region> r)
+AudioPlaylist::refresh_dependents (boost::shared_ptr<Region> const & r)
 {
 	boost::shared_ptr<AudioRegion> ar = boost::dynamic_pointer_cast<AudioRegion>(r);
 	set<boost::shared_ptr<Crossfade> > updated;
@@ -300,7 +300,7 @@ AudioPlaylist::refresh_dependents (boost::shared_ptr<Region> r)
 }
 
 void
-AudioPlaylist::finalize_split_region (boost::shared_ptr<Region> o, boost::shared_ptr<Region> l, boost::shared_ptr<Region> r)
+AudioPlaylist::finalize_split_region (boost::shared_ptr<Region> const & o, boost::shared_ptr<Region> const & l, boost::shared_ptr<Region> const & r)
 {
 	boost::shared_ptr<AudioRegion> orig  = boost::dynamic_pointer_cast<AudioRegion>(o);
 	boost::shared_ptr<AudioRegion> left  = boost::dynamic_pointer_cast<AudioRegion>(l);
@@ -340,7 +340,7 @@ AudioPlaylist::finalize_split_region (boost::shared_ptr<Region> o, boost::shared
 }
 
 void
-AudioPlaylist::check_dependents (boost::shared_ptr<Region> r, bool norefresh)
+AudioPlaylist::check_dependents (boost::shared_ptr<Region> const & r, bool norefresh)
 {
 	boost::shared_ptr<AudioRegion> other;
 	boost::shared_ptr<AudioRegion> region;
@@ -604,7 +604,7 @@ AudioPlaylist::dump () const
 }
 
 bool
-AudioPlaylist::destroy_region (boost::shared_ptr<Region> region)
+AudioPlaylist::destroy_region (boost::shared_ptr<Region> const & region)
 {
 	boost::shared_ptr<AudioRegion> r = boost::dynamic_pointer_cast<AudioRegion> (region);
 	bool changed = false;
@@ -687,7 +687,7 @@ AudioPlaylist::crossfade_changed (Change ignored)
 }
 
 bool
-AudioPlaylist::region_changed (Change what_changed, boost::shared_ptr<Region> region)
+AudioPlaylist::region_changed (Change what_changed, boost::shared_ptr<Region> const & region)
 {
 	if (in_flush || in_set_state) {
 		return false;
diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc
index f495e00..9f9b18f 100644
--- a/libs/ardour/playlist.cc
+++ b/libs/ardour/playlist.cc
@@ -89,7 +89,7 @@ Playlist::Playlist (Session& sess, const XMLNode& node, bool hide)
 	/* set state called by derived class */
 }
 
-Playlist::Playlist (boost::shared_ptr<const Playlist> other, string namestr, bool hide)
+Playlist::Playlist (boost::shared_ptr<const Playlist> const & other, string namestr, bool hide)
 	: _name (namestr), _session (other->_session), _orig_diskstream_id(other->_orig_diskstream_id)
 {
 	init (hide);
@@ -121,7 +121,7 @@ Playlist::Playlist (boost::shared_ptr<const Playlist> other, string namestr, boo
 	freeze_length = other->freeze_length;
 }
 
-Playlist::Playlist (boost::shared_ptr<const Playlist> other, nframes_t start, nframes_t cnt, string str, bool hide)
+Playlist::Playlist (boost::shared_ptr<const Playlist> const & other, nframes_t start, nframes_t cnt, string str, bool hide)
 	: _name (str), _session (other->_session), _orig_diskstream_id(other->_orig_diskstream_id)
 {
 	RegionLock rlock2 (const_cast<Playlist*> (other.get()));
@@ -336,7 +336,7 @@ Playlist::notify_modified ()
 }
 
 void
-Playlist::notify_region_removed (boost::shared_ptr<Region> r)
+Playlist::notify_region_removed (boost::shared_ptr<Region> const & r)
 {
 	if (holding_state ()) {
 		pending_removes.insert (r);
@@ -352,7 +352,7 @@ Playlist::notify_region_removed (boost::shared_ptr<Region> r)
 }
 
 void
-Playlist::notify_region_added (boost::shared_ptr<Region> r)
+Playlist::notify_region_added (boost::shared_ptr<Region> const & r)
 {
 	/* the length change might not be true, but we have to act
 	   as though it could be.
@@ -450,7 +450,7 @@ Playlist::flush_notifications ()
  *************************************************************/
 
 void
-Playlist::add_region (boost::shared_ptr<Region> region, nframes_t position, float times) 
+Playlist::add_region (boost::shared_ptr<Region> const & region, nframes_t position, float times)
 { 
 	RegionLock rlock (this);
 	
@@ -504,7 +504,7 @@ Playlist::set_region_ownership ()
 }
 
 void
-Playlist::add_region_internal (boost::shared_ptr<Region> region, nframes_t position)
+Playlist::add_region_internal (boost::shared_ptr<Region> const & region, nframes_t position)
 {
 	RegionSortByPosition cmp;
 	nframes_t old_length = 0;
@@ -548,7 +548,7 @@ Playlist::add_region_internal (boost::shared_ptr<Region> region, nframes_t posit
 }
 
 void
-Playlist::replace_region (boost::shared_ptr<Region> old, boost::shared_ptr<Region> newr, nframes_t pos)
+Playlist::replace_region (boost::shared_ptr<Region> const & old, boost::shared_ptr<Region> const & newr, nframes_t pos)
 {
 	RegionLock rlock (this);
 
@@ -564,14 +564,14 @@ Playlist::replace_region (boost::shared_ptr<Region> old, boost::shared_ptr<Regio
 }
 
 void
-Playlist::remove_region (boost::shared_ptr<Region> region)
+Playlist::remove_region (boost::shared_ptr<Region> const & region)
 {
 	RegionLock rlock (this);
 	remove_region_internal (region);
 }
 
 int
-Playlist::remove_region_internal (boost::shared_ptr<Region> region)
+Playlist::remove_region_internal (boost::shared_ptr<Region> const & region)
 {
 	RegionList::iterator i;
 	nframes_t old_length = 0;
@@ -615,7 +615,7 @@ Playlist::remove_region_internal (boost::shared_ptr<Region> region)
 }
 
 void
-Playlist::get_equivalent_regions (boost::shared_ptr<Region> other, vector<boost::shared_ptr<Region> >& results)
+Playlist::get_equivalent_regions (boost::shared_ptr<Region> const & other, vector<boost::shared_ptr<Region> >& results)
 {
 	if (Config->get_use_overlap_equivalency()) {
 		for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
@@ -633,7 +633,7 @@ Playlist::get_equivalent_regions (boost::shared_ptr<Region> other, vector<boost:
 }
 
 void
-Playlist::get_region_list_equivalent_regions (boost::shared_ptr<Region> other, vector<boost::shared_ptr<Region> >& results)
+Playlist::get_region_list_equivalent_regions (boost::shared_ptr<Region> const & other, vector<boost::shared_ptr<Region> >& results)
 {
 	for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
 
@@ -969,7 +969,7 @@ Playlist::paste (boost::shared_ptr<Playlist> other, nframes_t position, float ti
 
 
 void
-Playlist::duplicate (boost::shared_ptr<Region> region, nframes_t position, float times)
+Playlist::duplicate (boost::shared_ptr<Region> const & region, nframes_t position, float times)
 {
 	times = fabs (times);
 
@@ -993,7 +993,7 @@ Playlist::duplicate (boost::shared_ptr<Region> region, nframes_t position, float
 }
 
 void
-Playlist::split_region (boost::shared_ptr<Region> region, nframes_t playlist_position)
+Playlist::split_region (boost::shared_ptr<Region> const & region, nframes_t playlist_position)
 {
 	RegionLock rl (this);
 
@@ -1050,7 +1050,7 @@ Playlist::split_region (boost::shared_ptr<Region> region, nframes_t playlist_pos
 }
 
 void
-Playlist::possibly_splice (nframes_t at, nframes64_t distance, boost::shared_ptr<Region> exclude)
+Playlist::possibly_splice (nframes_t at, nframes64_t distance, boost::shared_ptr<Region> const & exclude)
 {
 	if (_splicing || in_set_state) {
 		/* don't respond to splicing moves or state setting */
@@ -1063,7 +1063,7 @@ Playlist::possibly_splice (nframes_t at, nframes64_t distance, boost::shared_ptr
 }
 
 void
-Playlist::possibly_splice_unlocked (nframes_t at, nframes64_t distance, boost::shared_ptr<Region> exclude)
+Playlist::possibly_splice_unlocked (nframes_t at, nframes64_t distance, boost::shared_ptr<Region> const & exclude)
 {
 	if (_splicing || in_set_state) {
 		/* don't respond to splicing moves or state setting */
@@ -1076,7 +1076,7 @@ Playlist::possibly_splice_unlocked (nframes_t at, nframes64_t distance, boost::s
 }
 
 void
-Playlist::splice_locked (nframes_t at, nframes64_t distance, boost::shared_ptr<Region> exclude)
+Playlist::splice_locked (nframes_t at, nframes64_t distance, boost::shared_ptr<Region> const & exclude)
 {
 	{
 		RegionLock rl (this);
@@ -1085,13 +1085,13 @@ Playlist::splice_locked (nframes_t at, nframes64_t distance, boost::shared_ptr<R
 }
 
 void
-Playlist::splice_unlocked (nframes_t at, nframes64_t distance, boost::shared_ptr<Region> exclude)
+Playlist::splice_unlocked (nframes_t at, nframes64_t distance, boost::shared_ptr<Region> const & exclude)
 {
 	core_splice (at, distance, exclude);
 }
 
 void
-Playlist::core_splice (nframes_t at, nframes64_t distance, boost::shared_ptr<Region> exclude)
+Playlist::core_splice (nframes_t at, nframes64_t distance, boost::shared_ptr<Region> const & exclude)
 {
 	_splicing = true;
 
@@ -1119,7 +1119,7 @@ Playlist::core_splice (nframes_t at, nframes64_t distance, boost::shared_ptr<Reg
 }
 
 void
-Playlist::region_bounds_changed (Change what_changed, boost::shared_ptr<Region> region)
+Playlist::region_bounds_changed (Change what_changed, boost::shared_ptr<Region> const & region)
 {
 	if (in_set_state || _splicing || _nudging || _shuffling) {
 		return;
@@ -1193,7 +1193,7 @@ Playlist::region_changed_proxy (Change what_changed, boost::weak_ptr<Region> wea
 }
 
 bool
-Playlist::region_changed (Change what_changed, boost::shared_ptr<Region> region)
+Playlist::region_changed (Change what_changed, boost::shared_ptr<Region> const & region)
 {
 	Change our_interests = Change (Region::MuteChanged|Region::LayerChanged|Region::OpacityChanged);
 	bool save = false;
@@ -1852,7 +1852,7 @@ Playlist::relayer ()
 /* XXX these layer functions are all deprecated */
 
 void
-Playlist::raise_region (boost::shared_ptr<Region> region)
+Playlist::raise_region (boost::shared_ptr<Region> const & region)
 {
 	uint32_t rsz = regions.size();
 	layer_t target = region->layer() + 1U;
@@ -1866,7 +1866,7 @@ Playlist::raise_region (boost::shared_ptr<Region> region)
 }
 
 void
-Playlist::lower_region (boost::shared_ptr<Region> region)
+Playlist::lower_region (boost::shared_ptr<Region> const & region)
 {
 	if (region->layer() == 0) {
 		/* its already at the bottom */
@@ -1879,7 +1879,7 @@ Playlist::lower_region (boost::shared_ptr<Region> region)
 }
 
 void
-Playlist::raise_region_to_top (boost::shared_ptr<Region> region)
+Playlist::raise_region_to_top (boost::shared_ptr<Region> const & region)
 {
 	/* does nothing useful if layering mode is later=higher */
 	if ((Config->get_layer_model() == MoveAddHigher) ||
@@ -1890,7 +1890,7 @@ Playlist::raise_region_to_top (boost::shared_ptr<Region> region)
 }
 
 void
-Playlist::lower_region_to_bottom (boost::shared_ptr<Region> region)
+Playlist::lower_region_to_bottom (boost::shared_ptr<Region> const & region)
 {
 	/* does nothing useful if layering mode is later=higher */
 	if ((Config->get_layer_model() == MoveAddHigher) ||
@@ -1901,7 +1901,7 @@ Playlist::lower_region_to_bottom (boost::shared_ptr<Region> region)
 }
 
 int
-Playlist::move_region_to_layer (layer_t target_layer, boost::shared_ptr<Region> region, int dir)
+Playlist::move_region_to_layer (layer_t target_layer, boost::shared_ptr<Region> const & region, int dir)
 {
 	RegionList::iterator i;
 	typedef pair<boost::shared_ptr<Region>,layer_t> LayerInfo;
@@ -2076,7 +2076,7 @@ Playlist::set_frozen (bool yn)
 }
 
 void
-Playlist::timestamp_layer_op (boost::shared_ptr<Region> region)
+Playlist::timestamp_layer_op (boost::shared_ptr<Region> const & region)
 {
 //	struct timeval tv;
 //	gettimeofday (&tv, 0);
@@ -2085,7 +2085,7 @@ Playlist::timestamp_layer_op (boost::shared_ptr<Region> region)
 
 
 void
-Playlist::shuffle (boost::shared_ptr<Region> region, int dir)
+Playlist::shuffle (boost::shared_ptr<Region> const & region, int dir)
 {
 	bool moved = false;
 	nframes_t new_pos;
@@ -2199,7 +2199,7 @@ Playlist::shuffle (boost::shared_ptr<Region> region, int dir)
 }
 
 bool
-Playlist::region_is_shuffle_constrained (boost::shared_ptr<Region>) 
+Playlist::region_is_shuffle_constrained (boost::shared_ptr<Region> const &)
 {
 	RegionLock rlock (const_cast<Playlist*> (this));
 	
-- 
1.5.3.8

Issue History

Date Modified Username Field Change
2008-01-24 23:29 timblech New Issue
2008-01-24 23:29 timblech File Added: 0001-passing-shared_ptr-Region-by-reference.patch