MacGui: use hb_preset_job_init instead of custom logic for audio, subtitles and pictu...
authorDamiano Galassi <damiog@gmail.com>
Sat, 29 Oct 2016 11:24:01 +0000 (13:24 +0200)
committerDamiano Galassi <damiog@gmail.com>
Sat, 29 Oct 2016 12:08:19 +0000 (14:08 +0200)
28 files changed:
macosx/HBAudio.h
macosx/HBAudio.m
macosx/HBAudioDefaults.h
macosx/HBAudioDefaults.m
macosx/HBCore.m
macosx/HBFilters.h
macosx/HBFilters.m
macosx/HBJob+HBJobConversion.h
macosx/HBJob+HBJobConversion.m
macosx/HBJob+Private.h [new file with mode: 0644]
macosx/HBJob.h
macosx/HBJob.m
macosx/HBPicture.h
macosx/HBPicture.m
macosx/HBPreset.h
macosx/HBPreset.m
macosx/HBPresetCoding.h
macosx/HBRange.m
macosx/HBSubtitles.h
macosx/HBSubtitles.m
macosx/HBSubtitlesDefaults.h
macosx/HBSubtitlesDefaults.m
macosx/HBTitle+Private.h [moved from macosx/HBTitlePrivate.h with 75% similarity]
macosx/HBTitle.h
macosx/HBTitle.m
macosx/HBVideo.h
macosx/HBVideo.m
macosx/HandBrake.xcodeproj/project.pbxproj

index d56f59d16fd2d5b1cd98b23876c878d09d7ec6e6..5d73830a746824f6e5a634823bd37f7413aeb5e2 100644 (file)
@@ -7,7 +7,7 @@
 #import <Foundation/Foundation.h>
 #import "HBPresetCoding.h"
 
-@class HBTitle;
+@class HBJob;
 @class HBAudioTrack;
 @class HBAudioDefaults;
 
@@ -15,9 +15,11 @@ NS_ASSUME_NONNULL_BEGIN
 
 extern NSString *HBAudioChangedNotification;
 
-@interface HBAudio : NSObject <NSSecureCoding, NSCopying, HBPresetCoding>
+@interface HBAudio : NSObject <NSSecureCoding, NSCopying>
 
-- (instancetype)initWithTitle:(HBTitle *)title;
+- (instancetype)initWithJob:(HBJob *)job;
+
+@property (nonatomic, readwrite, weak) HBJob *job;
 
 @property (nonatomic, readonly) NSMutableArray<NSDictionary *> *sourceTracks;
 @property (nonatomic, readonly) NSMutableArray<HBAudioTrack *> *tracks;
index 81936d790704203ed021571f3f77af389ba24f7e..6c6bda46c9369114328b3a4ceed41f2b9c5ca6e4 100644 (file)
@@ -6,12 +6,15 @@
 
 #import "HBAudio.h"
 
+#import "HBJob.h"
+#import "HBJob+HBJobConversion.m"
 #import "HBTitle.h"
 #import "HBAudioTrack.h"
 #import "HBAudioTrackPreset.h"
 #import "HBAudioDefaults.h"
 
 #import "HBCodingUtilities.h"
+#import "HBJob+Private.h"
 
 #include "hb.h"
 
@@ -24,14 +27,15 @@ NSString *HBAudioChangedNotification = @"HBAudioChangedNotification";
 
 @implementation HBAudio
 
-- (instancetype)initWithTitle:(HBTitle *)title
+- (instancetype)initWithJob:(HBJob *)job
 {
     self = [super init];
     if (self)
     {
+        _job = job;
         _container = HB_MUX_MP4;
 
-        _sourceTracks = [title.audioTracks mutableCopy];
+        _sourceTracks = [job.title.audioTracks mutableCopy];
         _tracks = [[NSMutableArray alloc] init];
         _defaults = [[HBAudioDefaults alloc] init];
 
@@ -112,7 +116,7 @@ NSString *HBAudioChangedNotification = @"HBAudioChangedNotification";
 
 - (void)reloadDefaults
 {
-    [self addTracksFromDefaults];
+    [self addDefaultTracksFromJobSettings:self.job.jobDict];
 }
 
 - (void)setContainer:(int)container
@@ -128,8 +132,6 @@ NSString *HBAudioChangedNotification = @"HBAudioChangedNotification";
         // Update the Auto Passthru Fallback Codec Popup
         // lets get the tag of the currently selected item first so we might reset it later
         [self.defaults validateEncoderFallbackForVideoContainer:container];
-
-        //[self validatePassthru];
     }
 }
 
@@ -177,12 +179,9 @@ NSString *HBAudioChangedNotification = @"HBAudioChangedNotification";
 
 #pragma mark - Defaults
 
-- (void)addTracksFromDefaults
+- (void)addDefaultTracksFromJobSettings:(NSDictionary *)settings
 {
-    BOOL firstTrack = NO;
-    BOOL allTracks = NO;
-    NSMutableIndexSet *tracksAdded = [NSMutableIndexSet indexSet];
-    NSMutableIndexSet *tracksToAdd = [NSMutableIndexSet indexSet];
+    NSArray<NSDictionary<NSString *, id> *> *tracks = settings[@"Audio"][@"AudioList"];
 
     // Reinitialize the configured list of audio tracks
     while (self.countOfTracks)
@@ -190,144 +189,31 @@ NSString *HBAudioChangedNotification = @"HBAudioChangedNotification";
         [self removeObjectFromTracksAtIndex:0];
     }
 
