#include "ardour/audiofilesource.h"
#include "ardour/audio_diskstream.h"
#include "ardour/audio_track.h"
-#include "ardour/playlist_templates.h"
#include "ardour/source.h"
#include "ardour/region_factory.h"
#include "ardour/profile.h"
if (_trackview.is_audio_track()) {
_trackview.get_diskstream()->playlist()->foreach_region(
- static_cast<StreamView*>(this),
- &StreamView::add_region_view);
+ sigc::mem_fun (*this, &StreamView::add_region_view)
+ );
boost::shared_ptr<AudioPlaylist> apl = boost::dynamic_pointer_cast<AudioPlaylist>(
- _trackview.get_diskstream()->playlist());
- if (apl)
- apl->foreach_crossfade (this, &AudioStreamView::add_crossfade);
+ _trackview.get_diskstream()->playlist()
+ );
+
+ if (apl) {
+ apl->foreach_crossfade (sigc::mem_fun (*this, &AudioStreamView::add_crossfade));
+ }
}
// Remove invalid crossfade views
// Add and display region views, and flag them as valid
if (_trackview.is_track()) {
_trackview.get_diskstream()->playlist()->foreach_region (
- static_cast<StreamView*>(this), &StreamView::add_region_view);
+ sigc::mem_fun (*this, &StreamView::add_region_view)
+ );
}
// Stack regions by layer, and remove invalid regions
#include "ardour/auditioner.h"
#include "ardour/audioplaylist.h"
#include "ardour/audiosource.h"
-#include "ardour/playlist_templates.h"
#include "ardour/region_factory.h"
#include "ardour/profile.h"
}
/* there is only one ... */
- pl.foreach_crossfade (this, &CrossfadeEditor::setup);
+ pl.foreach_crossfade (sigc::mem_fun (*this, &CrossfadeEditor::setup));
session.audition_playlist ();
}
_data_note_min = 127;
_data_note_max = 0;
_trackview.get_diskstream()->playlist()->foreach_region(
- static_cast<StreamView*>(this),
- &StreamView::update_contents_metrics);
+ sigc::mem_fun (*this, &StreamView::update_contents_metrics)
+ );
// No notes, use default range
if (!_range_dirty) {
// Add and display region views, and flag them as valid
_trackview.get_diskstream()->playlist()->foreach_region(
- static_cast<StreamView*>(this),
- &StreamView::add_region_view);
+ sigc::mem_fun (*this, &StreamView::add_region_view)
+ );
// Stack regions by layer, and remove invalid regions
layer_regions();
sigc::signal<void,boost::shared_ptr<Crossfade> > NewCrossfade;
- template<class T> void foreach_crossfade (T *t, void (T::*func)(boost::shared_ptr<Crossfade>));
+ void foreach_crossfade (sigc::slot<void, boost::shared_ptr<Crossfade> >);
void crossfades_at (nframes_t frame, Crossfades&);
bool destroy_region (boost::shared_ptr<Region>);
nframes64_t find_next_transient (nframes64_t position, int dir);
- 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>));
+ void foreach_region (sigc::slot<void, boost::shared_ptr<Region>, void *>, void *);
+ void foreach_region (sigc::slot<void, boost::shared_ptr<Region> >);
XMLNode& get_state ();
int set_state (const XMLNode&);
+++ /dev/null
-/*
- Copyright (C) 2003 Paul Davis
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __ardour_playlist_templates_h__
-#define __ardour_playlist_templates_h__
-
-namespace ARDOUR {
-
-template<class T> void AudioPlaylist::foreach_crossfade (T *t, void (T::*func)(boost::shared_ptr<Crossfade>)) {
- RegionLock rlock (this, false);
- for (Crossfades::iterator i = _crossfades.begin(); i != _crossfades.end(); i++) {
- (t->*func) (*i);
- }
-}
-
-template<class T> void Playlist::foreach_region (T *t, void (T::*func)(boost::shared_ptr<Region>, 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>)) {
- RegionLock rlock (this, false);
- for (RegionList::const_iterator i = regions.begin(); i != regions.end(); i++) {
- (t->*func) (*i);
- }
-}
-
-}
-
-#endif /* __ardour_playlist_templates_h__ */
}
}
+void
+AudioPlaylist::foreach_crossfade (sigc::slot<void, boost::shared_ptr<Crossfade> > s)
+{
+ RegionLock rl (this, false);
+ for (Crossfades::iterator i = _crossfades.begin(); i != _crossfades.end(); ++i) {
+ s (*i);
+ }
+}
thaw ();
}
+
+void
+Playlist::foreach_region (sigc::slot<void, boost::shared_ptr<Region>, void *> s, void* arg)
+{
+ RegionLock rl (this, false);
+ for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
+ s (*i, arg);
+ }
+}
+
+void
+Playlist::foreach_region (sigc::slot<void, boost::shared_ptr<Region> > s)
+{
+ RegionLock rl (this, false);
+ for (RegionList::iterator i = regions.begin(); i != regions.end(); ++i) {
+ s (*i);
+ }
+}
+
+