#include <vlc_common.h>
#include <vlc_keys.h>
#include <vlc_dialog.h>
+#include <vlc_url.h>
#include <unistd.h> /* execl() */
#import "intf.h"
#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 */
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];
[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")];
- (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
{
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];
return nil;
}
-#ifdef ENABLE_VLM
-- (id)vlm
-{
- return o_vlm;
-}
-#endif
-
- (id)bookmarks
{
if( o_bookmarks )
}
pthread_cleanup_pop(1);
-
- msg_Dbg( p_intf, "OS X Manage thread terminating" );
}
- (void)manageVolumeSlider
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
[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];
}
}
-- (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 )
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