-    if (self.defaults.trackSelectionBehavior != HBAudioTrackSelectionBehaviorNone)
+    // Add the tracks
+    for (NSDictionary *trackDict in tracks)
     {
-        // Add tracks of Default and Alternate Language by name
-        for (NSString *languageISOCode in self.defaults.trackSelectionLanguages)
-        {
-            NSMutableIndexSet *tracksIndexes = [[self _tracksWithISOCode:languageISOCode
-                                                         selectOnlyFirst:self.defaults.trackSelectionBehavior == HBAudioTrackSelectionBehaviorFirst] mutableCopy];
-            [tracksIndexes removeIndexes:tracksAdded];
-            if (tracksIndexes.count)
-            {
-                [self _processPresetAudioArray:self.defaults.tracksArray forTracks:tracksIndexes firstOnly:firstTrack];
-                firstTrack = self.defaults.secondaryEncoderMode ? YES : NO;
-                [tracksAdded addIndexes:tracksIndexes];
-            }
-        }
+        HBAudioTrack *track = [self trackFromSourceTrackIndex:[trackDict[@"Track"] unsignedIntegerValue] + 1];
 
-        // If no preferred Language was found, add standard track 1
-        if (tracksAdded.count == 0 && self.sourceTracks.count > 1)
+        track.drc = [trackDict[@"DRC"] doubleValue];
+        track.gain = [trackDict[@"Gain"] doubleValue];
+        track.mixdown = hb_mixdown_get_from_name([trackDict[@"Mixdown"] UTF8String]);
+        if ([trackDict[@"Samplerate"] isKindOfClass:[NSString class]])
         {
-            [tracksToAdd addIndex:1];
-        }
-    }
-
-    // If all tracks should be added, add all track numbers that are not yet processed
-    if (allTracks)
-    {
-        [tracksToAdd addIndexesInRange:NSMakeRange(1, self.sourceTracks.count - 1)];
-        [tracksToAdd removeIndexes:tracksAdded];
-    }
-
-    if (tracksToAdd.count)
-    {
-        [self _processPresetAudioArray:self.defaults.tracksArray forTracks:tracksToAdd firstOnly:firstTrack];
-    }
-
-    // Add an None item
-    [self addNoneTrack];
-}
-
-/**
- *  Uses the templateAudioArray from the preset to create the audios for the specified trackIndex.
- *
- *  @param templateAudioArray the track template.
- *  @param trackIndex         the index of the source track.
- *  @param firstOnly          use only the first track of the template or all.
- */
-- (void)_processPresetAudioArray:(NSArray *)templateAudioArray forTrack:(NSUInteger)trackIndex firstOnly:(BOOL)firstOnly
-{
-    for (HBAudioTrackPreset *preset in templateAudioArray)
-    {
-        HBAudioTrack *newAudio = [[HBAudioTrack alloc] initWithTrackIdx:trackIndex
-                                                              container:self.container
-                                                             dataSource:self
-                                                               delegate:self];
-        [newAudio setUndo:self.undo];
-
-        [self insertObject:newAudio inTracksAtIndex:[self countOfTracks]];
-
-        int inputCodec = [self.sourceTracks[trackIndex][keyAudioInputCodec] intValue];
-        int outputCodec = preset.encoder;
-
-        // Check if we need to use a fallback
-         if (preset.encoder & HB_ACODEC_PASS_FLAG && !(preset.encoder & inputCodec & HB_ACODEC_PASS_MASK))
-         {
-             outputCodec = hb_audio_encoder_get_fallback_for_passthru(outputCodec);
-
-             // If we couldn't find an encoder for the passthru format
-             // fall back to the selected encoder fallback
-             if (outputCodec == HB_ACODEC_INVALID)
-             {
-                 outputCodec = self.defaults.encoderFallback;
-             }
-         }
-
-        int supportedMuxers = hb_audio_encoder_get_from_codec(outputCodec)->muxers;
-
-        // If our preset wants us to support a codec that the track does not support,
-        // instead of changing the codec we remove the audio instead.
-        if (supportedMuxers & self.container)
-        {
-            newAudio.drc = preset.drc;
-            newAudio.gain = preset.gain;
-            newAudio.mixdown = preset.mixdown;
-            newAudio.sampleRate = preset.sampleRate;
-            newAudio.bitRate = preset.bitRate;
-            newAudio.encoder = outputCodec;
+            int sampleRate = hb_audio_samplerate_get_from_name([trackDict[@"Samplerate"] UTF8String]);
+            track.sampleRate = sampleRate == -1 ? 0 : sampleRate;
         }
         else
         {
-            [self removeObjectFromTracksAtIndex:[self countOfTracks] - 1];
+            track.sampleRate = [trackDict[@"Samplerate"] intValue];
         }
+        track.bitRate = [trackDict[@"Bitrate"] intValue];
+        track.encoder = hb_audio_encoder_get_from_name([trackDict[@"Encoder"] UTF8String]);
 
-
-        if (firstOnly)
-        {
-            break;
-        }
+        [self insertObject:track inTracksAtIndex:[self countOfTracks]];
     }
-}
-
-/**
- *  Matches the source audio tracks with the specific language iso code.
- *
- *  @param isoCode         the iso code to match.
- *  @param selectOnlyFirst whether to match only the first track for the iso code.
- *
- *  @return a NSIndexSet with the index of the matched tracks.
- */
-- (NSIndexSet *)_tracksWithISOCode:(NSString *)isoCode selectOnlyFirst:(BOOL)selectOnlyFirst
-{
-    NSMutableIndexSet *indexes = [NSMutableIndexSet indexSet];
 
-    [self.sourceTracks enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
-        if (idx) // Note that we skip the "None" track
-        {
-            if ([isoCode isEqualToString:@"und"] ||  [obj[keyAudioTrackLanguageIsoCode] isEqualToString:isoCode])
-            {
-                [indexes addIndex:idx];
-
-                if (selectOnlyFirst)
-                {
-                    *stop = YES;
-                }
-            }
-        }
-    }];
-
-    return indexes;
-}
-
-- (void)_processPresetAudioArray:(NSArray<HBAudioTrackPreset *> *)templateAudioArray forTracks:(NSIndexSet *)trackIndexes firstOnly:(BOOL)firstOnly
-{
-    __block BOOL firstTrack = firstOnly;
-    [trackIndexes enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL *stop) {
-        // Add the track
-        [self _processPresetAudioArray: self.defaults.tracksArray forTrack:idx firstOnly:firstTrack];
-        firstTrack = self.defaults.secondaryEncoderMode ? YES : NO;
-    }];
+    // Add an None item
+    [self addNoneTrack];
 }
 
 - (BOOL)anyCodecMatches:(int)codec
@@ -422,10 +308,10 @@ NSString *HBAudioChangedNotification = @"HBAudioChangedNotification";
     [self.defaults writeToPreset:preset];
 }
 
-- (void)applyPreset:(HBPreset *)preset
+- (void)applyPreset:(HBPreset *)preset jobSettings:(NSDictionary *)settings
 {
-    [self.defaults applyPreset:preset];
-    [self addTracksFromDefaults];
+    [self.defaults applyPreset:preset jobSettings:settings];
+    [self addDefaultTracksFromJobSettings:settings];
 }
 
 #pragma mark -
index fce8185ef39858d9463a62c59377ab79745c4dc4..8d3c1a8f3455bad79ce4d513610c1c79b21fa7a8 100644 (file)
@@ -47,6 +47,7 @@ typedef NS_ENUM(NSUInteger, HBAudioTrackSelectionBehavior) {
 @property(nonatomic, readonly) NSArray<NSString *> *audioEncoderFallbacks;
 
 - (void)validateEncoderFallbackForVideoContainer:(int)container;
+- (void)applyPreset:(HBPreset *)preset;
 
 @property (nonatomic, readwrite, weak, nullable) NSUndoManager *undo;
 
index 60bb933c89f416602ba8eba0db5948d8d0c29ec3..5f52d82feb9d03550a49a304886607dc61ead1ad 100644 (file)
     }
 }
 
