WinGui: Fix another instance of the Caliburn vs Json.net sillyness where objects...
[HandBrake.git] / macosx / HBAudioController.m
blobca051c9da86f0c93cd0f21c6861701185ab680de
1 /* HBAudioController.m
3  This file is part of the HandBrake source code.
4  Homepage: <http://handbrake.fr/>.
5  It may be used under the terms of the GNU General Public License. */
7 #import "HBAudioController.h"
9 #import "HBAudio.h"
10 #import "HBAudioDefaultsController.h"
12 @interface HBAudioController ()
14 @property (nonatomic, readwrite, strong) HBAudioDefaultsController *defaultsController;
16 @end
18 @implementation HBAudioController
20 - (instancetype)init
22     self = [super initWithNibName:@"Audio" bundle:nil];
23     return self;
26 - (BOOL)validateUserInterfaceItem:(id < NSValidatedUserInterfaceItem >)anItem
28     return (self.audio != nil);
31 - (IBAction)addAllAudioTracks:(id)sender
33     [self.audio addAllTracks];
36 - (IBAction)removeAll:(id)sender
38     [self.audio removeAll];
41 #pragma mark - Defaults
43 - (IBAction)showSettingsSheet:(id)sender
45     self.defaultsController = [[HBAudioDefaultsController alloc] initWithSettings:self.audio.defaults];
47         [NSApp beginSheet:self.defaultsController.window
48        modalForWindow:self.view.window
49         modalDelegate:self
50        didEndSelector:@selector(sheetDidEnd)
51           contextInfo:NULL];
54 - (void)sheetDidEnd
56     self.defaultsController = nil;
59 - (IBAction)reloadDefaults:(id)sender
61     [self.audio reloadDefaults];
64 @end