Commit 5048ad23 authored by David Fuhrmann's avatar David Fuhrmann Committed by Jean-Baptiste Kempf

macosx: add input changed event and reset shown crop values for new input

(cherry picked from commit 84d73bcd127eaf259f358a2b823802c93732ac55)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 691c2d31
......@@ -208,9 +208,22 @@ static VLCVideoEffects *_o_sharedInstance = nil;
[o_tableView selectFirstTabViewItem:self];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(inputChangedEvent:)
name:VLCInputChangedNotification
object:nil];
[self resetValues];
}
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc];
}
- (void)updateCocoaWindowLevel:(NSInteger)i_level
{
if (o_window && [o_window isVisible] && [o_window level] != i_level)
......@@ -219,6 +232,16 @@ static VLCVideoEffects *_o_sharedInstance = nil;
#pragma mark -
#pragma mark internal functions
-(void)inputChangedEvent:(NSNotification *)o_notification
{
// reset crop values when input changed
[self setCropBottomValue:0];
[self setCropTopValue:0];
[self setCropLeftValue:0];
[self setCropRightValue:0];
}
- (void)resetProfileSelector
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
......
......@@ -57,6 +57,7 @@ vout_thread_t *getVout(void);
vout_thread_t *getVoutForActiveWindow(void);
audio_output_t *getAout(void);
static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
/*****************************************************************************
* VLCMain interface
......
......@@ -1274,6 +1274,9 @@ static bool f_appExit = false;
p_current_input = NULL;
[o_mainmenu setRateControlsEnabled: NO];
[[NSNotificationCenter defaultCenter] postNotificationName:VLCInputChangedNotification
object:nil];
}
else if (!p_current_input) {
// object is hold here and released then it is dead
......@@ -1290,6 +1293,9 @@ static bool f_appExit = false;
p_input_changed = vlc_object_hold(p_current_input);
[[self playlist] continuePlaybackWhereYouLeftOff:p_current_input];
[[NSNotificationCenter defaultCenter] postNotificationName:VLCInputChangedNotification
object:nil];
}
}
......
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