diff options
author | Damiano Galassi <[email protected]> | 2017-12-11 14:58:15 +0100 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2017-12-11 14:58:15 +0100 |
commit | d55ae8e31f578e6ba254608e198c5931beba4084 (patch) | |
tree | 6329c4f913940860a463cb8fd56ac0f13b0b7a1d /macosx/HBRange+UIAdditions.m | |
parent | 05f181970d9c68c76ad9a686fee6f284412b5eb6 (diff) |
MacGui: add a "Start" column in the chapters tableview.
Diffstat (limited to 'macosx/HBRange+UIAdditions.m')
-rw-r--r-- | macosx/HBRange+UIAdditions.m | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/macosx/HBRange+UIAdditions.m b/macosx/HBRange+UIAdditions.m index 18710a159..e004fd724 100644 --- a/macosx/HBRange+UIAdditions.m +++ b/macosx/HBRange+UIAdditions.m @@ -56,3 +56,32 @@ } @end + +@implementation HBTimeTransformer + ++ (Class)transformedValueClass +{ + return [NSString class]; +} + +- (id)transformedValue:(id)value +{ + uint64_t duration = [value integerValue]; + uint64_t hours = duration / 90000 / 3600; + uint64_t minutes = ((duration / 90000 ) % 3600) / 60; + uint64_t seconds = (duration / 90000 ) % 60; + + return [NSString stringWithFormat:@"%02llu:%02llu:%02llu", hours, minutes, seconds]; +} + ++ (BOOL)allowsReverseTransformation +{ + return NO; +} + +- (id)reverseTransformedValue:(id)value +{ + return nil; +} + +@end |