diff options
author | ritsuka <[email protected]> | 2014-12-21 06:34:10 +0000 |
---|---|---|
committer | ritsuka <[email protected]> | 2014-12-21 06:34:10 +0000 |
commit | 01b16be689edd6ade8a348466a9cb362b0d3a949 (patch) | |
tree | 79e629a396e7cf62f5c7f80a7b59f84c2166003d /macosx/HBChapterTitlesController.m | |
parent | b4a65e7027fc060c8df9deae30a2a3ab460be520 (diff) |
MacGui: use HBJob when possible.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6633 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBChapterTitlesController.m')
-rw-r--r-- | macosx/HBChapterTitlesController.m | 36 |
1 files changed, 3 insertions, 33 deletions
diff --git a/macosx/HBChapterTitlesController.m b/macosx/HBChapterTitlesController.m index e029b7244..debfcb63f 100644 --- a/macosx/HBChapterTitlesController.m +++ b/macosx/HBChapterTitlesController.m @@ -6,7 +6,7 @@ #import "HBChapterTitlesController.h" #import "Controller.h" -#include "hb.h" +#import "HBJob.h" @interface HBChapterTitlesController () <NSTableViewDataSource, NSTableViewDelegate> { @@ -31,7 +31,6 @@ if (self) { fChapterTitlesArray = [[[NSMutableArray alloc] init] retain]; - [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(titleChanged:) name: HBTitleChangedNotification object: nil]; } return self; } @@ -42,39 +41,10 @@ [super dealloc]; } -- (void)titleChanged:(NSNotification *)aNotification +- (void)setJob:(HBJob *)job { - NSDictionary *notDict = [aNotification userInfo]; - NSData *theData = [notDict objectForKey: keyTitleTag]; - hb_title_t *title = NULL; - - [theData getBytes: &title length: sizeof(title)]; - [fChapterTitlesArray removeAllObjects]; - - if (title) - { - for (int i = 0; i < hb_list_count(title->list_chapter); i++) - { - hb_chapter_t *chapter = hb_list_item(title->list_chapter, i); - if (chapter != NULL) - { - if (chapter->title != NULL) - { - [fChapterTitlesArray addObject:[NSString - stringWithFormat:@"%s", - chapter->title]]; - } - else - { - [fChapterTitlesArray addObject:[NSString - stringWithFormat:@"Chapter %d", - i + 1]]; - } - } - } - } - + [fChapterTitlesArray addObjectsFromArray:job.title.chapters]; [fChapterTable reloadData]; } |