Commit 7f8e2bc5 authored by Jon Lech Johansen's avatar Jon Lech Johansen

* ./modules/gui/macosx: Defeated some deadlocks.

                          World domination ... is at hand.
parent f3563dc1
......@@ -22,12 +22,12 @@
toggleTitle = id;
toggleVar = id;
volumeDown = id;
volumeSliderUpdate = id;
volumeSliderUpdated = id;
volumeUp = id;
};
CLASS = VLCControls;
LANGUAGE = ObjC;
OUTLETS = {"o_main" = id; "o_mi_mute" = id; "o_open" = id; "o_volumeslider" = id; };
OUTLETS = {"o_main" = id; "o_open" = id; "o_volumeslider" = id; };
SUPERCLASS = NSObject;
},
{
......@@ -45,13 +45,13 @@
CLASS = VLCMain;
LANGUAGE = ObjC;
OUTLETS = {
"o_btn_fastforward" = id;
"o_btn_faster" = id;
"o_btn_next" = id;
"o_btn_play" = id;
"o_btn_playlist" = id;
"o_btn_prefs" = id;
"o_btn_prev" = id;
"o_btn_slowmotion" = id;
"o_btn_slower" = id;
"o_btn_stop" = id;
"o_controls" = id;
"o_dmi_play" = id;
......
......@@ -7,7 +7,7 @@
<key>IBEditorPositions</key>
<dict>
<key>29</key>
<string>16 822 419 44 0 0 1280 1002 </string>
<string>22 973 419 44 0 0 1600 1178 </string>
<key>303</key>
<string>60 509 104 66 0 0 1280 1002 </string>
<key>909</key>
......@@ -23,8 +23,8 @@
</array>
<key>IBOpenObjects</key>
<array>
<integer>21</integer>
<integer>29</integer>
<integer>21</integer>
</array>
<key>IBSystem Version</key>
<string>6G30</string>
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
* intf.h: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: intf.h,v 1.19 2003/01/29 11:34:11 jlj Exp $
* $Id: intf.h,v 1.20 2003/01/31 02:53:52 jlj Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -26,6 +26,7 @@
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include <vlc/vout.h>
#include <vlc/aout.h>
#include <Cocoa/Cocoa.h>
......@@ -48,6 +49,8 @@
#define _NS(s) [NSApp localizedString: _(s)]
int ExecuteOnMainThread( id target, SEL sel, void * p_arg );
/*****************************************************************************
* intf_sys_t: description and status of the interface
*****************************************************************************/
......@@ -58,9 +61,12 @@ struct intf_sys_t
/* special actions */
vlc_bool_t b_playing;
vlc_bool_t b_stopping;
vlc_bool_t b_mute;
/* interface update */
vlc_bool_t b_intf_update;
vlc_bool_t b_play_status;
/* menus handlers */
vlc_bool_t b_chapter_update;
vlc_bool_t b_program_update;
......@@ -70,9 +76,6 @@ struct intf_sys_t
vlc_bool_t b_aout_update;
vlc_bool_t b_vout_update;
/* The input thread */
input_thread_t * p_input;
/* The messages window */
msg_subscription_t * p_sub;
......@@ -96,13 +99,16 @@ struct intf_sys_t
IBOutlet id o_btn_playlist; /* btn playlist */
IBOutlet id o_btn_prev; /* btn previous */
IBOutlet id o_btn_slowmotion; /* btn slowmotion */
IBOutlet id o_btn_slower; /* btn slower */
IBOutlet id o_btn_play; /* btn play */
IBOutlet id o_btn_stop; /* btn stop */
IBOutlet id o_btn_fastforward; /* btn fastforward */
IBOutlet id o_btn_faster; /* btn faster */
IBOutlet id o_btn_next; /* btn next */
IBOutlet id o_btn_prefs; /* btn prefs */
NSImage * o_img_play; /* btn play img */
NSImage * o_img_pause; /* btn pause img */
IBOutlet id o_controls; /* VLCControls */
IBOutlet id o_playlist; /* VLCPlaylist */
......@@ -191,11 +197,18 @@ struct intf_sys_t
- (void)terminate;
- (void)manage;
- (void)manageMode;
- (void)setControlItems;
- (void)setupMenus;
- (void)setupLangMenu:(NSMenuItem *)o_mi
- (void)manage:(playlist_t *)p_playlist;
- (void)manageMode:(playlist_t *)p_playlist;
- (void)manageIntf:(NSTimer *)o_timer;
- (void)updateMessageArray;
- (void)playStatusUpdated:(BOOL)b_pause;
- (void)setSubmenusEnabled:(BOOL)b_enabled;
- (void)manageVolumeSlider;
- (void)setupMenus:(input_thread_t *)p_input;
- (void)setupLangMenu:(input_thread_t *)p_input
mi:(NSMenuItem *)o_mi
es:(es_descriptor_t *)p_es
category:(int)i_cat
selector:(SEL)pf_callback;
......@@ -210,7 +223,6 @@ struct intf_sys_t
- (IBAction)viewPreferences:(id)sender;
- (IBAction)timesliderUpdate:(id)sender;
- (void)displayTime;
- (IBAction)closeError:(id)sender;
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
* open.m: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: open.m,v 1.16 2003/01/26 14:53:08 hartman Exp $
* $Id: open.m,v 1.17 2003/01/31 02:53:52 jlj Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -37,17 +37,12 @@
#include <IOKit/storage/IOCDMedia.h>
#include <IOKit/storage/IODVDMedia.h>
#import <Cocoa/Cocoa.h>
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include "intf.h"
#include "playlist.h"
#include "open.h"
#include "netutils.h"
#import "intf.h"
#import "playlist.h"
#import "open.h"
/*****************************************************************************
* GetEjectableMediaOfClass
*****************************************************************************/
......
......@@ -2,7 +2,7 @@
* playlist.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: playlist.m,v 1.6 2003/01/29 11:34:11 jlj Exp $
* $Id: playlist.m,v 1.7 2003/01/31 02:53:52 jlj Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
*
......@@ -28,11 +28,6 @@
#include <sys/param.h> /* for MAXPATHLEN */
#include <string.h>
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include <Cocoa/Cocoa.h>
#include "intf.h"
#include "playlist.h"
......@@ -48,24 +43,41 @@
- (void)keyDown:(NSEvent *)o_event
{
intf_thread_t * p_intf = [NSApp getIntf];
unichar key = 0;
playlist_t * p_playlist;
intf_thread_t * p_intf = [NSApp getIntf];
if( [[o_event characters] length] )
{
key = [[o_event characters] characterAtIndex: 0];
}
p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist != NULL )
{
vlc_mutex_lock( &p_playlist->object_lock );
}
switch( key )
{
case ' ':
input_SetStatus( p_intf->p_sys->p_input , INPUT_STATUS_PAUSE );
if( p_playlist != NULL && p_playlist->p_input != NULL )
{
input_SetStatus( p_playlist->p_input, INPUT_STATUS_PAUSE );
}
break;
default:
[super keyDown: o_event];
break;
}
if( p_playlist != NULL )
{
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
}
}
@end
......
......@@ -2,7 +2,7 @@
* prefs.m: MacOS X plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: prefs.m,v 1.9 2003/01/27 17:41:01 ipkiss Exp $
* $Id: prefs.m,v 1.10 2003/01/31 02:53:52 jlj Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
*
......@@ -28,13 +28,8 @@
#include <sys/param.h> /* for MAXPATHLEN */
#include <string.h>
#import <Cocoa/Cocoa.h>
#include <vlc/vlc.h>
#include <vlc/intf.h>
#import "intf.h"
#import "prefs.h"
#include "intf.h"
#include "prefs.h"
/*****************************************************************************
* VLCPrefs implementation
......
......@@ -2,7 +2,7 @@
* vout.h: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: vout.h,v 1.4 2003/01/05 01:55:07 massiot Exp $
* $Id: vout.h,v 1.5 2003/01/31 02:53:52 jlj Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org>
......@@ -67,8 +67,6 @@
*****************************************************************************/
struct vout_sys_t
{
NSConditionLock * o_lock;
NSRect s_rect;
int b_pos_saved;
VLCWindow * o_window;
......
......@@ -2,7 +2,7 @@
* vout.m: MacOS X video output plugin
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: vout.m,v 1.20 2003/01/28 15:59:38 hartman Exp $
* $Id: vout.m,v 1.21 2003/01/31 02:53:52 jlj Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org>
......@@ -31,12 +31,6 @@
#include <stdlib.h> /* free() */
#include <string.h> /* strerror() */
#include <vlc/vlc.h>
#include <vlc/vout.h>
#include <vlc/aout.h>
#include <vlc/intf.h>
#include <Cocoa/Cocoa.h>
#include <QuickTime/QuickTime.h>
#include "intf.h"
......@@ -424,61 +418,14 @@ static int CoSendRequest( vout_thread_t *p_vout, SEL sel )
{
int i_ret = 0;
NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
VLCVout * o_vlv = [[[VLCVout alloc] init] autorelease];
VLCVout * o_vlv = [[VLCVout alloc] init];
if( [o_vlv respondsToSelector: @selector(performSelectorOnMainThread:
withObject:waitUntilDone:)] )
{
[o_vlv performSelectorOnMainThread: sel
withObject: [NSValue valueWithPointer: p_vout]
waitUntilDone: YES];
}
else if( [NSApp respondsToSelector: @selector(getIntf)] )
{
NSArray * o_array;
NSValue * o_value;
NSPort * o_recv_port;
NSInvocation * o_inv;
NSPortMessage * o_msg;
intf_thread_t * p_intf;
NSMethodSignature * o_sig;
p_intf = (intf_thread_t *)[NSApp getIntf];
o_recv_port = [[NSPort port] retain];
o_value = [NSValue valueWithPointer: p_vout];
o_sig = [VLCVout instanceMethodSignatureForSelector: sel];
o_inv = [NSInvocation invocationWithMethodSignature: o_sig];
[o_inv setArgument: &o_value atIndex: 2];
[o_inv setTarget: o_vlv];
[o_inv setSelector: sel];
o_array = [NSArray arrayWithObject:
[NSData dataWithBytes: &o_inv length: sizeof(o_inv)]];
o_msg = [[NSPortMessage alloc]
initWithSendPort: p_intf->p_sys->o_sendport
receivePort: o_recv_port components: o_array];
p_vout->p_sys->o_lock =
[[NSConditionLock alloc] initWithCondition: 0];
[o_msg sendBeforeDate: [NSDate distantPast]];
[p_vout->p_sys->o_lock lockWhenCondition: 1];
[p_vout->p_sys->o_lock unlock];
[p_vout->p_sys->o_lock release];
p_vout->p_sys->o_lock = nil;
[o_msg release];
[o_recv_port release];
}
else
if( ( i_ret = ExecuteOnMainThread( o_vlv, sel, (void *)p_vout ) ) )
{
msg_Err( p_vout, "SendRequest: no way to communicate with mt" );
i_ret = 1;
}
[o_pool release];
[o_vlv release];
return( i_ret );
}
......@@ -842,7 +789,6 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
playlist_Stop( p_playlist );
vlc_object_release( p_playlist );
p_intf->p_sys->b_stopping = 1;
/* The window will be closed by the intf later. */
return NO;
......
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