summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-07-24 23:06:40 +0100
committerCarl Hetherington <cth@carlh.net>2013-07-24 23:06:40 +0100
commit92112105d96ed0193031cce21d1197ce29dfecc2 (patch)
tree0c6862569b73cee49b83d206898fb5d69d4cef23 /src
parente875c2935a4031fd5d50864b20a432c343f48248 (diff)
Restore video content frame rate information.
Diffstat (limited to 'src')
-rw-r--r--src/lib/util.cc8
-rw-r--r--src/wx/video_panel.cc41
-rw-r--r--src/wx/video_panel.h4
3 files changed, 31 insertions, 22 deletions
diff --git a/src/lib/util.cc b/src/lib/util.cc
index affbe3b00..183ff7d8b 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -742,17 +742,17 @@ FrameRateConversion::FrameRateConversion (float source, int dcp)
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);
}
}
}
diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc
index d0c99f606..f5306e67f 100644
--- a/src/wx/video_panel.cc
+++ b/src/wx/video_panel.cc
@@ -71,14 +71,6 @@ VideoPanel::VideoPanel (FilmEditor* e)
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);
@@ -90,6 +82,14 @@ VideoPanel::VideoPanel (FilmEditor* e)
}
++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);
@@ -167,7 +167,8 @@ VideoPanel::film_changed (Film::Property property)
{
switch (property) {
case Film::CONTAINER:
- setup_scaling_description ();
+ case Film::VIDEO_FRAME_RATE:
+ setup_description ();
break;
default:
break;
@@ -187,7 +188,7 @@ VideoPanel::film_content_changed (shared_ptr<Content> c, int property)
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;
@@ -206,7 +207,9 @@ VideoPanel::film_content_changed (shared_ptr<Content> c, int property)
} 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 ());
@@ -241,11 +244,11 @@ VideoPanel::edit_filters_clicked ()
}
void
-VideoPanel::setup_scaling_description ()
+VideoPanel::setup_description ()
{
shared_ptr<VideoContent> vc = _editor->selected_video_content ();
if (!vc) {
- _scaling_description->SetLabel ("");
+ _description->SetLabel ("");
return;
}
@@ -255,7 +258,7 @@ VideoPanel::setup_scaling_description ()
if (vc->video_size().width && vc->video_size().height) {
d << wxString::Format (
- _("Original video is %dx%d (%.2f:1)\n"),
+ _("Content video is %dx%d (%.2f:1)\n"),
vc->video_size().width, vc->video_size().height,
float (vc->video_size().width) / vc->video_size().height
);
@@ -297,11 +300,17 @@ VideoPanel::setup_scaling_description ()
}
}
- 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 ();
}
diff --git a/src/wx/video_panel.h b/src/wx/video_panel.h
index 4bd526d49..5a2281150 100644
--- a/src/wx/video_panel.h
+++ b/src/wx/video_panel.h
@@ -42,7 +42,7 @@ private:
void ratio_changed ();
void frame_type_changed ();
- void setup_scaling_description ();
+ void setup_description ();
wxChoice* _frame_type;
wxSpinCtrl* _left_crop;
@@ -51,7 +51,7 @@ private:
wxSpinCtrl* _bottom_crop;
wxChoice* _ratio;
wxStaticText* _ratio_description;
- wxStaticText* _scaling_description;
+ wxStaticText* _description;
wxStaticText* _filters;
wxButton* _filters_button;
};