WinGui: Fix another instance of the Caliburn vs Json.net sillyness where objects...
[HandBrake.git] / macosx / HBRange+UIAdditions.m
blobf7061acf79621159923b305bef854106fa5d4732
1 /*  HBRange+UIAdditions.m $
3  This file is part of the HandBrake source code.
4  Homepage: <http://handbrake.fr/>.
5  It may be used under the terms of the GNU General Public License. */
7 #import "HBRange+UIAdditions.h"
8 #import "HBTitle.h"
10 @implementation HBRange (UIAdditions)
12 - (NSArray *)chapters
14     NSMutableArray *chapters = [NSMutableArray array];
15     [self.title.chapters enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
16         [chapters addObject:[NSString stringWithFormat: @"%lu", idx + 1]];
17     }];
18     return chapters;
21 - (NSArray *)types
23     return @[NSLocalizedString(@"Chapters", @""),
24              NSLocalizedString(@"Seconds", @""),
25              NSLocalizedString(@"Frames", @"")];
28 - (BOOL)chaptersSelected
30     return self.type == HBRangeTypeChapters;
33 - (BOOL)secondsSelected
35     return self.type == HBRangeTypeSeconds;
38 - (BOOL)framesSelected
40     return self.type == HBRangeTypeFrames;
43 @end