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/playlist.cc | |
| parent | abc6fa5ea5877a3a4d6eb65b7819821ed99a042c (diff) | |
Basic repeat.
Diffstat (limited to 'src/lib/playlist.cc')
| -rw-r--r-- | src/lib/playlist.cc | 15 |
1 files changed, 15 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 (); +} |
