summaryrefslogtreecommitdiffstats
path: root/macosx/HBRange+UIAdditions.m
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/HBRange+UIAdditions.m')
-rw-r--r--macosx/HBRange+UIAdditions.m21
1 files changed, 21 insertions, 0 deletions
diff --git a/macosx/HBRange+UIAdditions.m b/macosx/HBRange+UIAdditions.m
new file mode 100644
index 000000000..3bcb31023
--- /dev/null
+++ b/macosx/HBRange+UIAdditions.m
@@ -0,0 +1,21 @@
+/* HBRange+UIAdditions.m $
+
+ This file is part of the HandBrake source code.
+ Homepage: <http://handbrake.fr/>.
+ It may be used under the terms of the GNU General Public License. */
+
+#import "HBRange+UIAdditions.h"
+#import "HBTitle.h"
+
+@implementation HBRange (UIAdditions)
+
+- (NSArray *)chapters
+{
+ NSMutableArray *chapters = [NSMutableArray array];
+ [self.title.chapters enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
+ [chapters addObject:[NSString stringWithFormat: @"%lu", idx + 1]];
+ }];
+ return chapters;
+}
+
+@end