summaryrefslogtreecommitdiff
path: root/libs/timecode/timecode
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2012-10-13 23:27:40 +0000
committerRobin Gareus <robin@gareus.org>2012-10-13 23:27:40 +0000
commit4a17dd8fb619e7c8d25843c79a662f29b90ce83c (patch)
tree8196349a5c93668075bb31c67a16c2e957edf908 /libs/timecode/timecode
parent13d23f15aa334971e39fe22fed30cf968e2583e8 (diff)
move sample/timecode conversion to libtimecode.
git-svn-id: svn://localhost/ardour2/branches/3.0@13266 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/timecode/timecode')
-rw-r--r--libs/timecode/timecode/time.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/libs/timecode/timecode/time.h b/libs/timecode/timecode/time.h
index 7d77da1213..d9b3f01444 100644
--- a/libs/timecode/timecode/time.h
+++ b/libs/timecode/timecode/time.h
@@ -102,6 +102,38 @@ bool timecode_has_drop_frames(TimecodeFormat const t);
std::string timecode_format_name (TimecodeFormat const t);
+std::string timecode_format_time (Timecode::Time& timecode);
+
+std::string timecode_format_sampletime (
+ int64_t sample,
+ double sample_frame_rate,
+ double timecode_frames_per_second, bool timecode_drop_frames
+ );
+
+void
+timecode_to_sample(
+ Timecode::Time& timecode, int64_t& sample,
+ bool use_offset, bool use_subframes,
+ /* Note - framerate info is taken from Timecode::Time& */
+ double sample_frame_rate /**< may include pull up/down */,
+ int32_t subframes_per_frame /**< must not be 0 if use_subframes==true */,
+ /* optional offset - can be improved: function pointer to lazily query this*/
+ bool offset_is_negative, int64_t offset_samples
+ );
+
+void sample_to_timecode (
+ int64_t sample, Timecode::Time& timecode,
+ bool use_offset, bool use_subframes,
+ /* framerate info */
+ double timecode_frames_per_second,
+ bool timecode_drop_frames,
+ double sample_frame_rate/**< can include pull up/down */,
+ int32_t subframes_per_frame,
+ /* optional offset - can be improved: function pointer to lazily query this*/
+ bool offset_is_negative, int64_t offset_samples
+ );
+
+
} // namespace Timecode
std::ostream& operator<< (std::ostream& ostr, const Timecode::Time& t);