summaryrefslogtreecommitdiff
path: root/src/lib/playlist.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-04-06 12:26:12 +0100
committerCarl Hetherington <cth@carlh.net>2013-04-06 12:26:12 +0100
commit1bff0990433ab0ce588acaef7c589fa623bd998b (patch)
tree65cba435e949deb6359bbf75866b52684116df06 /src/lib/playlist.cc
parent3429cf48ff2ce056413588be4151be82c8114861 (diff)
Add interface to set up still image lengths.
Diffstat (limited to 'src/lib/playlist.cc')
-rw-r--r--src/lib/playlist.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc
index 0a4803f6e..e0220ef6f 100644
--- a/src/lib/playlist.cc
+++ b/src/lib/playlist.cc
@@ -31,6 +31,7 @@ using std::list;
using std::cout;
using std::vector;
using boost::shared_ptr;
+using boost::weak_ptr;
using boost::dynamic_pointer_cast;
Playlist::Playlist ()
@@ -50,6 +51,12 @@ Playlist::setup (ContentList content)
_imagemagick.clear ();
_sndfile.clear ();
+ for (list<boost::signals2::connection>::iterator i = _content_connections.begin(); i != _content_connections.end(); ++i) {
+ i->disconnect ();
+ }
+
+ _content_connections.clear ();
+
for (ContentList::const_iterator i = content.begin(); i != content.end(); ++i) {
shared_ptr<FFmpegContent> fc = dynamic_pointer_cast<FFmpegContent> (*i);
if (fc) {
@@ -74,7 +81,11 @@ Playlist::setup (ContentList content)
_sndfile.push_back (sc);
_audio_from = AUDIO_SNDFILE;
}
+
+ _content_connections.push_back ((*i)->Changed.connect (bind (&Playlist::content_changed, this, _1, _2)));
}
+
+ Changed ();
}
ContentAudioFrame
@@ -208,3 +219,8 @@ Playlist::has_audio () const
return _audio_from != AUDIO_NONE;
}
+void
+Playlist::content_changed (weak_ptr<Content> c, int p)
+{
+ ContentChanged (c, p);
+}