+- (void)applyPreset:(HBPreset *)preset jobSettings:(NSDictionary *)settings
+{
+    [self applyPreset:preset];
+}
+
 - (void)writeToPreset:(HBMutablePreset *)preset
 {
     // Track selection behavior
index dcc4d24e33840d2b2bebbcfdfb691072c52f6429..eae767060fdfa8ebf4a1101df87bbd5493e4874c 100644 (file)
@@ -11,7 +11,7 @@
 #import "HBUtilities.h"
 
 #import "HBStateFormatter+Private.h"
-#import "HBTitlePrivate.h"
+#import "HBTitle+Private.h"
 
 #include <dlfcn.h>
 
@@ -256,7 +256,7 @@ static void hb_error_handler(const char *errmsg)
     for (int i = 0; i < hb_list_count(title_set->list_title); i++)
     {
         hb_title_t *title = (hb_title_t *) hb_list_item(title_set->list_title, i);
-        [titles addObject:[[HBTitle alloc] initWithTitle:title featured:(title->index == title_set->feature)]];
+        [titles addObject:[[HBTitle alloc] initWithTitle:title handle:self.hb_handle featured:(title->index == title_set->feature)]];
     }
 
     self.titles = [titles copy];
index 37416697de72595d2a8559b358e0b77f82bcc38e..e5f7cbb656cc8784c39c3deb5a0db59ef56d65fe 100644 (file)
@@ -14,7 +14,7 @@ extern NSString * const HBFiltersChangedNotification;
 /**
  *  Filters settings.
  */
-@interface HBFilters : NSObject <NSSecureCoding, NSCopying, HBPresetCoding>
+@interface HBFilters : NSObject <NSSecureCoding, NSCopying>
 
 @property (nonatomic, readwrite, copy) NSString *detelecine;
 @property (nonatomic, readwrite, copy) NSString *detelecineCustomString;
index 910c4186d483771388b34f965632463feabb1b92..981b753100b2945fdf9bd1dc3b4dd6fe539cde1d 100644 (file)
@@ -475,7 +475,7 @@ NSString * const HBFiltersChangedNotification = @"HBFiltersChangedNotification";
     preset[@"PictureRotate"] = [NSString stringWithFormat:@"angle=%d:hflip=%d", self.rotate, self.flip];
 }
 
