diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-08-08 18:32:03 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-08-09 10:18:46 +0200 |
| commit | 280568029622c5e99d4b90d55b0cebe12cb24e93 (patch) | |
| tree | 5ab43db327263d98a358aad3b45e4d8be84ace94 /src/lib/playlist.cc | |
| parent | a3c1ae7c2e46b65347341896b3d1a505ff92632b (diff) | |
Move ContentSorter out of the header, and use a default constructor.
Diffstat (limited to 'src/lib/playlist.cc')
| -rw-r--r-- | src/lib/playlist.cc | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc index df7c95cc0..80037b575 100644 --- a/src/lib/playlist.cc +++ b/src/lib/playlist.cc @@ -58,10 +58,26 @@ using namespace boost::placeholders; #endif -Playlist::Playlist () +class ContentSorter { +public: + bool operator()(shared_ptr<Content> a, shared_ptr<Content> b) + { + if (a->position() != b->position()) { + return a->position() < b->position(); + } -} + /* Put video before audio if they start at the same time */ + if (a->video && !b->video) { + return true; + } else if (!a->video && b->video) { + return false; + } + + /* Last resort */ + return a->digest() < b->digest(); + } +}; Playlist::~Playlist () @@ -542,25 +558,6 @@ Playlist::set_sequence (bool s) } -bool -ContentSorter::operator() (shared_ptr<Content> a, shared_ptr<Content> b) -{ - if (a->position() != b->position()) { - return a->position() < b->position(); - } - - /* Put video before audio if they start at the same time */ - if (a->video && !b->video) { - return true; - } else if (!a->video && b->video) { - return false; - } - - /* Last resort */ - return a->digest() < b->digest(); -} - - /** @return content in ascending order of position */ ContentList Playlist::content () const |
