#import "eyetv.h"
#import "simple_prefs.h"
#import "CoreInteraction.h"
+#import "TrackSynchronization.h"
#import <AddressBook/AddressBook.h> /* for crashlog send mechanism */
#import <Sparkle/Sparkle.h> /* we're the update delegate */
*****************************************************************************/
int OpenIntf ( vlc_object_t *p_this )
{
+ NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
+ [VLCApplication sharedApplication];
intf_thread_t *p_intf = (intf_thread_t*) p_this;
p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
p_intf->pf_run = Run;
p_intf->b_should_run_on_first_thread = true;
+ [o_pool release];
return VLC_SUCCESS;
}
return VLC_EGENERIC;
}
- [[VLCMainWindow sharedInstance] setVideoplayEnabled:YES];
- [[VLCMainWindow sharedInstance] togglePlaylist:nil];
+ [[VLCMain sharedInstance] setActiveVideoPlayback: YES];
p_wnd->control = WindowControl;
p_wnd->sys = (vout_window_sys_t *)VLCIntf;
[o_pool release];
void WindowClose( vout_window_t *p_wnd )
{
NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
- [[VLCMainWindow sharedInstance] setVideoplayEnabled:NO];
+ [[VLCMain sharedInstance] setActiveVideoPlayback:NO];
NSLog( @"Window Close" );
// tell the interface to get rid of the video, TODO
[o_pool release];
pthread_sigmask( SIG_UNBLOCK, &set, NULL );
NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
+ [VLCApplication sharedApplication];
o_appLock = [[NSLock alloc] init];
- [VLCApplication sharedApplication];
-
[[VLCMain sharedInstance] setIntf: p_intf];
[NSBundle loadNibNamed: @"MainMenu" owner: NSApp];
static int InputEvent( vlc_object_t *p_this, const char *psz_var,
vlc_value_t oldval, vlc_value_t new_val, void *param )
{
+ NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
switch (new_val.i_int) {
case INPUT_EVENT_STATE:
[[VLCMain sharedInstance] playbackStatusUpdated];
break;
case INPUT_EVENT_TITLE:
case INPUT_EVENT_CHAPTER:
- [[VLCMain sharedInstance] updateTitle];
break;
case INPUT_EVENT_CACHE:
[[VLCMain sharedInstance] updateMainWindow];
break;
case INPUT_EVENT_ITEM_META:
case INPUT_EVENT_ITEM_INFO:
+ [[VLCMain sharedInstance] updateName];
[[VLCMain sharedInstance] updateInfoandMetaPanel];
break;
case INPUT_EVENT_BOOKMARK:
break;
case INPUT_EVENT_ITEM_NAME:
- [[VLCMain sharedInstance] updateTitle];
+ [[VLCMain sharedInstance] updateName];
+ [[VLCMain sharedInstance] playlistUpdated];
break;
case INPUT_EVENT_AUDIO_DELAY:
case INPUT_EVENT_SUBTITLE_DELAY:
+ [[VLCMain sharedInstance] updateDelays];
break;
case INPUT_EVENT_DEAD:
break;
}
+ [o_pool release];
return VLC_SUCCESS;
}
static int PLItemChanged( vlc_object_t *p_this, const char *psz_var,
vlc_value_t oldval, vlc_value_t new_val, void *param )
{
+ NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
[[VLCMain sharedInstance] performSelectorOnMainThread:@selector(PlaylistItemChanged) withObject:nil waitUntilDone:NO];
+ [o_pool release];
return VLC_SUCCESS;
}
static int PlaylistUpdated( vlc_object_t *p_this, const char *psz_var,
vlc_value_t oldval, vlc_value_t new_val, void *param )
{
+ NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
[[VLCMain sharedInstance] performSelectorOnMainThread:@selector(playlistUpdated) withObject:nil waitUntilDone:NO];
+ [o_pool release];
return VLC_SUCCESS;
}
static int PlaybackModeUpdated( vlc_object_t *p_this, const char *psz_var,
vlc_value_t oldval, vlc_value_t new_val, void *param )
{
+ NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
[[VLCMain sharedInstance] playbackModeUpdated];
+ [o_pool release];
return VLC_SUCCESS;
}
static int VolumeUpdated( vlc_object_t *p_this, const char *psz_var,
vlc_value_t oldval, vlc_value_t new_val, void *param )
{
+ NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
[[VLCMain sharedInstance] updateVolume];
+ [o_pool release];
return VLC_SUCCESS;
}
return p_vout;
}
-aout_instance_t *getAout(void)
+audio_output_t *getAout(void)
{
input_thread_t *p_input = getInput();
if (!p_input)
return NULL;
- aout_instance_t *p_aout = input_GetAout(p_input);
+ audio_output_t *p_aout = input_GetAout(p_input);
vlc_object_release(p_input);
return p_aout;
}
o_mainmenu = [[VLCMainMenu alloc] init];
o_coreinteraction = [[VLCCoreInteraction alloc] init];
o_eyetv = [[VLCEyeTVController alloc] init];
+ o_mainwindow = [[VLCMainWindow alloc] init];
/* announce our launch to a potential eyetv plugin */
[[NSDistributedNotificationCenter defaultCenter] postNotificationName: @"VLCOSXGUIInit"
{
playlist_t *p_playlist;
vlc_value_t val;
+ if( !p_intf ) return;
var_Create( p_intf, "intf-change", VLC_VAR_BOOL );
+ /* Check if we already did this once. Opening the other nibs calls it too,
+ because VLCMain is the owner */
+ if( nib_main_loaded ) return;
+
[o_msgs_panel setExcludedFromWindowsMenu: YES];
[o_msgs_panel setDelegate: self];
[o_embedded_list release];
[o_coredialogs release];
[o_eyetv release];
+ [o_mainwindow release];
/* unsubscribe from libvlc's debug messages */
msg_Unsubscribe( p_intf->p_sys->p_sub );
[o_mainwindow updateWindow];
}
-- (void)updateTitle
+- (void)updateDelays
+{
+ [[VLCTrackSynchronization sharedInstance] performSelectorOnMainThread: @selector(updateValues) withObject: nil waitUntilDone:NO];
+}
+
+- (void)updateName
{
- [o_mainwindow updateTitle];
+ [o_mainwindow updateName];
}
- (void)updatePlaybackPosition
return o_remote;
}
-- (IBAction)showController:(id)sender
+- (void)setActiveVideoPlayback:(BOOL)b_value
{
- //FIXME: why is this function here?!
- [o_mainwindow makeKeyAndOrderFront:sender];
+ b_active_videoplayback = b_value;
+ [o_mainwindow setVideoplayEnabled];
+ [o_mainwindow togglePlaylist:nil];
+}
+
+- (BOOL)activeVideoPlayback
+{
+ return b_active_videoplayback;
}
#pragma mark -
#pragma mark -
#pragma mark Playlist toggling
-- (IBAction)togglePlaylist:(id)sender
-{
- NSLog( @"needs to be re-implemented" );
-}
-
- (void)updateTogglePlaylistState
{
[[self playlist] outlineViewSelectionDidChange: NULL];