summaryrefslogtreecommitdiff
path: root/src/lib/format.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-03-31 15:09:49 +0100
committerCarl Hetherington <cth@carlh.net>2013-03-31 15:09:49 +0100
commit127672223cca569986e35c91265e269ed5a6561c (patch)
tree853793c1b929d4c38ebdf5456808e466083989b7 /src/lib/format.cc
parented78fd3d138114185e43edf81ffe91db17377da0 (diff)
Runs.
Diffstat (limited to 'src/lib/format.cc')
-rw-r--r--src/lib/format.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/lib/format.cc b/src/lib/format.cc
index b506c7000..05b71f2e5 100644
--- a/src/lib/format.cc
+++ b/src/lib/format.cc
@@ -29,6 +29,7 @@
#include <iostream>
#include "format.h"
#include "film.h"
+#include "playlist.h"
#include "i18n.h"
@@ -206,16 +207,16 @@ FixedFormat::FixedFormat (int r, libdcp::Size dcp, string id, string n, string d
* (so there are dcp_padding() pixels on the left and dcp_padding() on the right)
*/
int
-Format::dcp_padding (shared_ptr<const Film> f) const
+Format::dcp_padding (shared_ptr<const Playlist> p) const
{
- int p = rint ((_dcp_size.width - (_dcp_size.height * ratio_as_integer(f) / 100.0)) / 2.0);
+ int pad = rint ((_dcp_size.width - (_dcp_size.height * ratio_as_integer(p) / 100.0)) / 2.0);
/* This comes out -ve for Scope; bodge it */
- if (p < 0) {
- p = 0;
+ if (pad < 0) {
+ pad = 0;
}
- return p;
+ return pad;
}
float
@@ -231,15 +232,15 @@ VariableFormat::VariableFormat (libdcp::Size dcp, string id, string n, string d,
}
int
-VariableFormat::ratio_as_integer (shared_ptr<const Film> f) const
+VariableFormat::ratio_as_integer (shared_ptr<const Playlist> p) const
{
- return rint (ratio_as_float (f) * 100);
+ return rint (ratio_as_float (p) * 100);
}
float
-VariableFormat::ratio_as_float (shared_ptr<const Film> f) const
+VariableFormat::ratio_as_float (shared_ptr<const Playlist> p) const
{
- return float (f->size().width) / f->size().height;
+ return float (p->video_size().width) / p->video_size().height;
}
/** @return A name to be presented to the user */