string
FFmpegContent::summary () const
{
- return String::compose (_("%1 [movie]"), path());
+ /* Get the string() here so that the name does not have quotes around it */
+ return String::compose (_("%1 [movie]"), path().filename().string());
}
string
string
SndfileContent::summary () const
{
+ /* Get the string() here so that the name does not have quotes around it */
return String::compose (_("%1 [audio]"), path().filename().string());
}
string
StillImageContent::summary () const
{
- return String::compose (_("%1 [still]"), path());
+ /* Get the string() here so that the name does not have quotes around it */
+ return String::compose (_("%1 [still]"), path().filename().string());
}
string
change_speed = !about_equal (source * factor(), dcp);
if (!skip && !repeat && !change_speed) {
- description = _("DCP and source have the same rate.\n");
+ description = _("Content and DCP have the same rate.\n");
} else {
if (skip) {
- description = _("DCP will use every other frame of the source.\n");
+ description = _("DCP will use every other frame of the content.\n");
} else if (repeat) {
- description = _("Each source frame will be doubled in the DCP.\n");
+ description = _("Each content frame will be doubled in the DCP.\n");
}
if (change_speed) {
float const pc = dcp * 100 / (source * factor());
- description += String::compose (_("DCP will run at %1%% of the source speed.\n"), pc);
+ description += String::compose (_("DCP will run at %1%% of the content speed.\n"), pc);
}
}
}
{
return String::compose ("video: length %1, size %2x%3, rate %4", video_length(), video_size().width, video_size().height, video_frame_rate());
}
+
+libdcp::Size
+VideoContent::video_size_after_3d_split () const
+{
+ libdcp::Size const s = video_size ();
+ switch (video_frame_type ()) {
+ case VIDEO_FRAME_TYPE_2D:
+ return s;
+ case VIDEO_FRAME_TYPE_3D_LEFT_RIGHT:
+ return libdcp::Size (s.width / 2, s.height);
+ }
+
+ assert (false);
+}
return _ratio;
}
+ libdcp::Size video_size_after_3d_split () const;
+
protected:
void take_from_video_examiner (boost::shared_ptr<VideoExaminer>);
DirPickerCtrl::browse_clicked (wxCommandEvent &)
{
wxDirDialog* d = new wxDirDialog (this);
- d->ShowModal ();
- SetPath (d->GetPath ());
+ if (d->ShowModal () == wxID_OK) {
+ SetPath (d->GetPath ());
+ }
d->Destroy ();
}
{
set_general_sensitivity (f != 0);
- content_selection_changed ();
-
if (_film == f) {
return;
}
if (!_film->content().empty ()) {
set_selection (_film->content().front ());
}
+
+ content_selection_changed ();
}
void
, _window (window)
, _panel (panel)
, _table (table)
+ , _needs_pulse (false)
{
int n = 0;
panel->FitInside ();
}
+ void maybe_pulse ()
+ {
+ if (_job->running() && _needs_pulse) {
+ _gauge->Pulse ();
+ }
+
+ _needs_pulse = true;
+ }
+
private:
void progress ()
if (p >= 0) {
checked_set (_message, _job->status ());
_gauge->SetValue (p * 100);
- } else {
- checked_set (_message, wx_to_std (_("Running")));
- _gauge->Pulse ();
+ _needs_pulse = false;
}
_table->Layout ();
wxButton* _cancel;
wxButton* _pause;
wxButton* _details;
+ bool _needs_pulse;
};
/** Must be called in the GUI thread */
SetScrollRate (0, 32);
+ Bind (wxEVT_TIMER, boost::bind (&JobManagerView::periodic, this));
+ _timer.reset (new wxTimer (this));
+ _timer->Start (1000);
+
JobManager::instance()->JobAdded.connect (bind (&JobManagerView::job_added, this, _1));
}
}
}
+void
+JobManagerView::periodic ()
+{
+ for (list<shared_ptr<JobRecord> >::iterator i = _job_records.begin(); i != _job_records.end(); ++i) {
+ (*i)->maybe_pulse ();
+ }
+}
private:
void job_added (boost::weak_ptr<Job>);
+ void periodic ();
wxPanel* _panel;
wxFlexGridSizer* _table;
+ boost::shared_ptr<wxTimer> _timer;
std::list<boost::shared_ptr<JobRecord> > _job_records;
Buttons _buttons;
class ContentView : public View
{
public:
- ContentView (Timeline& tl, shared_ptr<Content> c, int t)
+ ContentView (Timeline& tl, shared_ptr<Content> c)
: View (tl)
, _content (c)
- , _track (t)
+ , _track (0)
, _selected (false)
{
_content_connection = c->Changed.connect (bind (&ContentView::content_changed, this, _2, _3));
class AudioContentView : public ContentView
{
public:
- AudioContentView (Timeline& tl, shared_ptr<Content> c, int t)
- : ContentView (tl, c, t)
+ AudioContentView (Timeline& tl, shared_ptr<Content> c)
+ : ContentView (tl, c)
{}
private:
class VideoContentView : public ContentView
{
public:
- VideoContentView (Timeline& tl, shared_ptr<Content> c, int t)
- : ContentView (tl, c, t)
+ VideoContentView (Timeline& tl, shared_ptr<Content> c)
+ : ContentView (tl, c)
{}
private:
for (ContentList::iterator i = content.begin(); i != content.end(); ++i) {
if (dynamic_pointer_cast<VideoContent> (*i)) {
- _views.push_back (shared_ptr<View> (new VideoContentView (*this, *i, 0)));
+ _views.push_back (shared_ptr<View> (new VideoContentView (*this, *i)));
}
if (dynamic_pointer_cast<AudioContent> (*i)) {
- _views.push_back (shared_ptr<View> (new AudioContentView (*this, *i, 0)));
+ _views.push_back (shared_ptr<View> (new AudioContentView (*this, *i)));
}
}
}
shared_ptr<Content> acv_content = acv->content();
-
+
int t = 1;
while (1) {
ViewList::iterator j = _views.begin();
shared_ptr<Content> test_content = test->content();
if (test && test->track() == t) {
- if ((acv_content->start() < test_content->start() && test_content->start() < acv_content->end()) ||
- (acv_content->start() < test_content->end() && test_content->end() < acv_content->end())) {
+ bool const no_overlap =
+ (acv_content->start() < test_content->start() && acv_content->end() < test_content->start()) ||
+ (acv_content->start() > test_content->end() && acv_content->end() > test_content->end());
+
+ if (!no_overlap) {
/* we have an overlap on track `t' */
++t;
break;
grid->Add (_ratio, wxGBPosition (r, 1));
++r;
- _scaling_description = new wxStaticText (this, wxID_ANY, wxT ("\n \n \n \n"), wxDefaultPosition, wxDefaultSize);
- grid->Add (_scaling_description, wxGBPosition (r, 0), wxGBSpan (1, 2), wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL, 6);
- wxFont font = _scaling_description->GetFont();
- font.SetStyle(wxFONTSTYLE_ITALIC);
- font.SetPointSize(font.GetPointSize() - 1);
- _scaling_description->SetFont(font);
- ++r;
-
{
add_label_to_grid_bag_sizer (grid, this, _("Filters"), true, wxGBPosition (r, 0));
wxSizer* s = new wxBoxSizer (wxHORIZONTAL);
}
++r;
+ _description = new wxStaticText (this, wxID_ANY, wxT ("\n \n \n \n \n"), wxDefaultPosition, wxDefaultSize);
+ grid->Add (_description, wxGBPosition (r, 0), wxGBSpan (1, 2), wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL, 6);
+ wxFont font = _description->GetFont();
+ font.SetStyle(wxFONTSTYLE_ITALIC);
+ font.SetPointSize(font.GetPointSize() - 1);
+ _description->SetFont(font);
+ ++r;
+
_left_crop->SetRange (0, 1024);
_top_crop->SetRange (0, 1024);
_right_crop->SetRange (0, 1024);
{
switch (property) {
case Film::CONTAINER:
- setup_scaling_description ();
+ case Film::VIDEO_FRAME_RATE:
+ setup_description ();
break;
default:
break;
if (property == VideoContentProperty::VIDEO_FRAME_TYPE) {
checked_set (_frame_type, vc ? vc->video_frame_type () : VIDEO_FRAME_TYPE_2D);
+ setup_description ();
} else if (property == VideoContentProperty::VIDEO_CROP) {
checked_set (_left_crop, vc ? vc->crop().left : 0);
checked_set (_right_crop, vc ? vc->crop().right : 0);
checked_set (_top_crop, vc ? vc->crop().top : 0);
checked_set (_bottom_crop, vc ? vc->crop().bottom : 0);
- setup_scaling_description ();
+ setup_description ();
} else if (property == VideoContentProperty::VIDEO_RATIO) {
if (vc) {
int n = 0;
} else {
checked_set (_ratio, -1);
}
- setup_scaling_description ();
+ setup_description ();
+ } else if (property == VideoContentProperty::VIDEO_FRAME_RATE) {
+ setup_description ();
} else if (property == FFmpegContentProperty::FILTERS) {
if (fc) {
pair<string, string> p = Filter::ffmpeg_strings (fc->filters ());
}
void
-VideoPanel::setup_scaling_description ()
+VideoPanel::setup_description ()
{
shared_ptr<VideoContent> vc = _editor->selected_video_content ();
if (!vc) {
- _scaling_description->SetLabel ("");
+ _description->SetLabel ("");
return;
}
if (vc->video_size().width && vc->video_size().height) {
d << wxString::Format (
- _("Original video is %dx%d (%.2f:1)\n"),
- vc->video_size().width, vc->video_size().height,
- float (vc->video_size().width) / vc->video_size().height
+ _("Content video is %dx%d (%.2f:1)\n"),
+ vc->video_size_after_3d_split().width, vc->video_size_after_3d_split().height,
+ float (vc->video_size_after_3d_split().width) / vc->video_size_after_3d_split().height
);
++lines;
}
Crop const crop = vc->crop ();
if ((crop.left || crop.right || crop.top || crop.bottom) && vc->video_size() != libdcp::Size (0, 0)) {
- libdcp::Size cropped = vc->video_size ();
+ libdcp::Size cropped = vc->video_size_after_3d_split ();
cropped.width -= crop.left + crop.right;
cropped.height -= crop.top + crop.bottom;
d << wxString::Format (
}
}
- for (int i = lines; i < 4; ++i) {
+ d << wxString::Format (_("Content frame rate %.4f\n"), vc->video_frame_rate ());
+ ++lines;
+ FrameRateConversion frc (vc->video_frame_rate(), _editor->film()->video_frame_rate ());
+ d << frc.description << "\n";
+ ++lines;
+
+ for (int i = lines; i < 6; ++i) {
d << wxT ("\n ");
}
- _scaling_description->SetLabel (d);
+ _description->SetLabel (d);
_sizer->Layout ();
}
void ratio_changed ();
void frame_type_changed ();
- void setup_scaling_description ();
+ void setup_description ();
wxChoice* _frame_type;
wxSpinCtrl* _left_crop;
wxSpinCtrl* _bottom_crop;
wxChoice* _ratio;
wxStaticText* _ratio_description;
- wxStaticText* _scaling_description;
+ wxStaticText* _description;
wxStaticText* _filters;
wxButton* _filters_button;
};