Commit 1e96bee0 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* New OSX controller (iTunes style)

  - Drag and drop implemented
  - still need new sliders and remove the titlebar.
* revert the mozilla plugin changes. i will build a seperate module for that
* simplified previous/next (only playlist, people with chapters and titles
   will have to use the menu
* Moved the disable screensaver from interface to vout.
parent 02619e2b
{
IBClasses = (
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = MPSlider; LANGUAGE = ObjC; SUPERCLASS = NSSlider; },
{
ACTIONS = {showPanel = id; };
CLASS = VLAboutBox;
......@@ -16,6 +17,8 @@
},
{CLASS = VLBrushedMetalImageView; LANGUAGE = ObjC; SUPERCLASS = NSImageView; },
{CLASS = VLCApplication; LANGUAGE = ObjC; SUPERCLASS = NSApplication; },
{CLASS = VLCControllerView; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = VLCControllerWindow; LANGUAGE = ObjC; SUPERCLASS = NSWindow; },
{
ACTIONS = {
backward = id;
......@@ -66,13 +69,13 @@
CLASS = VLCMain;
LANGUAGE = ObjC;
OUTLETS = {
"o_btn_faster" = id;
"o_btn_ff" = id;
"o_btn_fullscreen" = id;
"o_btn_next" = id;
"o_btn_play" = id;
"o_btn_playlist" = id;
"o_btn_prefs" = id;
"o_btn_prev" = id;
"o_btn_slower" = id;
"o_btn_rewind" = id;
"o_btn_stop" = id;
"o_controls" = id;
"o_dmi_mute" = id;
......@@ -171,6 +174,7 @@
"o_mu_window" = id;
"o_playlist" = id;
"o_prefs" = id;
"o_scrollfield" = id;
"o_timefield" = id;
"o_timeslider" = id;
"o_volumeslider" = id;
......
......@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>53 61 772 722 0 0 1280 1002 </string>
<string>27 143 356 496 0 0 1280 1002 </string>
<key>IBEditorPositions</key>
<dict>
<key>1617</key>
......@@ -16,13 +16,11 @@
<key>IBFramework Version</key>
<string>349.0</string>
<key>IBLockedObjects</key>
<array>
<integer>977</integer>
</array>
<array/>
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
<integer>21</integer>
<integer>1647</integer>
</array>
<key>IBSystem Version</key>
<string>7C107</string>
......
extras/MacOSX/Resources/pause.png

1.61 KB | W: | H:

extras/MacOSX/Resources/pause.png

2.77 KB | W: | H:

extras/MacOSX/Resources/pause.png
extras/MacOSX/Resources/pause.png
extras/MacOSX/Resources/pause.png
extras/MacOSX/Resources/pause.png
  • 2-up
  • Swipe
  • Onion skin
extras/MacOSX/Resources/play.png

1000 Bytes | W: | H:

extras/MacOSX/Resources/play.png

2.95 KB | W: | H:

extras/MacOSX/Resources/play.png
extras/MacOSX/Resources/play.png
extras/MacOSX/Resources/play.png
extras/MacOSX/Resources/play.png
  • 2-up
  • Swipe
  • Onion skin
extras/MacOSX/Resources/stop.png

547 Bytes | W: | H:

extras/MacOSX/Resources/stop.png

1.13 KB | W: | H:

extras/MacOSX/Resources/stop.png
extras/MacOSX/Resources/stop.png
extras/MacOSX/Resources/stop.png
extras/MacOSX/Resources/stop.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -6,7 +6,7 @@
objectVersion = 39;
objects = {
014CEA410018CDE011CA2923 = {
expectedFileType = wrapper.cfbundle;
expectedFileType = "wrapper.plug-in";
fallbackIsa = PBXFileReference;
isa = PBXBundleReference;
path = VLC.bundle;
......@@ -607,17 +607,6 @@
F6E4F91402D2648B01A80112,
F6E4F91502D2648B01A80112,
F69B0CA802E24F6401A80112,
A064F9EA03CB9EE000B21232,
A064F9EB03CB9EE000B21232,
A064F9EC03CB9EE000B21232,
A064F9ED03CB9EE000B21232,
A064F9EE03CB9EE000B21232,
A064F9EF03CB9EE000B21232,
A064F9F003CB9EE000B21232,
A064F9F103CB9EE000B21232,
A064F9F203CB9EE000B21232,
A064F9F303CB9EE000B21232,
8E88833D03DD6E870059A3A7,
8ED6C29F03E2F32E0059A3A7,
8ED6C2A003E2F32E0059A3A7,
8EBF3FA403F13FFB0059A3A7,
......@@ -648,6 +637,32 @@
8E445FB004728A700059A3A7,
8E445FB104728A700059A3A7,
8E445FB204728A700059A3A7,
8E9390B40565D6D300C7661C,
8E9390B50565D6D300C7661C,
8E9390B60565D6D300C7661C,
8E9390B70565D6D300C7661C,
8E9390B80565D6D300C7661C,
8E9390B90565D6D300C7661C,
8E9390BA0565D6D300C7661C,
8E9390BB0565D6D300C7661C,
8E9390BC0565D6D300C7661C,
8E9390BD0565D6D300C7661C,
8E9390BE0565D6D300C7661C,
8E9390BF0565D6D300C7661C,
8E9390C00565D6D300C7661C,
8E9390C10565D6D300C7661C,
8E9390C20565D6D300C7661C,
8E9390C30565D6D300C7661C,
8E9390C40565D6D300C7661C,
8E9390C50565D6D300C7661C,
8E9390C60565D6D300C7661C,
8E9390C70565D6D300C7661C,
8E9390C80565D6D300C7661C,
8E9390C90565D6D300C7661C,
8E9390CA0565D6D300C7661C,
8E9390CB0565D6D300C7661C,
8E9390CC0565D6D300C7661C,
8E9390CD0565D6D300C7661C,
);
isa = PBXResourcesBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
......@@ -671,17 +686,7 @@
children = (
F74F13EA02C2A79C01EE194C,
8E445F86047289E50059A3A7,
A064F9E003CB9EE000B21232,
A064F9E103CB9EE000B21232,
A064F9E203CB9EE000B21232,
A064F9E303CB9EE000B21232,
A064F9E403CB9EE000B21232,
A064F9E503CB9EE000B21232,
A064F9E603CB9EE000B21232,
A064F9E703CB9EE000B21232,
A064F9E803CB9EE000B21232,
A064F9E903CB9EE000B21232,
8E88833C03DD6E870059A3A7,
8ECA7E520563CD9500DFC000,
8EE1AFA30444660F0059A3A7,
F69B0CA602E24F6401A80112,
8ED6C29D03E2F32E0059A3A7,
......@@ -1203,16 +1208,366 @@
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E88833C03DD6E870059A3A7 = {
8E93909A0565D6D300C7661C = {
expectedFileType = image.png;
isa = PBXFileReference;
name = slow.png;
path = Resources/slow.png;
refType = 4;
sourceTree = "<group>";
name = display_slider.png;
path = Resources/display_slider.png;
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E93909B0565D6D300C7661C = {
expectedFileType = image.png;
isa = PBXFileReference;
name = display_track.png;
path = Resources/display_track.png;
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E93909C0565D6D300C7661C = {
expectedFileType = image.png;
isa = PBXFileReference;
name = display.png;
path = Resources/display.png;
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E88833D03DD6E870059A3A7 = {
fileRef = 8E88833C03DD6E870059A3A7;
8E93909D0565D6D300C7661C = {
expectedFileType = image.png;
isa = PBXFileReference;
name = fullscreen_active.png;
path = Resources/fullscreen_active.png;
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E93909E0565D6D300C7661C = {
expectedFileType = image.png;
isa = PBXFileReference;
name = fullscreen_blue.png;
path = Resources/fullscreen_blue.png;
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E93909F0565D6D300C7661C = {
expectedFileType = image.png;
isa = PBXFileReference;
name = next_active.png;
path = Resources/next_active.png;
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E9390A00565D6D300C7661C = {
expectedFileType = image.png;
isa = PBXFileReference;
name = next_blue.png;
path = Resources/next_blue.png;
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E9390A10565D6D300C7661C = {
expectedFileType = image.png;
isa = PBXFileReference;
name = pause_blue.png;
path = Resources/pause_blue.png;
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E9390A20565D6D300C7661C = {
expectedFileType = image.png;
isa = PBXFileReference;
name = pause.png;
path = Resources/pause.png;
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E9390A30565D6D300C7661C = {
expectedFileType = image.png;
isa = PBXFileReference;
name = play_blue.png;
path = Resources/play_blue.png;
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E9390A40565D6D300C7661C = {
expectedFileType = image.png;
isa = PBXFileReference;
name = play.png;
path = Resources/play.png;
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E9390A50565D6D300C7661C = {
expectedFileType = image.png;
isa = PBXFileReference;
name = playlistdrawer_active.png;
path = Resources/playlistdrawer_active.png;
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E9390A60565D6D300C7661C = {
expectedFileType = image.png;
isa = PBXFileReference;
name = playlistdrawer_blue.png;
path = Resources/playlistdrawer_blue.png;
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E9390A70565D6D300C7661C = {
expectedFileType = image.png;
isa = PBXFileReference;
name = previous_active.png;
path = Resources/previous_active.png;
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E9390A80565D6D300C7661C = {
expectedFileType = image.png;
isa = PBXFileReference;
name = previous_blue.png;
path = Resources/previous_blue.png;
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E9390A90565D6D300C7661C = {
expectedFileType = image.png;
isa = PBXFileReference;
name = skip_forward_active.png;
path = Resources/skip_forward_active.png;
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E9390AA0565D6D300C7661C = {
expectedFileType = image.png;
isa = PBXFileReference;
name = skip_forward_blue.png;
path = Resources/skip_forward_blue.png;
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E9390AB0565D6D300C7661C = {
expectedFileType = image.png;
isa = PBXFileReference;
name = skip_previous_active.png;
path = Resources/skip_previous_active.png;
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E9390AC0565D6D300C7661C = {
expectedFileType = image.png;
isa = PBXFileReference;
name = skip_previous_blue.png;
path = Resources/skip_previous_blue.png;
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E9390AD0565D6D300C7661C = {
expectedFileType = image.png;
isa = PBXFileReference;
name = stop_blue.png;
path = Resources/stop_blue.png;
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E9390AE0565D6D300C7661C = {
expectedFileType = image.png;
isa = PBXFileReference;
name = stop.png;
path = Resources/stop.png;
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E9390AF0565D6D300C7661C = {
expectedFileType = image.png;
isa = PBXFileReference;
name = volume_high.png;
path = Resources/volume_high.png;
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E9390B00565D6D300C7661C = {
expectedFileType = image.png;
isa = PBXFileReference;
name = volume_low.png;
path = Resources/volume_low.png;
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E9390B10565D6D300C7661C = {
expectedFileType = image.png;
isa = PBXFileReference;
name = volumeslider_blue.png;
path = Resources/volumeslider_blue.png;
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E9390B20565D6D300C7661C = {
expectedFileType = image.png;
isa = PBXFileReference;
name = volumeslider_normal.png;
path = Resources/volumeslider_normal.png;
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E9390B30565D6D300C7661C = {
expectedFileType = image.png;
isa = PBXFileReference;
name = volumetrack.png;
path = Resources/volumetrack.png;
refType = 2;
sourceTree = SOURCE_ROOT;
};
8E9390B40565D6D300C7661C = {
fileRef = 8E93909A0565D6D300C7661C;
isa = PBXBuildFile;
settings = {
};
};
8E9390B50565D6D300C7661C = {
fileRef = 8E93909B0565D6D300C7661C;
isa = PBXBuildFile;
settings = {
};
};
8E9390B60565D6D300C7661C = {
fileRef = 8E93909C0565D6D300C7661C;
isa = PBXBuildFile;
settings = {
};
};
8E9390B70565D6D300C7661C = {
fileRef = 8E93909D0565D6D300C7661C;
isa = PBXBuildFile;
settings = {
};
};
8E9390B80565D6D300C7661C = {
fileRef = 8E93909E0565D6D300C7661C;
isa = PBXBuildFile;
settings = {
};
};
8E9390B90565D6D300C7661C = {
fileRef = 8E93909F0565D6D300C7661C;
isa = PBXBuildFile;
settings = {
};
};
8E9390BA0565D6D300C7661C = {
fileRef = 8E9390A00565D6D300C7661C;
isa = PBXBuildFile;
settings = {
};
};
8E9390BB0565D6D300C7661C = {
fileRef = 8E9390A10565D6D300C7661C;
isa = PBXBuildFile;
settings = {
};
};
8E9390BC0565D6D300C7661C = {
fileRef = 8E9390A20565D6D300C7661C;
isa = PBXBuildFile;
settings = {
};
};
8E9390BD0565D6D300C7661C = {
fileRef = 8E9390A30565D6D300C7661C;
isa = PBXBuildFile;
settings = {
};
};
8E9390BE0565D6D300C7661C = {
fileRef = 8E9390A40565D6D300C7661C;
isa = PBXBuildFile;
settings = {
};
};
8E9390BF0565D6D300C7661C = {
fileRef = 8E9390A50565D6D300C7661C;
isa = PBXBuildFile;
settings = {
};
};
8E9390C00565D6D300C7661C = {
fileRef = 8E9390A60565D6D300C7661C;
isa = PBXBuildFile;
settings = {
};
};
8E9390C10565D6D300C7661C = {
fileRef = 8E9390A70565D6D300C7661C;
isa = PBXBuildFile;
settings = {
};
};
8E9390C20565D6D300C7661C = {
fileRef = 8E9390A80565D6D300C7661C;
isa = PBXBuildFile;
settings = {
};
};
8E9390C30565D6D300C7661C = {
fileRef = 8E9390A90565D6D300C7661C;
isa = PBXBuildFile;
settings = {
};
};
8E9390C40565D6D300C7661C = {
fileRef = 8E9390AA0565D6D300C7661C;
isa = PBXBuildFile;
settings = {
};
};
8E9390C50565D6D300C7661C = {
fileRef = 8E9390AB0565D6D300C7661C;
isa = PBXBuildFile;
settings = {
};
};
8E9390C60565D6D300C7661C = {
fileRef = 8E9390AC0565D6D300C7661C;
isa = PBXBuildFile;
settings = {
};
};
8E9390C70565D6D300C7661C = {
fileRef = 8E9390AD0565D6D300C7661C;
isa = PBXBuildFile;
settings = {
};
};
8E9390C80565D6D300C7661C = {
fileRef = 8E9390AE0565D6D300C7661C;
isa = PBXBuildFile;
settings = {
};
};
8E9390C90565D6D300C7661C = {
fileRef = 8E9390AF0565D6D300C7661C;
isa = PBXBuildFile;
settings = {
};
};
8E9390CA0565D6D300C7661C = {
fileRef = 8E9390B00565D6D300C7661C;
isa = PBXBuildFile;
settings = {
};
};
8E9390CB0565D6D300C7661C = {
fileRef = 8E9390B10565D6D300C7661C;
isa = PBXBuildFile;
settings = {
};
};
8E9390CC0565D6D300C7661C = {
fileRef = 8E9390B20565D6D300C7661C;
isa = PBXBuildFile;
settings = {
};
};
8E9390CD0565D6D300C7661C = {
fileRef = 8E9390B30565D6D300C7661C;
isa = PBXBuildFile;
settings = {
};
......@@ -1269,6 +1624,40 @@
settings = {
};
};
8ECA7E520563CD9500DFC000 = {
children = (
8E93909A0565D6D300C7661C,
8E93909B0565D6D300C7661C,
8E93909C0565D6D300C7661C,
8E93909D0565D6D300C7661C,
8E93909E0565D6D300C7661C,
8E93909F0565D6D300C7661C,
8E9390A00565D6D300C7661C,
8E9390A10565D6D300C7661C,
8E9390A20565D6D300C7661C,
8E9390A30565D6D300C7661C,
8E9390A40565D6D300C7661C,
8E9390A50565D6D300C7661C,
8E9390A60565D6D300C7661C,
8E9390A70565D6D300C7661C,
8E9390A80565D6D300C7661C,
8E9390A90565D6D300C7661C,
8E9390AA0565D6D300C7661C,
8E9390AB0565D6D300C7661C,
8E9390AC0565D6D300C7661C,
8E9390AD0565D6D300C7661C,
8E9390AE0565D6D300C7661C,
8E9390AF0565D6D300C7661C,
8E9390B00565D6D300C7661C,
8E9390B10565D6D300C7661C,
8E9390B20565D6D300C7661C,
8E9390B30565D6D300C7661C,
);
isa = PBXGroup;
name = Controller;
refType = 4;
sourceTree = "<group>";
};
8ED6C27A03E2EB1C0059A3A7 = {
expectedFileType = sourcecode.c.c;
fileEncoding = 30;
......@@ -1508,146 +1897,6 @@
//A02
//A03
//A04
A064F9E003CB9EE000B21232 = {
expectedFileType = image.png;
isa = PBXFileReference;
name = prefs.png;
path = Resources/prefs.png;
refType = 4;
sourceTree = "<group>";
};
A064F9E103CB9EE000B21232 = {
expectedFileType = image.png;
isa = PBXFileReference;
name = end.png;
path = Resources/end.png;
refType = 4;
sourceTree = "<group>";
};
A064F9E203CB9EE000B21232 = {
expectedFileType = image.png;
isa = PBXFileReference;
name = pause.png;
path = Resources/pause.png;
refType = 4;
sourceTree = "<group>";
};
A064F9E303CB9EE000B21232 = {
expectedFileType = image.png;
isa = PBXFileReference;
name = list.png;
path = Resources/list.png;
refType = 4;
sourceTree = "<group>";
};
A064F9E403CB9EE000B21232 = {
expectedFileType = image.png;
isa = PBXFileReference;
name = forw.png;
path = Resources/forw.png;
refType = 4;
sourceTree = "<group>";
};
A064F9E503CB9EE000B21232 = {
expectedFileType = image.png;
isa = PBXFileReference;
name = vlc_hg.png;
path = Resources/vlc_hg.png;
refType = 4;
sourceTree = "<group>";
};
A064F9E603CB9EE000B21232 = {
expectedFileType = image.png;
isa = PBXFileReference;
name = stop.png;
path = Resources/stop.png;
refType = 4;
sourceTree = "<group>";
};
A064F9E703CB9EE000B21232 = {
expectedFileType = image.png;
isa = PBXFileReference;
name = begin.png;
path = Resources/begin.png;
refType = 4;
sourceTree = "<group>";
};
A064F9E803CB9EE000B21232 = {
expectedFileType = image.png;
isa = PBXFileReference;
name = back.png;
path = Resources/back.png;
refType = 4;
sourceTree = "<group>";
};
A064F9E903CB9EE000B21232 = {
expectedFileType = image.png;
isa = PBXFileReference;
name = play.png;
path = Resources/play.png;
refType = 4;
sourceTree = "<group>";
};
A064F9EA03CB9EE000B21232 = {
fileRef = A064F9E003CB9EE000B21232;
isa = PBXBuildFile;
settings = {
};
};
A064F9EB03CB9EE000B21232 = {
fileRef = A064F9E103CB9EE000B21232;
isa = PBXBuildFile;
settings = {
};
};
A064F9EC03CB9EE000B21232 = {
fileRef = A064F9E203CB9EE000B21232;
isa = PBXBuildFile;
settings = {
};
};
A064F9ED03CB9EE000B21232 = {
fileRef = A064F9E303CB9EE000B21232;
isa = PBXBuildFile;
settings = {
};
};
A064F9EE03CB9EE000B21232 = {
fileRef = A064F9E403CB9EE000B21232;
isa = PBXBuildFile;
settings = {
};
};
A064F9EF03CB9EE000B21232 = {
fileRef = A064F9E503CB9EE000B21232;
isa = PBXBuildFile;
settings = {
};
};
A064F9F003CB9EE000B21232 = {
fileRef = A064F9E603CB9EE000B21232;
isa = PBXBuildFile;
settings = {
};
};
A064F9F103CB9EE000B21232 = {
fileRef = A064F9E703CB9EE000B21232;
isa = PBXBuildFile;
settings = {
};
};
A064F9F203CB9EE000B21232 = {
fileRef = A064F9E803CB9EE000B21232;
isa = PBXBuildFile;
settings = {
};
};
A064F9F303CB9EE000B21232 = {
fileRef = A064F9E903CB9EE000B21232;
isa = PBXBuildFile;
settings = {
};
};
A0E6B59804407FBD0080DD97 = {
expectedFileType = text;
fileEncoding = 12;
......
......@@ -2,7 +2,7 @@
* controls.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: controls.m,v 1.53 2003/11/11 23:50:41 hartman Exp $
* $Id: controls.m,v 1.54 2003/11/15 22:42:16 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -43,35 +43,46 @@
- (IBAction)play:(id)sender
{
vlc_value_t val;
playlist_t * p_playlist;
intf_thread_t * p_intf = [NSApp getIntf];
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
input_thread_t * p_input = vlc_object_find( p_intf, VLC_OBJECT_INPUT,
FIND_ANYWHERE );
if( p_playlist == NULL )
val.i_int = PLAYING_S;
if( p_input )
{
return;
var_Get( p_input, "state", &val );
}
if( playlist_IsPlaying( p_playlist ) )
if( p_input && val.i_int != PAUSE_S )
{
vout_OSDMessage( (vlc_object_t *)p_intf, _( "Pause" ) );
playlist_Pause( p_playlist );
vlc_object_release( p_playlist );
vout_OSDMessage( VLC_OBJECT(p_intf), _( "Pause" ) );
val.i_int = PAUSE_S;
var_Set( p_input, "state", val );
}
else
{
if( !playlist_IsEmpty( p_playlist ) )
p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist )
{
vlc_mutex_lock( &p_playlist->object_lock );
if( p_playlist->i_size )
{
vlc_mutex_unlock( &p_playlist->object_lock );
vout_OSDMessage( VLC_OBJECT(p_intf), _( "Play" ) );
playlist_Play( p_playlist );
vout_OSDMessage( (vlc_object_t *)p_intf, _( "Play" ) );
vlc_object_release( p_playlist );
}
else
{
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
[o_open openFileGeneric: nil];
}
}
}
if( p_input ) vlc_object_release( p_input );
}
- (IBAction)stop:(id)sender
......@@ -119,100 +130,28 @@
- (IBAction)prev:(id)sender
{
vlc_value_t val;
intf_thread_t * p_intf = [NSApp getIntf];
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
vlc_mutex_lock( &p_playlist->object_lock );
if( p_playlist->p_input == NULL )
{
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
return;
}
vlc_mutex_lock( &p_playlist->p_input->stream.stream_lock );
val.b_bool = VLC_TRUE;
#define p_area p_playlist->p_input->stream.p_selected_area
if( p_area->i_part > 0 && p_area->i_part_nb > 1)
{
vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
var_Set( p_playlist->p_input, "prev-chapter", val );
vlc_mutex_unlock( &p_playlist->object_lock );
}
else if( p_area->i_id > 1 )
{
vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
var_Set( p_playlist->p_input, "prev-title", val );
vlc_mutex_unlock( &p_playlist->object_lock );
}
else
if( p_playlist )
{
vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
vlc_mutex_unlock( &p_playlist->object_lock );
playlist_Prev( p_playlist );
}
#undef p_area
vlc_object_release( p_playlist );
vout_OSDMessage( (vlc_object_t *)p_intf, _( "Previous" ) );
}
}
- (IBAction)next:(id)sender
{
vlc_value_t val;
intf_thread_t * p_intf = [NSApp getIntf];
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
vlc_mutex_lock( &p_playlist->object_lock );
if( p_playlist->p_input == NULL )
{
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
return;
}
vlc_mutex_lock( &p_playlist->p_input->stream.stream_lock );
val.b_bool = VLC_TRUE;
#define p_area p_playlist->p_input->stream.p_selected_area
if( p_area->i_part < p_area->i_part_nb - 1 && p_area->i_part_nb > 1 )
{
vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
var_Set( p_playlist->p_input, "next-chapter", val );
vlc_mutex_unlock( &p_playlist->object_lock );
}
else if( p_area->i_id < p_playlist->p_input->stream.i_area_nb && p_playlist->p_input->stream.i_area_nb > 1 )
{
vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
var_Set( p_playlist->p_input, "next-title", val );
vlc_mutex_unlock( &p_playlist->object_lock );
}
else
if( p_playlist )
{
vlc_mutex_unlock( &p_playlist->p_input->stream.stream_lock );
vlc_mutex_unlock( &p_playlist->object_lock );
playlist_Next( p_playlist );
}
#undef p_area
vlc_object_release( p_playlist );
vout_OSDMessage( (vlc_object_t *)p_intf, _( "Next" ) );
}
}
- (IBAction)random:(id)sender
......@@ -397,9 +336,7 @@
{
if( [[o_window className] isEqualToString: @"VLCWindow"] )
{
if( [o_title isEqualToString: _NS("Fullscreen") ] )
[o_window toggleFullscreen];
else if( [o_title isEqualToString: _NS("Half Size") ] )
if( [o_title isEqualToString: _NS("Half Size") ] )
[o_window scaleWindowWithFactor: 0.5];
else if( [o_title isEqualToString: _NS("Normal Size") ] )
[o_window scaleWindowWithFactor: 1.0];
......@@ -412,6 +349,8 @@
if( ![o_window isZoomed] )
[o_window performZoom:self];
}
else
[o_window toggleFullscreen];
break;
}
}
......
......@@ -2,7 +2,7 @@
* intf.h: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: intf.h,v 1.48 2003/11/11 23:50:41 hartman Exp $
* $Id: intf.h,v 1.49 2003/11/15 22:42:16 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -93,6 +93,7 @@ struct intf_sys_t
id o_prefs; /* VLCPrefs */
IBOutlet id o_window; /* main window */
IBOutlet id o_infofield; /* info field */
IBOutlet id o_timefield; /* time field */
IBOutlet id o_timeslider; /* time slider */
float f_slider; /* slider value */
......@@ -101,15 +102,17 @@ struct intf_sys_t
IBOutlet id o_btn_playlist; /* btn playlist */
IBOutlet id o_btn_prev; /* btn previous */
IBOutlet id o_btn_slower; /* btn slower */
IBOutlet id o_btn_rewind; /* btn rewind */
IBOutlet id o_btn_play; /* btn play */
IBOutlet id o_btn_stop; /* btn stop */
IBOutlet id o_btn_faster; /* btn faster */
IBOutlet id o_btn_ff; /* btn fast forward */
IBOutlet id o_btn_next; /* btn next */
IBOutlet id o_btn_prefs; /* btn prefs */
IBOutlet id o_btn_fullscreen;/* btn fullscreen */
NSImage * o_img_play; /* btn play img */
NSImage * o_img_pause; /* btn pause img */
NSImage * o_img_play_pressed; /* btn play img */
NSImage * o_img_pause_pressed; /* btn pause img */
IBOutlet id o_controls; /* VLCControls */
IBOutlet id o_playlist; /* VLCPlaylist */
......@@ -226,6 +229,7 @@ struct intf_sys_t
}
- (id)getControls;
- (id)getPlaylist;
- (void)terminate;
- (void)initStrings;
......
......@@ -2,7 +2,7 @@
* intf.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: intf.m,v 1.100 2003/11/11 23:50:41 hartman Exp $
* $Id: intf.m,v 1.101 2003/11/15 22:42:16 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -431,12 +431,12 @@ unsigned int VLCModifiersToCocoa( unsigned int i_key )
/* button controls */
[o_btn_playlist setToolTip: _NS("Playlist")];
[o_btn_prev setToolTip: _NS("Previous")];
[o_btn_slower setToolTip: _NS("Slower")];
[o_btn_rewind setToolTip: _NS("Rewind")];
[o_btn_play setToolTip: _NS("Play")];
[o_btn_stop setToolTip: _NS("Stop")];
[o_btn_faster setToolTip: _NS("Faster")];
[o_btn_ff setToolTip: _NS("Fast Forward")];
[o_btn_next setToolTip: _NS("Next")];
[o_btn_prefs setToolTip: _NS("Preferences")];
[o_btn_fullscreen setToolTip: _NS("Fullscreen")];
[o_volumeslider setToolTip: _NS("Volume")];
[o_timeslider setToolTip: _NS("Position")];
......@@ -556,7 +556,9 @@ unsigned int VLCModifiersToCocoa( unsigned int i_key )
o_msg_arr = [[NSMutableArray arrayWithCapacity: 200] retain];
o_img_play = [[NSImage imageNamed: @"play"] retain];
o_img_play_pressed = [[NSImage imageNamed: @"play_blue"] retain];
o_img_pause = [[NSImage imageNamed: @"pause"] retain];
o_img_pause_pressed = [[NSImage imageNamed: @"pause_blue"] retain];
[p_intf->p_sys->o_sendport setDelegate: self];
[[NSRunLoop currentRunLoop]
......@@ -591,6 +593,15 @@ unsigned int VLCModifiersToCocoa( unsigned int i_key )
return nil;
}
- (id)getPlaylist
{
if ( o_playlist )
{
return o_playlist;
}
return nil;
}
- (void)manage
{
NSDate * o_sleep_date;
......@@ -715,7 +726,6 @@ unsigned int VLCModifiersToCocoa( unsigned int i_key )
vlc_bool_t b_control = VLC_FALSE;
vlc_bool_t b_seekable = VLC_FALSE;
vlc_bool_t b_chapters = VLC_FALSE;
vlc_value_t val;
b_plmul = p_playlist->i_size > 1;
......@@ -733,23 +743,11 @@ unsigned int VLCModifiersToCocoa( unsigned int i_key )
b_chapters = p_input->stream.i_area_nb > 1;
vlc_mutex_unlock( &p_input->stream.stream_lock );
/* play status */
var_Get( p_input, "state", &val );
p_intf->p_sys->b_play_status = val.i_int != PAUSE_S;
}
else
{
/* play status */
p_intf->p_sys->b_play_status = FALSE;
[self setSubmenusEnabled: FALSE];
}
[self playStatusUpdated: p_intf->p_sys->b_play_status];
[o_btn_stop setEnabled: b_input];
[o_btn_faster setEnabled: b_control];
[o_btn_slower setEnabled: b_control];
[o_btn_ff setEnabled: b_control];
[o_btn_rewind setEnabled: b_control];
[o_btn_prev setEnabled: (b_plmul || b_chapters)];
[o_btn_next setEnabled: (b_plmul || b_chapters)];
......@@ -764,19 +762,9 @@ unsigned int VLCModifiersToCocoa( unsigned int i_key )
if( p_intf->p_sys->b_playing && p_input != NULL )
{
vlc_value_t time, val;
vlc_value_t time;
NSString * o_time;
mtime_t i_seconds;
var_Get( p_input, "state", &val );
if( !p_input->b_die && ( p_intf->p_sys->b_play_status !=
( val.i_int != PAUSE_S ) ) )
{
p_intf->p_sys->b_play_status =
!p_intf->p_sys->b_play_status;
[self playStatusUpdated: p_intf->p_sys->b_play_status];
}
if( p_input->stream.b_seekable )
{
......@@ -800,9 +788,27 @@ unsigned int VLCModifiersToCocoa( unsigned int i_key )
(int) (i_seconds / 60 % 60),
(int) (i_seconds % 60)];
[o_timefield setStringValue: o_time];
}
if( p_input )
{
vlc_value_t val;
var_Get( p_input, "state", &val );
/* disable screen saver */
UpdateSystemActivity( UsrActivity );
if( val.i_int != PAUSE_S )
{
p_intf->p_sys->b_play_status = TRUE;
}
else
{
p_intf->p_sys->b_play_status = FALSE;
}
[self playStatusUpdated: p_intf->p_sys->b_play_status];
}
else
{
p_intf->p_sys->b_play_status = FALSE;
[self playStatusUpdated: p_intf->p_sys->b_play_status];
[self setSubmenusEnabled: FALSE];
}
#undef p_input
......@@ -964,6 +970,7 @@ unsigned int VLCModifiersToCocoa( unsigned int i_key )
if( b_pause )
{
[o_btn_play setImage: o_img_pause];
[o_btn_play setAlternateImage: o_img_pause_pressed];
[o_btn_play setToolTip: _NS("Pause")];
[o_mi_play setTitle: _NS("Pause")];
[o_dmi_play setTitle: _NS("Pause")];
......@@ -971,6 +978,7 @@ unsigned int VLCModifiersToCocoa( unsigned int i_key )
else
{
[o_btn_play setImage: o_img_play];
[o_btn_play setAlternateImage: o_img_play_pressed];
[o_btn_play setToolTip: _NS("Play")];
[o_mi_play setTitle: _NS("Play")];
[o_dmi_play setTitle: _NS("Play")];
......@@ -983,6 +991,7 @@ unsigned int VLCModifiersToCocoa( unsigned int i_key )
[o_mi_title setEnabled: b_enabled];
[o_mi_chapter setEnabled: b_enabled];
[o_mi_audiotrack setEnabled: b_enabled];
[o_mi_visual setEnabled: b_enabled];
[o_mi_videotrack setEnabled: b_enabled];
[o_mi_subtitle setEnabled: b_enabled];
[o_mi_channels setEnabled: b_enabled];
......@@ -1073,6 +1082,18 @@ unsigned int VLCModifiersToCocoa( unsigned int i_key )
playlist_Destroy( p_playlist );
}
if( o_img_pause_pressed != nil )
{
[o_img_pause_pressed release];
o_img_pause_pressed = nil;
}
if( o_img_pause_pressed != nil )
{
[o_img_pause_pressed release];
o_img_pause_pressed = nil;
}
if( o_img_pause != nil )
{
[o_img_pause release];
......
......@@ -2,7 +2,7 @@
* misc.h: code not specific to vlc
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: misc.h,v 1.2 2003/03/13 22:24:17 hartman Exp $
* $Id: misc.h,v 1.3 2003/11/15 22:42:16 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
*
......@@ -21,6 +21,26 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* VLCControllerWindow
*****************************************************************************/
@interface VLCControllerWindow : NSWindow
{
}
@end
/*****************************************************************************
* VLCControllerView
*****************************************************************************/
@interface VLCControllerView : NSView
{
}
@end
/*****************************************************************************
* VLBrushedMetalImageView
*****************************************************************************/
......
......@@ -2,7 +2,7 @@
* misc.m: code not specific to vlc
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: misc.m,v 1.2 2003/03/13 22:24:17 hartman Exp $
* $Id: misc.m,v 1.3 2003/11/15 22:42:16 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
*
......@@ -24,6 +24,98 @@
#include <Cocoa/Cocoa.h>
#include "misc.h"
#include "playlist.h"
/*****************************************************************************
* VLCControllerWindow
*****************************************************************************/
@implementation VLCControllerWindow
- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned int)styleMask
backing:(NSBackingStoreType)backingType defer:(BOOL)flag
{
self = [super initWithContentRect:contentRect styleMask:styleMask //& ~NSTitledWindowMask
backing:backingType defer:flag];
return( self );
}
@end
/*****************************************************************************
* VLCControllerView
*****************************************************************************/
@implementation VLCControllerView
- (void)dealloc
{
[self unregisterDraggedTypes];
[super dealloc];
}
- (void)awakeFromNib
{
[self registerForDraggedTypes:[NSArray arrayWithObjects:NSTIFFPboardType,
NSFilenamesPboardType, nil]];
}
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
{
if ((NSDragOperationGeneric & [sender draggingSourceOperationMask])
== NSDragOperationGeneric)
{
return NSDragOperationGeneric;
}
else
{
return NSDragOperationNone;
}
}
- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
{
return YES;
}
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
NSPasteboard *o_paste = [sender draggingPasteboard];
NSArray *o_types = [NSArray arrayWithObjects: NSFilenamesPboardType, nil];
NSString *o_desired_type = [o_paste availableTypeFromArray:o_types];
NSData *o_carried_data = [o_paste dataForType:o_desired_type];
if( o_carried_data )
{
if ([o_desired_type isEqualToString:NSFilenamesPboardType])
{
int i;
NSArray *o_array = [NSArray array];
NSArray *o_values = [[o_paste propertyListForType: NSFilenamesPboardType]
sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
for( i = 0; i < (int)[o_values count]; i++)
{
NSDictionary *o_dic;
o_dic = [NSDictionary dictionaryWithObject:[o_values objectAtIndex:i] forKey:@"ITEM_URL"];
o_array = [o_array arrayByAddingObject: o_dic];
}
[(VLCPlaylist *)[[NSApp delegate] getPlaylist] appendArray: o_array atPos: -1 enqueue:NO];
return YES;
}
}
[self setNeedsDisplay:YES];
return YES;
}
- (void)concludeDragOperation:(id <NSDraggingInfo>)sender
{
[self setNeedsDisplay:YES];
}
@end
/*****************************************************************************
* VLBrushedMetalImageView
......@@ -36,6 +128,71 @@
return YES;
}
- (void)dealloc
{
[self unregisterDraggedTypes];
[super dealloc];
}
- (void)awakeFromNib
{
[self registerForDraggedTypes:[NSArray arrayWithObjects:NSTIFFPboardType,
NSFilenamesPboardType, nil]];
}
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
{
if ((NSDragOperationGeneric & [sender draggingSourceOperationMask])
== NSDragOperationGeneric)
{
return NSDragOperationGeneric;
}
else
{
return NSDragOperationNone;
}
}
- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
{
return YES;
}
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
NSPasteboard *o_paste = [sender draggingPasteboard];
NSArray *o_types = [NSArray arrayWithObjects: NSFilenamesPboardType, nil];
NSString *o_desired_type = [o_paste availableTypeFromArray:o_types];
NSData *o_carried_data = [o_paste dataForType:o_desired_type];
if( o_carried_data )
{
if ([o_desired_type isEqualToString:NSFilenamesPboardType])
{
int i;
NSArray *o_array = [NSArray array];
NSArray *o_values = [[o_paste propertyListForType: NSFilenamesPboardType]
sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
for( i = 0; i < (int)[o_values count]; i++)
{
NSDictionary *o_dic;
o_dic = [NSDictionary dictionaryWithObject:[o_values objectAtIndex:i] forKey:@"ITEM_URL"];
o_array = [o_array arrayByAddingObject: o_dic];
}
[(VLCPlaylist *)[[NSApp delegate] getPlaylist] appendArray: o_array atPos: -1 enqueue:NO];
return YES;
}
}
[self setNeedsDisplay:YES];
return YES;
}
- (void)concludeDragOperation:(id <NSDraggingInfo>)sender
{
[self setNeedsDisplay:YES];
}
@end
......@@ -70,7 +227,7 @@
alpha: 1.0] retain];
_knobColor = [[NSColor blackColor] retain];
}
NSLog(@"boe");
return( self );
}
......
......@@ -2,7 +2,7 @@
* playlist.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: playlist.m,v 1.37 2003/11/12 02:45:26 hartman Exp $
* $Id: playlist.m,v 1.38 2003/11/15 22:42:16 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Derk-Jan Hartman <thedj@users.sourceforge.net>
......@@ -305,7 +305,6 @@
temp = strrchr( psz_dev , 's' );
psz_dev[temp - psz_dev] = '\0';
o_url = [NSString stringWithCString: psz_dev ];
NSLog(@"%@", o_url);
}
if (i_item == 0 && !b_enqueue)
......
......@@ -2,7 +2,7 @@
* vout.h: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: vout.h,v 1.15 2003/11/06 16:28:28 hartman Exp $
* $Id: vout.h,v 1.16 2003/11/15 22:42:16 hartman Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org>
......@@ -73,10 +73,6 @@ struct vout_sys_t
NSRect s_rect;
int b_pos_saved;
VLCWindow * o_window;
Rect rect;
int portx;
int porty;
int isplugin;
vlc_bool_t b_mouse_moved;
mtime_t i_time_mouse_last_moved;
......@@ -84,12 +80,10 @@ struct vout_sys_t
#ifdef __QUICKTIME__
CodecType i_codec;
CGrafPtr p_qdport;
CGrafPtr p_qdportold;
ImageSequence i_seq;
MatrixRecordPtr p_matrix;
DecompressorComponent img_dc;
ImageDescriptionHandle h_img_descr;
Ptr p_fullscreen_state;
RgnHandle mask;
#endif
};
/*****************************************************************************
* vout.m: MacOS X video output plugin
*****************************************************************************
* Copyright (C) 2001-2003 VideoLAN
* $Id: vout.m,v 1.64 2003/11/11 23:50:41 hartman Exp $
* $Id: vout.m,v 1.65 2003/11/15 22:42:16 hartman Exp $
*
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org>
......@@ -83,9 +82,6 @@ int E_(OpenVideo) ( vlc_object_t *p_this )
vout_thread_t * p_vout = (vout_thread_t *)p_this;
OSErr err;
int i_timeout;
vlc_value_t value_drawable;
var_Get( p_vout->p_vlc, "drawable", &value_drawable );
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL )
......@@ -96,9 +92,6 @@ int E_(OpenVideo) ( vlc_object_t *p_this )
memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
/* We don't need an intf in mozilla plugin */
if( value_drawable.i_int == 0 )
{
/* Wait for a MacOS X interface to appear. Timeout is 2 seconds. */
for( i_timeout = 20 ; i_timeout-- ; )
{
......@@ -116,7 +109,6 @@ int E_(OpenVideo) ( vlc_object_t *p_this )
return( 1 );
}
if( [NSApp respondsToSelector: @selector(getIntf)] )
{
intf_thread_t * p_intf;
......@@ -136,7 +128,6 @@ int E_(OpenVideo) ( vlc_object_t *p_this )
return( 1 );
}
}
}
p_vout->p_sys->h_img_descr =
(ImageDescriptionHandle)NewHandleClear( sizeof(ImageDescription) );
......@@ -146,22 +137,6 @@ int E_(OpenVideo) ( vlc_object_t *p_this )
p_vout->p_sys->b_mouse_moved = VLC_TRUE;
p_vout->p_sys->i_time_mouse_last_moved = mdate();
if( value_drawable.i_int != 0 )
{
p_vout->p_sys->mask = NewRgn();
p_vout->p_sys->rect.left = 0 ;
p_vout->p_sys->rect.right = 0 ;
p_vout->p_sys->rect.top = 0 ;
p_vout->p_sys->rect.bottom = 0 ;
p_vout->p_sys->isplugin = VLC_TRUE ;
} else
{
p_vout->p_sys->mask = NULL;
p_vout->p_sys->isplugin = VLC_FALSE ;
}
/* set window size */
p_vout->p_sys->s_rect.size.width = p_vout->i_window_width;
p_vout->p_sys->s_rect.size.height = p_vout->i_window_height;
......@@ -246,9 +221,6 @@ int E_(OpenVideo) ( vlc_object_t *p_this )
}
[o_pool release];
/* We don't need a window either in the mozilla plugin */
if( p_vout->p_sys->isplugin == 0 )
{
if( CoCreateWindow( p_vout ) )
{
msg_Err( p_vout, "unable to create window" );
......@@ -257,7 +229,6 @@ int E_(OpenVideo) ( vlc_object_t *p_this )
free( p_vout->p_sys );
return( 1 );
}
}
p_vout->pf_init = vout_Init;
p_vout->pf_end = vout_End;
......@@ -275,7 +246,6 @@ static int vout_Init( vout_thread_t *p_vout )
{
int i_index;
picture_t *p_pic;
vlc_value_t val;
I_OUTPUTPICTURES = 0;
......@@ -286,13 +256,6 @@ static int vout_Init( vout_thread_t *p_vout )
p_vout->output.i_height = p_vout->render.i_height;
p_vout->output.i_aspect = p_vout->render.i_aspect;
var_Get( p_vout->p_vlc, "drawable", &val );
if( p_vout->p_sys->isplugin )
{
p_vout->p_sys->p_qdport = val.i_int;
}
SetPort( p_vout->p_sys->p_qdport );
QTScaleMatrix( p_vout );
......@@ -358,13 +321,10 @@ void E_(CloseVideo) ( vlc_object_t *p_this )
{
vout_thread_t * p_vout = (vout_thread_t *)p_this;
if ( !p_vout->p_sys->isplugin )
{
if( CoDestroyWindow( p_vout ) )
{
msg_Err( p_vout, "unable to destroy window" );
}
}
if ( p_vout->p_sys->p_fullscreen_state != NULL )
EndFullScreen ( p_vout->p_sys->p_fullscreen_state, NULL );
......@@ -385,9 +345,6 @@ void E_(CloseVideo) ( vlc_object_t *p_this )
*****************************************************************************/
static int vout_Manage( vout_thread_t *p_vout )
{
vlc_value_t val1;
var_Get( p_vout->p_vlc, "drawableredraw", &val1 );
if( p_vout->i_changes & VOUT_FULLSCREEN_CHANGE )
{
if( CoToggleFullscreen( p_vout ) )
......@@ -398,24 +355,14 @@ static int vout_Manage( vout_thread_t *p_vout )
p_vout->i_changes &= ~VOUT_FULLSCREEN_CHANGE;
}
if( (p_vout->i_changes & VOUT_SIZE_CHANGE) ||
( p_vout->p_sys->isplugin && val1.i_int == 1) )
{
if( p_vout->p_sys->isplugin )
{
val1.i_int = 0;
var_Set( p_vout->p_vlc, "drawableredraw", val1 );
QTScaleMatrix( p_vout );
SetDSequenceMask( p_vout->p_sys->i_seq , p_vout->p_sys->mask );
}
else
if( p_vout->i_changes & VOUT_SIZE_CHANGE )
{
QTScaleMatrix( p_vout );
SetDSequenceMatrix( p_vout->p_sys->i_seq,
p_vout->p_sys->p_matrix );
p_vout->i_changes &= ~VOUT_SIZE_CHANGE;
}
}
/* hide/show mouse cursor
* this code looks unnecessarily complicated, but is necessary like this.
......@@ -432,6 +379,9 @@ static int vout_Manage( vout_thread_t *p_vout )
VLCHideMouse( p_vout, NO );
}
/* disable screen saver */
UpdateSystemActivity( UsrActivity );
return( 0 );
}
......@@ -444,50 +394,7 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
{
OSErr err;
CodecFlags flags;
Rect oldrect;
RgnHandle oldClip;
if( p_vout->p_sys->isplugin )
{
oldClip = NewRgn();
/* In mozilla plugin, mozilla browser also draws things in
* the windows. So we have to update the port/Origin for each
* picture. FIXME : the vout should lock something ! */
GetPort( &p_vout->p_sys->p_qdportold );
GetPortBounds( p_vout->p_sys->p_qdportold, &oldrect );
GetClip( oldClip );
LockPortBits( p_vout->p_sys->p_qdport );
SetPort( p_vout->p_sys->p_qdport );
SetOrigin( p_vout->p_sys->portx , p_vout->p_sys->porty );
ClipRect( &p_vout->p_sys->rect );
if( ( err = DecompressSequenceFrameS(
p_vout->p_sys->i_seq,
p_pic->p_sys->p_info,
p_pic->p_sys->i_size,
codecFlagUseImageBuffer, &flags, nil ) != noErr ) )
{
msg_Warn( p_vout, "DecompressSequenceFrameS failed: %d", err );
}
else
{
QDFlushPortBuffer( p_vout->p_sys->p_qdport, p_vout->p_sys->mask );
}
SetOrigin( oldrect.left , oldrect.top );
SetClip( oldClip );
SetPort( p_vout->p_sys->p_qdportold );
UnlockPortBits( p_vout->p_sys->p_qdport );
}
else
{
if( ( err = DecompressSequenceFrameS(
p_vout->p_sys->i_seq,
p_pic->p_sys->p_info,
......@@ -500,7 +407,6 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
{
QDFlushPortBuffer( p_vout->p_sys->p_qdport, nil );
}
}
}
/*****************************************************************************
......@@ -547,10 +453,8 @@ static int CoCreateWindow( vout_thread_t *p_vout )
*****************************************************************************/
static int CoDestroyWindow( vout_thread_t *p_vout )
{
if( [[NSCursor currentCursor] image] == NULL )
{
VLCHideMouse( p_vout, NO );
}
if( CoSendRequest( p_vout, @selector(destroyWindow:) ) )
{
......@@ -586,6 +490,9 @@ static int CoToggleFullscreen( vout_thread_t *p_vout )
return( 1 );
}
SetPort( p_vout->p_sys->p_qdport );
QTScaleMatrix( p_vout );
if( QTCreateSequence( p_vout ) )
{
msg_Err( p_vout, "unable to create sequence" );
......@@ -635,51 +542,12 @@ static void QTScaleMatrix( vout_thread_t *p_vout )
Fixed factor_x, factor_y;
unsigned int i_offset_x = 0;
unsigned int i_offset_y = 0;
vlc_value_t val;
vlc_value_t valt;
vlc_value_t vall;
vlc_value_t valb;
vlc_value_t valr;
vlc_value_t valx;
vlc_value_t valy;
vlc_value_t valw;
vlc_value_t valh;
vlc_value_t valportx;
vlc_value_t valporty;
GetPortBounds( p_vout->p_sys->p_qdport, &s_rect );
i_width = s_rect.right - s_rect.left;
i_height = s_rect.bottom - s_rect.top;
var_Get( p_vout->p_vlc, "drawable", &val );
var_Get( p_vout->p_vlc, "drawablet", &valt );
var_Get( p_vout->p_vlc, "drawablel", &vall );
var_Get( p_vout->p_vlc, "drawableb", &valb );
var_Get( p_vout->p_vlc, "drawabler", &valr );
var_Get( p_vout->p_vlc, "drawablex", &valx );
var_Get( p_vout->p_vlc, "drawabley", &valy );
var_Get( p_vout->p_vlc, "drawablew", &valw );
var_Get( p_vout->p_vlc, "drawableh", &valh );
var_Get( p_vout->p_vlc, "drawableportx", &valportx );
var_Get( p_vout->p_vlc, "drawableporty", &valporty );
if( p_vout->p_sys->isplugin )
{
p_vout->p_sys->portx = valportx.i_int;
p_vout->p_sys->porty = valporty.i_int;
p_vout->p_sys->p_qdport = val.i_int;
i_width = valw.i_int;
i_height = valh.i_int;
SetRectRgn( p_vout->p_sys->mask , vall.i_int - valx.i_int ,
valt.i_int - valy.i_int , valr.i_int - valx.i_int ,
valb.i_int - valy.i_int );
p_vout->p_sys->rect.top = 0;
p_vout->p_sys->rect.left = 0;
p_vout->p_sys->rect.bottom = valb.i_int - valt.i_int;
p_vout->p_sys->rect.right = valr.i_int - vall.i_int;
}
if( i_height * p_vout->output.i_aspect < i_width * VOUT_ASPECT_FACTOR )
{
int i_adj_width = i_height * p_vout->output.i_aspect /
......@@ -690,7 +558,7 @@ static void QTScaleMatrix( vout_thread_t *p_vout )
factor_y = FixDiv( Long2Fix( i_height ),
Long2Fix( p_vout->output.i_height ) );
i_offset_x = (i_width - i_adj_width) / 2 + i_offset_x;
i_offset_x = (i_width - i_adj_width) / 2;
}
else
{
......@@ -702,7 +570,7 @@ static void QTScaleMatrix( vout_thread_t *p_vout )
factor_y = FixDiv( Long2Fix( i_adj_height ),
Long2Fix( p_vout->output.i_height ) );
i_offset_y = (i_height - i_adj_height) / 2 + i_offset_y;
i_offset_y = (i_height - i_adj_height) / 2;
}
SetIdentityMatrix( p_vout->p_sys->p_matrix );
......@@ -745,10 +613,8 @@ static int QTCreateSequence( vout_thread_t *p_vout )
p_descr->dataSize = 0;
p_descr->depth = 24;
HUnlock( (Handle)p_vout->p_sys->h_img_descr );
if( ( err = DecompressSequenceBeginS(
&p_vout->p_sys->i_seq,
p_vout->p_sys->h_img_descr,
......@@ -756,7 +622,7 @@ static int QTCreateSequence( vout_thread_t *p_vout )
p_vout->p_sys->p_qdport,
NULL, NULL,
p_vout->p_sys->p_matrix,
0, p_vout->p_sys->mask,
0, NULL,
codecFlagUseImageBuffer,
codecLosslessQuality,
p_vout->p_sys->img_dc ) ) )
......@@ -765,7 +631,6 @@ static int QTCreateSequence( vout_thread_t *p_vout )
return( 1 );
}
return( 0 );
}
......@@ -1397,7 +1262,6 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
}
o_view = [[VLCView alloc] init];
/* FIXME: [o_view setMenu:] */
[p_vout->p_sys->o_window setContentView: o_view];
[o_view autorelease];
......
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