next/previous chapter.

This commit is contained in:
Damiano Galassi committed 2013-11-04 09:47:22 +01:00
1 parent 05cf06cfa9
commit 22afab8481
2 files changed
+14 -4

No files matched your search

+10 -2
View File
@@ -100,7 +100,7 @@
return [[[MP42ChapterTrack alloc] initWithTextFile:URL] autorelease];
}
- (void)addChapter:(NSString *)title duration:(uint64_t)timestamp
- (NSUInteger)addChapter:(NSString *)title duration:(uint64_t)timestamp
{
MP42TextSample *newChapter = [[MP42TextSample alloc] init];
newChapter.title = title;
@@ -112,9 +112,11 @@
[chapters addObject:newChapter];
[chapters sortUsingSelector:@selector(compare:)];
[newChapter release];
return [chapters indexOfObject:newChapter];
}
- (void)addChapter:(NSString *)title image:(MP42Image *)image duration:(uint64_t)timestamp {
- (NSUInteger)addChapter:(NSString *)title image:(MP42Image *)image duration:(uint64_t)timestamp {
MP42TextSample *newChapter = [[MP42TextSample alloc] init];
newChapter.title = title;
newChapter.image = image;
@@ -126,6 +128,12 @@
[chapters addObject:newChapter];
[chapters sortUsingSelector:@selector(compare:)];
[newChapter release];
return [chapters indexOfObject:newChapter];
}
- (NSUInteger)indexOfChapter:(MP42TextSample *)chapterSample {
return [chapters indexOfObject:chapterSample];
}
- (void)removeChapterAtIndex:(NSUInteger)index