Commit 499c0ee2 authored by Felix Paul Kühne's avatar Felix Paul Kühne

* implemented the controls for the logo and time filters (refs #350)

* complete l10n support

The usage of the logo-filter doesn't work here, but that might be because of my strange PNG-files. I'll investigate this tomorrow.

It would be nice if some of the OSX-devs and testers could check whether everything works as expected, whether you are able crash the entire thingie, etc.
Note that on-the-fly activation of filters doesn't work (this needs the vout-rework scheduled for 0.8.5).
parent 9cafa66b
...@@ -34,11 +34,9 @@ ...@@ -34,11 +34,9 @@
#import <vlc/vout.h> #import <vlc/vout.h>
/* TODO: /* TODO:
- fix all FIXMEs
- implement initStrings
- check for memory leaks - check for memory leaks
- save the preferences, if requested - save the preferences, if requested
- fix stupid compilation warning - fix stupid compilation warnings
*/ */
@implementation VLCsFilters @implementation VLCsFilters
...@@ -70,6 +68,46 @@ static VLCsFilters *_o_sharedInstance = nil; ...@@ -70,6 +68,46 @@ static VLCsFilters *_o_sharedInstance = nil;
- (void)initStrings - (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 - (void)awakeFromNib
...@@ -438,8 +476,86 @@ static VLCsFilters *_o_sharedInstance = nil; ...@@ -438,8 +476,86 @@ static VLCsFilters *_o_sharedInstance = nil;
/* time */ /* time */
else if( sender == o_time_stamp_fld )
{
if( [[o_time_stamp_fld stringValue] length] == 0 )
{
val.psz_string = "";
}
else
{
val.psz_string = [[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 */ /* 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 ) if ( p_input )
{ {
o_config_changed = YES; o_config_changed = YES;
......
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