- (void)manage
{
- NSDate * o_sleep_date;
playlist_t * p_playlist;
/* new thread requires a new pool */
[self manageVolumeSlider];
vlc_mutex_unlock( &p_intf->change_lock );
-
- o_sleep_date = [NSDate dateWithTimeIntervalSinceNow: .1];
- [NSThread sleepUntilDate: o_sleep_date];
+ msleep( 100000 );
}
-
- [self terminate];
[o_pool release];
}
[[NSUserDefaults standardUserDefaults] synchronize];
p_intf->b_die = VLC_TRUE;
- [NSApp stop:NULL];
}
- (IBAction)clearRecentItems:(id)sender
*****************************************************************************/
@interface VLCApplication : NSApplication
{
+ vlc_t *o_vlc;
}
+- (void)setVLC: (vlc_t *)p_vlc;
+
@end
#endif
}
}
- if( p_intf->b_block && strncmp( p_intf->p_module->psz_object_name,
+ if( p_intf->b_block && strncmp( p_intf->p_vlc->psz_object_name,
"clivlc", 6) )
{
o_pool = [[NSAutoreleasePool alloc] init];
[VLCApplication sharedApplication];
+ [NSApp setVLC: p_intf->p_vlc];
}
if( p_intf->b_block &&
else
{
/* Run the interface in a separate thread */
+ if( !strcmp( p_intf->p_module->psz_object_name, "macosx" ) )
+ {
+ msg_Err( p_intf, "You cannot run the MacOS X module as an extrainterface. Please read the README.MacOSX.rtf file");
+ return VLC_EGENERIC;
+ }
if( vlc_thread_create( p_intf, "interface", RunInterface,
VLC_THREAD_PRIORITY_LOW, VLC_FALSE ) )
{
*****************************************************************************/
@implementation VLCApplication
+- (void)setVLC: (vlc_t *) p_vlc
+{
+ o_vlc = p_vlc;
+}
+
- (void)stop: (id)sender
{
NSEvent *o_event;
- (void)terminate: (id)sender
{
- if( [NSApp isRunning] )
- [NSApp stop:sender];
- [super terminate: sender];
+ o_vlc->b_die = VLC_TRUE;
}
@end