o_msg_arr = [[NSMutableArray arrayWithCapacity: 600] retain];
o_open = [[VLCOpen alloc] init];
- //o_embedded_list = [[VLCEmbeddedList alloc] init];
o_coredialogs = [[VLCCoreDialogProvider alloc] init];
o_info = [[VLCInfo alloc] init];
o_mainmenu = [[VLCMainMenu alloc] init];
var_SetBool(p_playlist, "fullscreen", YES);
}
- /* load our Core Dialogs nib */
+ /* load our Core and Shared Dialogs nibs */
nib_coredialogs_loaded = [NSBundle loadNibNamed:@"CoreDialogs" owner: NSApp];
+ [NSBundle loadNibNamed:@"SharedDialogs" owner: NSApp];
/* subscribe to various interactive dialogues */
var_Create(p_intf, "dialog-error", VLC_VAR_ADDRESS);
[o_msgs_refresh_btn setImage: [NSImage imageNamed: NSImageNameRefreshTemplate]];
- BOOL b_video_deco = var_InheritBool(VLCIntf, "video-deco");
/* yeah, we are done */
b_nativeFullscreenMode = NO;
#ifdef MAC_OS_X_VERSION_10_7
- if (!OSX_SNOW_LEOPARD && b_video_deco)
+ if (!OSX_SNOW_LEOPARD)
b_nativeFullscreenMode = var_InheritBool(p_intf, "macosx-nativefullscreenmode");
#endif
[crashLogURLConnection cancel];
[crashLogURLConnection release];
- [o_embedded_list release];
[o_coredialogs release];
[o_eyetv release];
if (state == PLAYING_S) {
/* prevent the system from sleeping */
IOReturn success;
- CFStringRef reasonForActivity= CFStringCreateWithCString(kCFAllocatorDefault, _("VLC media playback"), kCFStringEncodingUTF8);
- if ([self activeVideoPlayback])
- success = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, reasonForActivity, &systemSleepAssertionID);
- else
- success = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, reasonForActivity, &systemSleepAssertionID);
- CFRelease(reasonForActivity);
+ /* work-around a bug in 10.7.4 and 10.7.5, so check for 10.7.x < 10.7.4, 10.8 and 10.6 */
+ if ((NSAppKitVersionNumber >= 1115.2 && NSAppKitVersionNumber < 1138.45) || OSX_MOUNTAIN_LION || OSX_SNOW_LEOPARD) {
+ CFStringRef reasonForActivity= CFStringCreateWithCString(kCFAllocatorDefault, _("VLC media playback"), kCFStringEncodingUTF8);
+ if ([self activeVideoPlayback])
+ success = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, reasonForActivity, &systemSleepAssertionID);
+ else
+ success = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, reasonForActivity, &systemSleepAssertionID);
+ CFRelease(reasonForActivity);
+ } else {
+ /* fall-back on the 10.5 mode, which also works on 10.7.4 and 10.7.5 */
+ if ([self activeVideoPlayback])
+ success = IOPMAssertionCreate(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, &systemSleepAssertionID);
+ else
+ success = IOPMAssertionCreate(kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, &systemSleepAssertionID);
+ }
if (success == kIOReturnSuccess)
msg_Dbg(VLCIntf, "prevented sleep through IOKit (%i)", systemSleepAssertionID);
bool loop = var_GetBool(p_playlist, "loop");
bool repeat = var_GetBool(p_playlist, "repeat");
if (repeat) {
- [o_mainwindow setRepeatOne];
+ [[o_mainwindow controlsBar] setRepeatOne];
[o_mainmenu setRepeatOne];
} else if (loop) {
- [o_mainwindow setRepeatAll];
+ [[o_mainwindow controlsBar] setRepeatAll];
[o_mainmenu setRepeatAll];
} else {
- [o_mainwindow setRepeatOff];
+ [[o_mainwindow controlsBar] setRepeatOff];
[o_mainmenu setRepeatOff];
}
- [o_mainwindow setShuffle];
+ [[o_mainwindow controlsBar] setShuffle];
[o_mainmenu setShuffle];
}
- (void)setWindowLevel:(NSNumber*)state
{
- if (var_InheritBool(p_intf, "macosx-background"))
+ if (var_InheritBool(p_intf, "video-wallpaper") || [[[[VLCMainWindow sharedInstance] videoView] window] level] < NSNormalWindowLevel)
return;
if ([state unsignedIntValue] & VOUT_WINDOW_STATE_ABOVE)
return o_mainmenu;
}
-- (id)mainWindow
+- (VLCMainWindow *)mainWindow
{
return o_mainwindow;
}
return videoView;
}
-- (id)embeddedList
-{
- if (o_embedded_list)
- return o_embedded_list;
-
- return nil;
-}
-
- (id)coreDialogProvider
{
if (o_coredialogs)