]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/controls.m
macosx: playlist: remove unused _other outlets
[vlc] / modules / gui / macosx / controls.m
index cc7195b0167806a710d02dd6a0c9fdfdb2e17334..c8a6dd874f769d05daf0d6c3fc02ebbdaf15c98f 100644 (file)
@@ -4,9 +4,7 @@
  * Copyright (C) 2002-2013 VLC authors and VideoLAN
  * $Id$
  *
- * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
- *          Christophe Massiot <massiot@via.ecp.fr>
- *          Derk-Jan Hartman <hartman at videolan dot org>
+ * Authors: Derk-Jan Hartman <hartman at videolan dot org>
  *          Benjamin Pracht <bigben at videolan doit org>
  *          Felix Paul Kühne <fkuehne at videolan dot org>
  *
@@ -39,6 +37,7 @@
 #import "playlist.h"
 #import "MainMenu.h"
 #import "CoreInteraction.h"
+#import "misc.h"
 #import <vlc_keys.h>
 
 #pragma mark -
  *****************************************************************************/
 @implementation VLCControls
 
+@synthesize jumpTimeValue;
+
 - (void)awakeFromNib
 {
-    [o_specificTime_mi setTitle: _NS("Jump To Time")];
+    [o_specificTime_mi setTitle: _NS("Jump to Time")];
     [o_specificTime_cancel_btn setTitle: _NS("Cancel")];
     [o_specificTime_ok_btn setTitle: _NS("OK")];
     [o_specificTime_sec_lbl setStringValue: _NS("sec.")];
-    [o_specificTime_goTo_lbl setStringValue: _NS("Jump to time")];
-}
+    [o_specificTime_goTo_lbl setStringValue: _NS("Jump to Time")];
 
+    [o_specificTime_enter_fld setFormatter:[[[PositionFormatter alloc] init] autorelease]];
+}
 
 - (void)dealloc
 {
@@ -66,7 +68,7 @@
 
 - (IBAction)play:(id)sender
 {
-    [[VLCCoreInteraction sharedInstance] play];
+    [[VLCCoreInteraction sharedInstance] playOrPause];
 }
 
 - (IBAction)stop:(id)sender
         [[VLCCoreInteraction sharedInstance] repeatOff];
 }
 
-- (IBAction)quitAfterPlayback:(id)sender
-{
-    vlc_value_t val;
-    playlist_t * p_playlist = pl_Get(VLCIntf);
-    var_ToggleBool(p_playlist, "play-and-exit");
-}
-
 - (IBAction)forward:(id)sender
 {
     [[VLCCoreInteraction sharedInstance] forward];
 
 - (IBAction)mute:(id)sender
 {
-    [[VLCCoreInteraction sharedInstance] setMute: YES];
+    [[VLCCoreInteraction sharedInstance] toggleMute];
 }
 
 - (IBAction)volumeSliderUpdated:(id)sender
     }
 }
 
-- (IBAction)telxTransparent:(id)sender
-{
-    vlc_object_t *p_vbi;
-    p_vbi = (vlc_object_t *) vlc_object_find_name(pl_Get(VLCIntf), "zvbi");
-    if (p_vbi) {
-        var_SetBool(p_vbi, "vbi-opaque", [sender state]);
-        [sender setState: ![sender state]];
-        vlc_object_release(p_vbi);
-    }
-}
-
-- (IBAction)telxNavLink:(id)sender
-{
-    intf_thread_t * p_intf = VLCIntf;
-    vlc_object_t *p_vbi;
-    int i_page = 0;
-
-    if ([[sender title] isEqualToString: _NS("Index")])
-        i_page = 'i' << 16;
-    else if ([[sender title] isEqualToString: _NS("Red")])
-        i_page = 'r' << 16;
-    else if ([[sender title] isEqualToString: _NS("Green")])
-        i_page = 'g' << 16;
-    else if ([[sender title] isEqualToString: _NS("Yellow")])
-        i_page = 'y' << 16;
-    else if ([[sender title] isEqualToString: _NS("Blue")])
-        i_page = 'b' << 16;
-    if (i_page == 0) return;
-
-    p_vbi = (vlc_object_t *) vlc_object_find_name(pl_Get(VLCIntf), "zvbi");
-    if (p_vbi) {
-        var_SetInteger(p_vbi, "vbi-page", i_page);
-        vlc_object_release(p_vbi);
-    }
-}
-
 - (IBAction)lockVideosAspectRatio:(id)sender
 {
     [[VLCCoreInteraction sharedInstance] setAspectRatioIsLocked: ![sender state]];
     [sender setState: [[VLCCoreInteraction sharedInstance] aspectRatioIsLocked]];
 }
 
