Commit 8f4538a6 authored by Felix Paul Kühne's avatar Felix Paul Kühne

* removed the sfilters-panel for 0.8.5

parent dae95ef0
......@@ -77,9 +77,6 @@ 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/Update.nib/classes.nib \
extras/MacOSX/Resources/English.lproj/Update.nib/info.nib \
extras/MacOSX/Resources/English.lproj/Update.nib/keyedobjects.nib \
......@@ -377,8 +374,6 @@ VLC-release.app: vlc
extended.m \
bookmarks.h \
bookmarks.m \
sfilters.h \
sfilters.m \
update.h \
update.m \
interaction.h \
......@@ -515,8 +510,6 @@ VLC.app: vlc
extended.m \
bookmarks.h \
bookmarks.m \
sfilters.h \
sfilters.m \
update.h \
update.m \
interaction.h \
......
......@@ -194,7 +194,6 @@
reportABug = id;
showBookmarks = id;
showExtended = id;
showSFilters = id;
showWizard = id;
timesliderUpdate = id;
togglePlaylist = id;
......
......@@ -11,19 +11,20 @@
<key>2197</key>
<string>422 532 596 143 0 0 1440 878 </string>
<key>29</key>
<string>76 675 438 44 0 0 1024 746 </string>
<string>130 802 438 44 0 0 1440 878 </string>
<key>915</key>
<string>777 479 187 249 0 0 1440 878 </string>
</dict>
<key>IBFramework Version</key>
<string>439.0</string>
<string>443.0</string>
<key>IBLockedObjects</key>
<array/>
<key>IBOpenObjects</key>
<array>
<integer>21</integer>
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>8H14</string>
<string>8I127</string>
</dict>
</plist>
{
IBClasses = (
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {enableFilter = id; "logo_selectFile" = 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_lbl" = 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_lbl" = 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_lbl" = 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>
......@@ -74,7 +74,6 @@
C2F2A709095AE51700018C74 /* skip_previous_embedded_blue.png in Resources */ = {isa = PBXBuildFile; fileRef = C2F2A705095AE51600018C74 /* skip_previous_embedded_blue.png */; };
CC1B4B4D09A8CF9E0078AD2E /* Interaction.nib in Resources */ = {isa = PBXBuildFile; fileRef = CC1B4B4B09A8CF9E0078AD2E /* Interaction.nib */; };
CC26BF2C09A7A05000E94D62 /* Update.nib in Resources */ = {isa = PBXBuildFile; fileRef = CC26BF2A09A7A05000E94D62 /* Update.nib */; };
CCF3C64C0923B99D00401862 /* SFilters.nib in Resources */ = {isa = PBXBuildFile; fileRef = CCF3C64A0923B99D00401862 /* SFilters.nib */; };
DC7F46ED08A183FC0027DB24 /* Extended.nib in Resources */ = {isa = PBXBuildFile; fileRef = DC7F46EB08A183FC0027DB24 /* Extended.nib */; };
DCA00AA9075F948800E6BF46 /* About.nib in Resources */ = {isa = PBXBuildFile; fileRef = DCA00AA7075F948800E6BF46 /* About.nib */; };
DCA693C30789DF8700139EC6 /* Open.nib in Resources */ = {isa = PBXBuildFile; fileRef = DCA693C10789DF8700139EC6 /* Open.nib */; };
......@@ -929,9 +928,6 @@
CC26BF2B09A7A05000E94D62 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = Resources/English.lproj/Update.nib; sourceTree = "<group>"; };
CC26BF3109A7A08C00E94D62 /* update.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = update.h; path = ../../modules/gui/macosx/update.h; sourceTree = SOURCE_ROOT; };
CC26BF3209A7A08C00E94D62 /* update.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = update.m; path = ../../modules/gui/macosx/update.m; sourceTree = SOURCE_ROOT; };
CCF3C64B0923B99D00401862 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = Resources/English.lproj/SFilters.nib; sourceTree = "<group>"; };
CCF3C6500923B9D100401862 /* sfilters.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = sfilters.h; path = ../../modules/gui/macosx/sfilters.h; sourceTree = SOURCE_ROOT; };
CCF3C6510923B9D100401862 /* sfilters.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = sfilters.m; path = ../../modules/gui/macosx/sfilters.m; sourceTree = SOURCE_ROOT; };
DC769AB7085DF0DB001A838D /* wizard.m */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; name = wizard.m; path = ../../modules/gui/macosx/wizard.m; sourceTree = SOURCE_ROOT; tabWidth = 4; usesTabs = 0; };
DC769AB8085DF0DB001A838D /* wizard.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; name = wizard.h; path = ../../modules/gui/macosx/wizard.h; sourceTree = SOURCE_ROOT; };
DC7F46EC08A183FC0027DB24 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = Resources/English.lproj/Extended.nib; sourceTree = "<group>"; };
......@@ -1047,8 +1043,6 @@
DC7F46F108A187F60027DB24 /* extended.m */,
DCE7BD0708A5724D007B10AE /* bookmarks.h */,
DCE7BD0608A5724D007B10AE /* bookmarks.m */,
CCF3C6500923B9D100401862 /* sfilters.h */,
CCF3C6510923B9D100401862 /* sfilters.m */,
CC26BF3109A7A08C00E94D62 /* update.h */,
CC26BF3209A7A08C00E94D62 /* update.m */,
);
......@@ -1169,7 +1163,6 @@
DCFCCDB7085CE18F001E36AF /* Wizard.nib */,
DC7F46EB08A183FC0027DB24 /* Extended.nib */,
DCE7BD0308A56C8B007B10AE /* Bookmarks.nib */,
CCF3C64A0923B99D00401862 /* SFilters.nib */,
CC26BF2A09A7A05000E94D62 /* Update.nib */,
CC1B4B4B09A8CF9E0078AD2E /* Interaction.nib */,
);
......@@ -1275,7 +1268,6 @@
DC7F46ED08A183FC0027DB24 /* Extended.nib in Resources */,
DCE7BD0508A56C8B007B10AE /* Bookmarks.nib in Resources */,
DCDA5E6508F94518009D93A8 /* about_bg.png in Resources */,
CCF3C64C0923B99D00401862 /* SFilters.nib in Resources */,
C2F2A6FB0958A6E600018C74 /* skip_forward_active_embedded.png in Resources */,
C2F2A6FD0958A94500018C74 /* play_embedded.png in Resources */,
C2F2A6FF0958AA9300018C74 /* pause_embedded.png in Resources */,
......@@ -1318,14 +1310,6 @@
name = Update.nib;
sourceTree = "<group>";
};
CCF3C64A0923B99D00401862 /* SFilters.nib */ = {
isa = PBXVariantGroup;
children = (
CCF3C64B0923B99D00401862 /* English */,
);
name = SFilters.nib;
sourceTree = "<group>";
};
DC7F46EB08A183FC0027DB24 /* Extended.nib */ = {
isa = PBXVariantGroup;
children = (
......
......@@ -36,8 +36,6 @@ SOURCES_macosx = \
extended.m \
bookmarks.h \
bookmarks.m \
sfilters.h \
sfilters.m \
embeddedwindow.h \
embeddedwindow.m \
update.h \
......
......@@ -97,7 +97,6 @@ struct intf_sys_t
id o_bookmarks; /* VLCBookmarks */
id o_embedded_list; /* VLCEmbeddedList*/
id o_interaction_list; /* VLCInteractionList*/
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 */
......@@ -105,7 +104,6 @@ struct intf_sys_t
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_sfilters_loaded; /* reference to the sfilters-nib */
BOOL nib_update_loaded; /* reference to the update-nib */
IBOutlet id o_window; /* main window */
......@@ -320,7 +318,6 @@ 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,7 +41,6 @@
#include "wizard.h"
#include "extended.h"
#include "bookmarks.h"
#include "sfilters.h"
#include "interaction.h"
#include "embeddedwindow.h"
#include "update.h"
......@@ -339,7 +338,6 @@ static VLCMain *_o_sharedMainInstance = nil;
o_bookmarks = [[VLCBookmarks alloc] init];
o_embedded_list = [[VLCEmbeddedList alloc] init];
o_interaction_list = [[VLCInteractionList alloc] init];
o_sfilters = nil;
o_update = [[VLCUpdate alloc] init];
i_lastShownVolume = -1;
......@@ -1621,22 +1619,6 @@ 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-2006 the VideoLAN team
* $Id:$
*
* Authors: Felix Kühne <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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#import <Cocoa/Cocoa.h>
#import <vlc/intf.h>
@interface VLCsFilters : NSObject
{
/* window stuff */
IBOutlet id o_sfilter_tabView;
IBOutlet id o_sfilter_win;
IBOutlet id o_sfilter_saveSettings_ckb;
/* 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_lbl;
IBOutlet id o_logo_pos_rel_pop;
/* 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_lbl;
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;
/* 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_lbl;
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;
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;
- (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-2006 the VideoLAN team
* $Id:$
*
* Authors: Felix Kühne <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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, 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:
- check for memory leaks
- save the preferences, if requested
*/
@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
{
[o_sfilter_win setTitle: _NS("Subpicture Filters")];
[[o_sfilter_tabView tabViewItemAtIndex: 0] setLabel: _NS("Logo")];
[[o_sfilter_tabView tabViewItemAtIndex: 1] setLabel: _NS("Time")];
[[o_sfilter_tabView tabViewItemAtIndex: 2] setLabel: _NS("Marquee")];
[o_sfilter_saveSettings_ckb setTitle: _NS("Save settings")];
[o_logo_image_btn setTitle: _NS("Browse...")];
[o_logo_enabled_ckb setTitle: _NS("Enabled")];
[o_logo_image_lbl setStringValue: [_NS("Image") \
stringByAppendingString: @":"]];
[o_logo_pos_lbl setStringValue: [_NS("Position") \
stringByAppendingString: @":"]];
[o_logo_opaque_lbl setStringValue: [_NS("Opaqueness") \
stringByAppendingString: @":"]];
[o_time_enabled_ckb setTitle: _NS("Enabled")];
[o_time_stamp_lbl setStringValue: [_NS("Timestamp") \
stringByAppendingString: @":"]];
[o_time_size_lbl setStringValue: [_NS("Size") \
stringByAppendingString: @":"]];
[o_time_color_lbl setStringValue: [_NS("Color") \
stringByAppendingString: @":"]];
[o_time_opaque_lbl setStringValue: [_NS("Opaqueness") \
stringByAppendingString: @":"]];
[o_time_pos_lbl setStringValue: [_NS("Position") \
stringByAppendingString: @":"]];
[o_time_size_inPx_lbl setStringValue: _NS("(in pixels)")];
[o_marq_enabled_ckb setTitle: _NS("Enabled")];
[o_marq_color_lbl setStringValue: [_NS("Color") \
stringByAppendingString: @":"]];
[o_marq_marq_lbl setStringValue: [_NS("Marquee") \
stringByAppendingString: @":"]];
[o_marq_opaque_lbl setStringValue: [_NS("Opaqueness") \
stringByAppendingString: @":"]];
[o_marq_tmOut_lbl setStringValue: [_NS("Timeout") \
stringByAppendingString: @":"]];
[o_marq_tmOut_ms_lbl setStringValue: _NS("ms")];
[o_marq_pos_lbl setStringValue: [_NS("Position") \
stringByAppendingString: @":"]];
[o_marq_size_lbl setStringValue: [_NS("Size") \
stringByAppendingString: @":"]];
[o_time_color_lbl setStringValue: _NS("(in pixels)")];
}
- (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 */
while ( x != [o_positions count] )
{
[o_time_pos_rel_pop addItemWithTitle: [[o_positions objectAtIndex:x] \
objectAtIndex:0]];
[[o_time_pos_rel_pop lastItem] setTag: [[[o_positions objectAtIndex:x] \
objectAtIndex:1] intValue]];
[o_marq_pos_rel_pop addItemWithTitle: [[o_positions objectAtIndex:x] \
objectAtIndex:0]];
[[o_marq_pos_rel_pop lastItem] setTag: [[[o_positions objectAtIndex:x] \
objectAtIndex:1] intValue]];
[o_logo_pos_rel_pop addItemWithTitle: [[o_positions objectAtIndex:x] \
objectAtIndex:0]];
[[o_logo_pos_rel_pop lastItem] setTag: [[[o_positions objectAtIndex:x] \
objectAtIndex:1] intValue]];
x = (x + 1);
}
[o_positions release];
NSArray * o_sizes;
o_sizes = [[NSArray alloc] initWithObjects: @"6", @"8", @"10", @"11", @"12",\
@"14", @"13", @"16", @"18", @"24", @"36", @"48", @"64", @"72", @"96", \
@"144", @"288", nil];
[o_marq_size_pop removeAllItems];
[o_marq_size_pop addItemsWithTitles: o_sizes];
[o_time_size_pop removeAllItems];
[o_time_size_pop addItemsWithTitles: o_sizes];
[o_sizes release];
}
- (void)showAsPanel
{
/* called from intf.m */
[o_sfilter_win displayIfNeeded];
[o_sfilter_win makeKeyAndOrderFront:nil];
/* show a warning until the panel is removed for 0.8.5
* This isn't to be localised */
NSBeginCriticalAlertSheet( @"Implementation incomplete", @"OK", \
@"", @"", o_sfilter_win, nil, nil, nil, nil, @"The panel " \
"you just opened is not implemented completely and contains " \
"various limitations and certain bugs. Be warned.\n\nIt isn't going " \
"to be included within the final build of VLC 0.8.5." );
intf_thread_t * p_intf = VLCIntf;
/* retrieve the marquee settings */
int x = 0;
int tempInt = config_GetInt( p_intf, "marq-color" );
while( strtol([[[o_colors objectAtIndex:x] objectAtIndex:1] UTF8String], \
NULL, 0) != tempInt )
{
x = (x + 1);
if( x >= [o_marq_color_pop numberOfItems] )
{
x = 0;
return;
}
}
[o_marq_color_pop selectItemAtIndex: x];
[o_marq_marq_fld setStringValue: [NSString stringWithUTF8String: \
config_GetPsz( p_intf, "marq-marquee" )]];
[o_marq_opaque_sld setIntValue: config_GetInt( p_intf, "marq-opacity")];
x = 0;
tempInt = config_GetInt( p_intf, "marq-position" );
while( tempInt != [[o_marq_pos_rel_pop itemAtIndex:x] tag] )
{
x = (x + 1);
if( x >= [o_marq_pos_rel_pop numberOfItems] )
{
x = 0;
return;
}
}
[o_marq_pos_rel_pop selectItemAtIndex:x];
x = 0;
tempInt = config_GetInt( p_intf, "marq-size" );
while( [[[o_marq_size_pop itemAtIndex: x] title] intValue] != tempInt )
x = (x + 1);
if( x >= [o_marq_size_pop numberOfItems] )
{
x = 0;
return;
}
[o_marq_size_pop selectItemAtIndex: x];
[o_marq_tmOut_fld setStringValue: [[NSNumber numberWithInt: \
config_GetInt( p_intf, "marq-timeout" )] stringValue]];
/* retrieve the time settings */
x = 0;
tempInt = config_GetInt( p_intf, "time-color" );
while( strtol([[[o_colors objectAtIndex:x] objectAtIndex:1] UTF8String], \
NULL, 0) != tempInt )
{
x = (x + 1);
if( x >= [o_time_color_pop numberOfItems] )
{
x = 0;
return;
}
}
[o_time_color_pop selectItemAtIndex: x];
[o_time_stamp_fld setStringValue: [NSString stringWithUTF8String: \
config_GetPsz( p_intf, "time-format" )]];
[o_time_opaque_sld setIntValue: config_GetInt( p_intf, "time-opacity")];
x = 0;
tempInt = config_GetInt( p_intf, "time-size" );
while( [[[o_time_size_pop itemAtIndex: x] title] intValue] != tempInt )
x = (x + 1);
if( x >= [o_time_size_pop numberOfItems] )
{
x = 0;
return;
}
[o_time_size_pop selectItemAtIndex: x];
x = 0;
tempInt = config_GetInt( p_intf, "time-position" );
while( tempInt != [[o_time_pos_rel_pop itemAtIndex:x] tag] )
{
x = (x + 1);
if( x >= [o_time_pos_rel_pop numberOfItems] )
{
x = 0;
return;
}
}
/* retrieve the logo settings */
[o_logo_opaque_sld setIntValue: config_GetInt( p_intf, "logo-transparency")];
/* in case that no path has been saved yet */
NSString * tempString = [[NSString alloc] initWithUTF8String: \
config_GetPsz( p_intf, "logo-file" )];
if( [tempString length] == 0 )
{
[o_logo_image_fld setStringValue: @""];
}
else
{
[o_logo_image_fld setStringValue: tempString ];
}
[tempString release];
x = 0;
tempInt = config_GetInt( p_intf, "logo-position" );
while( tempInt != [[o_logo_pos_rel_pop itemAtIndex:x] tag] )
{
x = (x + 1);
if( x >= [o_logo_pos_rel_pop numberOfItems] )
{
x = 0;
return;
}
}
/* enable the wanted filters */
char * psz_subfilters;
psz_subfilters = config_GetPsz( p_intf, "sub-filter" );
if( psz_subfilters )
{
[o_marq_enabled_ckb setState: (int)strstr( psz_subfilters, "marq")];
[o_logo_enabled_ckb setState: (int)strstr( psz_subfilters, "logo")];
[o_time_enabled_ckb setState: (int)strstr( psz_subfilters, "time")];
[self enableMarq];
[self enableLogo];
[self enableTime];
}
}
- (IBAction)logo_selectFile:(id)sender
{
NSOpenPanel * openPanel = [NSOpenPanel openPanel];
SEL sel = @selector(logo_getFile:returnCode:contextInfo:);
[openPanel beginSheetForDirectory:nil file:nil types: [NSArray \
arrayWithObjects: @"png", @"PNG", @"'PNGf'", nil] modalForWindow: \
o_sfilter_win modalDelegate:self didEndSelector:sel contextInfo:nil];
}
- (void)logo_getFile: (NSOpenPanel *)sheet returnCode: \
(int)returnCode contextInfo: (void *)contextInfo
{
if (returnCode == NSOKButton)
{
[o_logo_image_fld setStringValue: [sheet filename]];
}
}
- (IBAction)propertyChanged:(id)sender
{
intf_thread_t * p_intf = VLCIntf;
input_thread_t * p_input = (input_thread_t *)vlc_object_find( p_intf, \
VLC_OBJECT_INPUT, FIND_ANYWHERE );
vlc_value_t val;
/* general properties */
if( sender == o_sfilter_saveSettings_ckb)
{
o_save_settings = [o_sfilter_saveSettings_ckb state];
}
/* marquee */
else if( sender == o_marq_marq_fld )
{
if( [[o_marq_marq_fld stringValue] length] == 0 )
{
val.psz_string = "";
}
else
{
val.psz_string = (char *)[[o_marq_marq_fld stringValue] UTF8String];
}
if( p_input )
var_Set( p_input->p_libvlc, "marq-marquee", val );
config_PutPsz( p_intf, "marq-marquee", val.psz_string );
}
else if( sender == o_marq_pos_rel_pop )
{
val.i_int = [[o_marq_pos_rel_pop selectedItem] tag];
if( p_input )
var_Set( p_input->p_libvlc, "marq-position", val );
config_PutInt( p_intf, "marq-position", val.i_int );
}
else if( sender == o_marq_color_pop )
{
val.i_int = strtol( [[[o_colors objectAtIndex: [o_marq_color_pop \
indexOfSelectedItem]] objectAtIndex: 1] UTF8String], NULL, 0 );
if( p_input )
var_Set( p_input->p_libvlc, "marq-color", val );
config_PutInt( p_intf, "marq-color", val.i_int );
}
else if( sender == o_marq_opaque_sld )
{
val.i_int = [o_marq_opaque_sld intValue];
if( p_input )
var_Set( p_input->p_libvlc, "marq-opacity", val );
config_PutInt( p_intf, "marq-opacity", val.i_int );
}
else if( sender == o_marq_size_pop )
{
val.i_int = [[o_marq_size_pop titleOfSelectedItem] intValue];
if( p_input )
var_Set( p_input->p_libvlc, "marq-size", val );
config_PutInt( p_intf, "marq-size", val.i_int );
}
else if( sender == o_marq_tmOut_fld && [[sender stringValue] length] > 0 )
{
val.i_int = [o_marq_tmOut_fld intValue];
if( p_input )
var_Set( p_input->p_libvlc, "marq-timeout", val );
config_PutInt( p_intf, "marq-timeout", val.i_int );
}
/* time */
else if( sender == o_time_stamp_fld )
{
if( [[o_time_stamp_fld stringValue] length] == 0 )
{
val.psz_string = "";
}
else
{
val.psz_string = (char *)[[o_time_stamp_fld stringValue] UTF8String];
}
if( p_input )
var_Set( p_input->p_libvlc, "time-format", val );
config_PutPsz( p_intf, "time-format", val.psz_string );
}
else if( sender == o_time_pos_rel_pop )
{
val.i_int = [[o_time_pos_rel_pop selectedItem] tag];
if( p_input )
var_Set( p_input->p_libvlc, "time-position", val );
config_PutInt( p_intf, "time-position", val.i_int );
}
else if( sender == o_time_color_pop )
{
val.i_int = strtol( [[[o_colors objectAtIndex: [o_time_color_pop \
indexOfSelectedItem]] objectAtIndex: 1] UTF8String], NULL, 0 );
if( p_input )
var_Set( p_input->p_libvlc, "time-color", val );
config_PutInt( p_intf, "time-color", val.i_int );
}
else if( sender == o_time_opaque_sld )
{
val.i_int = [o_time_opaque_sld intValue];
if( p_input )
var_Set( p_input->p_libvlc, "time-opacity", val );
config_PutInt( p_intf, "time-opacity", val.i_int );
}
else if( sender == o_time_size_pop )
{
val.i_int = [[o_time_size_pop titleOfSelectedItem] intValue];
if( p_input )
var_Set( p_input->p_libvlc, "time-size", val );
config_PutInt( p_intf, "time-size", val.i_int );
}
/* logo */
else if( sender == o_logo_opaque_sld )
{
val.i_int = [o_logo_opaque_sld intValue];
if( p_input )
var_Set( p_input->p_libvlc, "logo-transparency", val );
config_PutInt( p_intf, "logo-transparency", val.i_int );
}
else if( sender == o_logo_pos_rel_pop )
{
val.i_int = [[o_logo_pos_rel_pop selectedItem] tag];
if( p_input )
var_Set( p_input->p_libvlc, "logo-position", val );
config_PutInt( p_intf, "logo-position", val.i_int );
}
/* clean up */
if ( p_input )
{
o_config_changed = YES;
vlc_object_release( p_input );
}
}
- (IBAction)enableFilter:(id)sender
{
if( sender == o_marq_enabled_ckb )
{
if( [o_marq_enabled_ckb state] == NSOnState )
{
[self changeFiltersString:"marq" onOrOff:VLC_TRUE];
}
else
{
[self changeFiltersString:"marq" onOrOff:VLC_FALSE];
}
[self enableMarq];
}
if( sender == o_logo_enabled_ckb )
{
if( [o_logo_enabled_ckb state] == NSOnState )
{
[self changeFiltersString:"logo" onOrOff:VLC_TRUE];
}
else
{
[self changeFiltersString:"logo" onOrOff:VLC_FALSE];
}
[self enableLogo];
}
if( sender == o_time_enabled_ckb )
{
if( [o_time_enabled_ckb state] == NSOnState )
{
[self changeFiltersString:"time" onOrOff:VLC_TRUE];
}
else
{
[self changeFiltersString:"time" onOrOff:VLC_FALSE];
}
[self enableTime];
}
}
- (void)enableMarq
{
[o_marq_color_pop setEnabled: [o_marq_enabled_ckb state]];
[o_marq_marq_fld setEnabled: [o_marq_enabled_ckb state]];
[o_marq_opaque_sld setEnabled: [o_marq_enabled_ckb state]];
[o_marq_size_pop setEnabled: [o_marq_enabled_ckb state]];
[o_marq_tmOut_fld setEnabled: [o_marq_enabled_ckb state]];
[o_marq_pos_rel_pop setEnabled: [o_marq_enabled_ckb state]];
}
- (void)enableTime
{
[o_time_color_pop setEnabled: [o_time_enabled_ckb state]];
[o_time_stamp_fld setEnabled: [o_time_enabled_ckb state]];
[o_time_opaque_sld setEnabled: [o_time_enabled_ckb state]];
[o_time_size_pop setEnabled: [o_time_enabled_ckb state]];
[o_time_pos_rel_pop setEnabled: [o_time_enabled_ckb state]];
}
- (void)enableLogo
{
[o_logo_image_btn setEnabled: [o_logo_enabled_ckb state]];
[o_logo_image_fld setEnabled: [o_logo_enabled_ckb state]];
[o_logo_opaque_sld setEnabled: [o_logo_enabled_ckb state]];
[o_logo_pos_rel_pop setEnabled: [o_logo_enabled_ckb state]];
}
- (void)changeFiltersString:(char *)psz_name onOrOff:(vlc_bool_t )b_add
{
/* copied from ../wxwidgets/extrapanel.cpp
* renamed to conform with Cocoa's rules
* and slightly modified to suit our needs */
intf_thread_t * p_intf = VLCIntf;
char *psz_parser, *psz_string;
psz_string = config_GetPsz( p_intf, "sub-filter" );
if( !psz_string ) psz_string = strdup("");
psz_parser = strstr( psz_string, psz_name );
if( b_add )
{
if( !psz_parser )
{
psz_parser = psz_string;
asprintf( &psz_string, (*psz_string) ? "%s:%s" : "%s%s",
psz_string, psz_name );
free( psz_parser );
}
else
{
return;
}
}
else
{
if( psz_parser )
{
memmove( psz_parser, psz_parser + strlen(psz_name) +
(*(psz_parser + strlen(psz_name)) == ':' ? 1 : 0 ),
strlen(psz_parser + strlen(psz_name)) + 1 );
/* Remove trailing : : */
if( *(psz_string+strlen(psz_string ) -1 ) == ':' )
{
*(psz_string+strlen(psz_string ) -1 ) = '\0';
}
}
else
{
free( psz_string );
return;
}
}
config_PutPsz( p_intf, "sub-filter", psz_string );
/* Try to set on the fly */
/* FIXME: enable this once we support on-the-fly addition of this kind of
* filters...
vout_thread_t *p_vout;
p_vout = (vout_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT,
FIND_ANYWHERE );
if( p_vout )
{
var_SetString( p_vout, "sub-filter", psz_string );
vlc_object_release( p_vout );
}*/
free( psz_string );
vlc_object_release( p_intf );
o_config_changed = YES;
}
@end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment