Protect playlist with a mutex so that we can add content safely from e.g. examine...
[dcpomatic.git] / src / lib / playlist.h
index e949de0ea077b231a8acba935bdb7616fbad749f..cd902d223d0f0944f5fd550f60805d2f8546dc12 100644 (file)
@@ -29,8 +29,8 @@
 class Content;
 class FFmpegContent;
 class FFmpegDecoder;
-class ImageMagickContent;
-class ImageMagickDecoder;
+class StillImageMagickContent;
+class StillImageMagickDecoder;
 class SndfileContent;
 class SndfileDecoder;
 class Job;
@@ -60,11 +60,10 @@ public:
 
        void add (boost::shared_ptr<Content>);
        void remove (boost::shared_ptr<Content>);
+       void remove (ContentList);
 
        bool has_subtitles () const;
 
-       typedef std::vector<boost::shared_ptr<Content> > ContentList;
-
        ContentList content () const;
 
        std::string video_identifier () const;
@@ -77,7 +76,7 @@ public:
        void set_sequence_video (bool);
        void maybe_sequence_video ();
 
-       void repeat (boost::shared_ptr<Content>, int);
+       void repeat (ContentList, int);
 
        mutable boost::signals2::signal<void ()> Changed;
        /** Third parameter is true if signals are currently being emitted frequently */
@@ -91,6 +90,7 @@ private:
        bool _sequence_video;
        bool _sequencing_video;
        std::list<boost::signals2::connection> _content_connections;
+       mutable boost::mutex _mutex;
 };
 
 #endif