}
_video_view->Sized.connect (boost::bind(&FilmViewer::video_view_sized, this));
- _timer.Bind (wxEVT_TIMER, boost::bind(&FilmViewer::timer, this));
set_film (shared_ptr<Film> ());
_closed_captions_dialog->update (time());
}
-void
-FilmViewer::timer ()
-{
- if (!_film || !_playing || _suspended) {
- return;
- }
-
- get (false);
- DCPTime const next = _video_position + one_video_frame();
-
- if (next >= _film->length()) {
- stop ();
- Finished ();
- return;
- }
-
- LOG_DEBUG_PLAYER("%1 -> %2; delay %3", next.seconds(), time().seconds(), max((next.seconds() - time().seconds()) * 1000, 1.0));
- _timer.Start (max ((next.seconds() - time().seconds()) * 1000, 1.0), wxTIMER_ONE_SHOT);
-
- if (_butler) {
- _butler->rethrow ();
- }
-}
-
void
FilmViewer::set_outline_content (bool o)
{
_playing = true;
_dropped = 0;
- timer ();
+ _video_view->timer ();
Started (position());
}
boost::signals2::signal<bool ()> PlaybackPermitted;
private:
+
+ /* XXX_b: to remove */
+ friend class SimpleVideoView;
+
void video_view_sized ();
- void timer ();
void calculate_sizes ();
void player_change (ChangeType type, int, bool);
bool get (bool lazy);
boost::shared_ptr<Player> _player;
VideoView* _video_view;
- wxTimer _timer;
bool _coalesce_player_changes;
std::list<int> _pending_player_changes;
#include "film_viewer.h"
#include "wx_util.h"
#include "lib/image.h"
+#include "lib/dcpomatic_log.h"
+#include "lib/butler.h"
#include <dcp/util.h>
#include <wx/wx.h>
#include <boost/bind.hpp>
_panel->Bind (wxEVT_PAINT, boost::bind (&SimpleVideoView::paint, this));
_panel->Bind (wxEVT_SIZE, boost::bind(boost::ref(Sized)));
+
+ _timer.Bind (wxEVT_TIMER, boost::bind(&SimpleVideoView::timer, this));
}
void
_panel->Refresh ();
_panel->Update ();
}
+
+void
+SimpleVideoView::timer ()
+{
+ if (!_viewer->_film || !_viewer->_playing) {
+ return;
+ }
+
+ _viewer->get (false);
+ DCPTime const next = _viewer->_video_position + _viewer->one_video_frame();
+
+ if (next >= _viewer->_film->length()) {
+ _viewer->stop ();
+ _viewer->Finished ();
+ return;
+ }
+
+ LOG_DEBUG_PLAYER("%1 -> %2; delay %3", next.seconds(), _viewer->time().seconds(), max((next.seconds() - _viewer->time().seconds()) * 1000, 1.0));
+ _timer.Start (max ((next.seconds() - _viewer->time().seconds()) * 1000, 1.0), wxTIMER_ONE_SHOT);
+
+ if (_viewer->_butler) {
+ _viewer->_butler->rethrow ();
+ }
+}
private:
void paint ();
+ void timer ();
wxPanel* _panel;
boost::shared_ptr<const Image> _image;
+ wxTimer _timer;
};
boost::signals2::signal<void()> Sized;
+ /* XXX_b: to remove */
+ virtual void timer () {}
+
protected:
FilmViewer* _viewer;