-- (void)applyPreset:(HBPreset *)preset
+- (void)applyPreset:(HBPreset *)preset jobSettings:(NSDictionary *)settings
 {
     self.notificationsEnabled = NO;
 
index b46aabc180b303e7a5f28bef7fb033b78235ce14..58e51e5bcb7b61b2687b7268c5e94389f5bf1a93 100644 (file)
 
 @interface HBJob (HBJobConversion)
 
+/**
+ *  Returns a job settings dict by applying
+ *  the current preset to the job.
+ */
+@property (nonatomic, readonly) NSDictionary *jobDict;
+
 /**
  *  Converts the job to a hb_job_t struct.
  */
index e90ccfd6c960a3816c5a167612fa890463462b57..5c6d9126b61a1bd6c2c12afc3d07395e0b4ef3a6 100644 (file)
 
 #import "HBChapter.h"
 
-#import "HBTitlePrivate.h"
+#import "HBTitle+Private.h"
+#import "HBMutablePreset.h"
 
 @implementation HBJob (HBJobConversion)
 
+- (NSDictionary *)jobDict
+{
+    NSAssert(self.title, @"HBJob: calling jobDict without a valid title loaded");
+
+    HBMutablePreset *preset = [[HBMutablePreset alloc] init];
+    [self writeToPreset:preset];
+
+    return [self.title jobSettingsWithPreset:preset];
+}
+
 /**
  *  Prepares a hb_job_t
  */
diff --git a/macosx/HBJob+Private.h b/macosx/HBJob+Private.h
new file mode 100644 (file)
index 0000000..acd78da
--- /dev/null
@@ -0,0 +1,52 @@
+//
+//  HBJob+HBJob_Private.h
+//  HandBrake
+//
+//  Created by Damiano Galassi on 29/10/16.
+//
+//
+
+#import <HandBrakeKit/HandBrakeKit.h>
+
+@interface HBVideo (Private)
+
+- (void)applyPreset:(HBPreset *)preset jobSettings:(NSDictionary *)settings;
+
+@end
+
+@interface HBPicture (Private)
+
+- (void)applyPreset:(HBPreset *)preset jobSettings:(NSDictionary *)settings;
+
+@end
+
+@interface HBFilters (Private)
+
+- (void)applyPreset:(HBPreset *)preset jobSettings:(NSDictionary *)settings;
+
+@end
+
+@interface HBAudio (Private)
+
+- (void)applyPreset:(HBPreset *)preset jobSettings:(NSDictionary *)settings;
+
+@end
+
+@interface HBSubtitles (Private)
+
+- (void)applyPreset:(HBPreset *)preset jobSettings:(NSDictionary *)settings;
+
+@end
+
+@interface HBAudioDefaults (Private)
+
+- (void)applyPreset:(HBPreset *)preset jobSettings:(NSDictionary *)settings;
+
+@end
+
+@interface HBSubtitlesDefaults (Private)
+
+- (void)applyPreset:(HBPreset *)preset jobSettings:(NSDictionary *)settings;
+
+@end
+
index 008fb780289173a287785ad97908b96dd073b890..416ac5b1c8870e02b721a696e7b9a7dd1cd669fd 100644 (file)
@@ -44,6 +44,8 @@ typedef NS_ENUM(NSUInteger, HBJobState){
 
 - (instancetype)initWithTitle:(HBTitle *)title andPreset:(HBPreset *)preset;
 
+- (void)applyPreset:(HBPreset *)preset;
+
 /// Current state of the job.
 @property (nonatomic, readwrite) HBJobState state;
 
index 7fa3b58f5881fa3a72f4eee3ba7e84d24f0bf2af..483735d33fcd2e69f2e279d6f8d6fb670c12faf7 100644 (file)
@@ -5,7 +5,8 @@
  It may be used under the terms of the GNU General Public License. */
 
 #import "HBJob.h"
-#import "HBTitle.h"
+#import "HBJob+Private.h"
+#import "HBTitle+Private.h"
 
 #import "HBAudioDefaults.h"
 #import "HBSubtitlesDefaults.h"
@@ -13,6 +14,7 @@
 #import "HBCodingUtilities.h"
 #import "HBMutablePreset.h"
 
+
 #include "hb.h"
 
 NSString *HBContainerChangedNotification = @"HBContainerChangedNotification";
@@ -47,8 +49,8 @@ NSString *HBChaptersChangedNotification  = @"HBChaptersChangedNotification";
         _picture = [[HBPicture alloc] initWithTitle:title];
         _filters = [[HBFilters alloc] init];
 
-        _audio = [[HBAudio alloc] initWithTitle:title];
-        _subtitles = [[HBSubtitles alloc] initWithTitle:title];
+        _audio = [[HBAudio alloc] initWithJob:self];
+        _subtitles = [[HBSubtitles alloc] initWithJob:self];
 
         _chapterTitles = [title.chapters copy];
 
@@ -64,7 +66,10 @@ NSString *HBChaptersChangedNotification  = @"HBChaptersChangedNotification";
 
 - (void)applyPreset:(HBPreset *)preset
 {
+    NSAssert(self.title, @"HBJob: calling applyPreset: without a valid title loaded");
+
     self.presetName = preset.name;
+    NSDictionary *jobSettings = [self.title jobSettingsWithPreset:preset];
 
     self.container = hb_container_get_from_name([preset[@"FileFormat"] UTF8String]);
 
@@ -75,8 +80,11 @@ NSString *HBChaptersChangedNotification  = @"HBChaptersChangedNotification";
     // Chapter Markers
     self.chaptersEnabled = [preset[@"ChapterMarkers"] boolValue];
 
-    [@[self.audio, self.subtitles, self.filters, self.picture, self.video] makeObjectsPerformSelector:@selector(applyPreset:)
-                                                                                                           withObject:preset];
+    [self.picture applyPreset:preset jobSettings:jobSettings];
+    [self.filters applyPreset:preset jobSettings:jobSettings];
+    [self.audio applyPreset:preset jobSettings:jobSettings];
+    [self.subtitles applyPreset:preset jobSettings:jobSettings];
+    [self.video applyPreset:preset jobSettings:jobSettings];
 }
 
 - (void)writeToPreset:(HBMutablePreset *)preset
@@ -290,6 +298,9 @@ NSString *HBChaptersChangedNotification  = @"HBChaptersChangedNotification";
         decodeObject(_audio, HBAudio);
         decodeObject(_subtitles, HBSubtitles);
 
+        _audio.job = self;
+        _video.job = self;
+
         decodeBool(_chaptersEnabled);
         decodeObject(_chapterTitles, NSArray);
 
index 74830139f9b516bf3dc55901a981fe2840018994..2b0dc9503491affd989333aad7198ecb6a647cb7 100644 (file)
@@ -23,7 +23,7 @@ extern NSString * const HBPictureChangedNotification;
 /**
  * HBPicture
  */
-@interface HBPicture : NSObject <NSSecureCoding, NSCopying, HBPresetCoding>
+@interface HBPicture : NSObject <NSSecureCoding, NSCopying>
 
 - (instancetype)initWithTitle:(HBTitle *)title;
 
index c0f7db15adb27dddcfcddaa7f04b6ef66c55e614..b9419e2bc50c9c3f87f4e7134b4437c70c15b355 100644 (file)
@@ -47,6 +47,7 @@ NSString * const HBPictureChangedNotification = @"HBPictureChangedNotification";
         _sourceHeight = 720;
 
         _anamorphicMode = HBPictureAnarmophicModeNone;
+        _modulus = 2;
 
         _parWidth = 1;
         _parHeight = 1;
@@ -654,30 +655,42 @@ NSString * const HBPictureChangedNotification = @"HBPictureChangedNotification";
     preset[@"PictureRightCrop"]  = @(self.cropRight);
 }
 
-- (void)applyPreset:(HBPreset *)preset
+- (void)applyPreset:(HBPreset *)preset jobSettings:(NSDictionary *)settings
 {
+    NSDictionary<NSString *, NSNumber *> *par = settings[@"PAR"];
+    NSDictionary<NSString *, id> *filterList = settings[@"Filters"][@"FilterList"];
+    NSDictionary<NSString *, NSNumber *> *cropScale = nil;
+
+    for (NSDictionary *dict in filterList)
+    {
+        if ([dict[@"ID"] intValue] == HB_FILTER_CROP_SCALE)
+        {
+            cropScale = dict[@"Settings"];
+        }
+    }
+
     self.validating = YES;
     self.notificationsEnabled = NO;
 
-    /* Note: objectForKey:@"UsesPictureSettings" refers to picture size, which encompasses:
-     * height, width, keep ar, anamorphic and crop settings.
-     * picture filters are handled separately below.
-     */
-    int maxWidth = self.sourceWidth - self.cropLeft - self.cropRight;
-    int maxHeight = self.sourceHeight - self.cropTop - self.cropBottom;
-    int parWidth = self.parWidth;
-    int parHeight = self.parHeight;
-    int jobMaxWidth = 0, jobMaxHeight = 0;
-
-    /* Check to see if the objectForKey:@"UsesPictureSettings is greater than 0, as 0 means use picture sizing "None"
-     * ( 2 is use max for source and 1 is use exact size when the preset was created ) and the
-     * preset completely ignores any picture sizing values in the preset.
-     */
-    if ([preset[@"UsesPictureSettings"] intValue] > 0)
+
+    // Check to see if UsesPictureSettings is greater than 0, as 0 means use picture sizing "None"
+    // (2 is use max for source and 1 is use exact size when the preset was created) and the
+    // preset completely ignores any picture sizing values in the preset.
+    if (cropScale && [preset[@"UsesPictureSettings"] intValue])
     {
         // If Cropping is set to custom, then recall all four crop values from
         // when the preset was created and apply them
-        if ([preset[@"PictureAutoCrop"] intValue] == 0)
+        if ([preset[@"PictureAutoCrop"] boolValue])
+        {
+            self.autocrop = YES;
+
+            // Here we use the auto crop values determined right after scan
+            self.cropTop    = [cropScale[@"crop-top"] intValue];
+            self.cropBottom = [cropScale[@"crop-bottom"] intValue];
+            self.cropLeft   = [cropScale[@"crop-left"] intValue];
+            self.cropRight  = [cropScale[@"crop-right"] intValue];
+        }
+        else
         {
             self.autocrop = NO;
 
@@ -687,19 +700,6 @@ NSString * const HBPictureChangedNotification = @"HBPictureChangedNotification";
             self.cropLeft   = [preset[@"PictureLeftCrop"] intValue];
             self.cropRight  = [preset[@"PictureRightCrop"] intValue];
         }
-        else // if auto crop has been saved in preset, set to auto and use post scan auto crop
-        {
-            self.autocrop = YES;
-            /* Here we use the auto crop values determined right after scan */
-            self.cropTop    = self.autoCropTop;
-            self.cropBottom = self.autoCropBottom;
-            self.cropLeft   = self.autoCropLeft;
-            self.cropRight  = self.autoCropRight;
-        }
-
-        // crop may have changed, reset maxWidth/maxHeight
-        maxWidth = self.sourceWidth - self.cropLeft - self.cropRight;
-        maxHeight = self.sourceHeight - self.cropTop - self.cropBottom;
 
         // Set modulus
         if (preset[@"PictureModulus"])
@@ -725,81 +725,20 @@ NSString * const HBPictureChangedNotification = @"HBPictureChangedNotification";
         else if ([preset[@"PicturePAR"] isEqualToString:@"custom"])
         {
             self.anamorphicMode = HB_ANAMORPHIC_CUSTOM;
-            parWidth = [preset[@"PicturePARWidth"] intValue];
-            parHeight = [preset[@"PicturePARHeight"] intValue];
         }
         else
         {
             self.anamorphicMode = HB_ANAMORPHIC_LOOSE;
         }
 
-        self.width = self.sourceWidth - self.cropLeft - self.cropRight;
-        self.height = self.sourceHeight - self.cropTop - self.cropBottom;
+        self.parWidth = [par[@"Num"] intValue];
+        self.parHeight = [par[@"Den"] intValue];
 
-        // Check to see if the "UsesPictureSettings" is 2,
-        // which means "Use max. picture size for source"
-        // If not 2 it must be 1 here which means "Use the picture
-        // size specified in the preset"
-        if ([preset[@"UsesPictureSettings"] intValue] != 2)
-        {
-             // if the preset specifies neither max. width nor height
-             // (both are 0), use the max. picture size
-             //
-             // if the specified non-zero dimensions exceed those of the
-             // source, also use the max. picture size (no upscaling)
-            if ([preset[@"PictureWidth"] intValue] > 0)
-            {
-                jobMaxWidth  = [preset[@"PictureWidth"] intValue];
-            }
-            if ([preset[@"PictureHeight"] intValue] > 0)
-            {
-                jobMaxHeight  = [preset[@"PictureHeight"] intValue];
-            }
-        }
+        self.width = [cropScale[@"width"] intValue];
+        self.height = [cropScale[@"height"] intValue];
+
+        self.displayWidth = self.width * self.parWidth / self.parHeight;
     }
-    // Modulus added to maxWidth/maxHeight to allow a small amount of
-    // upscaling to the next mod boundary. This does not apply to
-    // explicit limits set for device compatibility.  It only applies
-    // when limiting to cropped title dimensions.
-    maxWidth += self.modulus - 1;
-    maxHeight += self.modulus - 1;
-    if (jobMaxWidth == 0 || jobMaxWidth > maxWidth)
-        jobMaxWidth = maxWidth;
-    if (jobMaxHeight == 0 || jobMaxHeight > maxHeight)
-        jobMaxHeight = maxHeight;
-
-    hb_geometry_t srcGeo, resultGeo;
-    hb_geometry_settings_t uiGeo;
-
-    srcGeo.width = self.sourceWidth;
-    srcGeo.height = self.sourceHeight;
-    srcGeo.par.num = self.sourceParNum;
-    srcGeo.par.den = self.sourceParDen;
-
-    uiGeo.mode = self.anamorphicMode;
-    uiGeo.keep = self.keepDisplayAspect * HB_KEEP_DISPLAY_ASPECT;
-    uiGeo.itu_par = 0;
-    uiGeo.modulus = self.modulus;
-    int crop[4] = {self.cropTop, self.cropBottom, self.cropLeft, self.cropRight};
-    memcpy(uiGeo.crop, crop, sizeof(int[4]));
-    uiGeo.geometry.width = self.width;
-    uiGeo.geometry.height =  self.height;
-
-    hb_rational_t par = {parWidth, parHeight};
-    uiGeo.geometry.par = par;
-
-    uiGeo.maxWidth = jobMaxWidth;
-    uiGeo.maxHeight = jobMaxHeight;
-    hb_set_anamorphic_size2(&srcGeo, &uiGeo, &resultGeo);
-
-    int display_width;
-    display_width = resultGeo.width * resultGeo.par.num / resultGeo.par.den;
-
-    self.width = resultGeo.width;
-    self.height = resultGeo.height;
-    self.parWidth = resultGeo.par.num;
-    self.parHeight = resultGeo.par.den;
-    self.displayWidth = display_width;
 
     self.validating = NO;
     self.notificationsEnabled = YES;
index 100972784b3fb043bf327dde56361678a30ce6b5..7d4551fedf14f9e1f56f680247614018b36f4de2 100644 (file)
@@ -79,6 +79,8 @@ typedef NS_ENUM(NSUInteger, HBPresetFormat) {
 - (nullable id)objectForKey:(NSString *)key;
 - (nullable id)objectForKeyedSubscript:(NSString *)key;
 
+@property (nonatomic, strong, nullable, readonly) NSMutableDictionary *content;
+
 @end
 
 NS_ASSUME_NONNULL_END
index dcc164765029f6c208658e8da0df474464434018..97faea58a1a5d2d0a9226df96ca94bcb4c1ca1c7 100644 (file)
@@ -27,6 +27,7 @@
     {
         _name = @"New Preset";
         _presetDescription = @"";
+        _content = [[NSMutableDictionary alloc] init];
         self.isLeaf = YES;
     }
     return self;
index 9b51f6d3a42deceeb6ad8a1fb6e0bc813542459b..e8529fb4b5027ee2daa707cfb6544082ac80592f 100644 (file)
@@ -14,4 +14,4 @@
 - (void)applyPreset:(HBPreset *)preset;
 - (void)writeToPreset:(HBMutablePreset *)preset;
 
-@end
\ No newline at end of file
+@end
index defc73efe89040ce3a91ce5af7668058b9af1d27..54468ff7aa233ba9bccc9f4445fb40f65493cd2b 100644 (file)
@@ -5,7 +5,7 @@
  It may be used under the terms of the GNU General Public License. */
 
 #import "HBRange.h"
-#import "HBTitlePrivate.h"
+#import "HBTitle+Private.h"
 #import "HBCodingUtilities.h"
 
 NSString *HBRangeChangedNotification = @"HBRangeChangedNotification";
index 0a2c565940e7088d7552642203ea946bbe5a9197..afda6a659ad87c1d4646293e50da36fad5bdc0f6 100644 (file)
@@ -9,13 +9,15 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
-@class HBTitle;
+@class HBJob;
 @class HBSubtitlesTrack;
 @class HBSubtitlesDefaults;
 
-@interface HBSubtitles : NSObject <NSSecureCoding, NSCopying, HBPresetCoding>
+@interface HBSubtitles : NSObject <NSSecureCoding, NSCopying>
 
-- (instancetype)initWithTitle:(HBTitle *)title;
+- (instancetype)initWithJob:(HBJob *)job;
+
+@property (nonatomic, readwrite, weak) HBJob *job;
 
 - (void)addAllTracks;
 - (void)removeAll;
index 1c9b401ff115ed3615713ca807cf3884dd8b79d6..b920623ff6797a1a3565541e25d70ea81909c125 100644 (file)
@@ -9,8 +9,11 @@
 
 #import "HBSubtitlesTrack.h"
 
+#import "HBJob.h"
+#import "HBJob+HBJobConversion.h"
 #import "HBTitle.h"
 #import "HBCodingUtilities.h"
+#import "HBJob+Private.h"
 
 #include "common.h"
 
@@ -32,14 +35,15 @@ extern NSString *keySubTrackSrtFileURL;
 
 @implementation HBSubtitles
 
-- (instancetype)initWithTitle:(HBTitle *)title
+- (instancetype)initWithJob:(HBJob *)job
 {
     self = [super init];
     if (self)
     {
+        _job = job;
         _container = HB_MUX_MP4;
 
-        _sourceTracks = [title.subtitlesTracks mutableCopy];
+        _sourceTracks = [job.title.subtitlesTracks mutableCopy];
         _tracks = [[NSMutableArray alloc] init];
         _defaults = [[HBSubtitlesDefaults alloc] init];
 
@@ -123,10 +127,10 @@ extern NSString *keySubTrackSrtFileURL;
                 [self insertObject:track inTracksAtIndex:0];
             }
         }
-        [self addNoneTrack];
     }
+
     // Else add a new None track
-    else if (oldSourceIdx == NONE_TRACK_INDEX)
+    if (oldSourceIdx == NONE_TRACK_INDEX)
     {
         [self addNoneTrack];
     }
@@ -204,7 +208,7 @@ extern NSString *keySubTrackSrtFileURL;
 
 - (void)reloadDefaults
 {
-    [self addTracksFromDefaults];
+    [self addDefaultTracksFromJobSettings:self.job.jobDict];
 }
 
 - (void)addSrtTrackFromURL:(NSURL *)srtURL
@@ -275,134 +279,41 @@ extern NSString *keySubTrackSrtFileURL;
 
 #pragma mark - Defaults
 
-/**
- *  Remove all the subtitles tracks and
- *  add new ones based on the defaults settings
- */
-- (IBAction)addTracksFromDefaults
+- (void)addDefaultTracksFromJobSettings:(NSDictionary *)settings
 {
-    // Keeps a set of the indexes of the added track
-    // so we don't add the same track twice.
-    NSMutableIndexSet *tracksAdded = [NSMutableIndexSet indexSet];
+    NSArray<NSDictionary<NSString *, id> *> *tracks = settings[@"Subtitle"][@"SubtitleList"];
+    NSDictionary<NSString *, id> *search = settings[@"Subtitle"][@"Search"];
 
+    // Reinitialize the configured list of audio tracks
     while (self.countOfTracks)
     {
         [self removeObjectFromTracksAtIndex:0];
     }
 
     // Add the foreign audio search pass
-    if (self.defaults.addForeignAudioSearch)
+    if ([search[@"Enable"] boolValue])
     {
-        [self addTrack:[self trackFromSourceTrackIndex:FOREIGN_TRACK_INDEX]];
-    }
+        HBSubtitlesTrack *track = [self trackFromSourceTrackIndex:FOREIGN_TRACK_INDEX];
 
-    // Add the tracks for the selected languages
-    if (self.defaults.trackSelectionBehavior != HBSubtitleTrackSelectionBehaviorNone)
-    {
-        for (NSString *lang in self.defaults.trackSelectionLanguages)
-        {
-            NSUInteger idx = 0;
-            for (NSDictionary *track in self.sourceTracks)
-            {
-                if (idx > FOREIGN_TRACK_INDEX &&
-                    ([lang isEqualToString:@"und"] || [track[keySubTrackLanguageIsoCode] isEqualToString:lang]))
-                {
-                    if (![tracksAdded containsIndex:idx])
-                    {
-                        [self addTrack:[self trackFromSourceTrackIndex:idx]];
-                    }
-                    [tracksAdded addIndex:idx];
-
-                    if (self.defaults.trackSelectionBehavior == HBSubtitleTrackSelectionBehaviorFirst)
-                    {
-                        break;
-                    }
-                }
-                idx++;
-            }
-        }
-    }
+        track.burnedIn = [search[@"Burn"] boolValue];
+        track.forcedOnly = [search[@"Forced"] boolValue];
 
-    // Add the closed captions track if there is one.
-    if (self.defaults.addCC)
-    {
-        NSUInteger idx = 0;
-        for (NSDictionary *track in self.sourceTracks)
-        {
-            if ([track[keySubTrackType] intValue] == CC608SUB)
-            {
-                if (![tracksAdded containsIndex:idx])
-                {
-                    [self addTrack:[self trackFromSourceTrackIndex:idx]];
-                }
-
-                if (self.defaults.trackSelectionBehavior == HBSubtitleTrackSelectionBehaviorFirst)
-                {
-                    break;
-                }
-            }
-            idx++;
-        }
+        [self addTrack:track];
     }
 
-    // Set the burn key for the appropriate track.
-    if (self.defaults.burnInBehavior != HBSubtitleTrackBurnInBehaviorNone && self.tracks.count)
+    // Add the tracks
+    for (NSDictionary *trackDict in tracks)
     {
-        if (self.defaults.burnInBehavior == HBSubtitleTrackBurnInBehaviorFirst)
-        {
-            if (self.tracks.firstObject.sourceTrackIdx != FOREIGN_TRACK_INDEX)
-            {
-                self.tracks.firstObject.burnedIn = YES;
-            }
-            else if (self.tracks.count > 1)
-            {
-                self.tracks[0].burnedIn = NO;
-                self.tracks[1].burnedIn = YES;
-            }
-        }
-        else if (self.defaults.burnInBehavior == HBSubtitleTrackBurnInBehaviorForeignAudio)
-        {
-            if (self.tracks.firstObject.sourceTrackIdx == FOREIGN_TRACK_INDEX)
-            {
-                self.tracks.firstObject.burnedIn = YES;
-            }
-        }
-        else if (self.defaults.burnInBehavior == HBSubtitleTrackBurnInBehaviorForeignAudioThenFirst)
-        {
-            self.tracks.firstObject.burnedIn = YES;
-        }
-    }
+        HBSubtitlesTrack *track = [self trackFromSourceTrackIndex:[trackDict[@"Track"] unsignedIntegerValue] + 2];
 
-    // Burn-in the first dvd or bluray track and remove the others.
-    if (self.defaults.burnInDVDSubtitles || self.defaults.burnInBluraySubtitles)
-    {
-        // Ugly settings for ugly players
-        BOOL bitmapSubtitlesFound = NO;
+        track.burnedIn = [trackDict[@"Burn"] boolValue];
+        track.forcedOnly = [trackDict[@"Forced"] boolValue];
 
-        NSMutableArray *tracksToDelete = [[NSMutableArray alloc] init];
-        for (HBSubtitlesTrack *track in self.tracks)
-        {
-            if (track.sourceTrackIdx != 1)
-            {
-                if (((track.type == VOBSUB && self.defaults.burnInDVDSubtitles) ||
-                     (track.type == PGSSUB && self.defaults.burnInBluraySubtitles)) &&
-                    !bitmapSubtitlesFound)
-                {
-                    track.burnedIn = YES;
-                    bitmapSubtitlesFound = YES;
-                }
-                else if (track.type == VOBSUB || track.type == PGSSUB)
-                {
-                    [tracksToDelete addObject:track];
-                }
-            }
-        }
-        [self.tracks removeObjectsInArray:tracksToDelete];
+        [self addTrack:track];
     }
 
-    // Add an empty track
+    // Add an None item
     [self addNoneTrack];
-    [self validatePassthru];
 }
 
 #pragma mark - Validation
@@ -549,10 +460,10 @@ extern NSString *keySubTrackSrtFileURL;
     [self.defaults writeToPreset:preset];
 }
 
-- (void)applyPreset:(HBPreset *)preset
+- (void)applyPreset:(HBPreset *)preset jobSettings:(NSDictionary *)settings
 {
-    [self.defaults applyPreset:preset];
-    [self addTracksFromDefaults];
+    [self.defaults applyPreset:preset jobSettings:settings];
+    [self addDefaultTracksFromJobSettings:settings];
 }
 
 #pragma mark -
index 148f8ad825d4e0e056a1ce3765e07e431e62b7dc..a44551e1ea31bfe5b2d1ffbeda0eb064c546fa11 100644 (file)
@@ -35,6 +35,8 @@ typedef NS_ENUM(NSUInteger, HBSubtitleTrackBurnInBehavior) {
 @property (nonatomic, readwrite) BOOL burnInDVDSubtitles;
 @property (nonatomic, readwrite) BOOL burnInBluraySubtitles;
 
+- (void)applyPreset:(HBPreset *)preset;
+
 @property (nonatomic, readwrite, weak, nullable) NSUndoManager *undo;
 
 @end
index 5dfd4b5a8daa995816b2cf380c7e32b7cd02266d..fa1044a6970c2608c5f0f0613b847c16c83e0a59 100644 (file)
     self.burnInBluraySubtitles = [preset[@"SubtitleBurnBDSub"] boolValue];
 }
 
+- (void)applyPreset:(HBPreset *)preset jobSettings:(NSDictionary *)settings
+{
+    [self applyPreset:preset];
+}
+
 - (void)writeToPreset:(HBMutablePreset *)preset
 {
     if (self.trackSelectionBehavior == HBSubtitleTrackSelectionBehaviorFirst)
similarity index 75%
rename from macosx/HBTitlePrivate.h
rename to macosx/HBTitle+Private.h
index 01e9532eb480f559eae90d0b2662f412c8d4832e..76aecdba4f0cfc215640d0ab3c0e064823976e0d 100644 (file)
  *  @param title    the libhb title to wrap.
  *  @param featured whether the title is the featured one or not.
  */
-- (instancetype)initWithTitle:(hb_title_t *)title featured:(BOOL)featured;
+- (instancetype)initWithTitle:(hb_title_t *)title handle:(hb_handle_t *)handle featured:(BOOL)featured;
 
 /**
  *  The internal libhb structure.
  */
 @property (nonatomic, readonly) hb_title_t *hb_title;
 
-@end
\ No newline at end of file
+- (NSDictionary *)jobSettingsWithPreset:(HBPreset *)preset;
+
+@end
index 898166d6f1523804695e706f0f16443b6db79da3..37d5a360b808913cf06957f7ab26bc91a83f456c 100644 (file)
@@ -9,6 +9,7 @@
 NS_ASSUME_NONNULL_BEGIN
 
 @class HBChapter;
+@class HBPreset;
 
 /**
  * HBTitles is an interface to the low-level hb_title_t.
index a0cd592d424a9ae980c11d0a3b907985f3db67d0..5d87bfaad2887627790de4831fff2aed56dd486c 100644 (file)
@@ -5,8 +5,10 @@
  It may be used under the terms of the GNU General Public License. */
 
 #import "HBTitle.h"
-#import "HBTitlePrivate.h"
+#import "HBTitle+Private.h"
 #import "HBChapter.h"
+#import "HBPreset.h"
+#import "NSDictionary+HBAdditions.h"
 
 #include "lang.h"
 
@@ -26,6 +28,7 @@ extern NSString *keySubTrackType;
 @interface HBTitle ()
 
 @property (nonatomic, readonly) hb_title_t *hb_title;
+@property (nonatomic, readonly) hb_handle_t *hb_handle;
 @property (nonatomic, readwrite, strong) NSString *name;
 
 @property (nonatomic, readwrite) NSArray *audioTracks;
@@ -36,7 +39,7 @@ extern NSString *keySubTrackType;
 
 @implementation HBTitle
 
-- (instancetype)initWithTitle:(hb_title_t *)title featured:(BOOL)featured
+- (instancetype)initWithTitle:(hb_title_t *)title handle:(hb_handle_t *)handle featured:(BOOL)featured
 {
     self = [super init];
     if (self)
@@ -47,6 +50,7 @@ extern NSString *keySubTrackType;
         }
 
         _hb_title = title;
+        _hb_handle = handle;
         _featured = featured;
     }
 
@@ -256,4 +260,22 @@ extern NSString *keySubTrackType;
     return _chapters;
 }
 
