#include "lib/compose.hpp"
#include "lib/config.h"
#include "lib/content_factory.h"
+#include "lib/cross.h"
#include "lib/dcp_content.h"
#include "lib/dcpomatic_log.h"
#include "lib/ffmpeg_content.h"
using std::exception;
using std::list;
using std::make_shared;
-using std::max;
using std::shared_ptr;
using std::string;
using std::vector;
_timing_panel = new TimingPanel (this, _film_viewer);
_notebook->AddPage (_timing_panel, _("Timing"), false);
+ _timing_panel->create ();
_content->Bind (wxEVT_LIST_ITEM_SELECTED, boost::bind (&ContentPanel::item_selected, this));
_content->Bind (wxEVT_LIST_ITEM_DESELECTED, boost::bind (&ContentPanel::item_deselected, this));
if (have_video && !_video_panel) {
_video_panel = new VideoPanel (this);
_notebook->InsertPage (off, _video_panel, _video_panel->name());
+ _video_panel->create ();
} else if (!have_video && _video_panel) {
_notebook->DeletePage (off);
_video_panel = 0;
if (have_audio && !_audio_panel) {
_audio_panel = new AudioPanel (this);
_notebook->InsertPage (off, _audio_panel, _audio_panel->name());
+ _audio_panel->create ();
} else if (!have_audio && _audio_panel) {
_notebook->DeletePage (off);
_audio_panel = 0;
if (have_text[i] && !_text_panel[i]) {
_text_panel[i] = new TextPanel (this, static_cast<TextType>(i));
_notebook->InsertPage (off, _text_panel[i], _text_panel[i]->name());
+ _text_panel[i]->create ();
} else if (!have_text[i] && _text_panel[i]) {
_notebook->DeletePage (off);
_text_panel[i] = 0;
return;
}
+ auto path = Config::instance()->add_files_path();
+
/* The wxFD_CHANGE_DIR here prevents a `could not set working directory' error 123 on Windows when using
non-Latin filenames or paths.
*/
auto d = new wxFileDialog (
_splitter,
_("Choose a file or files"),
- wxT (""),
+ std_to_wx(path ? path->string() : home_directory().string()),
wxT (""),
wxT ("All files|*.*|Subtitle files|*.srt;*.xml|Audio files|*.wav;*.w64;*.flac;*.aif;*.aiff"),
wxFD_MULTIPLE | wxFD_CHANGE_DIR
wxArrayString paths;
d->GetPaths (paths);
- list<boost::filesystem::path> path_list;
+ vector<boost::filesystem::path> path_list;
for (unsigned int i = 0; i < paths.GetCount(); ++i) {
- path_list.push_back (wx_to_std (paths[i]));
+ path_list.push_back (wx_to_std(paths[i]));
}
add_files (path_list);
+ if (!path_list.empty()) {
+ Config::instance()->set_add_files_path(path_list[0].parent_path());
+ }
+
d->Destroy ();
}
}
auto paths = event.GetFiles ();
- list<boost::filesystem::path> path_list;
+ vector<boost::filesystem::path> path_list;
for (int i = 0; i < event.GetNumberOfFiles(); i++) {
- path_list.push_back (wx_to_std (paths[i]));
+ path_list.push_back (wx_to_std(paths[i]));
}
add_files (path_list);
void
-ContentPanel::add_files (list<boost::filesystem::path> paths)
+ContentPanel::add_files (vector<boost::filesystem::path> paths)
{
/* It has been reported that the paths returned from e.g. wxFileDialog are not always sorted;
I can't reproduce that, but sort them anyway. Don't use ImageFilenameSorter as a normal
alphabetical sort is expected here.
*/
- paths.sort (CaseInsensitiveSorter ());
+ std::sort (paths.begin(), paths.end(), CaseInsensitiveSorter());
/* XXX: check for lots of files here and do something */