diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-06-04 12:32:37 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-06-04 12:32:37 +0100 |
| commit | 951572c6eb7e31834d2d7f1fbc67a9cdb1336696 (patch) | |
| tree | adfa99e08b52d759905499ffa2d5731c48ed8ac6 /src | |
| parent | 73663040fef9ae613ce42e89d852a66cbbc81bf6 (diff) | |
to_* to as_* in a few method names.
Diffstat (limited to 'src')
| -rw-r--r-- | src/dcp_time.cc | 6 | ||||
| -rw-r--r-- | src/dcp_time.h | 6 | ||||
| -rw-r--r-- | src/interop_subtitle_content.cc | 8 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/dcp_time.cc b/src/dcp_time.cc index 8e152ad2..d34804e9 100644 --- a/src/dcp_time.cc +++ b/src/dcp_time.cc @@ -240,7 +240,7 @@ dcp::operator/ (Time a, Time const & b) /** @return A string of the form h:m:s:e padded as in 00:00:00:000 */ string -Time::to_string () const +Time::as_string () const { stringstream str; str << setw(2) << setfill('0') << h << ":" @@ -251,13 +251,13 @@ Time::to_string () const } int64_t -Time::to_editable_units (int tcr_) const +Time::as_editable_units (int tcr_) const { return (int64_t(e) * float (tcr_ / tcr)) + int64_t(s) * tcr_ + int64_t(m) * 60 * tcr_ + int64_t(h) * 60 * 60 * tcr_; } double -Time::to_seconds () const +Time::as_seconds () const { return h * 3600 + m * 60 + s + double(e) / tcr; } diff --git a/src/dcp_time.h b/src/dcp_time.h index 907a8306..4e505738 100644 --- a/src/dcp_time.h +++ b/src/dcp_time.h @@ -69,9 +69,9 @@ public: int e; ///< editable units (where 1 editable unit is 1 / tcr_ seconds) int tcr; ///< timecode rate: the number of editable units per second. - std::string to_string () const; - double to_seconds () const; - int64_t to_editable_units (int tcr_) const; + std::string as_string () const; + double as_seconds () const; + int64_t as_editable_units (int tcr_) const; Time rebase (int tcr_) const; private: diff --git a/src/interop_subtitle_content.cc b/src/interop_subtitle_content.cc index a833e795..7b99e16e 100644 --- a/src/interop_subtitle_content.cc +++ b/src/interop_subtitle_content.cc @@ -159,10 +159,10 @@ InteropSubtitleContent::xml_as_string () const subtitle_element = font_element->add_child ("Subtitle"); subtitle_element->set_attribute ("SpotNumber", raw_convert<string> (spot_number++)); - subtitle_element->set_attribute ("TimeIn", i->in().to_string()); - subtitle_element->set_attribute ("TimeOut", i->out().to_string()); - subtitle_element->set_attribute ("FadeUpTime", raw_convert<string> (i->fade_up_time().to_editable_units(250))); - subtitle_element->set_attribute ("FadeDownTime", raw_convert<string> (i->fade_down_time().to_editable_units(250))); + subtitle_element->set_attribute ("TimeIn", i->in().as_string()); + subtitle_element->set_attribute ("TimeOut", i->out().as_string()); + subtitle_element->set_attribute ("FadeUpTime", raw_convert<string> (i->fade_up_time().as_editable_units(250))); + subtitle_element->set_attribute ("FadeDownTime", raw_convert<string> (i->fade_down_time().as_editable_units(250))); last_in = i->in (); last_out = i->out (); |
