#include "wx/film_viewer.h"
#include "wx/player_information.h"
#include "wx/update_dialog.h"
+#include "wx/config_dialog.h"
#include <wx/wx.h>
#include <wx/stdpaths.h>
#include <wx/splash.h>
#include <wx/cmdline.h>
+#include <wx/preferences.h>
#include <boost/bind.hpp>
#include <iostream>
DOMFrame ()
: wxFrame (0, -1, _("DCP-o-matic Player"))
, _update_news_requested (false)
+ , _info (0)
+ , _config_dialog (0)
+ , _viewer (0)
{
#if defined(DCPOMATIC_WINDOWS)
Bind (wxEVT_MENU, boost::bind (&DOMFrame::file_open, this), ID_file_open);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::file_exit, this), wxID_EXIT);
+ Bind (wxEVT_MENU, boost::bind (&DOMFrame::edit_preferences, this), wxID_PREFERENCES);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::set_decode_reduction, this, optional<int>()), ID_view_scale_appropriate);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::set_decode_reduction, this, optional<int>(0)), ID_view_scale_full);
Bind (wxEVT_MENU, boost::bind (&DOMFrame::set_decode_reduction, this, optional<int>(1)), ID_view_scale_half);
}
_viewer->set_film (_film);
- _info->update ();
+ _info->triggered_update ();
}
private:
Close ();
}
+ void edit_preferences ()
+ {
+ if (!_config_dialog) {
+ _config_dialog = create_config_dialog ();
+ }
+ _config_dialog->Show (this);
+ }
+
void tools_check_for_updates ()
{
UpdateChecker::instance()->run ();
bool _update_news_requested;
PlayerInformation* _info;
+ wxPreferencesEditor* _config_dialog;
FilmViewer* _viewer;
boost::shared_ptr<Film> _film;
};
{
wxSizer* s = new wxBoxSizer (wxVERTICAL);
add_label_to_sizer(s, this, _("Performance"), false, 0)->SetFont(title_font);
+ _dropped = add_label_to_sizer(s, this, wxT(""), false, 0);
_sizer->Add (s, 1, wxEXPAND | wxALL, 6);
}
SetSizerAndFit (_sizer);
- update ();
+ triggered_update ();
+
+ Bind (wxEVT_TIMER, boost::bind (&PlayerInformation::periodic_update, this));
+ _timer.reset (new wxTimer (this));
+ _timer->Start (500);
+}
+
+void
+PlayerInformation::periodic_update ()
+{
+ checked_set (_dropped, wxString::Format(_("Dropped frames: %d"), _viewer->dropped()));
}
void
-PlayerInformation::update ()
+PlayerInformation::triggered_update ()
{
shared_ptr<DCPContent> dcp;
if (_viewer->film()) {