2 Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
4 This file is part of DCP-o-matic.
6 DCP-o-matic is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 DCP-o-matic is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
22 #include "audio_panel.h"
23 #include "content_panel.h"
24 #include "content_panel.h"
25 #include "cucumber_bridge.h"
26 #include "cucumber_registry.h"
27 #include "dcpomatic_button.h"
28 #include "dir_dialog.h"
29 #include "file_dialog.h"
30 #include "film_viewer.h"
31 #include "image_sequence_dialog.h"
32 #include "text_panel.h"
33 #include "timeline_dialog.h"
34 #include "timing_panel.h"
35 #include "video_panel.h"
36 #include "video_panel.h"
39 #include "lib/audio_content.h"
40 #include "lib/case_insensitive_sorter.h"
41 #include "lib/compose.hpp"
42 #include "lib/config.h"
43 #include "lib/content_factory.h"
44 #include "lib/cross.h"
45 #include "lib/dcp_content.h"
46 #include "lib/dcp_subtitle_content.h"
47 #include "lib/dcp_subtitle_decoder.h"
48 #include "lib/dcpomatic_log.h"
49 #include "lib/ffmpeg_content.h"
51 #include "lib/film_util.h"
52 #include "lib/image_content.h"
54 #include "lib/playlist.h"
55 #include "lib/scope_guard.h"
56 #include "lib/string_text_file.h"
57 #include "lib/string_text_file_content.h"
58 #include "lib/text_content.h"
59 #include "lib/video_content.h"
60 #include <dcp/filesystem.h>
61 #include <dcp/warnings.h>
62 LIBDCP_DISABLE_WARNINGS
63 #include <wx/display.h>
65 #include <wx/listctrl.h>
66 #include <wx/notebook.h>
68 LIBDCP_ENABLE_WARNINGS
69 #include <boost/filesystem.hpp>
72 using std::dynamic_pointer_cast;
75 using std::make_shared;
76 using std::shared_ptr;
80 using boost::optional;
81 using namespace dcpomatic;
82 #if BOOST_VERSION >= 106100
83 using namespace boost::placeholders;
87 class LimitedContentPanelSplitter : public wxSplitterWindow
90 LimitedContentPanelSplitter(wxWindow* parent)
91 : wxSplitterWindow(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_NOBORDER | wxSP_3DSASH | wxSP_LIVE_UPDATE)
93 /* This value doesn't really mean much but we just want to stop double-click on the
94 divider from shrinking the bottom panel (#1601).
96 SetMinimumPaneSize(64);
98 Bind(wxEVT_SIZE, boost::bind(&LimitedContentPanelSplitter::sized, this, _1));
101 bool OnSashPositionChange(int new_position) override
103 /* Try to stop the top bit of the splitter getting so small that buttons disappear */
104 auto const ok = new_position > 220;
106 Config::instance()->set_main_content_divider_sash_position(new_position);
111 void first_shown(wxWindow* top, wxWindow* bottom)
113 int const sn = wxDisplay::GetFromWindow(this);
114 /* Fallback for when GetFromWindow fails for reasons that aren't clear */
117 wxRect const screen = wxDisplay(sn).GetClientArea();
118 /* This is a hack to try and make the content notebook a sensible size; large on big displays but small
119 enough on small displays to leave space for the content area.
121 pos = screen.height > 800 ? -600 : -_top_panel_minimum_size;
123 SplitHorizontally(top, bottom, Config::instance()->main_content_divider_sash_position().get_value_or(pos));
128 void sized(wxSizeEvent& ev)
130 auto const height = GetSize().GetHeight();
131 if (_first_shown && (!_last_height || *_last_height != height) && height > _top_panel_minimum_size && GetSashPosition() < _top_panel_minimum_size) {
132 /* The window is now fairly big but the top panel is small; this happens when the DCP-o-matic window
133 * is shrunk and then made larger again. Try to set a sensible top panel size in this case (#1839).
135 SetSashPosition(Config::instance()->main_content_divider_sash_position().get_value_or(_top_panel_minimum_size));
139 _last_height = height;
142 bool _first_shown = false;
143 int const _top_panel_minimum_size = 350;
144 boost::optional<int> _last_height;
148 class ContentDropTarget : public wxFileDropTarget
151 ContentDropTarget(ContentPanel* owner)
155 bool OnDropFiles(wxCoord, wxCoord, wxArrayString const& filenames) override
157 vector<boost::filesystem::path> files;
158 vector<boost::filesystem::path> dcps;
159 vector<boost::filesystem::path> folders;
160 for (size_t i = 0; i < filenames.GetCount(); ++i) {
161 auto path = boost::filesystem::path(wx_to_std(filenames[i]));
162 if (dcp::filesystem::is_regular_file(path)) {
163 files.push_back(path);
164 } else if (dcp::filesystem::is_directory(path)) {
165 if (contains_assetmap(path)) {
166 dcps.push_back(path);
168 folders.push_back(path);
173 if (!filenames.empty()) {
174 _panel->add_files(files);
177 for (auto dcp: dcps) {
178 _panel->add_dcp(dcp);
181 for (auto dir: folders) {
182 _panel->add_folder(dir);
189 ContentPanel* _panel;
193 /** A wxListCtrl that can middle-ellipsize its text */
194 class ContentListCtrl : public wxListCtrl
197 ContentListCtrl(wxWindow* parent)
198 : wxListCtrl(parent, wxID_ANY, wxDefaultPosition, wxSize(320, 160), wxLC_REPORT | wxLC_NO_HEADER | wxLC_VIRTUAL)
200 _red.SetTextColour(*wxRED);
206 weak_ptr<Content> content;
210 void set(vector<Item> const& items)
213 SetItemCount(items.size());
216 wxString OnGetItemText(long item, long) const override
218 DCPOMATIC_ASSERT(item >= 0 && item < static_cast<long>(_items.size()));
219 wxClientDC dc(const_cast<wxWindow*>(static_cast<wxWindow const*>(this)));
220 return wxControl::Ellipsize(_items[item].text, dc, wxELLIPSIZE_MIDDLE, GetSize().GetWidth());
223 wxListItemAttr* OnGetItemAttr(long item) const override
225 DCPOMATIC_ASSERT(item >= 0 && item < static_cast<long>(_items.size()));
226 return _items[item].error ? const_cast<wxListItemAttr*>(&_red) : nullptr;
229 weak_ptr<Content> content_at_index(long index)
231 if (index < 0 || index >= static_cast<long>(_items.size())) {
234 return _items[index].content;
238 std::vector<Item> _items;
243 ContentPanel::ContentPanel(wxNotebook* n, shared_ptr<Film> film, FilmViewer& viewer)
246 , _film_viewer (viewer)
247 , _generally_sensitive (true)
248 , _ignore_deselect (false)
249 , _no_check_selection (false)
251 _splitter = new LimitedContentPanelSplitter(n);
252 _top_panel = new wxPanel (_splitter);
254 _menu = new ContentMenu (_splitter, _film_viewer);
257 auto s = new wxBoxSizer (wxHORIZONTAL);
259 _content = new ContentListCtrl(_top_panel);
260 _content->DragAcceptFiles (true);
261 s->Add (_content, 1, wxEXPAND | wxTOP | wxBOTTOM, 6);
263 _content->InsertColumn (0, wxT(""));
264 _content->SetColumnWidth(0, 2048);
266 auto b = new wxBoxSizer (wxVERTICAL);
268 _add_file = new Button (_top_panel, _("Add file(s)..."));
269 _add_file->SetToolTip(_("Add video, image, sound or subtitle files to the film (Ctrl+A)."));
270 b->Add (_add_file, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
272 _add_folder = new Button (_top_panel, _("Add folder..."));
273 _add_folder->SetToolTip (_("Add a folder of image files (which will be used as a moving image sequence) or a folder of sound files."));
274 b->Add (_add_folder, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
276 _add_dcp = new Button (_top_panel, _("Add DCP..."));
277 _add_dcp->SetToolTip (_("Add a DCP."));
278 b->Add (_add_dcp, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
280 _remove = new Button (_top_panel, _("Remove"));
281 _remove->SetToolTip(_("Remove the selected piece of content from the film (Delete)."));
282 b->Add (_remove, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
284 _earlier = new Button (_top_panel, _("Earlier"));
285 _earlier->SetToolTip (_("Move the selected piece of content earlier in the film."));
286 b->Add (_earlier, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
288 _later = new Button (_top_panel, _("Later"));
289 _later->SetToolTip (_("Move the selected piece of content later in the film."));
290 b->Add (_later, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
292 _timeline = new Button (_top_panel, _("Timeline..."));
293 _timeline->SetToolTip(_("Open the timeline for the film (Ctrl+T)."));
294 b->Add (_timeline, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
296 s->Add (b, 0, wxALL, 4);
297 _top_panel->SetSizer (s);
300 _notebook = new wxNotebook (_splitter, wxID_ANY);
302 _timing_panel = new TimingPanel (this, _film_viewer);
303 _notebook->AddPage (_timing_panel, _("Timing"), false);
304 _timing_panel->create ();
306 _content->Bind (wxEVT_LIST_ITEM_SELECTED, boost::bind (&ContentPanel::item_selected, this));
307 _content->Bind (wxEVT_LIST_ITEM_DESELECTED, boost::bind (&ContentPanel::item_deselected, this));
308 _content->Bind (wxEVT_LIST_ITEM_RIGHT_CLICK, boost::bind (&ContentPanel::right_click, this, _1));
309 _content->Bind (wxEVT_DROP_FILES, boost::bind (&ContentPanel::files_dropped, this, _1));
310 _add_file->Bind (wxEVT_BUTTON, boost::bind (&ContentPanel::add_file_clicked, this));
311 _add_folder->Bind (wxEVT_BUTTON, boost::bind (&ContentPanel::add_folder_clicked, this));
312 _add_dcp->Bind (wxEVT_BUTTON, boost::bind (&ContentPanel::add_dcp_clicked, this));
313 _remove->Bind (wxEVT_BUTTON, boost::bind (&ContentPanel::remove_clicked, this, false));
314 _earlier->Bind (wxEVT_BUTTON, boost::bind (&ContentPanel::earlier_clicked, this));
315 _later->Bind (wxEVT_BUTTON, boost::bind (&ContentPanel::later_clicked, this));
316 _timeline->Bind (wxEVT_BUTTON, boost::bind (&ContentPanel::timeline_clicked, this));
318 _content->SetDropTarget(new ContentDropTarget(this));
323 ContentPanel::first_shown ()
325 _splitter->first_shown (_top_panel, _notebook);
330 ContentPanel::selected ()
335 s = _content->GetNextItem (s, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
340 auto weak = _content->content_at_index(s);
341 if (auto content = weak.lock()) {
342 sel.push_back(content);
351 ContentPanel::selected_video ()
355 for (auto i: selected()) {
366 ContentPanel::selected_audio ()
370 for (auto i: selected()) {
381 ContentPanel::selected_text ()
385 for (auto i: selected()) {
386 if (!i->text.empty()) {
396 ContentPanel::selected_ffmpeg ()
398 FFmpegContentList sc;
400 for (auto i: selected()) {
401 auto t = dynamic_pointer_cast<FFmpegContent> (i);
412 ContentPanel::film_changed(FilmProperty p)
415 case FilmProperty::CONTENT:
416 case FilmProperty::CONTENT_ORDER:
423 for (auto i: panels()) {
430 ContentPanel::item_deselected ()
432 /* Maybe this is just a re-click on the same item; if not, _ignore_deselect will stay
433 false and item_deselected_foo will handle the deselection.
435 _ignore_deselect = false;
436 signal_manager->when_idle (boost::bind (&ContentPanel::item_deselected_idle, this));
441 ContentPanel::item_deselected_idle ()
443 if (!_ignore_deselect) {
450 ContentPanel::item_selected ()
452 _ignore_deselect = true;
458 ContentPanel::check_selection ()
460 if (_no_check_selection) {
464 setup_sensitivity ();
466 for (auto i: panels()) {
467 i->content_selection_changed ();
470 optional<DCPTime> go_to;
471 for (auto content: selected()) {
472 if (content->paths_valid()) {
473 auto position = content->position();
474 if (auto text_content = dynamic_pointer_cast<StringTextFileContent>(content)) {
475 /* Rather special case; if we select a text subtitle file jump to its
478 StringTextFile ts(text_content);
479 if (auto first = ts.first()) {
480 position += DCPTime(first.get(), _film->active_frame_rate_change(content->position()));
482 } else if (auto dcp_content = dynamic_pointer_cast<DCPSubtitleContent>(content)) {
483 /* Do the same for DCP subtitles */
484 DCPSubtitleDecoder ts(_film, dcp_content);
485 if (auto first = ts.first()) {
486 position += DCPTime(first.get(), _film->active_frame_rate_change(content->position()));
489 if (!go_to || position < go_to.get()) {
495 if (go_to && Config::instance()->jump_to_selected() && signal_manager) {
496 signal_manager->when_idle(boost::bind(&FilmViewer::seek, &_film_viewer, go_to.get().ceil(_film->video_frame_rate()), true));
499 if (_timeline_dialog) {
500 _timeline_dialog->set_selection (selected());
503 /* Make required tabs visible */
505 if (_notebook->GetPageCount() > 1) {
506 /* There's more than one tab in the notebook so the current selection could be meaningful
507 to the user; store it so that we can try to restore it later.
509 _last_selected_tab = 0;
510 if (_notebook->GetSelection() != wxNOT_FOUND) {
511 _last_selected_tab = _notebook->GetPage(_notebook->GetSelection());
515 bool have_video = false;
516 bool have_audio = false;
517 EnumIndexedVector<bool, TextType> have_text;
518 for (auto i: selected()) {
525 for (auto j: i->text) {
526 have_text[static_cast<int>(j->original_type())] = true;
532 if (have_video && !_video_panel) {
533 _video_panel = new VideoPanel (this);
534 _notebook->InsertPage (off, _video_panel, _video_panel->name());
535 _video_panel->create ();
536 } else if (!have_video && _video_panel) {
537 _notebook->DeletePage (off);
538 _video_panel = nullptr;
545 if (have_audio && !_audio_panel) {
546 _audio_panel = new AudioPanel (this);
547 _notebook->InsertPage (off, _audio_panel, _audio_panel->name());
548 _audio_panel->create ();
549 } else if (!have_audio && _audio_panel) {
550 _notebook->DeletePage (off);
551 _audio_panel = nullptr;
558 for (int i = 0; i < static_cast<int>(TextType::COUNT); ++i) {
559 if (have_text[i] && !_text_panel[i]) {
560 _text_panel[i] = new TextPanel (this, static_cast<TextType>(i));
561 _notebook->InsertPage (off, _text_panel[i], _text_panel[i]->name());
562 _text_panel[i]->create ();
563 } else if (!have_text[i] && _text_panel[i]) {
564 _notebook->DeletePage (off);
565 _text_panel[i] = nullptr;
572 /* Set up the tab selection */
575 for (size_t i = 0; i < _notebook->GetPageCount(); ++i) {
576 if (_notebook->GetPage(i) == _last_selected_tab) {
577 _notebook->SetSelection (i);
582 if (!done && _notebook->GetPageCount() > 0) {
583 _notebook->SetSelection (0);
586 setup_sensitivity ();
592 ContentPanel::add_file_clicked ()
594 /* This method is also called when Ctrl-A is pressed, so check that our notebook page
597 if (_parent->GetCurrentPage() != _splitter || !_film) {
601 /* The wxFD_CHANGE_DIR here prevents a `could not set working directory' error 123 on Windows when using
602 non-Latin filenames or paths.
606 _("Choose a file or files"),
607 wxT("All files|*.*|Subtitle files|*.srt;*.xml|Audio files|*.wav;*.w64;*.flac;*.aif;*.aiff"),
608 wxFD_MULTIPLE | wxFD_CHANGE_DIR,
610 add_files_override_path(_film)
614 add_files(dialog.paths());
620 ContentPanel::add_folder_clicked ()
622 DirDialog dialog(_splitter, _("Choose a folder"), wxDD_DIR_MUST_EXIST, "AddFilesPath", add_files_override_path(_film));
624 add_folder(dialog.path());
630 ContentPanel::add_folder(boost::filesystem::path folder)
632 vector<shared_ptr<Content>> content;
635 content = content_factory(folder);
636 } catch (exception& e) {
637 error_dialog (_parent, e.what());
641 if (content.empty ()) {
642 error_dialog (_parent, _("No content found in this folder."));
646 for (auto i: content) {
647 auto ic = dynamic_pointer_cast<ImageContent> (i);
649 ImageSequenceDialog dialog(_splitter);
651 if (dialog.ShowModal() != wxID_OK) {
654 ic->set_video_frame_rate(_film, dialog.frame_rate());
657 _film->examine_and_add_content (i);
663 ContentPanel::add_dcp_clicked ()
665 DirDialog dialog(_splitter, _("Choose a DCP folder"), wxDD_DIR_MUST_EXIST, "AddFilesPath", add_files_override_path(_film));
667 add_dcp(dialog.path());
673 ContentPanel::add_dcp(boost::filesystem::path dcp)
676 _film->examine_and_add_content(make_shared<DCPContent>(dcp));
677 } catch (ProjectFolderError &) {
681 "This looks like a DCP-o-matic project folder, which cannot be added to a different project. "
682 "Choose the DCP folder inside the DCP-o-matic project folder if that's what you want to import."
685 } catch (exception& e) {
686 error_dialog(_parent, e.what());
691 /** @return true if this remove "click" should be ignored */
693 ContentPanel::remove_clicked (bool hotkey)
695 /* If the method was called because Delete was pressed check that our notebook page
696 is visible and that the content list is focused.
698 if (hotkey && (_parent->GetCurrentPage() != _splitter || !_content->HasFocus())) {
702 for (auto i: selected ()) {
703 _film->remove_content (i);
712 ContentPanel::timeline_clicked ()
714 if (!_film || _film->content().empty()) {
718 _timeline_dialog.reset(this, _film, _film_viewer);
719 _timeline_dialog->set_selection (selected());
720 _timeline_dialog->Show ();
725 ContentPanel::right_click (wxListEvent& ev)
727 _menu->popup (_film, selected (), TimelineContentViewList (), ev.GetPoint ());
731 /** Set up broad sensitivity based on the type of content that is selected */
733 ContentPanel::setup_sensitivity ()
735 _add_file->Enable (_generally_sensitive);
736 _add_folder->Enable (_generally_sensitive);
737 _add_dcp->Enable (_generally_sensitive);
739 auto selection = selected ();
740 auto video_selection = selected_video ();
741 auto audio_selection = selected_audio ();
743 _remove->Enable (_generally_sensitive && !selection.empty());
744 _earlier->Enable (_generally_sensitive && selection.size() == 1);
745 _later->Enable (_generally_sensitive && selection.size() == 1);
746 _timeline->Enable (_generally_sensitive && _film && !_film->content().empty());
749 _video_panel->Enable (_generally_sensitive && video_selection.size() > 0);
752 _audio_panel->Enable (_generally_sensitive && audio_selection.size() > 0);
754 for (auto text: _text_panel) {
756 text->Enable(_generally_sensitive && selection.size() == 1 && !selection.front()->text.empty());
759 _timing_panel->Enable (_generally_sensitive);
764 ContentPanel::set_film (shared_ptr<Film> film)
767 _audio_panel->set_film (film);
772 film_changed(FilmProperty::CONTENT);
773 film_changed(FilmProperty::AUDIO_CHANNELS);
779 setup_sensitivity ();
784 ContentPanel::set_general_sensitivity (bool s)
786 _generally_sensitive = s;
787 setup_sensitivity ();
792 ContentPanel::earlier_clicked ()
794 auto sel = selected ();
795 if (sel.size() == 1) {
796 _film->move_content_earlier (sel.front ());
803 ContentPanel::later_clicked ()
805 auto sel = selected ();
806 if (sel.size() == 1) {
807 _film->move_content_later (sel.front ());
814 ContentPanel::set_selection (weak_ptr<Content> wc)
816 auto content = _film->content ();
817 for (size_t i = 0; i < content.size(); ++i) {
818 set_selected_state(i, content[i] == wc.lock());
824 ContentPanel::set_selection (ContentList cl)
827 _no_check_selection = true;
828 ScopeGuard sg = [this]() { _no_check_selection = false; };
830 auto content = _film->content ();
831 for (size_t i = 0; i < content.size(); ++i) {
832 set_selected_state(i, find(cl.begin(), cl.end(), content[i]) != cl.end());
841 ContentPanel::select_all ()
843 set_selection (_film->content());
848 ContentPanel::film_content_changed (int property)
851 property == ContentProperty::PATH ||
852 property == DCPContentProperty::NEEDS_ASSETS ||
853 property == DCPContentProperty::NEEDS_KDM ||
854 property == DCPContentProperty::NAME
860 for (auto i: panels()) {
861 i->film_content_changed (property);
868 text_for_content(shared_ptr<Content> content, bool& alert)
870 bool const valid = content->paths_valid();
872 auto dcp = dynamic_pointer_cast<DCPContent>(content);
873 bool const needs_kdm = dcp && dcp->needs_kdm();
874 bool const needs_assets = dcp && dcp->needs_assets();
876 auto s = std_to_wx(content->summary());
879 s = _("MISSING: ") + s;
883 s = _("NEEDS KDM: ") + s;
887 s = _("NEEDS OV: ") + s;
890 alert = !valid || needs_kdm || needs_assets;
897 ContentPanel::setup ()
900 _content->DeleteAllItems ();
901 setup_sensitivity ();
905 auto content = _film->content ();
906 auto selection = selected();
908 vector<ContentListCtrl::Item> items;
910 for (auto i: content) {
911 int const t = _content->GetItemCount ();
913 wxString const s = text_for_content(i, alert);
914 items.push_back({s, i, alert});
919 item.SetData (i.get ());
920 _content->InsertItem (item);
922 if (i.get() == selected_content) {
923 _content->SetItemState (t, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
927 _content->SetItemTextColour (t, *wxRED);
931 _content->set(items);
933 if (selection.empty() && !content.empty()) {
934 set_selected_state(0, true);
936 set_selection(selection);
939 setup_sensitivity ();
944 ContentPanel::files_dropped (wxDropFilesEvent& event)
950 auto paths = event.GetFiles ();
951 vector<boost::filesystem::path> path_list;
952 for (int i = 0; i < event.GetNumberOfFiles(); i++) {
953 path_list.push_back (wx_to_std(paths[i]));
956 add_files (path_list);
961 ContentPanel::add_files (vector<boost::filesystem::path> paths)
967 /* It has been reported that the paths returned from e.g. wxFileDialog are not always sorted;
968 I can't reproduce that, but sort them anyway. Don't use ImageFilenameSorter as a normal
969 alphabetical sort is expected here.
972 std::sort (paths.begin(), paths.end(), CaseInsensitiveSorter());
974 /* XXX: check for lots of files here and do something */
977 for (auto i: paths) {
978 for (auto j: content_factory(i)) {
979 _film->examine_and_add_content (j);
982 } catch (exception& e) {
983 error_dialog (_parent, e.what());
988 list<ContentSubPanel*>
989 ContentPanel::panels () const
991 list<ContentSubPanel*> p;
993 p.push_back (_video_panel);
996 p.push_back (_audio_panel);
998 for (auto text: _text_panel) {
1003 p.push_back (_timing_panel);
1009 ContentPanel::set_selected_state(int item, bool state)
1011 _content->SetItemState(item, state ? wxLIST_STATE_SELECTED : 0, wxLIST_STATE_SELECTED);
1012 _content->SetItemState(item, state ? wxLIST_STATE_FOCUSED : 0, wxLIST_STATE_FOCUSED);
1017 ContentPanel::window() const
1024 ContentPanel::cucumber_add_content_file (string filename)
1026 list<boost::filesystem::path> path_list;
1027 path_list.push_back (filename);
1028 add_files (path_list);
1032 /** This may not be called from the GUI thread */
1034 ContentPanel::cucumber_get_content_list ()
1036 /* The playlist method that we end up calling has a mutex, so this should be ok */
1038 BOOST_FOREACH (shared_ptr<Content> i, _film->content()) {
1040 s += wx_to_std (text_for_content(i, alert)) + "\n";