1 /*****************************************************************************
2 * VLCVoutWindowController.m: MacOS X interface module
3 *****************************************************************************
4 * Copyright (C) 2012 VLC authors and VideoLAN
7 * Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org>
8 * David Fuhrmann <david dot fuhrmann at googlemail dot com>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
25 #import "VLCVoutWindowController.h"
28 @implementation VLCVoutWindowController
33 o_vout_dict = [[NSMutableDictionary alloc] init];
39 [o_vout_dict release];
43 - (void)addVout:(VLCVideoWindowCommon *)o_window forDisplay:(vout_window_t *)p_wnd
45 [o_vout_dict setObject:o_window forKey:[NSValue valueWithPointer:p_wnd]];
48 - (void)removeVoutforDisplay:(NSValue *)o_key
50 VLCVideoWindowCommon *o_window = [o_vout_dict objectForKey:o_key];
52 if (![NSStringFromClass([o_window class]) isEqualToString:@"VLCMainWindow"]) {
53 [o_window orderOut:self];
56 [o_vout_dict removeObjectForKey:o_key];
59 - (void)updateWindowsControlsBarWithSelector:(SEL)aSel
61 [o_vout_dict enumerateKeysAndObjectsUsingBlock:^(id key, VLCVideoWindowCommon *o_window, BOOL *stop) {
62 id o_controlsBar = [o_window controlsBar];
64 [o_controlsBar performSelector:aSel];
68 - (void)updateWindowsUsingBlock:(void (^)(VLCVideoWindowCommon *o_window))windowUpdater
70 [o_vout_dict enumerateKeysAndObjectsUsingBlock:^(id key, VLCVideoWindowCommon *o_window, BOOL *stop) {
71 windowUpdater(o_window);