summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-11-15 23:59:05 +0000
committerCarl Hetherington <cth@carlh.net>2018-11-22 23:26:27 +0000
commitc5662acf0b21d8c41e0b0f3d0690ebab7c6908a3 (patch)
treed43c61d378c919abaadf3bf501bd56c6866277a1 /src
parent00fd974edb88da88fcde308709ae629e541e59c4 (diff)
swaroop: remove SPL editing from player UI.
Diffstat (limited to 'src')
-rw-r--r--src/lib/config.cc3
-rw-r--r--src/lib/config.h9
-rw-r--r--src/wx/controls.cc99
-rw-r--r--src/wx/controls.h7
4 files changed, 0 insertions, 118 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc
index 1a503adde..489e66db9 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -176,7 +176,6 @@ Config::set_defaults ()
_player_watermark_theatre = "";
_player_watermark_period = 1;
_player_watermark_duration = 50;
- _allow_spl_editing = true;
_player_lock_file = boost::none;
#endif
@@ -529,7 +528,6 @@ try
BOOST_FOREACH (cxml::ConstNodePtr i, f.node_children("RequiredMonitor")) {
_required_monitors.push_back(Monitor(i));
}
- _allow_spl_editing = f.optional_bool_child("AllowSPLEditing").get_value_or(true);
_player_lock_file = f.optional_string_child("PlayerLockFile");
#endif
@@ -943,7 +941,6 @@ Config::write_config () const
BOOST_FOREACH (Monitor i, _required_monitors) {
i.as_xml(root->add_child("RequiredMonitor"));
}
- root->add_child("AllowSPLEditing")->add_child_text(_allow_spl_editing ? "1" : "0");
if (_player_lock_file) {
root->add_child("PlayerLockFile")->add_child_text(_player_lock_file->string());
}
diff --git a/src/lib/config.h b/src/lib/config.h
index dd20b58e7..0e5f9dfd1 100644
--- a/src/lib/config.h
+++ b/src/lib/config.h
@@ -530,10 +530,6 @@ public:
}
#endif
- bool allow_spl_editing () const {
- return _allow_spl_editing;
- }
-
/* SET (mostly) */
void set_master_encoding_threads (int n) {
@@ -1038,10 +1034,6 @@ public:
}
#endif
- void set_allow_spl_editing (bool s) {
- maybe_set (_allow_spl_editing, s);
- }
-
void changed (Property p = OTHER);
boost::signals2::signal<void (Property)> Changed;
/** Emitted if read() failed on an existing Config file. There is nothing
@@ -1248,7 +1240,6 @@ private:
/** a file which, if specified, must be present for the player to work */
boost::optional<boost::filesystem::path> _player_lock_file;
#endif
- bool _allow_spl_editing;
static int const _current_version;
diff --git a/src/wx/controls.cc b/src/wx/controls.cc
index 2d28077e1..5fa8d7176 100644
--- a/src/wx/controls.cc
+++ b/src/wx/controls.cc
@@ -108,15 +108,6 @@ Controls::Controls (wxWindow* parent, shared_ptr<FilmViewer> viewer, bool editor
_current_spl_view->AppendColumn (wxT(""), wxLIST_FORMAT_LEFT, 580);
e_sizer->Add (_current_spl_view, 1, wxALL | wxEXPAND, DCPOMATIC_SIZER_GAP);
- wxBoxSizer* buttons_sizer = new wxBoxSizer (wxVERTICAL);
- _add_button = new wxButton(this, wxID_ANY, _("Add"));
- buttons_sizer->Add (_add_button);
- _save_button = new wxButton(this, wxID_ANY, _("Save..."));
- buttons_sizer->Add (_save_button);
- _load_button = new wxButton(this, wxID_ANY, _("Load..."));
- buttons_sizer->Add (_load_button);
- e_sizer->Add (buttons_sizer, 0, wxALL | wxEXPAND, DCPOMATIC_SIZER_GAP);
-
_v_sizer->Add (e_sizer, 1, wxEXPAND);
_log = new wxTextCtrl (this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1, 200), wxTE_READONLY | wxTE_MULTILINE);
@@ -125,9 +116,6 @@ Controls::Controls (wxWindow* parent, shared_ptr<FilmViewer> viewer, bool editor
_content_view->Show (false);
_spl_view->Show (false);
_current_spl_view->Show (false);
- _add_button->Show (false);
- _save_button->Show (false);
- _load_button->Show (false);
_log->Show (false);
wxBoxSizer* h_sizer = new wxBoxSizer (wxHORIZONTAL);
@@ -183,9 +171,6 @@ Controls::Controls (wxWindow* parent, shared_ptr<FilmViewer> viewer, bool editor
_jump_to_selected->Bind (wxEVT_CHECKBOX, boost::bind (&Controls::jump_to_selected_clicked, this));
_jump_to_selected->SetValue (Config::instance()->jump_to_selected ());
}
- _add_button->Bind (wxEVT_BUTTON, boost::bind(&Controls::add_clicked, this));
- _save_button->Bind (wxEVT_BUTTON, boost::bind(&Controls::save_clicked, this));
- _load_button->Bind (wxEVT_BUTTON, boost::bind(&Controls::load_clicked, this));
_viewer->PositionChanged.connect (boost::bind(&Controls::position_changed, this));
_viewer->Started.connect (boost::bind(&Controls::started, this));
@@ -207,56 +192,6 @@ Controls::Controls (wxWindow* parent, shared_ptr<FilmViewer> viewer, bool editor
}
void
-Controls::add_clicked ()
-{
- shared_ptr<Content> sel = _content_view->selected()->clone();
- DCPOMATIC_ASSERT (sel);
- _film->examine_and_add_content (sel);
- bool const ok = display_progress (_("DCP-o-matic"), _("Loading DCP"));
- if (!ok || !report_errors_from_last_job(this)) {
- return;
- }
- add_content_to_list (sel, _current_spl_view);
- setup_sensitivity ();
-}
-
-void
-Controls::save_clicked ()
-{
- wxFileDialog* d = new wxFileDialog (
- this, _("Select playlist file"), wxEmptyString, wxEmptyString, wxT ("XML files (*.xml)|*.xml"),
- wxFD_SAVE | wxFD_OVERWRITE_PROMPT
- );
-
- if (d->ShowModal() == wxID_OK) {
- boost::filesystem::path p(wx_to_std(d->GetPath()));
- _film->set_name(p.stem().string());
- _film->write_metadata(p);
- }
-
- d->Destroy ();
-}
-
-void
-Controls::load_clicked ()
-{
- wxFileDialog* d = new wxFileDialog (
- this, _("Select playlist file"), wxEmptyString, wxEmptyString, wxT ("XML files (*.xml)|*.xml")
- );
-
- if (d->ShowModal() == wxID_OK) {
- _film->read_metadata (boost::filesystem::path(wx_to_std(d->GetPath())));
- _current_spl_view->DeleteAllItems ();
- BOOST_FOREACH (shared_ptr<Content> i, _film->content()) {
- shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent>(i);
- add_content_to_list (dcp, _current_spl_view);
- }
- }
-
- d->Destroy ();
-}
-
-void
Controls::config_changed (int property)
{
if (property == Config::PLAYER_CONTENT_DIRECTORY) {
@@ -504,9 +439,6 @@ Controls::setup_sensitivity ()
if (_eye) {
_eye->Enable (c && _film->three_d ());
}
-
- _add_button->Enable (Config::instance()->allow_spl_editing() && static_cast<bool>(_content_view->selected()));
- _save_button->Enable (Config::instance()->allow_spl_editing());
}
void
@@ -576,41 +508,10 @@ Controls::show_extended_player_controls (bool s)
}
_current_spl_view->Show (s);
_log->Show (s);
- _add_button->Show (s);
- _save_button->Show (s);
- _load_button->Show (s);
_v_sizer->Layout ();
}
void
-Controls::add_content_to_list (shared_ptr<Content> content, wxListCtrl* ctrl)
-{
- int const N = ctrl->GetItemCount();
-
- wxListItem it;
- it.SetId(N);
- it.SetColumn(0);
- DCPTime length = content->length_after_trim (_film);
- int h, m, s, f;
- length.split (24, h, m, s, f);
- it.SetText(wxString::Format("%02d:%02d:%02d", h, m, s));
- ctrl->InsertItem(it);
-
- shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent>(content);
- if (dcp && dcp->content_kind()) {
- it.SetId(N);
- it.SetColumn(1);
- it.SetText(std_to_wx(dcp::content_kind_to_string(*dcp->content_kind())));
- ctrl->SetItem(it);
- }
-
- it.SetId(N);
- it.SetColumn(2);
- it.SetText(std_to_wx(content->summary()));
- ctrl->SetItem(it);
-}
-
-void
Controls::add_playlist_to_list (shared_ptr<Film> film)
{
int const N = _spl_view->GetItemCount();
diff --git a/src/wx/controls.h b/src/wx/controls.h
index 59fe4e5d2..3bb963660 100644
--- a/src/wx/controls.h
+++ b/src/wx/controls.h
@@ -90,10 +90,6 @@ private:
void pause_clicked ();
void stop_clicked ();
#endif
- void add_clicked ();
- void save_clicked ();
- void load_clicked ();
- void add_content_to_list (boost::shared_ptr<Content> content, wxListCtrl* list);
void add_playlist_to_list (boost::shared_ptr<Film> film);
boost::shared_ptr<Film> _film;
@@ -110,9 +106,6 @@ private:
wxListCtrl* _spl_view;
wxListCtrl* _current_spl_view;
wxTextCtrl* _log;
- wxButton* _add_button;
- wxButton* _save_button;
- wxButton* _load_button;
std::vector<boost::shared_ptr<Film> > _playlists;
wxSlider* _slider;
wxButton* _rewind_button;