diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-10-26 01:17:56 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-10-26 01:17:56 +0100 |
| commit | 2c35515c5db7b8e49c17fd4ddfa085393d544f9d (patch) | |
| tree | 0e7596e7887b72a477673bf9acb736b9b0296cff /src/wx | |
| parent | ee2cf80b14e8e78eb46280ba30cdb2f0c10c90a0 (diff) | |
Add empty playlist list and configuration option.
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/controls.cc | 27 | ||||
| -rw-r--r-- | src/wx/controls.h | 1 | ||||
| -rw-r--r-- | src/wx/player_config_dialog.cc | 15 |
3 files changed, 34 insertions, 9 deletions
diff --git a/src/wx/controls.cc b/src/wx/controls.cc index 9540b8586..747d21061 100644 --- a/src/wx/controls.cc +++ b/src/wx/controls.cc @@ -87,7 +87,7 @@ Controls::Controls (wxWindow* parent, shared_ptr<FilmViewer> viewer, bool editor _v_sizer->Add (view_options, 0, wxALL, DCPOMATIC_SIZER_GAP); - wxBoxSizer* e_sizer = new wxBoxSizer (wxHORIZONTAL); + wxBoxSizer* left_sizer = new wxBoxSizer (wxVERTICAL); _content_view = new wxListCtrl (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_NO_HEADER); /* time */ @@ -96,13 +96,20 @@ Controls::Controls (wxWindow* parent, shared_ptr<FilmViewer> viewer, bool editor _content_view->AppendColumn (wxT(""), wxLIST_FORMAT_LEFT, 80); /* annotation text */ _content_view->AppendColumn (wxT(""), wxLIST_FORMAT_LEFT, 580); - e_sizer->Add (_content_view, 1, wxALL | wxEXPAND, DCPOMATIC_SIZER_GAP); + left_sizer->Add (_content_view, 1, wxALL | wxEXPAND, DCPOMATIC_SIZER_GAP); _spl_view = new wxListCtrl (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_NO_HEADER); - _spl_view->AppendColumn (wxT(""), wxLIST_FORMAT_LEFT, 80); - _spl_view->AppendColumn (wxT(""), wxLIST_FORMAT_LEFT, 80); - _spl_view->AppendColumn (wxT(""), wxLIST_FORMAT_LEFT, 580); - e_sizer->Add (_spl_view, 1, wxALL | wxEXPAND, DCPOMATIC_SIZER_GAP); + _spl_view->AppendColumn (wxT(""), wxLIST_FORMAT_LEFT, 740); + left_sizer->Add (_spl_view, 1, wxALL | wxEXPAND, DCPOMATIC_SIZER_GAP); + + wxBoxSizer* e_sizer = new wxBoxSizer (wxHORIZONTAL); + e_sizer->Add (left_sizer, 1, wxALL | wxEXPAND, DCPOMATIC_SIZER_GAP); + + _current_spl_view = new wxListCtrl (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_NO_HEADER); + _current_spl_view->AppendColumn (wxT(""), wxLIST_FORMAT_LEFT, 80); + _current_spl_view->AppendColumn (wxT(""), wxLIST_FORMAT_LEFT, 80); + _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")); @@ -120,6 +127,7 @@ 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); @@ -215,7 +223,7 @@ Controls::add_clicked () /* Put 1 frame of black at the start so when we seek to 0 we don't see anything */ sel->set_position (DCPTime::from_frames(1, _film->video_frame_rate())); } - add_content_to_list (sel, _spl_view); + add_content_to_list (sel, _current_spl_view); setup_sensitivity (); } @@ -243,10 +251,10 @@ Controls::load_clicked () if (d->ShowModal() == wxID_OK) { _film->read_metadata (boost::filesystem::path(wx_to_std(d->GetPath()))); - _spl_view->DeleteAllItems (); + _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, _spl_view); + add_content_to_list (dcp, _current_spl_view); } } @@ -577,6 +585,7 @@ Controls::show_extended_player_controls (bool s) update_content_directory (); } _spl_view->Show (s); + _current_spl_view->Show (s); _log->Show (s); _add_button->Show (s); _save_button->Show (s); diff --git a/src/wx/controls.h b/src/wx/controls.h index 6e9b684a6..2c0b84d8d 100644 --- a/src/wx/controls.h +++ b/src/wx/controls.h @@ -106,6 +106,7 @@ private: wxCheckBox* _jump_to_selected; wxListCtrl* _content_view; wxListCtrl* _spl_view; + wxListCtrl* _current_spl_view; wxTextCtrl* _log; wxButton* _add_button; wxButton* _save_button; diff --git a/src/wx/player_config_dialog.cc b/src/wx/player_config_dialog.cc index a7f61a330..62b216b11 100644 --- a/src/wx/player_config_dialog.cc +++ b/src/wx/player_config_dialog.cc @@ -234,6 +234,11 @@ private: table->Add (_content_directory, wxGBPosition (r, 1)); ++r; + add_label_to_sizer (table, _panel, _("Playlist directory"), true, wxGBPosition (r, 0)); + _playlist_directory = new wxDirPickerCtrl (_panel, wxID_ANY, wxEmptyString, wxDirSelectorPromptStr, wxDefaultPosition, wxSize (300, -1)); + table->Add (_playlist_directory, wxGBPosition (r, 1)); + ++r; + add_label_to_sizer (table, _panel, _("KDM directory"), true, wxGBPosition (r, 0)); _kdm_directory = new wxDirPickerCtrl (_panel, wxID_ANY, wxEmptyString, wxDirSelectorPromptStr, wxDefaultPosition, wxSize (300, -1)); table->Add (_kdm_directory, wxGBPosition (r, 1)); @@ -247,6 +252,7 @@ private: #endif _content_directory->Bind (wxEVT_DIRPICKER_CHANGED, bind(&LocationsPage::content_directory_changed, this)); + _playlist_directory->Bind (wxEVT_DIRPICKER_CHANGED, bind(&LocationsPage::playlist_directory_changed, this)); _kdm_directory->Bind (wxEVT_DIRPICKER_CHANGED, bind(&LocationsPage::kdm_directory_changed, this)); #ifdef DCPOMATIC_VARIANT_SWAROOP _background_image->Bind (wxEVT_FILEPICKER_CHANGED, bind(&LocationsPage::background_image_changed, this)); @@ -260,6 +266,9 @@ private: if (config->player_content_directory()) { checked_set (_content_directory, *config->player_content_directory()); } + if (config->player_playlist_directory()) { + checked_set (_playlist_directory, *config->player_playlist_directory()); + } if (config->player_kdm_directory()) { checked_set (_kdm_directory, *config->player_kdm_directory()); } @@ -275,6 +284,11 @@ private: Config::instance()->set_player_content_directory(wx_to_std(_content_directory->GetPath())); } + void playlist_directory_changed () + { + Config::instance()->set_player_playlist_directory(wx_to_std(_playlist_directory->GetPath())); + } + void kdm_directory_changed () { Config::instance()->set_player_kdm_directory(wx_to_std(_kdm_directory->GetPath())); @@ -288,6 +302,7 @@ private: #endif wxDirPickerCtrl* _content_directory; + wxDirPickerCtrl* _playlist_directory; wxDirPickerCtrl* _kdm_directory; #ifdef DCPOMATIC_VARIANT_SWAROOP FilePickerCtrl* _background_image; |
