Commit a67fd4f9 authored by Felix Paul Kühne's avatar Felix Paul Kühne

* ALL: first development version of a GUI for the SubPicture Filters (refs #350)

- the marquee section is already completely usable, more to come
- TODO:
    - fix all FIXMEs
    - implement the logo and time settings completely
    - implement l10n
    - fix 10.3 compatibility (runs under Tiger only atm)
    - save the preferences, if requested
    - close a current vout and re-open it, when a filter is (de-)activated
    - redesign the GUI to a smaller panel
parent cc5e6f6c
......@@ -181,6 +181,9 @@ EXTRA_DIST += \
extras/MacOSX/Resources/English.lproj/Extended.nib/classes.nib \
extras/MacOSX/Resources/English.lproj/Extended.nib/info.nib \
extras/MacOSX/Resources/English.lproj/Extended.nib/keyedobjects.nib \
extras/MacOSX/Resources/English.lproj/SFilters.nib/classes.nib \
extras/MacOSX/Resources/English.lproj/SFilters.nib/info.nib \
extras/MacOSX/Resources/English.lproj/SFilters.nib/keyedobjects.nib \
extras/MacOSX/Resources/English.lproj/InfoPlist.strings \
extras/MacOSX/Resources/a52.icns \
extras/MacOSX/Resources/aac.icns \
......@@ -609,6 +612,8 @@ VLC-release.app: vlc
extended.m \
bookmarks.h \
bookmarks.m \
sfilters.h \
sfilters.m \
vout.m; do \
cp "$(srcdir)/modules/gui/macosx/$$i" \
$(top_builddir)/tmp/modules/gui/macosx; \
......@@ -723,6 +728,8 @@ VLC.app: vlc
extended.m \
bookmarks.h \
bookmarks.m \
sfilters.h \
sfilters.m \
vout.m; do \
cp "$(srcdir)/modules/gui/macosx/$$i" \
$(top_builddir)/tmp/modules/gui/macosx; \
......
......@@ -110,6 +110,7 @@
reportABug = id;
showBookmarks = id;
showExtended = id;
showSFilters = id;
showWizard = id;
timesliderUpdate = id;
togglePlaylist = id;
......
......@@ -11,21 +11,21 @@
<key>2197</key>
<string>422 532 596 143 0 0 1440 878 </string>
<key>29</key>
<string>423 907 438 44 0 0 1280 1002 </string>
<string>503 790 438 44 0 0 1440 878 </string>
<key>915</key>
<string>678 573 187 249 0 0 1280 1002 </string>
</dict>
<key>IBFramework Version</key>
<string>439.0</string>
<string>437.0</string>
<key>IBLockedObjects</key>
<array/>
<key>IBOpenObjects</key>
<array>
<integer>21</integer>
<integer>2029</integer>
<integer>29</integer>
<integer>2029</integer>
<integer>21</integer>
</array>
<key>IBSystem Version</key>
<string>8C46</string>
<string>8F46</string>
</dict>
</plist>
{
IBClasses = (
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {
enableFilter = id;
"logo_selectFile" = id;
otherPositionForLogo = id;
otherPositionForMarq = id;
otherPositionForTime = id;
propertyChanged = id;
};
CLASS = VLCsFilters;
LANGUAGE = ObjC;
OUTLETS = {
"o_logo_enabled_ckb" = id;
"o_logo_image_btn" = id;
"o_logo_image_fld" = id;
"o_logo_image_lbl" = id;
"o_logo_opaque_lbl" = id;
"o_logo_opaque_sld" = id;
"o_logo_pos_fix_X_fld" = id;
"o_logo_pos_fix_X_lbl" = id;
"o_logo_pos_fix_Y_fld" = id;
"o_logo_pos_fix_Y_lbl" = id;
"o_logo_pos_fix_btn" = id;
"o_logo_pos_lbl" = id;
"o_logo_pos_matrix" = id;
"o_logo_pos_rel_btn" = id;
"o_logo_pos_rel_pop" = id;
"o_marq_color_lbl" = id;
"o_marq_color_pop" = id;
"o_marq_enabled_ckb" = id;
"o_marq_marq_fld" = id;
"o_marq_marq_lbl" = id;
"o_marq_opaque_lbl" = id;
"o_marq_opaque_sld" = id;
"o_marq_pos_fix_X_fld" = id;
"o_marq_pos_fix_X_lbl" = id;
"o_marq_pos_fix_Y_fld" = id;
"o_marq_pos_fix_Y_lbl" = id;
"o_marq_pos_fix_btn" = id;
"o_marq_pos_lbl" = id;
"o_marq_pos_matrix" = id;
"o_marq_pos_rel_btn" = id;
"o_marq_pos_rel_pop" = id;
"o_marq_size_inPx_lbl" = id;
"o_marq_size_lbl" = id;
"o_marq_size_pop" = id;
"o_marq_tmOut_fld" = id;
"o_marq_tmOut_lbl" = id;
"o_marq_tmOut_ms_lbl" = id;
"o_sfilter_saveSettings_ckb" = id;
"o_sfilter_tabView" = id;
"o_sfilter_win" = id;
"o_time_color_lbl" = id;
"o_time_color_pop" = id;
"o_time_enabled_ckb" = id;
"o_time_opaque_lbl" = id;
"o_time_opaque_sld" = id;
"o_time_pos_fix_X_fld" = id;
"o_time_pos_fix_X_lbl" = id;
"o_time_pos_fix_Y_fld" = id;
"o_time_pos_fix_Y_lbl" = id;
"o_time_pos_fix_btn" = id;
"o_time_pos_lbl" = id;
"o_time_pos_matrix" = id;
"o_time_pos_rel_btn" = id;
"o_time_pos_rel_pop" = id;
"o_time_size_inPx_lbl" = id;
"o_time_size_lbl" = id;
"o_time_size_pop" = id;
"o_time_stamp_fld" = id;
"o_time_stamp_lbl" = id;
};
SUPERCLASS = NSObject;
}
);
IBVersion = 1;
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>69 67 356 240 0 0 1440 878 </string>
<key>IBFramework Version</key>
<string>437.0</string>
<key>IBOpenObjects</key>
<array>
<integer>5</integer>
</array>
<key>IBSystem Version</key>
<string>8F46</string>
</dict>
</plist>
......@@ -837,6 +837,7 @@
DC7F46ED08A183FC0027DB24,
DCE7BD0508A56C8B007B10AE,
DCDA5E6508F94518009D93A8,
CCF3C64C0923B99D00401862,
);
isa = PBXResourcesBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
......@@ -923,6 +924,8 @@
DC7F46F108A187F60027DB24,
DCE7BD0708A5724D007B10AE,
DCE7BD0608A5724D007B10AE,
CCF3C6500923B9D100401862,
CCF3C6510923B9D100401862,
);
isa = PBXGroup;
name = Classes;
......@@ -2166,6 +2169,58 @@
//A02
//A03
//A04
//CC0
//CC1
//CC2
//CC3
//CC4
CCF3C64A0923B99D00401862 = {
children = (
CCF3C64B0923B99D00401862,
);
isa = PBXVariantGroup;
name = SFilters.nib;
path = "";
refType = 4;
sourceTree = "<group>";
};
CCF3C64B0923B99D00401862 = {
isa = PBXFileReference;
lastKnownFileType = wrapper.nib;
name = English;
path = Resources/English.lproj/SFilters.nib;
refType = 4;
sourceTree = "<group>";
};
CCF3C64C0923B99D00401862 = {
fileRef = CCF3C64A0923B99D00401862;
isa = PBXBuildFile;
settings = {
};
};
CCF3C6500923B9D100401862 = {
fileEncoding = 30;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.h;
name = sfilters.h;
path = ../../modules/gui/macosx/sfilters.h;
refType = 2;
sourceTree = SOURCE_ROOT;
};
CCF3C6510923B9D100401862 = {
fileEncoding = 30;
isa = PBXFileReference;
lastKnownFileType = sourcecode.c.objc;
name = sfilters.m;
path = ../../modules/gui/macosx/sfilters.m;
refType = 2;
sourceTree = SOURCE_ROOT;
};
//CC0
//CC1
//CC2
//CC3
//CC4
//DC0
//DC1
//DC2
......@@ -2379,6 +2434,7 @@
DCFCCDB7085CE18F001E36AF,
DC7F46EB08A183FC0027DB24,
DCE7BD0308A56C8B007B10AE,
CCF3C64A0923B99D00401862,
);
isa = PBXGroup;
name = nibs;
......
......@@ -34,5 +34,7 @@ SOURCES_macosx = \
extended.m \
bookmarks.h \
bookmarks.m \
sfilters.h \
sfilters.m \
$(NULL)
......@@ -93,13 +93,15 @@ struct intf_sys_t
id o_wizard; /* VLCWizard */
id o_extended; /* VLCExtended */
id o_bookmarks; /* VLCBookmarks */
id o_sfilters; /* VLCsFilters */
/*id o_update; VLCUpdate */
BOOL nib_main_loaded; /* reference to the main-nib */
BOOL nib_open_loaded; /* reference to the open-nib */
BOOL nib_about_loaded; /* reference to the about-nib */
BOOL nib_wizard_loaded; /* reference to the wizard-nib */
BOOL nib_extended_loaded; /* reference to the extended-nib */
BOOL nib_bookmarks_loaded; /* reference to the bookmarks-nib */
BOOL nib_bookmarks_loaded; /* reference to the bookmarks-nib */
BOOL nib_sfilters_loaded; /* reference to the sfilters-nib */
/*BOOL nib_update_loaded; reference to the update-nib */
IBOutlet id o_window; /* main window */
......@@ -307,6 +309,7 @@ struct intf_sys_t
- (IBAction)showWizard:(id)sender;
- (IBAction)showExtended:(id)sender;
- (IBAction)showBookmarks:(id)sender;
- (IBAction)showSFilters:(id)sender;
- (IBAction)viewAbout:(id)sender;
- (IBAction)viewPreferences:(id)sender;
......
......@@ -41,6 +41,7 @@
#include "wizard.h"
#include "extended.h"
#include "bookmarks.h"
#include "sfilters.h"
/*#include "update.h"*/
/*****************************************************************************
......@@ -303,6 +304,7 @@ static VLCMain *_o_sharedMainInstance = nil;
o_wizard = [[VLCWizard alloc] init];
o_extended = nil;
o_bookmarks = [[VLCBookmarks alloc] init];
o_sfilters = nil;
/*o_update = [[VLCUpdate alloc] init];*/
i_lastShownVolume = -1;
......@@ -1524,6 +1526,22 @@ static VLCMain *_o_sharedMainInstance = nil;
}
}
- (IBAction)showSFilters:(id)sender
{
if ( o_sfilters == nil )
{
o_sfilters = [[VLCsFilters alloc] init];
}
if (!nib_sfilters_loaded)
{
nib_sfilters_loaded = [NSBundle loadNibNamed:@"SFilters" owner:self];
[o_sfilters initStrings];
[o_sfilters showAsPanel];
} else {
[o_sfilters showAsPanel];
}
}
- (IBAction)showBookmarks:(id)sender
{
/* we need the wizard-nib for the bookmarks's extract functionality */
......
/*****************************************************************************
* sfilter.h: MacOS X Subpicture filters dialogue
*****************************************************************************
* Copyright (C) 2005 the VideoLAN team
* $Id:$
*
* Authors: Felix Khne <fkuehne@users.sf.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#import <Cocoa/Cocoa.h>
#import <vlc/intf.h>
@interface VLCsFilters : NSObject
{
/* window stuff */
IBOutlet id o_sfilter_tabView;
IBOutlet id o_sfilter_win;
/* logo section */
IBOutlet id o_logo_enabled_ckb;
IBOutlet id o_logo_image_btn;
IBOutlet id o_logo_image_fld;
IBOutlet id o_logo_image_lbl;
IBOutlet id o_logo_opaque_lbl;
IBOutlet id o_logo_opaque_sld;
IBOutlet id o_logo_pos_fix_btn;
IBOutlet id o_logo_pos_fix_X_fld;
IBOutlet id o_logo_pos_fix_X_lbl;
IBOutlet id o_logo_pos_fix_Y_fld;
IBOutlet id o_logo_pos_fix_Y_lbl;
IBOutlet id o_logo_pos_lbl;
IBOutlet id o_logo_pos_rel_btn;
IBOutlet id o_logo_pos_rel_pop;
IBOutlet id o_logo_pos_matrix;
/* marquee section */
IBOutlet id o_marq_enabled_ckb;
IBOutlet id o_marq_color_lbl;
IBOutlet id o_marq_color_pop;
IBOutlet id o_marq_marq_fld;
IBOutlet id o_marq_marq_lbl;
IBOutlet id o_marq_opaque_lbl;
IBOutlet id o_marq_opaque_sld;
IBOutlet id o_marq_pos_fix_btn;
IBOutlet id o_marq_pos_fix_X_fld;
IBOutlet id o_marq_pos_fix_X_lbl;
IBOutlet id o_marq_pos_fix_Y_fld;
IBOutlet id o_marq_pos_fix_Y_lbl;
IBOutlet id o_marq_pos_lbl;
IBOutlet id o_marq_pos_rel_btn;
IBOutlet id o_marq_pos_rel_pop;
IBOutlet id o_marq_size_inPx_lbl;
IBOutlet id o_marq_size_lbl;
IBOutlet id o_marq_size_pop;
IBOutlet id o_marq_tmOut_fld;
IBOutlet id o_marq_tmOut_lbl;
IBOutlet id o_marq_tmOut_ms_lbl;
IBOutlet id o_marq_pos_matrix;
/* time section */
IBOutlet id o_time_enabled_ckb;
IBOutlet id o_time_color_lbl;
IBOutlet id o_time_color_pop;
IBOutlet id o_time_opaque_lbl;
IBOutlet id o_time_opaque_sld;
IBOutlet id o_time_pos_fix_btn;
IBOutlet id o_time_pos_fix_X_fld;
IBOutlet id o_time_pos_fix_X_lbl;
IBOutlet id o_time_pos_fix_Y_fld;
IBOutlet id o_time_pos_fix_Y_lbl;
IBOutlet id o_time_pos_lbl;
IBOutlet id o_time_pos_rel_btn;
IBOutlet id o_time_pos_rel_pop;
IBOutlet id o_time_size_inPx_lbl;
IBOutlet id o_time_size_lbl;
IBOutlet id o_time_size_pop;
IBOutlet id o_time_stamp_fld;
IBOutlet id o_time_stamp_lbl;
IBOutlet id o_time_pos_matrix;
BOOL o_config_changed;
BOOL o_save_settings;
NSArray * o_colors;
}
+ (VLCsFilters *)sharedInstance;
- (IBAction)logo_selectFile:(id)sender;
- (IBAction)propertyChanged:(id)sender;
- (IBAction)enableFilter:(id)sender;
- (IBAction)otherPositionForLogo:(id)sender;
- (IBAction)otherPositionForMarq:(id)sender;
- (IBAction)otherPositionForTime:(id)sender;
- (void)showAsPanel;
- (void)initStrings;
- (void)changeFiltersString: (char *)psz_name onOrOff: (vlc_bool_t )b_add;
- (void)enableTime;
- (void)enableLogo;
- (void)enableMarq;
@end
/*****************************************************************************
* sfilter.m: MacOS X Subpicture filters dialogue
*****************************************************************************
* Copyright (C) 2005 the VideoLAN team
* $Id:$
*
* Authors: Felix Khne <fkuehne@users.sf.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Note:
* the code used to bind with VLC's core is partially based upon the
* RC-interface, written by Antoine Cellerier and Mark F. Moriarty
* (members of the VideoLAN team)
*****************************************************************************/
#import "sfilters.h"
#import "intf.h"
#import <vlc/vout.h>
/* TODO:
- fix all FIXMEs
- if a vout closes and another is opened, the marquee is shown at marq-x /
marq-y regardless of the fact whether the user wants it to be positioned
fixed or not. This needs fixing in marq.c and a new global config-variable
- That will probably happen with logo and time as well.
- implement initStrings
- check for memory leaks
- save the preferences, if requested
- fix 10.3 compatibility
*/
@implementation VLCsFilters
static VLCsFilters *_o_sharedInstance = nil;
+ (VLCsFilters *)sharedInstance
{
return _o_sharedInstance ? _o_sharedInstance : [[self alloc] init];
}
- (id)init
{
if (_o_sharedInstance) {
[self dealloc];
} else {
_o_sharedInstance = [super init];
}
return _o_sharedInstance;
}
- (void)dealloc
{
[o_colors release];
[super dealloc];
}
- (void)initStrings
{
}
- (void)awakeFromNib
{
/* colors as implemented at the beginning of marq.c and time.c
* feel free to add more colors, but remember to add them to these files
* as well to keep a certain level of consistency across the interfaces */
NSArray * o_default;
NSArray * o_black;
NSArray * o_gray;
NSArray * o_silver;
NSArray * o_white;
NSArray * o_maroon;
NSArray * o_red;
NSArray * o_fuchsia;
NSArray * o_yellow;
NSArray * o_olive;
NSArray * o_green;
NSArray * o_teal;
NSArray * o_lime;
NSArray * o_purple;
NSArray * o_navy;
NSArray * o_blue;
NSArray * o_aqua;
o_default = [NSArray arrayWithObjects: _NS("Default"), @"-1", nil];
o_black = [NSArray arrayWithObjects: _NS("Black"), @"0x000000", nil];
o_gray = [NSArray arrayWithObjects: _NS("Gray"), @"0x808080", nil];
o_silver = [NSArray arrayWithObjects: _NS("Silver"), @"0xC0C0C0", nil];
o_white = [NSArray arrayWithObjects: _NS("White"), @"0xFFFFFF", nil];
o_maroon = [NSArray arrayWithObjects: _NS("Maroon"), @"0x800000", nil];
o_red = [NSArray arrayWithObjects: _NS("Red"), @"0xFF0000", nil];
o_fuchsia = [NSArray arrayWithObjects: _NS("Fuchsia"), @"0xFF00FF", nil];
o_yellow = [NSArray arrayWithObjects: _NS("Yellow"), @"0xFFFF00", nil];
o_olive = [NSArray arrayWithObjects: _NS("Olive"), @"0x808000", nil];
o_green = [NSArray arrayWithObjects: _NS("Green"), @"0x008000", nil];
o_teal = [NSArray arrayWithObjects: _NS("Teal"), @"0x008080", nil];
o_lime = [NSArray arrayWithObjects: _NS("Lime"), @"0x00FF00", nil];
o_purple = [NSArray arrayWithObjects: _NS("Purple"), @"0x800080", nil];
o_navy = [NSArray arrayWithObjects: _NS("Navy"), @"0x000080", nil];
o_blue = [NSArray arrayWithObjects: _NS("Blue"), @"0x0000FF", nil];
o_aqua = [NSArray arrayWithObjects: _NS("Aqua"), @"0x00FFFF", nil];
o_colors = [[NSArray alloc] initWithObjects: o_default, o_black, o_gray, \
o_silver, o_white, o_maroon, o_red, o_fuchsia, o_yellow, o_olive, \
o_green, o_teal, o_lime, o_purple, o_navy, o_blue, o_aqua, nil];
unsigned int x = 0;
[o_marq_color_pop removeAllItems];
[o_time_color_pop removeAllItems];
/* we are adding tags to the items, so we can easily identify them even if
* the menu was sorted */
while (x != [o_colors count])
{
[o_marq_color_pop addItemWithTitle: [[o_colors objectAtIndex:x] \
objectAtIndex:0]];
[[o_marq_color_pop lastItem] setTag: x];
[o_time_color_pop addItemWithTitle: [[o_colors objectAtIndex:x] \
objectAtIndex:0]];
[[o_time_color_pop lastItem] setTag: x];
x = (x + 1);
}
[o_marq_color_pop selectItemAtIndex:0];
[o_time_color_pop selectItemAtIndex:0];
/* define the relative positions and copy them to the menues
* we can destroy the array afterwards, because we are saving the ints
* as tags to the menu-items */
NSArray * o_cnt_cnt;
NSArray * o_lft_cnt;
NSArray * o_rht_cnt;
NSArray * o_cnt_top;
NSArray * o_lft_top;
NSArray * o_rht_top;
NSArray * o_cnt_btm;
NSArray * o_lft_btm;
NSArray * o_rht_btm;
NSArray * o_positions;
o_cnt_cnt = [NSArray arrayWithObjects: _NS("Center-Center"), @"0", nil];
o_lft_cnt = [NSArray arrayWithObjects: _NS("Left-Center"), @"1", nil];
o_rht_cnt = [NSArray arrayWithObjects: _NS("Right-Center"), @"2", nil];
o_cnt_top = [NSArray arrayWithObjects: _NS("Center-Top"), @"4", nil];
o_lft_top = [NSArray arrayWithObjects: _NS("Left-Top"), @"5", nil];
o_rht_top = [NSArray arrayWithObjects: _NS("Right-Top"), @"6", nil];
o_cnt_btm = [NSArray arrayWithObjects: _NS("Center-Bottom"), @"8", nil];
o_lft_btm = [NSArray arrayWithObjects: _NS("Left-Bottom"), @"9", nil];
o_rht_btm = [NSArray arrayWithObjects: _NS("Right-Bottom"), @"10", nil];
o_positions = [[NSArray alloc] initWithObjects: o_cnt_cnt, o_lft_cnt, \
o_rht_cnt, o_cnt_top, o_lft_top, o_rht_top, o_cnt_btm, o_lft_btm, \
o_rht_btm, nil];
x = 0;
[o_time_pos_rel_pop removeAllItems];
[o_marq_pos_rel_pop removeAllItems];
[o_logo_pos_rel_pop removeAllItems];
/* we are adding a tag here, so we can easily select an item later on */