summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-08-08 18:32:03 +0200
committerCarl Hetherington <cth@carlh.net>2023-08-09 10:18:46 +0200
commit280568029622c5e99d4b90d55b0cebe12cb24e93 (patch)
tree5ab43db327263d98a358aad3b45e4d8be84ace94 /src/lib
parenta3c1ae7c2e46b65347341896b3d1a505ff92632b (diff)
Move ContentSorter out of the header, and use a default constructor.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/playlist.cc39
-rw-r--r--src/lib/playlist.h9
2 files changed, 20 insertions, 28 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
diff --git a/src/lib/playlist.h b/src/lib/playlist.h
index 2d68d3f39..e2662eb45 100644
--- a/src/lib/playlist.h
+++ b/src/lib/playlist.h
@@ -36,12 +36,6 @@
class Film;
-struct ContentSorter
-{
- bool operator() (std::shared_ptr<Content> a, std::shared_ptr<Content> b);
-};
-
-
/** @class Playlist
* @brief A set of Content objects with knowledge of how they should be arranged into
* a DCP.
@@ -49,7 +43,8 @@ struct ContentSorter
class Playlist
{
public:
- Playlist ();
+ Playlist() = default;
+
~Playlist ();
Playlist (Playlist const&) = delete;