summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-06-29 22:02:19 +0100
committerCarl Hetherington <cth@carlh.net>2018-06-29 22:02:19 +0100
commite00b9850a7336b7db0aee058fe12f576db5f84a3 (patch)
tree390f055e9b70fc41a4e9eff851f931e1a8a2609f /src/lib
parent362443f12f6614404fe668b309f91099e3a83d51 (diff)
Basic jump to selected subtitle (#1200).
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/player.cc17
-rw-r--r--src/lib/player.h2
2 files changed, 19 insertions, 0 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc
index 5515b70e8..df58ed223 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -1089,3 +1089,20 @@ Player::set_dcp_decode_reduction (optional<int> reduction)
_have_valid_pieces = false;
Changed (PlayerProperty::DCP_DECODE_REDUCTION, false);
}
+
+DCPTime
+Player::content_time_to_dcp (shared_ptr<Content> content, ContentTime t)
+{
+ if (_have_valid_pieces) {
+ setup_pieces ();
+ }
+
+ BOOST_FOREACH (shared_ptr<Piece> i, _pieces) {
+ if (i->content == content) {
+ return content_time_to_dcp (i, t);
+ }
+ }
+
+ DCPOMATIC_ASSERT (false);
+ return DCPTime ();
+}
diff --git a/src/lib/player.h b/src/lib/player.h
index fc7117ba2..54fa074c0 100644
--- a/src/lib/player.h
+++ b/src/lib/player.h
@@ -84,6 +84,8 @@ public:
void set_play_referenced ();
void set_dcp_decode_reduction (boost::optional<int> reduction);
+ DCPTime content_time_to_dcp (boost::shared_ptr<Content> content, ContentTime t);
+
/** Emitted when something has changed such that if we went back and emitted
* the last frame again it would look different. This is not emitted after
* a seek.