Commit 496bd7cd authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: respond to updated synchro values

parent 9d00cb58
......@@ -54,6 +54,7 @@
IBOutlet id o_video_view;
IBOutlet id o_split_view;
IBOutlet id o_sidebar_view;
IBOutlet id o_chosen_category_lbl;
BOOL b_dark_interface;
BOOL b_video_playback_enabled;
......@@ -97,7 +98,7 @@
- (void)updateTimeSlider;
- (void)updateVolumeSlider;
- (void)updateWindow;
- (void)updateTitle;
- (void)updateName;
- (void)setPause;
- (void)setPlay;
- (void)setRepeatOne;
......
......@@ -62,25 +62,13 @@ static VLCMainWindow *_o_sharedInstance = nil;
- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)styleMask
backing:(NSBackingStoreType)backingType defer:(BOOL)flag
{
/* FIXME: this should enable the SnowLeopard window style, however, it leads to ugly artifacts
* needs some further investigation! -- feepk */
BOOL b_useTextured = YES;
if( [[NSWindow class] instancesRespondToSelector:@selector(setContentBorderThickness:forEdge:)] )
{
b_useTextured = NO;
// styleMask ^= NSTexturedBackgroundWindowMask;
}
self = [super initWithContentRect:contentRect styleMask:styleMask //& ~NSTitledWindowMask
backing:backingType defer:flag];
[[VLCMain sharedInstance] updateTogglePlaylistState];
// FIXME: see above...
if(! b_useTextured )
[self setContentBorderThickness:28.0 forEdge:NSMinYEdge];
/* we want to be moveable regardless of our style */
[self setMovableByWindowBackground: YES];
......@@ -219,21 +207,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
[self updateVolumeSlider];
}
- (void)becomeMainWindow
{
[o_sidebar_view setBackgroundColor: [NSColor colorWithCalibratedRed:0.820
green:0.843
blue:0.886
alpha:1.0]];
[super becomeMainWindow];
}
- (void)resignMainWindow
{
[o_sidebar_view setBackgroundColor: [NSColor colorWithCalibratedWhite:0.91 alpha:1.0]];
[super resignMainWindow];
}
#pragma mark -
#pragma mark Button Actions
......@@ -462,7 +435,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
}
}
- (void)updateTitle
- (void)updateName
{
input_thread_t * p_input;
......
......@@ -54,6 +54,7 @@
+ (VLCTrackSynchronization *)sharedInstance;
- (IBAction)toggleWindow:(id)sender;
- (IBAction)resetValues:(id)sender;
- (void)updateValues;
/* Audio / Video */
- (IBAction)avValueChanged:(id)sender;
......
......@@ -89,6 +89,19 @@ static VLCTrackSynchronization *_o_sharedInstance = nil;
}
}
- (void)updateValues
{
input_thread_t * p_input = pl_CurrentInput( p_intf );
if( p_input )
{
[o_av_value_fld setFloatValue: var_GetTime( p_input, "audio-delay" ) / 1000000];
[o_sv_advance_value_fld setFloatValue: var_GetTime( p_input, "spu-delay" ) / 1000000];
[o_sv_speed_value_fld setFloatValue: var_GetFloat( p_input, "sub-fps" )];
vlc_object_release( p_input );
}
}
- (IBAction)avValueChanged:(id)sender
{
if( sender == o_av_minus_btn )
......
......@@ -176,10 +176,11 @@ struct intf_sys_t
- (void)playbackModeUpdated;
- (void)updateVolume;
- (void)updatePlaybackPosition;
- (void)updateTitle;
- (void)updateName;
- (void)playlistUpdated;
- (void)updateInfoandMetaPanel;
- (void)updateMainWindow;
- (void)updateDelays;
- (void)initStrings;
- (BOOL)application:(NSApplication *)o_app openFile:(NSString *)o_filename;
......
......@@ -57,6 +57,7 @@
#import "eyetv.h"
#import "simple_prefs.h"
#import "CoreInteraction.h"
#import "TrackSynchronization.h"
#import <AddressBook/AddressBook.h> /* for crashlog send mechanism */
#import <Sparkle/Sparkle.h> /* we're the update delegate */
......@@ -261,7 +262,7 @@ static int InputEvent( vlc_object_t *p_this, const char *psz_var,
break;
case INPUT_EVENT_ITEM_META:
case INPUT_EVENT_ITEM_INFO:
[[VLCMain sharedInstance] updateTitle];
[[VLCMain sharedInstance] updateName];
[[VLCMain sharedInstance] updateInfoandMetaPanel];
break;
case INPUT_EVENT_BOOKMARK:
......@@ -276,11 +277,12 @@ static int InputEvent( vlc_object_t *p_this, const char *psz_var,
break;
case INPUT_EVENT_ITEM_NAME:
[[VLCMain sharedInstance] updateTitle];
[[VLCMain sharedInstance] updateName];
break;
case INPUT_EVENT_AUDIO_DELAY:
case INPUT_EVENT_SUBTITLE_DELAY:
[[VLCMain sharedInstance] updateDelays];
break;
case INPUT_EVENT_DEAD:
......@@ -1231,9 +1233,14 @@ unsigned int CocoaKeyToVLC( unichar i_key )
[o_mainwindow updateWindow];
}
- (void)updateTitle
- (void)updateDelays
{
[o_mainwindow updateTitle];
[[VLCTrackSynchronization sharedInstance] performSelectorOnMainThread: @selector(updateValues) withObject: nil waitUntilDone:NO];
}
- (void)updateName
{
[o_mainwindow updateName];
}
- (void)updatePlaybackPosition
......
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