]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/fspanel.m
macosx: updated applescript binding to current API
[vlc] / modules / gui / macosx / fspanel.m
index 7b31e6ec34939feb8e90fc6f99f6b61b552a0d2b..92505b79e64f60e639c3d68648810988d64cde10 100644 (file)
@@ -26,7 +26,7 @@
  * Preamble
  *****************************************************************************/
 #import "intf.h"
-#import "controls.h"
+#import "CoreInteraction.h"
 #import "vout.h"
 #import "misc.h"
 #import "fspanel.h"
          object: NSApp];
 }
 
-/* Windows created with NSBorderlessWindowMask normally can't be key, but we want ours to be */
+/* make sure that we don't become key, since we can't handle hotkeys */
 - (BOOL)canBecomeKeyWindow
 {
-    return YES;
+    return NO;
 }
 
 - (BOOL)mouseDownCanMoveWindow
 
 - (void)setActive:(id)noData
 {
-    if( [[[VLCMain sharedInstance] controls] voutView] != nil )
+    if( [[VLCCoreInteraction sharedInstance] voutView] != nil )
     {
-        if( [[[[VLCMain sharedInstance] controls] voutView] isFullscreen] )
+        if( [[[VLCCoreInteraction sharedInstance] voutView] isFullscreen] )
         {
             b_nonActive = NO;
             [self fadeIn];
 - (void)mouseExited:(NSEvent *)theEvent
 {
     /* give up our focus, so the vout may show us again without letting the user clicking it */
-    if( [[[[VLCMain sharedInstance] controls] voutView] isFullscreen] )
-        [[[[[VLCMain sharedInstance] controls] voutView] window] makeKeyWindow];
+    if( [[[VLCCoreInteraction sharedInstance] voutView] isFullscreen] )
+        [[[[VLCCoreInteraction sharedInstance] voutView] window] makeKeyWindow];
 }
 
 - (void)hideMouse
     [o_button setAction: @selector(action:)];                                                   \
     [self addSubview:o_button];
 
-#define addTextfield( o_text, align, font, color, size )                                    \
-    o_text = [[NSTextField alloc] initWithFrame: s_rc];                            \
+#define addTextfield( class, o_text, align, font, color, size )                                    \
+    o_text = [[class alloc] initWithFrame: s_rc];                            \
     [o_text setDrawsBackground: NO];                                                        \
     [o_text setBordered: NO];                                                               \
     [o_text setEditable: NO];                                                               \
     s_rc.origin.y = 64;
     s_rc.size.width = 352;
     s_rc.size.height = 14;
-    addTextfield( o_streamTitle_txt, NSCenterTextAlignment, systemFontOfSize, whiteColor, 0 );
-    s_rc.origin.x = 486;
+    addTextfield( NSTextField, o_streamTitle_txt, NSCenterTextAlignment, systemFontOfSize, whiteColor, 0 );
+    s_rc.origin.x = 481;
     s_rc.origin.y = 64;
-    s_rc.size.width = 50;
-    addTextfield( o_streamPosition_txt, NSRightTextAlignment, systemFontOfSize, whiteColor, 0 );
+    s_rc.size.width = 55;
+    addTextfield( VLCTimeField, o_streamPosition_txt, NSRightTextAlignment, systemFontOfSize, whiteColor, 0 );
 
     return view;
 }
 
 - (IBAction)fsTimeSliderUpdate:(id)sender
 {
-    [[VLCMain sharedInstance] timesliderUpdate: sender];
+    input_thread_t * p_input;
+    p_input = pl_CurrentInput( VLCIntf );
+    if( p_input != NULL )
+    {
+        vlc_value_t pos;
+
+        pos.f_float = [o_fs_timeSlider floatValue] / 10000.;
+        var_Set( p_input, "position", pos );
+        vlc_object_release( p_input );
+    }
+    [[VLCMain sharedInstance] updatePlaybackPosition];
 }
 
 - (IBAction)fsVolumeSliderUpdate:(id)sender
 {
-    [[[VLCMain sharedInstance] controls] volumeSliderUpdated: sender];
+    [[VLCCoreInteraction sharedInstance] setVolume: [sender intValue]];
 }
 
 #define addImage(image, _x, _y, mode, _width)                                               \