Move ContentSorter out of the header, and use a default constructor.
authorCarl Hetherington <cth@carlh.net>
Tue, 8 Aug 2023 16:32:03 +0000 (18:32 +0200)
committerCarl Hetherington <cth@carlh.net>
Wed, 9 Aug 2023 08:18:46 +0000 (10:18 +0200)
src/lib/playlist.cc
src/lib/playlist.h

index df7c95cc087333549a1e955d62e5811bb3102c49..80037b5755fcbfc0057a1bbd30392b9d37312d68 100644 (file)
@@ -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
index 2d68d3f393bd7cf00b804215364170a6b99c433c..e2662eb4581d78293f7d344c6e35619eaae9c400 100644 (file)
 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;