summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-07-11 11:16:01 +0100
committerCarl Hetherington <cth@carlh.net>2014-07-11 11:16:01 +0100
commit65618b6b245a7ba25a7814e00d1d1510cfa61f64 (patch)
tree22d41c04c16c7625d1271eb8821d269686f13f0b /src/lib
parenta8af9a0b57b853b8a8cd8fa35adb3fc967d59ee7 (diff)
Rename subtitle_use -> use_subtitles.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ffmpeg_content.cc2
-rw-r--r--src/lib/player.cc4
-rw-r--r--src/lib/subtitle_content.cc22
-rw-r--r--src/lib/subtitle_content.h10
4 files changed, 19 insertions, 19 deletions
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc
index 9b2bfc606..e14d1bd6b 100644
--- a/src/lib/ffmpeg_content.cc
+++ b/src/lib/ffmpeg_content.cc
@@ -110,7 +110,7 @@ FFmpegContent::FFmpegContent (shared_ptr<const Film> f, vector<boost::shared_ptr
for (size_t i = 0; i < c.size(); ++i) {
shared_ptr<FFmpegContent> fc = dynamic_pointer_cast<FFmpegContent> (c[i]);
- if (fc->subtitle_use() && *(fc->_subtitle_stream.get()) != *(ref->_subtitle_stream.get())) {
+ if (fc->use_subtitles() && *(fc->_subtitle_stream.get()) != *(ref->_subtitle_stream.get())) {
throw JoinError (_("Content to be joined must use the same subtitle stream."));
}
diff --git a/src/lib/player.cc b/src/lib/player.cc
index 9e14b65b3..c8ac591a7 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -196,7 +196,7 @@ Player::content_changed (weak_ptr<Content> w, int property, bool frequent)
Changed (frequent);
} else if (
- property == SubtitleContentProperty::SUBTITLE_USE ||
+ property == SubtitleContentProperty::USE_SUBTITLES ||
property == SubtitleContentProperty::SUBTITLE_X_OFFSET ||
property == SubtitleContentProperty::SUBTITLE_Y_OFFSET ||
property == SubtitleContentProperty::SUBTITLE_SCALE ||
@@ -539,7 +539,7 @@ Player::get_subtitles (DCPTime time, DCPTime length, bool starting)
for (list<shared_ptr<Piece> >::const_iterator j = subs.begin(); j != subs.end(); ++j) {
shared_ptr<SubtitleContent> subtitle_content = dynamic_pointer_cast<SubtitleContent> ((*j)->content);
- if (!subtitle_content->subtitle_use ()) {
+ if (!subtitle_content->use_subtitles ()) {
continue;
}
diff --git a/src/lib/subtitle_content.cc b/src/lib/subtitle_content.cc
index 8c94a94b9..3415ae613 100644
--- a/src/lib/subtitle_content.cc
+++ b/src/lib/subtitle_content.cc
@@ -36,11 +36,11 @@ using dcp::raw_convert;
int const SubtitleContentProperty::SUBTITLE_X_OFFSET = 500;
int const SubtitleContentProperty::SUBTITLE_Y_OFFSET = 501;
int const SubtitleContentProperty::SUBTITLE_SCALE = 502;
-int const SubtitleContentProperty::SUBTITLE_USE = 503;
+int const SubtitleContentProperty::USE_SUBTITLES = 503;
SubtitleContent::SubtitleContent (shared_ptr<const Film> f)
: Content (f)
- , _subtitle_use (false)
+ , _use_subtitles (false)
, _subtitle_x_offset (0)
, _subtitle_y_offset (0)
, _subtitle_scale (1)
@@ -50,7 +50,7 @@ SubtitleContent::SubtitleContent (shared_ptr<const Film> f)
SubtitleContent::SubtitleContent (shared_ptr<const Film> f, boost::filesystem::path p)
: Content (f, p)
- , _subtitle_use (false)
+ , _use_subtitles (false)
, _subtitle_x_offset (0)
, _subtitle_y_offset (0)
, _subtitle_scale (1)
@@ -60,13 +60,13 @@ SubtitleContent::SubtitleContent (shared_ptr<const Film> f, boost::filesystem::p
SubtitleContent::SubtitleContent (shared_ptr<const Film> f, cxml::ConstNodePtr node, int version)
: Content (f, node)
- , _subtitle_use (false)
+ , _use_subtitles (false)
, _subtitle_x_offset (0)
, _subtitle_y_offset (0)
, _subtitle_scale (1)
{
if (version >= 7) {
- _subtitle_use = node->bool_child ("SubtitleUse");
+ _use_subtitles = node->bool_child ("UseSubtitles");
_subtitle_x_offset = node->number_child<float> ("SubtitleXOffset");
_subtitle_y_offset = node->number_child<float> ("SubtitleYOffset");
} else {
@@ -85,7 +85,7 @@ SubtitleContent::SubtitleContent (shared_ptr<const Film> f, vector<shared_ptr<Co
for (size_t i = 0; i < c.size(); ++i) {
shared_ptr<SubtitleContent> sc = dynamic_pointer_cast<SubtitleContent> (c[i]);
- if (sc->subtitle_use() != ref->subtitle_use()) {
+ if (sc->use_subtitles() != ref->use_subtitles()) {
throw JoinError (_("Content to be joined must have the same 'use subtitles' setting."));
}
@@ -102,7 +102,7 @@ SubtitleContent::SubtitleContent (shared_ptr<const Film> f, vector<shared_ptr<Co
}
}
- _subtitle_use = ref->subtitle_use ();
+ _use_subtitles = ref->use_subtitles ();
_subtitle_x_offset = ref->subtitle_x_offset ();
_subtitle_y_offset = ref->subtitle_y_offset ();
_subtitle_scale = ref->subtitle_scale ();
@@ -111,20 +111,20 @@ SubtitleContent::SubtitleContent (shared_ptr<const Film> f, vector<shared_ptr<Co
void
SubtitleContent::as_xml (xmlpp::Node* root) const
{
- root->add_child("SubtitleUse")->add_child_text (raw_convert<string> (_subtitle_use));
+ root->add_child("UseSubtitles")->add_child_text (raw_convert<string> (_use_subtitles));
root->add_child("SubtitleXOffset")->add_child_text (raw_convert<string> (_subtitle_x_offset));
root->add_child("SubtitleYOffset")->add_child_text (raw_convert<string> (_subtitle_y_offset));
root->add_child("SubtitleScale")->add_child_text (raw_convert<string> (_subtitle_scale));
}
void
-SubtitleContent::set_subtitle_use (bool u)
+SubtitleContent::set_use_subtitles (bool u)
{
{
boost::mutex::scoped_lock lm (_mutex);
- _subtitle_use = u;
+ _use_subtitles = u;
}
- signal_changed (SubtitleContentProperty::SUBTITLE_USE);
+ signal_changed (SubtitleContentProperty::USE_SUBTITLES);
}
void
diff --git a/src/lib/subtitle_content.h b/src/lib/subtitle_content.h
index 29634f95a..57f5eb950 100644
--- a/src/lib/subtitle_content.h
+++ b/src/lib/subtitle_content.h
@@ -28,7 +28,7 @@ public:
static int const SUBTITLE_X_OFFSET;
static int const SUBTITLE_Y_OFFSET;
static int const SUBTITLE_SCALE;
- static int const SUBTITLE_USE;
+ static int const USE_SUBTITLES;
};
/** @class SubtitleContent
@@ -50,14 +50,14 @@ public:
virtual bool has_subtitles () const = 0;
- void set_subtitle_use (bool);
+ void set_use_subtitles (bool);
void set_subtitle_x_offset (double);
void set_subtitle_y_offset (double);
void set_subtitle_scale (double);
- bool subtitle_use () const {
+ bool use_subtitles () const {
boost::mutex::scoped_lock lm (_mutex);
- return _subtitle_use;
+ return _use_subtitles;
}
double subtitle_x_offset () const {
@@ -78,7 +78,7 @@ public:
private:
friend class ffmpeg_pts_offset_test;
- bool _subtitle_use;
+ bool _use_subtitles;
/** x offset for placing subtitles, as a proportion of the container width;
* +ve is further right, -ve is further left.
*/