summaryrefslogtreecommitdiffstats
path: root/macosx/HBTitle.m
diff options
context:
space:
mode:
authorritsuka <[email protected]>2014-12-27 10:46:04 +0000
committerritsuka <[email protected]>2014-12-27 10:46:04 +0000
commitdf8b2ff3e109699e3dadd88404911f8dfc7b210a (patch)
tree8489fee4edaf57adf55f69d0c0d28f61a5757057 /macosx/HBTitle.m
parent8df584534c0c39f5c2f298d8ba480cc906743bbf (diff)
MacGui: change the queue to work with serialized HBJob objects, remove the NSDictionary job representation and the duplicate prepareJob method. Implement NSCopying protocol in HBJob.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6655 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBTitle.m')
-rw-r--r--macosx/HBTitle.m48
1 files changed, 11 insertions, 37 deletions
diff --git a/macosx/HBTitle.m b/macosx/HBTitle.m
index 6d179e383..c2f6dc305 100644
--- a/macosx/HBTitle.m
+++ b/macosx/HBTitle.m
@@ -74,7 +74,15 @@ extern NSString *keySubTrackSrtCharCode;
{
if (!_name)
{
- _name = [@(self.hb_title->name) retain];
+ _name = @(self.hb_title->name);
+
+ // If the name is empty use file/directory name
+ if (_name.length == 0)
+ {
+ _name = [@(self.hb_title->path) lastPathComponent];
+ }
+
+ [_name retain];
}
return _name;
@@ -146,26 +154,17 @@ extern NSString *keySubTrackSrtCharCode;
{
NSMutableArray *tracks = [NSMutableArray array];
hb_subtitle_t *subtitle;
- hb_list_t *list = self.hb_title->list_audio;
+ hb_list_t *list = self.hb_title->list_subtitle;
int count = hb_list_count(list);
- NSMutableArray *forcedSourceNamesArray = [[NSMutableArray alloc] init];
- //NSString *foreignAudioSearchTrackName = nil;
-
for (int i = 0; i < count; i++)
{
- subtitle = (hb_subtitle_t *)hb_list_item(self.hb_title->list_subtitle, i);
+ subtitle = (hb_subtitle_t *) hb_list_item(self.hb_title->list_subtitle, i);
/* Human-readable representation of subtitle->source */
NSString *bitmapOrText = subtitle->format == PICTURESUB ? @"Bitmap" : @"Text";
NSString *subSourceName = @(hb_subsource_name(subtitle->source));
- /* if the subtitle track can be forced, add its source name to the array */
- if (hb_subtitle_can_force(subtitle->source) && [forcedSourceNamesArray containsObject:subSourceName] == NO)
- {
- [forcedSourceNamesArray addObject:subSourceName];
- }
-
// Use the native language name if available
iso639_lang_t *language = lang_for_code2(subtitle->iso639_2);
NSString *nativeLanguage = strlen(language->native_name) ? @(language->native_name) : @(language->eng_name);
@@ -178,31 +177,6 @@ extern NSString *keySubTrackSrtCharCode;
keySubTrackLanguageIsoCode: @(subtitle->iso639_2)}];
}
- /* now set the name of the Foreign Audio Search track */
- if ([forcedSourceNamesArray count])
- {
- [forcedSourceNamesArray sortUsingComparator:^(id obj1, id obj2)
- {
- return [((NSString *)obj1) compare:((NSString *)obj2)];
- }];
-
- NSString *tempList = @"";
- for (NSString *tempString in forcedSourceNamesArray)
- {
- if ([tempList length])
- {
- tempList = [tempList stringByAppendingString:@", "];
- }
- tempList = [tempList stringByAppendingString:tempString];
- }
- //foreignAudioSearchTrackName = [NSString stringWithFormat:@"Foreign Audio Search (Bitmap) (%@)", tempList];
- }
- else
- {
- //foreignAudioSearchTrackName = @"Foreign Audio Search (Bitmap)";
- }
- [forcedSourceNamesArray release];
-
_subtitlesTracks = [tracks copy];
}