Report more detailed errors when the butler dies.
[dcpomatic.git] / src / lib / butler.h
index 4d4fa4a0939d86186e54c2488e9478fa4f29baeb..a62eb0525f18fbc2f5c6d53709b4daf057d1d73e 100644 (file)
@@ -49,10 +49,22 @@ public:
 
        void seek (DCPTime position, bool accurate);
 
-       enum Error {
-               NONE,
-               AGAIN,
-               DIED
+       class Error {
+       public:
+               enum Code {
+                       NONE,
+                       AGAIN,
+                       DIED
+               };
+
+               Error ()
+                       : code(NONE)
+               {}
+
+               Code code;
+               std::string message;
+
+               std::string summary () const;
        };
 
        std::pair<boost::shared_ptr<PlayerVideo>, DCPTime> get_video (Error* e = 0);
@@ -99,6 +111,7 @@ private:
        int _suspended;
        bool _finished;
        bool _died;
+       std::string _died_message;
        bool _stop_thread;
 
        AudioMapping _audio_mapping;