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/HBSubtitlesController.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/HBSubtitlesController.m')
-rw-r--r-- | macosx/HBSubtitlesController.m | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/macosx/HBSubtitlesController.m b/macosx/HBSubtitlesController.m index df433fcc2..9b4337594 100644 --- a/macosx/HBSubtitlesController.m +++ b/macosx/HBSubtitlesController.m @@ -8,6 +8,8 @@ #import "HBSubtitlesDefaultsController.h" #import "HBSubtitlesDefaults.h" +#import "HBJob.h" + #import "Controller.h" #include "hb.h" #include "lang.h" @@ -86,7 +88,6 @@ NSString *keySubTrackLanguageIndex = @"keySubTrackLanguageIndex"; // Register as observer for the HBController notifications. [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(containerChanged:) name: HBContainerChangedNotification object: nil]; - [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(titleChanged:) name: HBTitleChangedNotification object: nil]; } return self; @@ -101,19 +102,18 @@ NSString *keySubTrackLanguageIndex = @"keySubTrackLanguageIndex"; _enabled = enabled; } -- (void)titleChanged:(NSNotification *)aNotification +- (void)setJob:(HBJob *)job { - NSDictionary *notDict = [aNotification userInfo]; - NSData *theData = notDict[keyTitleTag]; - hb_title_t *title = NULL; - [theData getBytes: &title length: sizeof(title)]; - /* reset the subtitles arrays */ [self.subtitleArray removeAllObjects]; [self.subtitleSourceArray removeAllObjects]; + self.settings = nil; - if (title) + if (job) { + self.settings = job.subtitlesDefaults; + hb_title_t *title = job.title.hb_title; + /* now populate the array with the source subtitle track info */ NSMutableArray *forcedSourceNamesArray = [[NSMutableArray alloc] init]; for (int i = 0; i < hb_list_count(title->list_subtitle); i++) @@ -220,7 +220,6 @@ NSString *keySubTrackLanguageIndex = @"keySubTrackLanguageIndex"; - (void)applySettingsFromPreset:(NSDictionary *)preset { - self.settings = [[[HBSubtitlesDefaults alloc] init] autorelease]; [self.settings applySettingsFromPreset:preset]; [self addTracksFromDefaults:self]; |