+- (NSDictionary *)jobSettingsWithPreset:(HBPreset *)preset
+{
+    NSDictionary *result = nil;
+
+    hb_dict_t *hb_preset = [preset content].hb_value;
+    hb_dict_t *job = hb_preset_job_init(self.hb_handle, self.hb_title->index, hb_preset);
+
+    if (job)
+    {
+        result = [[NSDictionary alloc] initWithHBDict:job];
+    }
+
+    hb_dict_free(&hb_preset);
+    hb_dict_free(&job);
+
+    return result;
+}
+
 @end
index a8ceef80866eb91a45dd504fa75eeb0c7b51886d..50678ec41aed976c5359a56d7d0384607479d975 100644 (file)
@@ -26,10 +26,12 @@ extern NSString * const HBVideoChangedNotification;
 /**
  *  HBVideo
  */
-@interface HBVideo : NSObject <NSSecureCoding, NSCopying, HBPresetCoding>
+@interface HBVideo : NSObject <NSSecureCoding, NSCopying>
 
 - (instancetype)initWithJob:(HBJob *)job;
 
+@property (nonatomic, readwrite, weak) HBJob *job;
+
 - (void)containerChanged;
 
 @property (nonatomic, readwrite) int encoder;
@@ -58,7 +60,6 @@ extern NSString * const HBVideoChangedNotification;
 
 @property (nonatomic, readwrite) BOOL fastDecode;
 
