/*****************************************************************************
* embeddedwindow.m: MacOS X interface module
*****************************************************************************
- * Copyright (C) 2005-2008 the VideoLAN team
+ * Copyright (C) 2005-2011 the VideoLAN team
* $Id$
*
* Authors: Benjamin Pracht <bigben at videolan dot org>
#import "vout.h"
#import "embeddedwindow.h"
#import "fspanel.h"
+#import "CoreInteraction.h"
#import "playlist.h"
+#import <vlc_url.h>
/* SetSystemUIMode, ... */
#import <Carbon/Carbon.h>
o_img_play = [NSImage imageNamed: @"play_embedded"];
o_img_pause = [NSImage imageNamed: @"pause_embedded"];
- [self controlTintChanged];
- [[NSNotificationCenter defaultCenter] addObserver: self
- selector: @selector( controlTintChanged )
- name: NSControlTintDidChangeNotification
- object: nil];
-
/* Set color of sidebar to Leopard's "Sidebar Blue" */
[o_sidebar_list setBackgroundColor: [NSColor colorWithCalibratedRed:0.820
green:0.843
view_rect.size.width,
view_rect.size.height )];
}
+
+ /* we don't want this window to be restored on relaunch */
+ if ([self respondsToSelector:@selector(setRestorable:)])
+ [self setRestorable:NO];
}
- (void)controlTintChanged
[super dealloc];
}
+- (id)videoView
+{
+ return o_video_view;
+}
+
- (void)setTime:(NSString *)o_arg_time position:(float)f_position
{
[o_time setStringValue: o_arg_time];
if( videoRatio.height == 0. || videoRatio.width == 0. )
return proposedFrameSize;
- if( [[[VLCMain sharedInstance] controls] aspectRatioIsLocked] )
+ if( [[VLCCoreInteraction sharedInstance] aspectRatioIsLocked] )
{
NSRect viewRect = [o_view convertRect:[o_view bounds] toView: nil];
NSRect contentRect = [self contentRectForFrameRect:[self frame]];
vout_thread_t *p_vout = getVout();
BOOL blackout_other_displays = config_GetInt( VLCIntf, "macosx-black" );
- screen = [NSScreen screenWithDisplayID:(CGDirectDisplayID)var_GetInteger( p_vout, "video-device" )];
+ if( p_vout )
+ screen = [NSScreen screenWithDisplayID:(CGDirectDisplayID)var_GetInteger( p_vout, "video-device" )];
[self lockFullscreenAnimation];
if (!screen)
{
- msg_Dbg( p_vout, "chosen screen isn't present, using current screen for fullscreen mode" );
+ msg_Dbg( VLCIntf, "chosen screen isn't present, using current screen for fullscreen mode" );
screen = [self screen];
}
if (!screen)
{
- msg_Dbg( p_vout, "Using deepest screen" );
+ msg_Dbg( VLCIntf, "Using deepest screen" );
screen = [NSScreen deepestScreen];
}
- vlc_object_release( p_vout );
+ if( p_vout )
+ vlc_object_release( p_vout );
screen_rect = [screen frame];
* simply fade the display */
CGDisplayFadeReservationToken token;
- CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval, &token);
- CGDisplayFade( token, 0.5, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES );
+ if( blackout_other_displays )
+ {
+ CGAcquireDisplayFadeReservation( kCGMaxDisplayReservationInterval, &token );
+ CGDisplayFade( token, 0.5, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES );
+ }
if ([screen isMainScreen])
SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar);
[o_fullscreen_window setFrame:screen_rect display:YES];
- CGDisplayFade( token, 0.3, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0, 0, 0, NO );
- CGReleaseDisplayFadeReservation( token);
+ if( blackout_other_displays )
+ {
+ CGDisplayFade( token, 0.3, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0, 0, 0, NO );
+ CGReleaseDisplayFadeReservation( token );
+ }
/* Will release the lock */
[self hasBecomeFullscreen];
{
NSMutableDictionary *dict1, *dict2;
NSRect frame;
+ BOOL blackout_other_displays = config_GetInt( VLCIntf, "macosx-black" );
[self lockFullscreenAnimation];
* simply fade the display */
CGDisplayFadeReservationToken token;
- CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval, &token);
- CGDisplayFade( token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES );
+ if( blackout_other_displays )
+ {
+ CGAcquireDisplayFadeReservation( kCGMaxDisplayReservationInterval, &token );
+ CGDisplayFade( token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES );
+ }
[[[[VLCMain sharedInstance] controls] fspanel] setNonActive: nil];
SetSystemUIMode( kUIModeNormal, kUIOptionAutoShowMenuBar);
* here */
b_window_is_invisible = YES;
- CGDisplayFade( token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0, 0, 0, NO );
- CGReleaseDisplayFadeReservation( token);
+ if( blackout_other_displays )
+ {
+ CGDisplayFade( token, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0, 0, 0, NO );
+ CGReleaseDisplayFadeReservation( token );
+ }
+
return;
}
for( i = 0; i < (int)[o_values count]; i++)
{
NSDictionary *o_dic;
- o_dic = [NSDictionary dictionaryWithObject:[o_values objectAtIndex:i] forKey:@"ITEM_URL"];
+ char *psz_uri = make_URI([[o_values objectAtIndex:i] UTF8String], NULL);
+ if( !psz_uri )
+ continue;
+
+ o_dic = [NSDictionary dictionaryWithObject:[NSString stringWithCString:psz_uri encoding:NSUTF8StringEncoding] forKey:@"ITEM_URL"];
+ free( psz_uri );
+
o_array = [o_array arrayByAddingObject: o_dic];
}
if( b_autoplay )