diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-09-14 21:22:33 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-09-14 21:22:33 +0100 |
| commit | 234bca29f70aeeba4fffd67f987de876ff89b6cc (patch) | |
| tree | 1096d9356805a79d802e950438aef8267ff6df42 /src/wx | |
| parent | 53c7f717da44c6ff681bde8946875e4f39764b25 (diff) | |
Basic and rather clumsy option to respect KDM validity windows.
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/film_viewer.cc | 6 | ||||
| -rw-r--r-- | src/wx/film_viewer.h | 2 | ||||
| -rw-r--r-- | src/wx/player_config_dialog.cc | 13 |
3 files changed, 21 insertions, 0 deletions
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index c062524e9..d45da2021 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -406,6 +406,12 @@ FilmViewer::start () return; } + optional<bool> v = PlaybackPermitted (); + if (v && !*v) { + /* Computer says no */ + return; + } + if (_audio.isStreamOpen()) { _audio.setStreamTime (_video_position.seconds()); _audio.startStream (); diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h index 029ec0323..0e44994de 100644 --- a/src/wx/film_viewer.h +++ b/src/wx/film_viewer.h @@ -93,6 +93,8 @@ public: boost::signals2::signal<void ()> Stopped; boost::signals2::signal<void ()> FilmChanged; + boost::signals2::signal<bool ()> PlaybackPermitted; + private: void paint_panel (); void panel_sized (wxSizeEvent &); diff --git a/src/wx/player_config_dialog.cc b/src/wx/player_config_dialog.cc index 258db9a57..c84c8b212 100644 --- a/src/wx/player_config_dialog.cc +++ b/src/wx/player_config_dialog.cc @@ -94,7 +94,12 @@ private: table->Add (_player_mode, wxGBPosition(r, 1)); ++r; + _respect_kdm = new wxCheckBox (_panel, wxID_ANY, _("Respect KDM validity periods")); + table->Add (_respect_kdm, wxGBPosition(r, 0), wxGBSpan(1, 2)); + ++r; + _player_mode->Bind (wxEVT_CHOICE, bind(&PlayerGeneralPage::player_mode_changed, this)); + _respect_kdm->Bind (wxEVT_CHECKBOX, bind(&PlayerGeneralPage::respect_kdm_changed, this)); } void config_changed () @@ -112,6 +117,8 @@ private: checked_set (_player_mode, 2); break; } + + checked_set (_respect_kdm, Config::instance()->respect_kdm_validity_periods()); } private: @@ -130,7 +137,13 @@ private: } } + void respect_kdm_changed () + { + Config::instance()->set_respect_kdm_validity_periods(_respect_kdm->GetValue()); + } + wxChoice* _player_mode; + wxCheckBox* _respect_kdm; }; wxPreferencesEditor* |
