diff options
author | dynaflash <[email protected]> | 2010-01-21 18:58:17 +0000 |
---|---|---|
committer | dynaflash <[email protected]> | 2010-01-21 18:58:17 +0000 |
commit | 56fef9aafba02e1f6bac8724aeda00f78b77c712 (patch) | |
tree | 89fdaf9760b03017f1ba9f1233c9ba88886e4ca2 /macosx/HBSubtitles.m | |
parent | e67bbc820dcae0c2bbdbfc5cd24d2b8495285d0a (diff) |
MacGui: Queued item editing initial implementation.
- Sends a chosen queued item back to the main window for reload ( and rescan ) via contextual menu (right click)
- Deletes queued item from queue after being reloaded to main window ( after editing or whatever, send back to queue via Add To Queue Button same as a new source).
- New queue window contextual menu also includes delete and show options previously only available via separate icons.
- Note: Needs testing particularly in the subtitle area, which is not to say there aren't other bugs.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3080 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBSubtitles.m')
-rw-r--r-- | macosx/HBSubtitles.m | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/macosx/HBSubtitles.m b/macosx/HBSubtitles.m index d0e959c27..aca46b556 100644 --- a/macosx/HBSubtitles.m +++ b/macosx/HBSubtitles.m @@ -426,6 +426,7 @@ } +/* used to return the current subtitleArray to controller.m */ - (NSMutableArray*) getSubtitleArray { return subtitleArray; @@ -433,7 +434,52 @@ - (void)containerChanged:(int) newContainer { -container = newContainer; + container = newContainer; +} + +- (void)setNewSubtitles:(NSMutableArray*) newSubtitleArray +{ + /* Note: we need to look for external subtitles so it can be added to the source array track. + * Remember the source container subs are already loaded with resetTitle which is already called + * so any external sub sources need to be added to our source subs here + */ + + int i = 0; + NSEnumerator *enumerator = [newSubtitleArray objectEnumerator]; + id tempObject; + while ( tempObject = [enumerator nextObject] ) + { + /* We have an srt track */ + if ([[tempObject objectForKey:@"subtitleSourceTrackType"] isEqualToString:@"SRT"]) + { + NSString *filePath = [tempObject objectForKey:@"subtitleSourceSrtFilePath"]; + /* Start replicate the add new srt code above */ + /* Create a new entry for the subtitle source array so it shows up in our subtitle source list */ + NSString *displayname = [filePath lastPathComponent];// grok an appropriate display name from the srt subtitle */ + /* create a dictionary of source subtitle information to store in our array */ + NSMutableDictionary *newSubtitleSourceTrack = [[NSMutableDictionary alloc] init]; + /* Subtitle Source track popup index */ + [newSubtitleSourceTrack setObject:[NSNumber numberWithInt:[subtitleSourceArray count]+1] forKey:@"sourceTrackNum"]; + /* Subtitle Source track type */ + [newSubtitleSourceTrack setObject:displayname forKey:@"sourceTrackName"]; + /* Subtitle Source track type (Source, Srt, etc.) */ + [newSubtitleSourceTrack setObject:@"SRT" forKey:@"sourceTrackType"]; + [newSubtitleSourceTrack setObject:@"SRT" forKey:@"subtitleSourceTrackType"]; + /* Subtitle Source track type */ + [newSubtitleSourceTrack setObject:filePath forKey:@"sourceSrtFilePath"]; + /* Subtitle Source track popup isPictureSub */ + [newSubtitleSourceTrack setObject:[NSNumber numberWithInt:0] forKey:@"sourceTrackisPictureSub"]; + + [subtitleSourceArray addObject:newSubtitleSourceTrack]; + [newSubtitleSourceTrack autorelease]; + /* END replicate the add new srt code above */ + } + i++; + } + + + /*Set the subtitleArray to the newSubtitleArray */ + [subtitleArray setArray:newSubtitleArray]; } #pragma mark - |