]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/intf.m
Adding posterize filter to effects dialog
[vlc] / modules / gui / macosx / intf.m
index 95a4989421aaed456bd179d81436dfb08b815b6f..21098e9c370a0183a735a55bf77feffe6e77fd78 100644 (file)
@@ -33,6 +33,7 @@
 #include <vlc_common.h>
 #include <vlc_keys.h>
 #include <vlc_dialog.h>
+#include <vlc_url.h>
 #include <unistd.h> /* execl() */
 
 #import "intf.h"
@@ -52,9 +53,6 @@
 #import "AppleRemote.h"
 #import "eyetv.h"
 #import "simple_prefs.h"
-#ifdef ENABLE_VLM
-#import "vlm.h"
-#endif
 
 #import <AddressBook/AddressBook.h>         /* for crashlog send mechanism */
 #import <IOKit/hidsystem/ev_keymap.h>         /* for the media key support */
@@ -353,12 +351,9 @@ static VLCMain *_o_sharedMainInstance = nil;
     o_prefs = nil;
     o_open = [[VLCOpen alloc] init];
     o_wizard = [[VLCWizard alloc] init];
-#ifdef ENABLE_VLM
-    o_vlm = [[VLCVLMController alloc] init];
-#endif
     o_extended = nil;
     o_bookmarks = [[VLCBookmarks alloc] init];
-    o_embedded_list = [[VLCEmbeddedList alloc] init];
+    o_embedded_list = NULL; // [[VLCEmbeddedList alloc] init];
     o_coredialogs = [[VLCCoreDialogProvider alloc] init];
     o_info = [[VLCInfo alloc] init];
 
@@ -704,6 +699,8 @@ static VLCMain *_o_sharedMainInstance = nil;
     [o_mi_addSub setTitle: _NS("Open File...")];
     [o_mi_deinterlace setTitle: _NS("Deinterlace")];
     [o_mu_deinterlace setTitle: _NS("Deinterlace")];
+    [o_mi_deinterlace_mode setTitle: _NS("Deinterlace mode")];
+    [o_mu_deinterlace_mode setTitle: _NS("Deinterlace mode")];
     [o_mi_ffmpeg_pp setTitle: _NS("Post processing")];
     [o_mu_ffmpeg_pp setTitle: _NS("Post processing")];
     [o_mi_teletext setTitle: _NS("Teletext")];
@@ -1050,7 +1047,14 @@ static NSString * VLCToolbarMediaControl     = @"VLCToolbarMediaControl";
 - (BOOL)application:(NSApplication *)o_app openFile:(NSString *)o_filename
 {
     BOOL b_autoplay = config_GetInt( VLCIntf, "macosx-autoplay" );
-    NSDictionary *o_dic = [NSDictionary dictionaryWithObjectsAndKeys: o_filename, @"ITEM_URL", nil];
+    char *psz_uri = make_URI([o_filename UTF8String], "file" );
+    if( !psz_uri )
+        return( FALSE );
+
+    NSDictionary *o_dic = [NSDictionary dictionaryWithObject:[NSString stringWithCString:psz_uri encoding:NSUTF8StringEncoding] forKey:@"ITEM_URL"];
+
+    free( psz_uri );
+
     if( b_autoplay )
         [o_playlist appendArray: [NSArray arrayWithObject: o_dic] atPos: -1 enqueue: NO];
     else
@@ -1109,6 +1113,12 @@ static NSString * VLCToolbarMediaControl     = @"VLCToolbarMediaControl";
 {
     switch( buttonIdentifier )
     {
+        case k2009RemoteButtonFullscreen:
+            [o_controls toogleFullscreen:self];
+            break;
+        case k2009RemoteButtonPlay:
+            [o_controls play:self];
+            break;
         case kRemoteButtonPlay:
             if(count >= 2) {
                 [o_controls toogleFullscreen:self];
@@ -1449,13 +1459,6 @@ static unsigned int VLCModifiersToCocoa( unsigned int i_key )
     return nil;
 }
 
-#ifdef ENABLE_VLM
-- (id)vlm
-{
-    return o_vlm;
-}
-#endif
-
 - (id)bookmarks
 {
     if( o_bookmarks )
@@ -1615,8 +1618,6 @@ static void manage_cleanup( void * args )
     }
 
     pthread_cleanup_pop(1);
-
-    msg_Dbg( p_intf, "OS X Manage thread terminating" );
 }
 
 - (void)manageVolumeSlider
@@ -1928,6 +1929,9 @@ end:
                 var: "video-device" selector: @selector(toggleVar:)];
 
             [o_controls setupVarMenuItem: o_mi_deinterlace target: (vlc_object_t *)p_vout
+                var: "deinterlace" selector: @selector(toggleVar:)];
+
+            [o_controls setupVarMenuItem: o_mi_deinterlace_mode target: (vlc_object_t *)p_vout
                 var: "deinterlace-mode" selector: @selector(toggleVar:)];
 
 #if 1
@@ -2036,6 +2040,7 @@ end:
     [o_mi_subtitle setEnabled: b_enabled];
     [o_mi_channels setEnabled: b_enabled];
     [o_mi_deinterlace setEnabled: b_enabled];
+    [o_mi_deinterlace_mode setEnabled: b_enabled];
     [o_mi_ffmpeg_pp setEnabled: b_enabled];
     [o_mi_device setEnabled: b_enabled];
     [o_mi_screen setEnabled: b_enabled];
@@ -2188,20 +2193,6 @@ end:
     }
 }
 
-- (IBAction)showVLM:(id)sender
-{
-#ifdef ENABLE_VLM
-    if( !nib_vlm_loaded )
-        nib_vlm_loaded = [NSBundle loadNibNamed:@"VLM" owner: NSApp];
-
-    [o_vlm showVLMWindow];
-#else
-    NSAlert *theAlert;
-    theAlert = [NSAlert alertWithMessageText:_NS("VLM not available") defaultButton:_NS("OK") alternateButton:nil otherButton:nil informativeTextWithFormat:_NS("The VideoLAN Manager was not enabled in this version of VLC.")];
-    [theAlert runModal];
-#endif
-}
-
 - (IBAction)showExtended:(id)sender
 {
     if( o_extended == nil )
@@ -2934,4 +2925,14 @@ end:
     b_justJumped = NO;
 }
 
+// when user selects the quit menu from dock it sends a terminate:
+// but we need to send a stop: to properly exits libvlc.
+// However, we are not able to change the action-method sent by this standard menu item.
+// thus we override terminat: to send a stop:
+// see [af97f24d528acab89969d6541d83f17ce1ecd580] that introduced the removal of setjmp() and longjmp() 
+- (void)terminate:(id)sender
+{
+    [self stop:sender];
+}
+
 @end