diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-07-19 13:23:54 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-07-19 13:23:54 +0100 |
| commit | 86461ade4087f8473c1e8b063907d92884813843 (patch) | |
| tree | a45f3954cad0753be9b1d438efb0dfa4b1cb521a /src/lib | |
| parent | abc6fa5ea5877a3a4d6eb65b7819821ed99a042c (diff) | |
Basic repeat.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/playlist.cc | 15 | ||||
| -rw-r--r-- | src/lib/playlist.h | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc index c70c79972..31b16b646 100644 --- a/src/lib/playlist.cc +++ b/src/lib/playlist.cc @@ -289,3 +289,18 @@ Playlist::content () const { return _content; } + +void +Playlist::repeat (shared_ptr<Content> c, int n) +{ + Time pos = c->end (); + for (int i = 0; i < n; ++i) { + shared_ptr<Content> copy = c->clone (); + copy->set_start (pos); + _content.push_back (copy); + pos = copy->end (); + } + + reconnect (); + Changed (); +} diff --git a/src/lib/playlist.h b/src/lib/playlist.h index 735ef7a43..e949de0ea 100644 --- a/src/lib/playlist.h +++ b/src/lib/playlist.h @@ -77,6 +77,8 @@ public: void set_sequence_video (bool); void maybe_sequence_video (); + void repeat (boost::shared_ptr<Content>, int); + mutable boost::signals2::signal<void ()> Changed; /** Third parameter is true if signals are currently being emitted frequently */ mutable boost::signals2::signal<void (boost::weak_ptr<Content>, int, bool)> ContentChanged; |
