/*
- Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2017 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
_kdm_filename_format = dcp::NameFormat ("KDM %f %c %s");
_dcp_metadata_filename_format = dcp::NameFormat ("%t");
_dcp_asset_filename_format = dcp::NameFormat ("%t");
+ _jump_to_selected = true;
_allowed_dcp_frame_rates.clear ();
_allowed_dcp_frame_rates.push_back (24);
_kdm_filename_format = dcp::NameFormat (f.optional_string_child("KDMFilenameFormat").get_value_or ("KDM %f %c %s"));
_dcp_metadata_filename_format = dcp::NameFormat (f.optional_string_child("DCPMetadataFilenameFormat").get_value_or ("%t"));
_dcp_asset_filename_format = dcp::NameFormat (f.optional_string_child("DCPAssetFilenameFormat").get_value_or ("%t"));
+ _jump_to_selected = f.optional_bool_child("JumpToSelected").get_value_or (true);
/* Replace any cinemas from config.xml with those from the configured file */
if (boost::filesystem::exists (_cinemas_file)) {
root->add_child("KDMContainerNameFormat")->add_child_text (_kdm_container_name_format.specification ());
root->add_child("DCPMetadataFilenameFormat")->add_child_text (_dcp_metadata_filename_format.specification ());
root->add_child("DCPAssetFilenameFormat")->add_child_text (_dcp_asset_filename_format.specification ());
+ root->add_child("JumpToSelected")->add_child_text (_jump_to_selected ? "1" : "0");
try {
doc.write_to_file_formatted (path("config.xml").string ());
#include "lib/video_decoder.h"
#include "lib/timer.h"
#include "lib/log.h"
+#include "lib/config.h"
extern "C" {
#include <libavutil/pixfmt.h>
}
, _outline_content (new wxCheckBox (this, wxID_ANY, _("Outline content")))
, _left_eye (new wxRadioButton (this, wxID_ANY, _("Left eye"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP))
, _right_eye (new wxRadioButton (this, wxID_ANY, _("Right eye")))
+ , _jump_to_selected (new wxCheckBox (this, wxID_ANY, _("Jump to selected content")))
, _slider (new wxSlider (this, wxID_ANY, 0, 0, 4096))
, _back_button (new wxButton (this, wxID_ANY, wxT("<")))
, _forward_button (new wxButton (this, wxID_ANY, wxT(">")))
view_options->Add (_outline_content, 0, wxRIGHT, DCPOMATIC_SIZER_GAP);
view_options->Add (_left_eye, 0, wxLEFT | wxRIGHT, DCPOMATIC_SIZER_GAP);
view_options->Add (_right_eye, 0, wxLEFT | wxRIGHT, DCPOMATIC_SIZER_GAP);
+ view_options->Add (_jump_to_selected, 0, wxLEFT | wxRIGHT, DCPOMATIC_SIZER_GAP);
_v_sizer->Add (view_options, 0, wxALL, DCPOMATIC_SIZER_GAP);
wxBoxSizer* h_sizer = new wxBoxSizer (wxHORIZONTAL);
_back_button->SetMinSize (wxSize (32, -1));
_forward_button->SetMinSize (wxSize (32, -1));
- _panel->Bind (wxEVT_PAINT, boost::bind (&FilmViewer::paint_panel, this));
- _panel->Bind (wxEVT_SIZE, boost::bind (&FilmViewer::panel_sized, this, _1));
- _outline_content->Bind(wxEVT_CHECKBOX, boost::bind (&FilmViewer::refresh_panel, this));
- _left_eye->Bind (wxEVT_RADIOBUTTON, boost::bind (&FilmViewer::refresh, this));
- _right_eye->Bind (wxEVT_RADIOBUTTON, boost::bind (&FilmViewer::refresh, this));
- _slider->Bind (wxEVT_SCROLL_THUMBTRACK, boost::bind (&FilmViewer::slider_moved, this));
- _slider->Bind (wxEVT_SCROLL_PAGEUP, boost::bind (&FilmViewer::slider_moved, this));
- _slider->Bind (wxEVT_SCROLL_PAGEDOWN, boost::bind (&FilmViewer::slider_moved, this));
- _play_button->Bind (wxEVT_TOGGLEBUTTON, boost::bind (&FilmViewer::play_clicked, this));
- _timer.Bind (wxEVT_TIMER, boost::bind (&FilmViewer::timer, this));
- _back_button->Bind (wxEVT_LEFT_DOWN, boost::bind (&FilmViewer::back_clicked, this, _1));
- _forward_button->Bind (wxEVT_LEFT_DOWN, boost::bind (&FilmViewer::forward_clicked, this, _1));
- _frame_number->Bind (wxEVT_LEFT_DOWN, boost::bind (&FilmViewer::frame_number_clicked, this));
- _timecode->Bind (wxEVT_LEFT_DOWN, boost::bind (&FilmViewer::timecode_clicked, this));
+ _panel->Bind (wxEVT_PAINT, boost::bind (&FilmViewer::paint_panel, this));
+ _panel->Bind (wxEVT_SIZE, boost::bind (&FilmViewer::panel_sized, this, _1));
+ _outline_content->Bind (wxEVT_CHECKBOX, boost::bind (&FilmViewer::refresh_panel, this));
+ _left_eye->Bind (wxEVT_RADIOBUTTON, boost::bind (&FilmViewer::refresh, this));
+ _right_eye->Bind (wxEVT_RADIOBUTTON, boost::bind (&FilmViewer::refresh, this));
+ _slider->Bind (wxEVT_SCROLL_THUMBTRACK, boost::bind (&FilmViewer::slider_moved, this));
+ _slider->Bind (wxEVT_SCROLL_PAGEUP, boost::bind (&FilmViewer::slider_moved, this));
+ _slider->Bind (wxEVT_SCROLL_PAGEDOWN, boost::bind (&FilmViewer::slider_moved, this));
+ _play_button->Bind (wxEVT_TOGGLEBUTTON, boost::bind (&FilmViewer::play_clicked, this));
+ _timer.Bind (wxEVT_TIMER, boost::bind (&FilmViewer::timer, this));
+ _back_button->Bind (wxEVT_LEFT_DOWN, boost::bind (&FilmViewer::back_clicked, this, _1));
+ _forward_button->Bind (wxEVT_LEFT_DOWN, boost::bind (&FilmViewer::forward_clicked, this, _1));
+ _frame_number->Bind (wxEVT_LEFT_DOWN, boost::bind (&FilmViewer::frame_number_clicked, this));
+ _timecode->Bind (wxEVT_LEFT_DOWN, boost::bind (&FilmViewer::timecode_clicked, this));
+ _jump_to_selected->Bind (wxEVT_CHECKBOX, boost::bind (&FilmViewer::jump_to_selected_clicked, this));
+
+ _jump_to_selected->SetValue (Config::instance()->jump_to_selected ());
set_film (shared_ptr<Film> ());
}
dialog->Destroy ();
}
+
+void
+FilmViewer::jump_to_selected_clicked ()
+{
+ Config::instance()->set_jump_to_selected (_jump_to_selected->GetValue ());
+}