summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-04-10 19:43:01 +0100
committerCarl Hetherington <cth@carlh.net>2013-04-10 19:43:01 +0100
commit9bdd8cc51942a13e360dde4efc04b3ca417c8b94 (patch)
tree502e33212c51fa5e269cbdec87a29ed8fa711243 /src
parent5c620f37c8979a645a2094aa36b9af3d4f4ef5ec (diff)
parent01bb4ca21bea60137dce7201d9a37a0cf5691812 (diff)
Merge master.
Diffstat (limited to 'src')
-rw-r--r--src/lib/format.cc11
-rw-r--r--src/tools/dvdomatic.cc2
-rw-r--r--src/tools/po/es_ES.po2
-rw-r--r--src/tools/po/fr_FR.po2
-rw-r--r--src/tools/po/it_IT.po4
-rw-r--r--src/tools/po/sv_SE.po4
-rw-r--r--src/wx/film_editor.cc31
-rw-r--r--src/wx/film_viewer.cc13
-rw-r--r--src/wx/film_viewer.h3
9 files changed, 43 insertions, 29 deletions
diff --git a/src/lib/format.cc b/src/lib/format.cc
index 5eda9eb88..cce8762bd 100644
--- a/src/lib/format.cc
+++ b/src/lib/format.cc
@@ -200,14 +200,14 @@ FixedFormat::FixedFormat (int r, libdcp::Size dcp, string id, string n, string d
int
Format::dcp_padding (shared_ptr<const Film> f) const
{
- int pad = rint ((_dcp_size.width - (_dcp_size.height * ratio_as_integer(f) / 100.0)) / 2.0);
+ int p = rint ((_dcp_size.width - (_dcp_size.height * ratio(f))) / 2.0);
/* This comes out -ve for Scope; bodge it */
- if (pad < 0) {
- pad = 0;
+ if (p < 0) {
+ p = 0;
}
- return pad;
+ return p;
}
float
@@ -231,7 +231,8 @@ VariableFormat::ratio_as_integer (shared_ptr<const Film> f) const
float
VariableFormat::ratio_as_float (shared_ptr<const Film> f) const
{
- return float (f->video_size().width) / f->video_size().height;
+ libdcp::Size const c = f->cropped_size (f->video_size ());
+ return float (c.width) / c.height;
}
/** @return A name to be presented to the user */
diff --git a/src/tools/dvdomatic.cc b/src/tools/dvdomatic.cc
index 239b4a517..3fc19a91c 100644
--- a/src/tools/dvdomatic.cc
+++ b/src/tools/dvdomatic.cc
@@ -72,7 +72,7 @@ public:
{
_dialog = new wxMessageDialog (
0,
- std_to_wx (String::compose (wx_to_std (_("Save changes to film \"%1\" before closing?")), film->name())),
+ wxString::Format (_("Save changes to film \"%s\" before closing?"), std_to_wx (film->name ()).data()),
_("Film changed"),
wxYES_NO | wxYES_DEFAULT | wxICON_QUESTION
);
diff --git a/src/tools/po/es_ES.po b/src/tools/po/es_ES.po
index 1ab1a8489..abfbfef6d 100644
--- a/src/tools/po/es_ES.po
+++ b/src/tools/po/es_ES.po
@@ -109,7 +109,7 @@ msgid "S&how DCP"
msgstr "&Mostrar DCP"
#: src/tools/dvdomatic.cc:74
-msgid "Save changes to film \"%1\" before closing?"
+msgid "Save changes to film \"%s\" before closing?"
msgstr ""
#: src/tools/dvdomatic.cc:319
diff --git a/src/tools/po/fr_FR.po b/src/tools/po/fr_FR.po
index 35e686f67..b40c86877 100644
--- a/src/tools/po/fr_FR.po
+++ b/src/tools/po/fr_FR.po
@@ -106,7 +106,7 @@ msgid "S&how DCP"
msgstr "Voir le DCP"
#: src/tools/dvdomatic.cc:74
-msgid "Save changes to film \"%1\" before closing?"
+msgid "Save changes to film \"%s\" before closing?"
msgstr ""
#: src/tools/dvdomatic.cc:319
diff --git a/src/tools/po/it_IT.po b/src/tools/po/it_IT.po
index 09e3f5f34..38cbec157 100644
--- a/src/tools/po/it_IT.po
+++ b/src/tools/po/it_IT.po
@@ -106,8 +106,8 @@ msgid "S&how DCP"
msgstr "&Mostra DCP"
#: src/tools/dvdomatic.cc:74
-msgid "Save changes to film \"%1\" before closing?"
-msgstr "Salvare i cambiamenti del film \"%1\" prima di chiudere?"
+msgid "Save changes to film \"%s\" before closing?"
+msgstr "Salvare i cambiamenti del film \"%s\" prima di chiudere?"
#: src/tools/dvdomatic.cc:319
msgid "Select film to open"
diff --git a/src/tools/po/sv_SE.po b/src/tools/po/sv_SE.po
index 28566d876..57254770c 100644
--- a/src/tools/po/sv_SE.po
+++ b/src/tools/po/sv_SE.po
@@ -107,8 +107,8 @@ msgid "S&how DCP"
msgstr "&Visa DCP"
#: src/tools/dvdomatic.cc:74
-msgid "Save changes to film \"%1\" before closing?"
-msgstr "Spara ändringarna till filmen \"%1\" före avslut?"
+msgid "Save changes to film \"%s\" before closing?"
+msgstr "Spara ändringarna till filmen \"%s\" före avslut?"
#: src/tools/dvdomatic.cc:319
msgid "Select film to open"
diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc
index 9cd10ad61..c03a13bfe 100644
--- a/src/wx/film_editor.cc
+++ b/src/wx/film_editor.cc
@@ -146,7 +146,7 @@ FilmEditor::make_film_panel ()
}
++r;
- _frame_rate_description = new wxStaticText (_film_panel, wxID_ANY, wxT (" \n \n "), wxDefaultPosition, wxDefaultSize);
+ _frame_rate_description = new wxStaticText (_film_panel, wxID_ANY, wxT ("\n \n "), wxDefaultPosition, wxDefaultSize);
grid->Add (_frame_rate_description, wxGBPosition (r, 0), wxGBSpan (1, 2), wxEXPAND | wxALIGN_CENTER_VERTICAL | wxALL, 6);
wxFont font = _frame_rate_description->GetFont();
font.SetStyle(wxFONTSTYLE_ITALIC);
@@ -785,8 +785,11 @@ void
FilmEditor::setup_frame_rate_description ()
{
wxString d;
+ int lines = 0;
+
if (_film->video_frame_rate()) {
d << std_to_wx (FrameRateConversion (_film->video_frame_rate(), _film->dcp_frame_rate()).description);
+ ++lines;
#ifdef HAVE_SWRESAMPLE
if (_film->audio_frame_rate() && _film->audio_frame_rate() != _film->target_audio_sample_rate ()) {
d << wxString::Format (
@@ -794,14 +797,15 @@ FilmEditor::setup_frame_rate_description ()
_film->audio_frame_rate(),
_film->target_audio_sample_rate()
);
- } else {
- d << wxT ("\n");
+ ++lines;
}
-#else
- d << wxT ("\n");
#endif
}
+ for (int i = lines; i < 2; ++i) {
+ d << wxT ("\n ");
+ }
+
_frame_rate_description->SetLabel (d);
}
@@ -1402,13 +1406,14 @@ FilmEditor::setup_scaling_description ()
int lines = 0;
- d << wxString::Format (
- _("Original video is %dx%d (%.2f:1)\n"),
- _film->video_size().width, _film->video_size().height,
- float (_film->video_size().width) / _film->video_size().height
- );
-
- ++lines;
+ if (_film->video_size().width && _film->video_size().height) {
+ d << wxString::Format (
+ _("Original video is %dx%d (%.2f:1)\n"),
+ _film->video_size().width, _film->video_size().height,
+ float (_film->video_size().width) / _film->video_size().height
+ );
+ ++lines;
+ }
Crop const crop = _film->crop ();
if (crop.left || crop.right || crop.top || crop.bottom) {
@@ -1444,7 +1449,7 @@ FilmEditor::setup_scaling_description ()
}
for (int i = lines; i < 4; ++i) {
- d << wxT (" \n");
+ d << wxT ("\n ");
}
_scaling_description->SetLabel (d);
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index d18083694..cba19c07c 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -133,6 +133,11 @@ FilmViewer::set_film (shared_ptr<Film> f)
_film = f;
+ _raw_frame.reset ();
+ _display_frame.reset ();
+ _panel->Refresh ();
+ _panel->Update ();
+
if (!_film) {
return;
}
@@ -216,20 +221,20 @@ FilmViewer::paint_panel (wxPaintEvent &)
dc.DrawBitmap (sub_bitmap, _display_sub_position.x, _display_sub_position.y);
}
- if (_film_size.width < _panel_size.width) {
+ if (_out_size.width < _panel_size.width) {
wxPen p (GetBackgroundColour ());
wxBrush b (GetBackgroundColour ());
dc.SetPen (p);
dc.SetBrush (b);
- dc.DrawRectangle (_film_size.width, 0, _panel_size.width - _film_size.width, _panel_size.height);
+ dc.DrawRectangle (_out_size.width, 0, _panel_size.width - _out_size.width, _panel_size.height);
}
- if (_film_size.height < _panel_size.height) {
+ if (_out_size.height < _panel_size.height) {
wxPen p (GetBackgroundColour ());
wxBrush b (GetBackgroundColour ());
dc.SetPen (p);
dc.SetBrush (b);
- dc.DrawRectangle (0, _film_size.height, _panel_size.width, _panel_size.height - _film_size.height);
+ dc.DrawRectangle (0, _out_size.height, _panel_size.width, _panel_size.height - _out_size.height);
}
}
diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h
index 0ce8a526e..c81c65acd 100644
--- a/src/wx/film_viewer.h
+++ b/src/wx/film_viewer.h
@@ -88,6 +88,9 @@ private:
boost::shared_ptr<Image> _raw_frame;
boost::shared_ptr<Subtitle> _raw_sub;
boost::shared_ptr<Image> _display_frame;
+ /* The x offset at which we display the actual film content; this corresponds
+ to the film's padding converted to our coordinates.
+ */
int _display_frame_x;
boost::shared_ptr<RGBPlusAlphaImage> _display_sub;
Position _display_sub_position;