-@property (nonatomic, readwrite, weak) HBJob *job;
 @property (nonatomic, readonly) NSString *completeTune;
 
 @property (nonatomic, readwrite, weak, nullable) NSUndoManager *undo;
index 6a1bdf5fb46d2696724a9cca72a828d6bda4487c..d1641087e987d37b97e43dc0b4af411fef735845 100644 (file)
@@ -553,7 +553,7 @@ NSString * const HBVideoChangedNotification = @"HBVideoChangedNotification";
     return string;
 }
 
-- (void)applyPreset:(HBPreset *)preset
+- (void)applyPreset:(HBPreset *)preset jobSettings:(NSDictionary *)settings
 {
     self.notificationsEnabled = NO;
 
index b6f145dacc8b6d912e45e47658229f4bcd805f60..786c4e4a09a39845121bb3239c76aecc74076de8 100644 (file)
                A91F97361D7B2A4E00D82DCE /* HBAudioTransformers.m in Sources */ = {isa = PBXBuildFile; fileRef = A91F97341D7B2A4E00D82DCE /* HBAudioTransformers.m */; };
                A92268781A6E555500A8D5C5 /* HBAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A92268771A6E555500A8D5C5 /* HBAppDelegate.m */; };
                A922687B1A6E569B00A8D5C5 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = A92268791A6E569B00A8D5C5 /* MainWindow.xib */; };
