summaryrefslogtreecommitdiffstats
path: root/macosx/Controller.m
diff options
context:
space:
mode:
authorritsuka <[email protected]>2014-12-29 08:37:40 +0000
committerritsuka <[email protected]>2014-12-29 08:37:40 +0000
commit0ca568a18216cfaa4785c36637a81a241fd8821e (patch)
tree342d6b7e3f2e868a1b916962ecc44bc587e8e38f /macosx/Controller.m
parentf1c5cb5f2388aeebbe7ec9f105b406bebf2345e0 (diff)
MacGui: use bindings to toggle the chapters/seconds/frames UI.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6669 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/Controller.m')
-rw-r--r--macosx/Controller.m71
1 files changed, 8 insertions, 63 deletions
diff --git a/macosx/Controller.m b/macosx/Controller.m
index bc0da2012..4dd1a3d1b 100644
--- a/macosx/Controller.m
+++ b/macosx/Controller.m
@@ -2483,60 +2483,12 @@ static void queueFSEventStreamCallback(
}
}
-- (IBAction) encodeStartStopPopUpChanged: (id) sender;
-{
- // We are chapters
- if ([fEncodeStartStopPopUp indexOfSelectedItem] == 0)
- {
- self.job.range.type = HBRangeTypeChapters;
-
- [fSrcChapterStartPopUp setHidden: NO];
- [fSrcChapterEndPopUp setHidden: NO];
-
- [fSrcTimeStartEncodingField setHidden: YES];
- [fSrcTimeEndEncodingField setHidden: YES];
-
- [fSrcFrameStartEncodingField setHidden: YES];
- [fSrcFrameEndEncodingField setHidden: YES];
-
- [self chapterPopUpChanged:nil];
- }
- // We are time based (seconds)
- else if ([fEncodeStartStopPopUp indexOfSelectedItem] == 1)
- {
- self.job.range.type = HBRangeTypeSeconds;
-
- [fSrcChapterStartPopUp setHidden: YES];
- [fSrcChapterEndPopUp setHidden: YES];
-
- [fSrcTimeStartEncodingField setHidden: NO];
- [fSrcTimeEndEncodingField setHidden: NO];
-
- [fSrcFrameStartEncodingField setHidden: YES];
- [fSrcFrameEndEncodingField setHidden: YES];
- }
- // We are frame based
- else if ([fEncodeStartStopPopUp indexOfSelectedItem] == 2)
- {
- self.job.range.type = HBRangeTypeFrames;
-
- [fSrcChapterStartPopUp setHidden: YES];
- [fSrcChapterEndPopUp setHidden: YES];
-
- [fSrcTimeStartEncodingField setHidden: YES];
- [fSrcTimeEndEncodingField setHidden: YES];
-
- [fSrcFrameStartEncodingField setHidden: NO];
- [fSrcFrameEndEncodingField setHidden: NO];
- }
-}
-
-- (IBAction) chapterPopUpChanged: (id) sender
+- (void)chapterPopUpChanged:(NSNotification *)notification
{
// We're changing the chapter range - we may need to flip the m4v/mp4 extension
if ([[fDstFormatPopUp selectedItem] tag] & HB_MUX_MASK_MP4)
{
- [self autoSetM4vExtension:sender];
+ [self autoSetM4vExtension:notification];
}
// If Auto Naming is on it might need to be update if it includes the chapters range
@@ -2719,29 +2671,22 @@ static void queueFSEventStreamCallback(
self.selectedPreset = preset;
self.customPreset = NO;
- NSDictionary *chosenPreset = preset.content;
-
- [fPresetSelectedDisplay setStringValue:[chosenPreset objectForKey:@"PresetName"]];
-
- if ([[chosenPreset objectForKey:@"Default"] intValue] == 1)
+ if (preset.isDefault)
{
- [fPresetSelectedDisplay setStringValue:[NSString stringWithFormat:@"%@ (Default)", [chosenPreset objectForKey:@"PresetName"]]];
+ fPresetSelectedDisplay.stringValue = [NSString stringWithFormat:@"%@ (Default)", preset.name];
}
else
{
- [fPresetSelectedDisplay setStringValue:[chosenPreset objectForKey:@"PresetName"]];
+ fPresetSelectedDisplay.stringValue = preset.name;
}
// Apply the preset to the current job
[self.job applyPreset:preset];
- // check to see if we have only one chapter
- [self chapterPopUpChanged:nil];
-
- // Audio
+ // Have to apply the presets the audio and subtitles controllers too
+ // because they haven't been moved to HBJob yer.
+ NSDictionary *chosenPreset = preset.content;
[fAudioController applySettingsFromPreset: chosenPreset];
-
- // Subtitles
[fSubtitlesViewController applySettingsFromPreset:chosenPreset];
// If Auto Naming is on. We create an output filename of dvd name - title number