#include "timeline_dialog.h"
#include "image_sequence_dialog.h"
#include "film_viewer.h"
+#include "dcpomatic_button.h"
#include "lib/audio_content.h"
#include "lib/text_content.h"
#include "lib/video_content.h"
#include "lib/compose.hpp"
#include "lib/string_text_file_content.h"
#include "lib/string_text_file.h"
+#include "lib/dcpomatic_log.h"
#include <wx/wx.h>
#include <wx/notebook.h>
#include <wx/listctrl.h>
using boost::dynamic_pointer_cast;
using boost::optional;
-#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-
ContentPanel::ContentPanel (wxNotebook* n, shared_ptr<Film> film, weak_ptr<FilmViewer> viewer)
: _video_panel (0)
, _audio_panel (0)
wxBoxSizer* b = new wxBoxSizer (wxVERTICAL);
- _add_file = new wxButton (_panel, wxID_ANY, _("Add file(s)..."));
+ _add_file = new Button (_panel, _("Add file(s)..."));
_add_file->SetToolTip (_("Add video, image, sound or subtitle files to the film."));
b->Add (_add_file, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
- _add_folder = new wxButton (_panel, wxID_ANY, _("Add folder..."));
+ _add_folder = new Button (_panel, _("Add folder..."));
_add_folder->SetToolTip (_("Add a folder of image files (which will be used as a moving image sequence) or a folder of sound files."));
b->Add (_add_folder, 1, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
- _add_dcp = new wxButton (_panel, wxID_ANY, _("Add DCP..."));
+ _add_dcp = new Button (_panel, _("Add DCP..."));
_add_dcp->SetToolTip (_("Add a DCP."));
b->Add (_add_dcp, 1, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
- _remove = new wxButton (_panel, wxID_ANY, _("Remove"));
+ _remove = new Button (_panel, _("Remove"));
_remove->SetToolTip (_("Remove the selected piece of content from the film."));
b->Add (_remove, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
- _earlier = new wxButton (_panel, wxID_ANY, _("Earlier"));
+ _earlier = new Button (_panel, _("Earlier"));
_earlier->SetToolTip (_("Move the selected piece of content earlier in the film."));
b->Add (_earlier, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
- _later = new wxButton (_panel, wxID_ANY, _("Later"));
+ _later = new Button (_panel, _("Later"));
_later->SetToolTip (_("Move the selected piece of content later in the film."));
b->Add (_later, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
- _timeline = new wxButton (_panel, wxID_ANY, _("Timeline..."));
+ _timeline = new Button (_panel, _("Timeline..."));
_timeline->SetToolTip (_("Open the timeline for the film."));
b->Add (_timeline, 0, wxEXPAND | wxALL, DCPOMATIC_BUTTON_STACK_GAP);
if (go_to && Config::instance()->jump_to_selected() && signal_manager) {
shared_ptr<FilmViewer> fv = _film_viewer.lock ();
DCPOMATIC_ASSERT (fv);
- signal_manager->when_idle(boost::bind(&FilmViewer::set_position, fv.get(), go_to.get().ceil(_film->video_frame_rate())));
+ signal_manager->when_idle(boost::bind(&FilmViewer::seek, fv.get(), go_to.get().ceil(_film->video_frame_rate()), true));
}
if (_timeline_dialog) {
list<shared_ptr<Content> > content;
try {
- content = content_factory (_film, path);
+ content = content_factory (path);
} catch (exception& e) {
error_dialog (_parent, e.what());
return;
}
try {
- _film->examine_and_add_content (shared_ptr<Content> (new DCPContent (_film, path)));
+ _film->examine_and_add_content (shared_ptr<Content> (new DCPContent (path)));
} catch (exception& e) {
error_dialog (_parent, e.what());
}
_text_panel[i]->Enable (_generally_sensitive && selection.size() == 1 && !selection.front()->text.empty());
}
}
- _timing_panel->Enable (_generally_sensitive);
+ _timing_panel->Enable (_generally_sensitive);
}
void
try {
BOOST_FOREACH (boost::filesystem::path i, paths) {
- BOOST_FOREACH (shared_ptr<Content> j, content_factory (_film, i)) {
+ BOOST_FOREACH (shared_ptr<Content> j, content_factory(i)) {
_film->examine_and_add_content (j);
}
}