summaryrefslogtreecommitdiff
path: root/libs/timecode
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2012-11-13 20:29:28 +0000
committerRobin Gareus <robin@gareus.org>2012-11-13 20:29:28 +0000
commite1581242ca8554660ea68290688e573a9acfca06 (patch)
tree49099b7fa12f4c0732dcc635fda59e448c1e5ea3 /libs/timecode
parentf761de0d70b896c4a3437f99b238effac520519d (diff)
implement TC offset for slave&generator.
Many related changes that require atomic update, mostly because ClockOption slots changed: * change offset config format to std:string (backwards compat - reads 0) * make Timecode offset independent from fps * sample_to_timecode() handle negative sample-num * audio-clock fix entry and edit of negative numbers * option editor: - remove old global internal offset - add slave & generator TC entry - still needs UI cleanup, tooltops, maybe sep. tab.. * LTC & MTC slave& generator: - cache offset - subscribe to parameter changes git-svn-id: svn://localhost/ardour2/branches/3.0@13485 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/timecode')
-rw-r--r--libs/timecode/src/time.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/timecode/src/time.cc b/libs/timecode/src/time.cc
index b39da34d6d..9a67e177b7 100644
--- a/libs/timecode/src/time.cc
+++ b/libs/timecode/src/time.cc
@@ -21,6 +21,7 @@
#include <math.h>
#include <stdio.h>
+#include <stdlib.h>
#include "timecode/time.h"
@@ -761,8 +762,8 @@ sample_to_timecode (
int64_t offset_sample;
if (!use_offset) {
- offset_sample = sample;
- timecode.negative = false;
+ timecode.negative = (sample < 0);
+ offset_sample = llabs(sample);
} else {
if (offset_is_negative) {
offset_sample = sample + offset_samples;