+               A9294CC91DC4BBF7004D3415 /* HBJob+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = A9294CC71DC4BBF7004D3415 /* HBJob+Private.h */; };
                A932E26C1988334B0047D13E /* AudioDefaults.xib in Resources */ = {isa = PBXBuildFile; fileRef = A932E26A1988334B0047D13E /* AudioDefaults.xib */; };
                A9350F501CCA7F490089F970 /* HBQTKitPlayer.m in Sources */ = {isa = PBXBuildFile; fileRef = A9350F4E1CCA7C3B0089F970 /* HBQTKitPlayer.m */; };
                A937EECB1C6C7C0300EEAE6D /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = A937EECA1C6C7C0300EEAE6D /* dsa_pub.pem */; };
                A92268761A6E555500A8D5C5 /* HBAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HBAppDelegate.h; sourceTree = "<group>"; };
                A92268771A6E555500A8D5C5 /* HBAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBAppDelegate.m; sourceTree = "<group>"; };
                A922687A1A6E569B00A8D5C5 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = MainWindow.xib; sourceTree = "<group>"; };
+               A9294CC71DC4BBF7004D3415 /* HBJob+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "HBJob+Private.h"; sourceTree = "<group>"; };
                A932E26B1988334B0047D13E /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = AudioDefaults.xib; sourceTree = "<group>"; };
                A932E26D198833920047D13E /* HBAudioDefaultsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HBAudioDefaultsController.h; sourceTree = "<group>"; };
                A932E26E198833920047D13E /* HBAudioDefaultsController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBAudioDefaultsController.m; sourceTree = "<group>"; };
                A98C29C31977B10600AF5DED /* HBLanguagesSelection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBLanguagesSelection.m; sourceTree = "<group>"; };
                A98F38041C7DCA7E00E469C8 /* HBStateFormatter+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "HBStateFormatter+Private.h"; sourceTree = "<group>"; };
                A98F38051C7DCA7E00E469C8 /* HBStateFormatter+Private.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "HBStateFormatter+Private.m"; sourceTree = "<group>"; };
-               A98FD5941B19C6E400FCC7A5 /* HBTitlePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HBTitlePrivate.h; sourceTree = "<group>"; };
+               A98FD5941B19C6E400FCC7A5 /* HBTitle+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "HBTitle+Private.h"; sourceTree = "<group>"; };
                A9906B2B1A710920001D82D5 /* HBQueueController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBQueueController.m; sourceTree = "<group>"; };
                A990D9051A64562200139032 /* HBJob+HBJobConversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "HBJob+HBJobConversion.h"; sourceTree = "<group>"; };
                A990D9061A64562200139032 /* HBJob+HBJobConversion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "HBJob+HBJobConversion.m"; sourceTree = "<group>"; };
                                A9DEC8731A23C87500C79B48 /* HBCore.m */,
                                A971281D1A2C75180088C076 /* HBTitle.h */,
                                A971281E1A2C75180088C076 /* HBTitle.m */,
