#include "gl_video_view.h"
#include "film_viewer.h"
+#include "wx_util.h"
#include "lib/image.h"
#include "lib/dcpomatic_assert.h"
#include "lib/exceptions.h"
#include "lib/cross.h"
#include "lib/player_video.h"
+#include "lib/butler.h"
#include <boost/bind.hpp>
#include <iostream>
_canvas->Bind (wxEVT_SIZE, boost::bind(boost::ref(Sized)));
_canvas->Bind (wxEVT_CREATE, boost::bind(&GLVideoView::create, this));
+ _canvas->Bind (wxEVT_TIMER, boost::bind(&GLVideoView::check_for_butler_errors, this));
+ _timer.reset (new wxTimer(_canvas));
+ _timer->Start (2000);
+
#if defined(DCPOMATIC_LINUX) && defined(DCPOMATIC_HAVE_GLX_SWAP_INTERVAL_EXT)
if (_canvas->IsExtensionSupported("GLX_EXT_swap_control")) {
/* Enable vsync */
glDeleteTextures (1, &_id);
}
+void
+GLVideoView::check_for_butler_errors ()
+{
+ try {
+ _viewer->butler()->rethrow ();
+ } catch (DecodeError& e) {
+ error_dialog (get(), e.what());
+ }
+}
+
static void
check_gl_error (char const * last)
{
void thread ();
void request_one_shot ();
void create ();
+ void check_for_butler_errors ();
wxGLCanvas* _canvas;
wxGLContext* _context;
boost::condition _playing_condition;
bool _playing;
bool _one_shot;
+
+ boost::shared_ptr<wxTimer> _timer;
};
_player_video.first->eyes() != EYES_BOTH
);
- /* XXX_b: this is called from the GL thread so it shouldn't be opening error dialogs */
- try {
- _viewer->butler()->rethrow ();
- } catch (DecodeError& e) {
- error_dialog (get(), e.what());
- }
-
return true;
}