Always block waiting for audio when exporting.
[dcpomatic.git] / src / lib / butler.h
index cd3891754be508c51603b8b343e3069a3a95481a..c7e71658da25889107d033147e62b16897f92f4d 100644 (file)
@@ -59,25 +59,26 @@ public:
 
        class Error {
        public:
-               enum Code{
+               enum class Code {
                        NONE,
                        AGAIN,
                        DIED,
                        FINISHED
                };
 
-               Error()
-                       : code (NONE)
-               {}
-
-               Code code;
+               Code code = Code::NONE;
                std::string message;
 
                std::string summary () const;
        };
 
-       std::pair<std::shared_ptr<PlayerVideo>, dcpomatic::DCPTime> get_video (bool blocking, Error* e = 0);
-       boost::optional<dcpomatic::DCPTime> get_audio (float* out, Frame frames);
+       enum class Behaviour {
+               BLOCKING,
+               NON_BLOCKING
+       };
+
+       std::pair<std::shared_ptr<PlayerVideo>, dcpomatic::DCPTime> get_video (Behaviour behaviour, Error* e = nullptr);
+       boost::optional<dcpomatic::DCPTime> get_audio (Behaviour behaviour, float* out, Frame frames);
        boost::optional<TextRingBuffers::Data> get_closed_caption ();
 
        void disable_audio ();