Commit 9e904e66 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx/video effects: remove object instance from xib file and further reduce the exposed class API

parent d53743bf
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -1131,7 +1131,7 @@
o_videoeffects = [[VLCVideoEffects alloc] init];
if (!b_nib_videoeffects_loaded)
b_nib_videoeffects_loaded = [NSBundle loadNibNamed:@"VideoEffects" owner: NSApp];
b_nib_videoeffects_loaded = [NSBundle loadNibNamed:@"VideoEffects" owner: o_videoeffects];
[o_videoeffects toggleWindow:sender];
}
......
/*****************************************************************************
* VideoEffects.h: MacOS X interface module
*****************************************************************************
* Copyright (C) 2011-2012 Felix Paul Kühne
* Copyright (C) 2011-2015 Felix Paul Kühne
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org>
......@@ -23,125 +23,124 @@
#import <Cocoa/Cocoa.h>
@interface VLCVideoEffects : NSObject
@interface VLCVideoEffects : NSObject {
/* generic */
IBOutlet id o_window;
IBOutlet id o_tableView;
IBOutlet id o_profile_pop;
/* basic */
IBOutlet id o_adjust_ckb;
IBOutlet id o_adjust_hue_lbl;
IBOutlet id o_adjust_hue_sld;
IBOutlet id o_adjust_contrast_lbl;
IBOutlet id o_adjust_contrast_sld;
IBOutlet id o_adjust_brightness_lbl;
IBOutlet id o_adjust_brightness_sld;
IBOutlet id o_adjust_brightness_ckb;
IBOutlet id o_adjust_saturation_lbl;
IBOutlet id o_adjust_saturation_sld;
IBOutlet id o_adjust_gamma_lbl;
IBOutlet id o_adjust_gamma_sld;
IBOutlet id o_adjust_reset_btn;
IBOutlet id o_sharpen_ckb;
IBOutlet id o_sharpen_lbl;
IBOutlet id o_sharpen_sld;
IBOutlet id o_banding_ckb;
IBOutlet id o_banding_lbl;
IBOutlet id o_banding_sld;
IBOutlet id o_grain_ckb;
IBOutlet id o_grain_sld;
IBOutlet id o_grain_lbl;
/* crop */
IBOutlet id o_crop_top_lbl;
IBOutlet id o_crop_top_fld;
IBOutlet id o_crop_top_stp;
IBOutlet id o_crop_left_lbl;
IBOutlet id o_crop_left_fld;
IBOutlet id o_crop_left_stp;
IBOutlet id o_crop_right_lbl;
IBOutlet id o_crop_right_fld;
IBOutlet id o_crop_right_stp;
IBOutlet id o_crop_bottom_lbl;
IBOutlet id o_crop_bottom_fld;
IBOutlet id o_crop_bottom_stp;
IBOutlet id o_crop_sync_top_bottom_ckb;
IBOutlet id o_crop_sync_left_right_ckb;
/* geometry */
IBOutlet id o_transform_ckb;
IBOutlet id o_transform_pop;
IBOutlet id o_zoom_ckb;
IBOutlet id o_puzzle_ckb;
IBOutlet id o_puzzle_rows_lbl;
IBOutlet id o_puzzle_rows_fld;
IBOutlet id o_puzzle_rows_stp;
IBOutlet id o_puzzle_columns_lbl;
IBOutlet id o_puzzle_columns_fld;
IBOutlet id o_puzzle_columns_stp;
IBOutlet id o_clone_ckb;
IBOutlet id o_clone_number_fld;
IBOutlet id o_clone_number_stp;
IBOutlet id o_clone_number_lbl;
IBOutlet id o_wall_ckb;
IBOutlet id o_wall_numofrows_fld;
IBOutlet id o_wall_numofrows_stp;
IBOutlet id o_wall_numofrows_lbl;
IBOutlet id o_wall_numofcols_fld;
IBOutlet id o_wall_numofcols_stp;
IBOutlet id o_wall_numofcols_lbl;
/* color */
IBOutlet id o_threshold_ckb;
IBOutlet id o_threshold_color_lbl;
IBOutlet id o_threshold_color_fld;
IBOutlet id o_threshold_saturation_lbl;
IBOutlet id o_threshold_saturation_sld;
IBOutlet id o_threshold_similarity_lbl;
IBOutlet id o_threshold_similarity_sld;
IBOutlet id o_sepia_ckb;
IBOutlet id o_sepia_lbl;
IBOutlet id o_sepia_fld;
IBOutlet id o_sepia_stp;
IBOutlet id o_noise_ckb;
IBOutlet id o_gradient_ckb;
IBOutlet id o_gradient_mode_lbl;
IBOutlet id o_gradient_mode_pop;
IBOutlet id o_gradient_color_ckb;
IBOutlet id o_gradient_cartoon_ckb;
IBOutlet id o_extract_ckb;
IBOutlet id o_extract_lbl;
IBOutlet id o_extract_fld;
IBOutlet id o_invert_ckb;
IBOutlet id o_posterize_ckb;
IBOutlet id o_posterize_lbl;
IBOutlet id o_posterize_fld;
IBOutlet id o_posterize_stp;
IBOutlet id o_blur_ckb;
IBOutlet id o_blur_sld;
IBOutlet id o_blur_lbl;
IBOutlet id o_motiondetect_ckb;
IBOutlet id o_watereffect_ckb;
IBOutlet id o_waves_ckb;
IBOutlet id o_psychedelic_ckb;
/* misc */
IBOutlet id o_addtext_ckb;
IBOutlet id o_addtext_text_fld;
IBOutlet id o_addtext_text_lbl;
IBOutlet id o_addtext_pos_lbl;
IBOutlet id o_addtext_pos_pop;
IBOutlet id o_addlogo_ckb;
IBOutlet id o_addlogo_logo_lbl;
IBOutlet id o_addlogo_logo_fld;
IBOutlet id o_addlogo_pos_lbl;
IBOutlet id o_addlogo_pos_pop;
IBOutlet id o_addlogo_transparency_lbl;
IBOutlet id o_addlogo_transparency_sld;
IBOutlet id o_anaglyph_ckb;
}
/* generic */
@property (readwrite, weak) IBOutlet NSWindow *window;
@property (readwrite, weak) IBOutlet NSTabView *tabView;
@property (readwrite, weak) IBOutlet NSPopUpButton *profilePopup;
/* basic */
@property (readwrite, weak) IBOutlet NSButton *adjustCheckbox;
@property (readwrite, weak) IBOutlet NSTextField *adjustHueLabel;
@property (readwrite, weak) IBOutlet NSSlider *adjustHueSlider;
@property (readwrite, weak) IBOutlet NSTextField *adjustContrastLabel;
@property (readwrite, weak) IBOutlet NSSlider *adjustContrastSlider;
@property (readwrite, weak) IBOutlet NSTextField *adjustBrightnessLabel;
@property (readwrite, weak) IBOutlet NSSlider *adjustBrightnessSlider;
@property (readwrite, weak) IBOutlet NSButton *adjustBrightnessCheckbox;
@property (readwrite, weak) IBOutlet NSTextField *adjustSaturationLabel;
@property (readwrite, weak) IBOutlet NSSlider *adjustSaturationSlider;
@property (readwrite, weak) IBOutlet NSTextField *adjustGammaLabel;
@property (readwrite, weak) IBOutlet NSSlider *adjustGammaSlider;
@property (readwrite, weak) IBOutlet NSButton *adjustResetButton;
@property (readwrite, weak) IBOutlet NSButton *sharpenCheckbox;
@property (readwrite, weak) IBOutlet NSTextField *sharpenLabel;
@property (readwrite, weak) IBOutlet NSSlider *sharpenSlider;
@property (readwrite, weak) IBOutlet NSButton *bandingCheckbox;
@property (readwrite, weak) IBOutlet NSTextField *bandingLabel;
@property (readwrite, weak) IBOutlet NSSlider *bandingSlider;
@property (readwrite, weak) IBOutlet NSButton *grainCheckbox;
@property (readwrite, weak) IBOutlet NSSlider *grainSlider;
@property (readwrite, weak) IBOutlet NSTextField *grainLabel;
/* crop */
@property (readwrite, weak) IBOutlet NSTextField *cropTopLabel;
@property (readwrite, weak) IBOutlet NSTextField *cropTopTextField;
@property (readwrite, weak) IBOutlet NSStepper *cropTopStepper;
@property (readwrite, weak) IBOutlet NSTextField *cropLeftLabel;
@property (readwrite, weak) IBOutlet NSTextField *cropLeftTextField;
@property (readwrite, weak) IBOutlet NSStepper *cropLeftStepper;
@property (readwrite, weak) IBOutlet NSTextField *cropRightLabel;
@property (readwrite, weak) IBOutlet NSTextField *cropRightTextField;
@property (readwrite, weak) IBOutlet NSStepper *cropRightStepper;
@property (readwrite, weak) IBOutlet NSTextField *cropBottomLabel;
@property (readwrite, weak) IBOutlet NSTextField *cropBottomTextField;
@property (readwrite, weak) IBOutlet NSStepper *cropBottomStepper;
@property (readwrite, weak) IBOutlet NSButton *cropSyncTopBottomCheckbox;
@property (readwrite, weak) IBOutlet NSButton *cropSyncLeftRightCheckbox;
/* geometry */
@property (readwrite, weak) IBOutlet NSButton *transformCheckbox;
@property (readwrite, weak) IBOutlet NSPopUpButton *transformPopup;
@property (readwrite, weak) IBOutlet NSButton *zoomCheckbox;
@property (readwrite, weak) IBOutlet NSButton *puzzleCheckbox;
@property (readwrite, weak) IBOutlet NSTextField *puzzleRowsLabel;
@property (readwrite, weak) IBOutlet NSTextField *puzzleRowsTextField;
@property (readwrite, weak) IBOutlet NSStepper *puzzleRowsStepper;
@property (readwrite, weak) IBOutlet NSTextField *puzzleColumnsLabel;
@property (readwrite, weak) IBOutlet NSTextField *puzzleColumnsTextField;
@property (readwrite, weak) IBOutlet NSStepper *puzzleColumnsStepper;
@property (readwrite, weak) IBOutlet NSButton *cloneCheckbox;
@property (readwrite, weak) IBOutlet NSTextField *cloneNumberTextField;
@property (readwrite, weak) IBOutlet NSStepper *cloneNumberStepper;
@property (readwrite, weak) IBOutlet NSTextField *cloneNumberLabel;
@property (readwrite, weak) IBOutlet NSButton *wallCheckbox;
@property (readwrite, weak) IBOutlet NSTextField *wallNumbersOfRowsTextField;
@property (readwrite, weak) IBOutlet NSStepper *wallNumbersOfRowsStepper;
@property (readwrite, weak) IBOutlet NSTextField *wallNumbersOfRowsLabel;
@property (readwrite, weak) IBOutlet NSTextField *wallNumberOfColumnsTextField;
@property (readwrite, weak) IBOutlet NSStepper *wallNumberOfColumnsStepper;
@property (readwrite, weak) IBOutlet NSTextField *wallNumberOfColumnsLabel;
/* color */
@property (readwrite, weak) IBOutlet NSButton *thresholdCheckbox;
@property (readwrite, weak) IBOutlet NSTextField *thresholdColorLabel;
@property (readwrite, weak) IBOutlet NSTextField *thresholdColorTextField;
@property (readwrite, weak) IBOutlet NSTextField *thresholdSaturationLabel;
@property (readwrite, weak) IBOutlet NSSlider *thresholdSaturationSlider;
@property (readwrite, weak) IBOutlet NSTextField *thresholdSimilarityLabel;
@property (readwrite, weak) IBOutlet NSSlider *thresholdSimilaritySlider;
@property (readwrite, weak) IBOutlet NSButton *sepiaCheckbox;
@property (readwrite, weak) IBOutlet NSTextField *sepiaLabel;
@property (readwrite, weak) IBOutlet NSTextField *sepiaTextField;
@property (readwrite, weak) IBOutlet NSStepper *sepiaStepper;
@property (readwrite, weak) IBOutlet NSButton *noiseCheckbox;
@property (readwrite, weak) IBOutlet NSButton *gradientCheckbox;
@property (readwrite, weak) IBOutlet NSTextField *gradientModeLabel;
@property (readwrite, weak) IBOutlet NSPopUpButton *gradientModePopup;
@property (readwrite, weak) IBOutlet NSButton *gradientColorCheckbox;
@property (readwrite, weak) IBOutlet NSButton *gradientCartoonCheckbox;
@property (readwrite, weak) IBOutlet NSButton *extractCheckbox;
@property (readwrite, weak) IBOutlet NSTextField *extractLabel;
@property (readwrite, weak) IBOutlet NSTextField *extractTextField;
@property (readwrite, weak) IBOutlet NSButton *invertCheckbox;
@property (readwrite, weak) IBOutlet NSButton *posterizeCheckbox;
@property (readwrite, weak) IBOutlet NSTextField *posterizeLabel;
@property (readwrite, weak) IBOutlet NSTextField *posterizeTextField;
@property (readwrite, weak) IBOutlet NSStepper *posterizeStepper;
@property (readwrite, weak) IBOutlet NSButton *blurCheckbox;
@property (readwrite, weak) IBOutlet NSSlider *blurSlider;
@property (readwrite, weak) IBOutlet NSTextField *blurLabel;
@property (readwrite, weak) IBOutlet NSButton *motiondetectCheckbox;
@property (readwrite, weak) IBOutlet NSButton *watereffectCheckbox;
@property (readwrite, weak) IBOutlet NSButton *wavesCheckbox;
@property (readwrite, weak) IBOutlet NSButton *psychedelicCheckbox;
/* misc */
@property (readwrite, weak) IBOutlet NSButton *addTextCheckbox;
@property (readwrite, weak) IBOutlet NSTextField *addTextTextTextField;
@property (readwrite, weak) IBOutlet NSTextField *addTextTextLabel;
@property (readwrite, weak) IBOutlet NSTextField *addTextPositionLabel;
@property (readwrite, weak) IBOutlet NSPopUpButton *addTextPositionPopup;
@property (readwrite, weak) IBOutlet NSButton *addLogoCheckbox;
@property (readwrite, weak) IBOutlet NSTextField *addLogoLogoLabel;
@property (readwrite, weak) IBOutlet NSTextField *addLogoLogoTextField;
@property (readwrite, weak) IBOutlet NSTextField *addLogoPositionLabel;
@property (readwrite, weak) IBOutlet NSPopUpButton *addLogoPositionPopup;
@property (readwrite, weak) IBOutlet NSTextField *addLogoTransparencyLabel;
@property (readwrite, weak) IBOutlet NSSlider *addLogoTransparencySlider;
@property (readwrite, weak) IBOutlet NSButton *anaglyphCheckbox;
/* text field / stepper binding values */
/* use setter to modify gui elements */
......@@ -165,13 +164,10 @@
/* generic */
+ (VLCVideoEffects *)sharedInstance;
- (void)updateCocoaWindowLevel:(NSInteger)i_level;
- (void)saveCurrentProfile;
- (IBAction)toggleWindow:(id)sender;
- (void)toggleWindow:(id)sender;
- (IBAction)profileSelectorAction:(id)sender;
- (IBAction)addProfile:(id)sender;
- (IBAction)removeProfile:(id)sender;
/* basic */
- (IBAction)enableAdjust:(id)sender;
......
/*****************************************************************************
* VideoEffects.m: MacOS X interface module
*****************************************************************************
* Copyright (C) 2011-2012 Felix Paul Kühne
* Copyright (C) 2011-2015 Felix Paul Kühne
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org>
......@@ -29,10 +29,8 @@
@interface VLCVideoEffects()
{
intf_thread_t *p_intf;
NSInteger i_old_profile_index;
}
- (void)resetProfileSelector;
@end
#pragma mark -
......@@ -62,7 +60,6 @@
- (id)init
{
self = [super init];
p_intf = VLCIntf;
i_old_profile_index = -1;
return self;
......@@ -70,139 +67,139 @@
- (void)awakeFromNib
{
[o_window setTitle: _NS("Video Effects")];
[o_window setExcludedFromWindowsMenu:YES];
[o_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
[_window setTitle: _NS("Video Effects")];
[_window setExcludedFromWindowsMenu:YES];
[_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
[[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"basic"]] setLabel:_NS("Basic")];
[[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"crop"]] setLabel:_NS("Crop")];
[[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"geometry"]] setLabel:_NS("Geometry")];
[[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"color"]] setLabel:_NS("Color")];
[[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"misc"]] setLabel:_NS("Miscellaneous")];
[[_tabView tabViewItemAtIndex:[_tabView indexOfTabViewItemWithIdentifier:@"basic"]] setLabel:_NS("Basic")];
[[_tabView tabViewItemAtIndex:[_tabView indexOfTabViewItemWithIdentifier:@"crop"]] setLabel:_NS("Crop")];
[[_tabView tabViewItemAtIndex:[_tabView indexOfTabViewItemWithIdentifier:@"geometry"]] setLabel:_NS("Geometry")];
[[_tabView tabViewItemAtIndex:[_tabView indexOfTabViewItemWithIdentifier:@"color"]] setLabel:_NS("Color")];
[[_tabView tabViewItemAtIndex:[_tabView indexOfTabViewItemWithIdentifier:@"misc"]] setLabel:_NS("Miscellaneous")];
[self resetProfileSelector];
[o_adjust_ckb setTitle:_NS("Image Adjust")];
[o_adjust_hue_lbl setStringValue:_NS("Hue")];
[o_adjust_contrast_lbl setStringValue:_NS("Contrast")];
[o_adjust_brightness_lbl setStringValue:_NS("Brightness")];
[o_adjust_brightness_ckb setTitle:_NS("Brightness Threshold")];
[o_adjust_saturation_lbl setStringValue:_NS("Saturation")];
[o_adjust_gamma_lbl setStringValue:_NS("Gamma")];
[o_adjust_reset_btn setTitle: _NS("Reset")];
[o_sharpen_ckb setTitle:_NS("Sharpen")];
[o_sharpen_lbl setStringValue:_NS("Sigma")];
[o_banding_ckb setTitle:_NS("Banding removal")];
[o_banding_lbl setStringValue:_NS("Radius")];
[o_grain_ckb setTitle:_NS("Film Grain")];
[o_grain_lbl setStringValue:_NS("Variance")];
[o_crop_top_lbl setStringValue:_NS("Top")];
[o_crop_left_lbl setStringValue:_NS("Left")];
[o_crop_right_lbl setStringValue:_NS("Right")];
[o_crop_bottom_lbl setStringValue:_NS("Bottom")];
[o_crop_sync_top_bottom_ckb setTitle:_NS("Synchronize top and bottom")];
[o_crop_sync_left_right_ckb setTitle:_NS("Synchronize left and right")];
[o_transform_ckb setTitle:_NS("Transform")];
[o_transform_pop removeAllItems];
[o_transform_pop addItemWithTitle: _NS("Rotate by 90 degrees")];
[[o_transform_pop lastItem] setTag: 90];
[o_transform_pop addItemWithTitle: _NS("Rotate by 180 degrees")];
[[o_transform_pop lastItem] setTag: 180];
[o_transform_pop addItemWithTitle: _NS("Rotate by 270 degrees")];
[[o_transform_pop lastItem] setTag: 270];
[o_transform_pop addItemWithTitle: _NS("Flip horizontally")];
[[o_transform_pop lastItem] setTag: 1];
[o_transform_pop addItemWithTitle: _NS("Flip vertically")];
[[o_transform_pop lastItem] setTag: 2];
[o_zoom_ckb setTitle:_NS("Magnification/Zoom")];
[o_puzzle_ckb setTitle:_NS("Puzzle game")];
[o_puzzle_rows_lbl setStringValue:_NS("Rows")];
[o_puzzle_columns_lbl setStringValue:_NS("Columns")];
[o_clone_ckb setTitle:_NS("Clone")];
[o_clone_number_lbl setStringValue:_NS("Number of clones")];
[o_wall_ckb setTitle:_NS("Wall")];
[o_wall_numofrows_lbl setStringValue:_NS("Rows")];
[o_wall_numofcols_lbl setStringValue:_NS("Columns")];
[o_threshold_ckb setTitle:_NS("Color threshold")];
[o_threshold_color_lbl setStringValue:_NS("Color")];
[o_threshold_saturation_lbl setStringValue:_NS("Saturation")];
[o_threshold_similarity_lbl setStringValue:_NS("Similarity")];
[o_sepia_ckb setTitle:_NS("Sepia")];
[o_sepia_lbl setStringValue:_NS("Intensity")];
[o_noise_ckb setTitle:_NS("Noise")];
[o_gradient_ckb setTitle:_NS("Gradient")];
[o_gradient_mode_lbl setStringValue:_NS("Mode")];
[o_gradient_mode_pop removeAllItems];
[o_gradient_mode_pop addItemWithTitle: _NS("Gradient")];
[[o_gradient_mode_pop lastItem] setTag: 1];
[o_gradient_mode_pop addItemWithTitle: _NS("Edge")];
[[o_gradient_mode_pop lastItem] setTag: 2];
[o_gradient_mode_pop addItemWithTitle: _NS("Hough")];
[[o_gradient_mode_pop lastItem] setTag: 3];
[o_gradient_color_ckb setTitle:_NS("Color")];
[o_gradient_cartoon_ckb setTitle:_NS("Cartoon")];
[o_extract_ckb setTitle:_NS("Color extraction")];
[o_extract_lbl setStringValue:_NS("Color")];
[o_invert_ckb setTitle:_NS("Invert colors")];
[o_posterize_ckb setTitle:_NS("Posterize")];
[o_posterize_lbl setStringValue:_NS("Posterize level")];
[o_blur_ckb setTitle:_NS("Motion blur")];
[o_blur_lbl setStringValue:_NS("Factor")];
[o_motiondetect_ckb setTitle:_NS("Motion Detect")];
[o_watereffect_ckb setTitle:_NS("Water effect")];
[o_waves_ckb setTitle:_NS("Waves")];
[o_psychedelic_ckb setTitle:_NS("Psychedelic")];
[o_anaglyph_ckb setTitle:_NS("Anaglyph")];
[o_addtext_ckb setTitle:_NS("Add text")];
[o_addtext_text_lbl setStringValue:_NS("Text")];
[o_addtext_pos_lbl setStringValue:_NS("Position")];
[o_addtext_pos_pop removeAllItems];
[o_addtext_pos_pop addItemWithTitle: _NS("Center")];
[[o_addtext_pos_pop lastItem] setTag: 0];
[o_addtext_pos_pop addItemWithTitle: _NS("Left")];
[[o_addtext_pos_pop lastItem] setTag: 1];
[o_addtext_pos_pop addItemWithTitle: _NS("Right")];
[[o_addtext_pos_pop lastItem] setTag: 2];
[o_addtext_pos_pop addItemWithTitle: _NS("Top")];
[[o_addtext_pos_pop lastItem] setTag: 4];
[o_addtext_pos_pop addItemWithTitle: _NS("Bottom")];
[[o_addtext_pos_pop lastItem] setTag: 8];
[o_addtext_pos_pop addItemWithTitle: _NS("Top-Left")];
[[o_addtext_pos_pop lastItem] setTag: 5];
[o_addtext_pos_pop addItemWithTitle: _NS("Top-Right")];
[[o_addtext_pos_pop lastItem] setTag: 6];
[o_addtext_pos_pop addItemWithTitle: _NS("Bottom-Left")];
[[o_addtext_pos_pop lastItem] setTag: 9];
[o_addtext_pos_pop addItemWithTitle: _NS("Bottom-Right")];
[[o_addtext_pos_pop lastItem] setTag: 10];
[o_addlogo_ckb setTitle:_NS("Add logo")];
[o_addlogo_logo_lbl setStringValue:_NS("Logo")];
[o_addlogo_pos_lbl setStringValue:_NS("Position")];
[o_addlogo_pos_pop removeAllItems];
[o_addlogo_pos_pop addItemWithTitle: _NS("Center")];
[[o_addlogo_pos_pop lastItem] setTag: 0];
[o_addlogo_pos_pop addItemWithTitle: _NS("Left")];
[[o_addlogo_pos_pop lastItem] setTag: 1];
[o_addlogo_pos_pop addItemWithTitle: _NS("Right")];
[[o_addlogo_pos_pop lastItem] setTag: 2];
[o_addlogo_pos_pop addItemWithTitle: _NS("Top")];
[[o_addlogo_pos_pop lastItem] setTag: 4];
[o_addlogo_pos_pop addItemWithTitle: _NS("Bottom")];
[[o_addlogo_pos_pop lastItem] setTag: 8];
[o_addlogo_pos_pop addItemWithTitle: _NS("Top-Left")];
[[o_addlogo_pos_pop lastItem] setTag: 5];
[o_addlogo_pos_pop addItemWithTitle: _NS("Top-Right")];
[[o_addlogo_pos_pop lastItem] setTag: 6];
[o_addlogo_pos_pop addItemWithTitle: _NS("Bottom-Left")];
[[o_addlogo_pos_pop lastItem] setTag: 9];
[o_addlogo_pos_pop addItemWithTitle: _NS("Bottom-Right")];
[[o_addlogo_pos_pop lastItem] setTag: 10];
[o_addlogo_transparency_lbl setStringValue:_NS("Transparency")];
[o_tableView selectFirstTabViewItem:self];
[_adjustCheckbox setTitle:_NS("Image Adjust")];
[_adjustHueLabel setStringValue:_NS("Hue")];
[_adjustContrastLabel setStringValue:_NS("Contrast")];
[_adjustBrightnessLabel setStringValue:_NS("Brightness")];
[_adjustBrightnessCheckbox setTitle:_NS("Brightness Threshold")];
[_adjustSaturationLabel setStringValue:_NS("Saturation")];
[_adjustGammaLabel setStringValue:_NS("Gamma")];
[_adjustResetButton setTitle: _NS("Reset")];
[_sharpenCheckbox setTitle:_NS("Sharpen")];
[_sharpenLabel setStringValue:_NS("Sigma")];
[_bandingCheckbox setTitle:_NS("Banding removal")];
[_bandingLabel setStringValue:_NS("Radius")];
[_grainCheckbox setTitle:_NS("Film Grain")];
[_grainLabel setStringValue:_NS("Variance")];
[_cropTopLabel setStringValue:_NS("Top")];
[_cropLeftLabel setStringValue:_NS("Left")];
[_cropRightLabel setStringValue:_NS("Right")];
[_cropBottomLabel setStringValue:_NS("Bottom")];
[_cropSyncTopBottomCheckbox setTitle:_NS("Synchronize top and bottom")];
[_cropSyncLeftRightCheckbox setTitle:_NS("Synchronize left and right")];
[_transformCheckbox setTitle:_NS("Transform")];
[_transformPopup removeAllItems];
[_transformPopup addItemWithTitle: _NS("Rotate by 90 degrees")];
[[_transformPopup lastItem] setTag: 90];
[_transformPopup addItemWithTitle: _NS("Rotate by 180 degrees")];
[[_transformPopup lastItem] setTag: 180];
[_transformPopup addItemWithTitle: _NS("Rotate by 270 degrees")];
[[_transformPopup lastItem] setTag: 270];
[_transformPopup addItemWithTitle: _NS("Flip horizontally")];
[[_transformPopup lastItem] setTag: 1];
[_transformPopup addItemWithTitle: _NS("Flip vertically")];
[[_transformPopup lastItem] setTag: 2];
[_zoomCheckbox setTitle:_NS("Magnification/Zoom")];
[_puzzleCheckbox setTitle:_NS("Puzzle game")];
[_puzzleRowsLabel setStringValue:_NS("Rows")];
[_puzzleColumnsLabel setStringValue:_NS("Columns")];
[_cloneCheckbox setTitle:_NS("Clone")];
[_cloneNumberLabel setStringValue:_NS("Number of clones")];
[_wallCheckbox setTitle:_NS("Wall")];
[_wallNumbersOfRowsLabel setStringValue:_NS("Rows")];
[_wallNumberOfColumnsLabel setStringValue:_NS("Columns")];
[_thresholdCheckbox setTitle:_NS("Color threshold")];
[_thresholdColorLabel setStringValue:_NS("Color")];
[_thresholdSaturationLabel setStringValue:_NS("Saturation")];
[_thresholdSimilarityLabel setStringValue:_NS("Similarity")];
[_sepiaCheckbox setTitle:_NS("Sepia")];
[_sepiaLabel setStringValue:_NS("Intensity")];
[_noiseCheckbox setTitle:_NS("Noise")];
[_gradientCheckbox setTitle:_NS("Gradient")];
[_gradientModeLabel setStringValue:_NS("Mode")];
[_gradientModePopup removeAllItems];
[_gradientModePopup addItemWithTitle: _NS("Gradient")];
[[_gradientModePopup lastItem] setTag: 1];
[_gradientModePopup addItemWithTitle: _NS("Edge")];
[[_gradientModePopup lastItem] setTag: 2];
[_gradientModePopup addItemWithTitle: _NS("Hough")];
[[_gradientModePopup lastItem] setTag: 3];
[_gradientColorCheckbox setTitle:_NS("Color")];
[_gradientCartoonCheckbox setTitle:_NS("Cartoon")];
[_extractCheckbox setTitle:_NS("Color extraction")];
[_extractLabel setStringValue:_NS("Color")];
[_invertCheckbox setTitle:_NS("Invert colors")];
[_posterizeCheckbox setTitle:_NS("Posterize")];
[_posterizeLabel setStringValue:_NS("Posterize level")];
[_blurCheckbox setTitle:_NS("Motion blur")];
[_blurLabel setStringValue:_NS("Factor")];
[_motiondetectCheckbox setTitle:_NS("Motion Detect")];
[_watereffectCheckbox setTitle:_NS("Water effect")];
[_wavesCheckbox setTitle:_NS("Waves")];
[_psychedelicCheckbox setTitle:_NS("Psychedelic")];
[_anaglyphCheckbox setTitle:_NS("Anaglyph")];
[_addTextCheckbox setTitle:_NS("Add text")];
[_addTextTextLabel setStringValue:_NS("Text")];
[_addTextPositionLabel setStringValue:_NS("Position")];
[_addTextPositionPopup removeAllItems];
[_addTextPositionPopup addItemWithTitle: _NS("Center")];
[[_addTextPositionPopup lastItem] setTag: 0];
[_addTextPositionPopup addItemWithTitle: _NS("Left")];
[[_addTextPositionPopup lastItem] setTag: 1];
[_addTextPositionPopup addItemWithTitle: _NS("Right")];
[[_addTextPositionPopup lastItem] setTag: 2];
[_addTextPositionPopup addItemWithTitle: _NS("Top")];
[[_addTextPositionPopup lastItem] setTag: 4];
[_addTextPositionPopup addItemWithTitle: _NS("Bottom")];
[[_addTextPositionPopup lastItem] setTag: 8];
[_addTextPositionPopup addItemWithTitle: _NS("Top-Left")];
[[_addTextPositionPopup lastItem] setTag: 5];
[_addTextPositionPopup addItemWithTitle: _NS("Top-Right")];
[[_addTextPositionPopup lastItem] setTag: 6];
[_addTextPositionPopup addItemWithTitle: _NS("Bottom-Left")];
[[_addTextPositionPopup lastItem] setTag: 9];
[_addTextPositionPopup addItemWithTitle: _NS("Bottom-Right")];
[[_addTextPositionPopup lastItem] setTag: 10];
[_addLogoCheckbox setTitle:_NS("Add logo")];
[_addLogoLogoLabel setStringValue:_NS("Logo")];
[_addLogoPositionLabel setStringValue:_NS("Position")];
[_addLogoPositionPopup removeAllItems];
[_addLogoPositionPopup addItemWithTitle: _NS("Center")];
[[_addLogoPositionPopup lastItem] setTag: 0];
[_addLogoPositionPopup addItemWithTitle: _NS("Left")];
[[_addLogoPositionPopup lastItem] setTag: 1];
[_addLogoPositionPopup addItemWithTitle: _NS("Right")];
[[_addLogoPositionPopup lastItem] setTag: 2];
[_addLogoPositionPopup addItemWithTitle: _NS("Top")];
[[_addLogoPositionPopup lastItem] setTag: 4];
[_addLogoPositionPopup addItemWithTitle: _NS("Bottom")];
[[_addLogoPositionPopup lastItem] setTag: 8];
[_addLogoPositionPopup addItemWithTitle: _NS("Top-Left")];
[[_addLogoPositionPopup lastItem] setTag: 5];
[_addLogoPositionPopup addItemWithTitle: _NS("Top-Right")];
[[_addLogoPositionPopup lastItem] setTag: 6];
[_addLogoPositionPopup addItemWithTitle: _NS("Bottom-Left")];
[[_addLogoPositionPopup lastItem] setTag: 9];
[_addLogoPositionPopup addItemWithTitle: _NS("Bottom-Right")];
[[_addLogoPositionPopup lastItem] setTag: 10];
[_addLogoTransparencyLabel setStringValue:_NS("Transparency")];
[_tabView selectFirstTabViewItem:self];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(inputChangedEvent:)
......@@ -220,8 +217,8 @@
- (void)updateCocoaWindowLevel:(NSInteger)i_level
{
if (o_window && [o_window isVisible] && [o_window level] != i_level)
[o_window setLevel: i_level];
if (_window && [_window isVisible] && [_window level] != i_level)
[_window setLevel: i_level];
}
#pragma mark -
......@@ -239,28 +236,29 @@
- (void)resetProfileSelector
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[o_profile_pop removeAllItems];
[_profilePopup removeAllItems];
NSArray * profileNames = [defaults objectForKey:@"VideoEffectProfileNames"];
[o_profile_pop addItemsWithTitles:profileNames];
NSArray *profileNames = [defaults objectForKey:@"VideoEffectProfileNames"];
[_profilePopup addItemsWithTitles:profileNames];
[[o_profile_pop menu] addItem:[NSMenuItem separatorItem]];
[o_profile_pop addItemWithTitle:_NS("Duplicate current profile...")];
[[o_profile_pop lastItem] setTarget: self];
[[o_profile_pop lastItem] setAction: @selector(addProfile:)];
[[_profilePopup menu] addItem:[NSMenuItem separatorItem]];
[_profilePopup addItemWithTitle:_NS("Duplicate current profile...")];
[[_profilePopup lastItem] setTarget: self];
[[_profilePopup lastItem] setAction: @selector(addProfile:)];
if ([profileNames count] > 1) {
[o_profile_pop addItemWithTitle:_NS("Organize profiles...")];
[[o_profile_pop lastItem] setTarget: self];
[[o_profile_pop lastItem] setAction: @selector(removeProfile:)];
[_profilePopup addItemWithTitle:_NS("Organize profiles...")];
[[_profilePopup lastItem] setTarget: self];
[[_profilePopup lastItem] setAction: @selector(removeProfile:)];
}
[o_profile_pop selectItemAtIndex:[defaults integerForKey:@"VideoEffectSelectedProfile"]];
[_profilePopup selectItemAtIndex:[defaults integerForKey:@"VideoEffectSelectedProfile"]];
[self profileSelectorAction:self];
}
- (void)resetValues
{
intf_thread_t *p_intf = VLCIntf;
NSString *tmpString;
char *tmpChar;
BOOL b_state;
......@@ -269,240 +267,246 @@
char * psz_vfilters;
psz_vfilters = config_GetPsz(p_intf, "video-filter");
if (psz_vfilters) {
[o_adjust_ckb setState: (NSInteger)strstr(psz_vfilters, "adjust")];
[o_sharpen_ckb setState: (NSInteger)strstr(psz_vfilters, "sharpen")];
[o_banding_ckb setState: (NSInteger)strstr(psz_vfilters, "gradfun")];
[o_grain_ckb setState: (NSInteger)strstr(psz_vfilters, "grain")];
[o_transform_ckb setState: (NSInteger)strstr(psz_vfilters, "transform")];
[o_zoom_ckb setState: (NSInteger)strstr(psz_vfilters, "magnify")];
[o_puzzle_ckb setState: (NSInteger)strstr(psz_vfilters, "puzzle")];
[o_threshold_ckb setState: (NSInteger)strstr(psz_vfilters, "colorthres")];
[o_sepia_ckb setState: (NSInteger)strstr(psz_vfilters, "sepia")];
[o_noise_ckb setState: (NSInteger)strstr(psz_vfilters, "noise")];
[o_gradient_ckb setState: (NSInteger)strstr(psz_vfilters, "gradient")];
[o_extract_ckb setState: (NSInteger)strstr(psz_vfilters, "extract")];
[o_invert_ckb setState: (NSInteger)strstr(psz_vfilters, "invert")];
[o_posterize_ckb setState: (NSInteger)strstr(psz_vfilters, "posterize")];
[o_blur_ckb setState: (NSInteger)strstr(psz_vfilters, "motionblur")];
[o_motiondetect_ckb setState: (NSInteger)strstr(psz_vfilters, "motiondetect")];
[o_watereffect_ckb setState: (NSInteger)strstr(psz_vfilters, "ripple")];
[o_waves_ckb setState: (NSInteger)strstr(psz_vfilters, "wave")];
[o_psychedelic_ckb setState: (NSInteger)strstr(psz_vfilters, "psychedelic")];
[o_anaglyph_ckb setState: (NSInteger)strstr(psz_vfilters, "anaglyph")];
[_adjustCheckbox setState: (NSInteger)strstr(psz_vfilters, "adjust")];
[_sharpenCheckbox setState: (NSInteger)strstr(psz_vfilters, "sharpen")];
[_bandingCheckbox setState: (NSInteger)strstr(psz_vfilters, "gradfun")];
[_grainCheckbox setState: (NSInteger)strstr(psz_vfilters, "grain")];
[_transformCheckbox setState: (NSInteger)strstr(psz_vfilters, "transform")];
[_zoomCheckbox setState: (NSInteger)strstr(psz_vfilters, "magnify")];
[_puzzleCheckbox setState: (NSInteger)strstr(psz_vfilters, "puzzle")];
[_thresholdCheckbox setState: (NSInteger)strstr(psz_vfilters, "colorthres")];
[_sepiaCheckbox setState: (NSInteger)strstr(psz_vfilters, "sepia")];
[_noiseCheckbox setState: (NSInteger)strstr(psz_vfilters, "noise")];
[_gradientCheckbox setState: (NSInteger)strstr(psz_vfilters, "gradient")];
[_extractCheckbox setState: (NSInteger)strstr(psz_vfilters, "extract")];
[_invertCheckbox setState: (NSInteger)strstr(psz_vfilters, "invert")];
[_posterizeCheckbox setState: (NSInteger)strstr(psz_vfilters, "posterize")];
[_blurCheckbox setState: (NSInteger)strstr(psz_vfilters, "motionblur")];
[_motiondetectCheckbox setState: (NSInteger)strstr(psz_vfilters, "motiondetect")];
[_watereffectCheckbox setState: (NSInteger)strstr(psz_vfilters, "ripple")];
[_wavesCheckbox setState: (NSInteger)strstr(psz_vfilters, "wave")];
[_psychedelicCheckbox setState: (NSInteger)strstr(psz_vfilters, "psychedelic")];
[_anaglyphCheckbox setState: (NSInteger)strstr(psz_vfilters, "anaglyph")];
free(psz_vfilters);
} else {
[o_adjust_ckb setState: NSOffState];
[o_sharpen_ckb setState: NSOffState];
[o_banding_ckb setState: NSOffState];
[o_grain_ckb setState: NSOffState];
[o_transform_ckb setState: NSOffState];
</