-- (IBAction)addSubtitleFile:(id)sender
-{
-    NSInteger i_returnValue = 0;
-    input_thread_t * p_input = pl_CurrentInput(VLCIntf);
-    if (!p_input)
-        return;
-
-    input_item_t *p_item = input_GetItem(p_input);
-    if (!p_item) {
-        vlc_object_release(p_input);
-        return;
-    }
-
-    char *path = input_item_GetURI(p_item);
-    if (!path)
-        path = strdup("");
-
-    NSOpenPanel * openPanel = [NSOpenPanel openPanel];
-    [openPanel setCanChooseFiles: YES];
-    [openPanel setCanChooseDirectories: NO];
-    [openPanel setAllowsMultipleSelection: YES];
-    [openPanel setAllowedFileTypes: [NSArray arrayWithObjects: @"cdg",@"@idx",@"srt",@"sub",@"utf",@"ass",@"ssa",@"aqt",@"jss",@"psb",@"rt",@"smi",@"txt",@"smil", nil]];
-    [openPanel setDirectoryURL:[NSURL fileURLWithPath:[[NSString stringWithUTF8String:path] stringByExpandingTildeInPath]]];
-    i_returnValue = [openPanel runModal];
-    free(path);
-
-    if (i_returnValue == NSOKButton) {
-        NSUInteger c = 0;
-        if (!p_input)
-            return;
-
-        c = [[openPanel URLs] count];
-
-        for (int i = 0; i < c ; i++) {
-            msg_Dbg(VLCIntf, "loading subs from %s", [[[[openPanel URLs] objectAtIndex: i] path] UTF8String]);
-            if (input_AddSubtitle(p_input, [[[[openPanel URLs] objectAtIndex: i] path] UTF8String], TRUE))
-                msg_Warn(VLCIntf, "unable to load subtitles from '%s'",
-                         [[[[openPanel URLs] objectAtIndex: i] path] UTF8String]);
-        }
-    }
-    vlc_object_release(p_input);
-}
-
 - (BOOL)keyEvent:(NSEvent *)o_event
 {
     BOOL eventHandled = NO;
                             eventHandled = YES;
                         }
                     }
-                    else if (key == ' ') {
-                        [self play:self];
-                        eventHandled = YES;
-                    }
                     vlc_object_release(p_vout);
                 }
                 vlc_object_release(p_input);
                     [fieldContent componentsSeparatedByString: @":"];
 
                 if ([[fieldContent componentsSeparatedByString: @":"] count] == 3) {
-                    timeInSec += ([[ourTempArray objectAtIndex: 0] intValue] * 3600); //h
-                    timeInSec += ([[ourTempArray objectAtIndex: 1] intValue] * 60); //m
-                    timeInSec += [[ourTempArray objectAtIndex: 2] intValue];        //s
+                    timeInSec += ([[ourTempArray objectAtIndex:0] intValue] * 3600); //h
+                    timeInSec += ([[ourTempArray objectAtIndex:1] intValue] * 60); //m
+                    timeInSec += [[ourTempArray objectAtIndex:2] intValue];        //s
                 } else {
-                    timeInSec += ([[ourTempArray objectAtIndex: 0] intValue] * 60); //m
-                    timeInSec += [[ourTempArray objectAtIndex: 1] intValue]; //s
+                    timeInSec += ([[ourTempArray objectAtIndex:0] intValue] * 60); //m
+                    timeInSec += [[ourTempArray objectAtIndex:1] intValue]; //s
                 }
             }
             else
         if (p_input) {
             /* we can obviously only do that if an input is available */
             vlc_value_t pos, length;
-            var_Get(p_input, "time", &pos);
-            [o_specificTime_enter_fld setIntValue: (pos.i_time / 1000000)];
             var_Get(p_input, "length", &length);
             [o_specificTime_stepper setMaxValue: (length.i_time / 1000000)];
-
+            var_Get(p_input, "time", &pos);
+            [self setJumpTimeValue: (pos.i_time / 1000000)];
             [NSApp beginSheet: o_specificTime_win modalForWindow: \
                 [NSApp mainWindow] modalDelegate: self didEndSelector: nil \
                 contextInfo: nil];