-                               A98FD5941B19C6E400FCC7A5 /* HBTitlePrivate.h */,
+                               A98FD5941B19C6E400FCC7A5 /* HBTitle+Private.h */,
                                A9DEC87D1A23DF6F00C79B48 /* HBJob.h */,
                                A9DEC87E1A23DF6F00C79B48 /* HBJob.m */,
+                               A9294CC71DC4BBF7004D3415 /* HBJob+Private.h */,
                                A990D9051A64562200139032 /* HBJob+HBJobConversion.h */,
                                A990D9061A64562200139032 /* HBJob+HBJobConversion.m */,
                                A918066F1A4807B000FC9BED /* HBRange.h */,
                                A91CE2EC1C7DAEEE0068F46F /* HBStateFormatter.h in Headers */,
                                A91CE2ED1C7DAEEE0068F46F /* HBUtilities.h in Headers */,
                                A91CE2FB1C7DB99D0068F46F /* HBPresetsManager.h in Headers */,
+                               A9294CC91DC4BBF7004D3415 /* HBJob+Private.h in Headers */,
                                A91CE2FC1C7DB99D0068F46F /* HBPreset.h in Headers */,
                                A91CE2FD1C7DB99D0068F46F /* HBMutablePreset.h in Headers */,
                                A98B8E241C7DD2A200B810C9 /* HBPresetCoding.h in Headers */,