From: Felix Paul Kühne Date: Sun, 10 Sep 2006 20:12:12 +0000 (+0000) Subject: * New Fullscreen controller panel X-Git-Tag: 0.9.0-test0~10346 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=6f54a5309b529a0368b21cf38854eb1e4e9f696a;p=vlc * New Fullscreen controller panel - basically written by Jerome Decoodt aka DiDjCodt plus - various patches, coding-style fixes, etc. here and there - integration to VLCControls - automagic fading-in and -out when in fullscreen mode TODO: - get and use native graphics. These are currently being prepared by Simon Damkjaer Andersen, who already donated new playback mode icons (to be committed soon) - implement the volume slider - fix seeking with the time slider - check for memory leaks - further clean-up ATTENTION: for the moment, you need certain images from Jerome's patch to get this running. Put them to extras/MacOSX/Resources/ and it'll work. Otherwise, VLC won't crash, but only show strings. --- diff --git a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib index 454a39e7f4..e420b2b50c 100644 --- a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib +++ b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib @@ -33,6 +33,7 @@ CLASS = VLCControls; LANGUAGE = ObjC; OUTLETS = { + "o_fs_panel" = id; "o_main" = id; "o_specificTime_cancel_btn" = id; "o_specificTime_enter_fld" = id; @@ -98,6 +99,14 @@ }; SUPERCLASS = NSObject; }, + {CLASS = VLCFSPanel; LANGUAGE = ObjC; SUPERCLASS = NSWindow; }, + { + ACTIONS = {faster = id; next = id; play = id; prev = id; slower = id; }; + CLASS = VLCFSPanelView; + LANGUAGE = ObjC; + SUPERCLASS = NSView; + }, + {CLASS = VLCFSTimeSlider; LANGUAGE = ObjC; SUPERCLASS = NSSlider; }, { ACTIONS = { createOutlineGroup = id; diff --git a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib index 748e78b5d7..55c60c43af 100644 --- a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib +++ b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib @@ -3,7 +3,7 @@ IBDocumentLocation - 361 41 478 430 0 0 1440 878 + 443 64 478 430 0 0 1440 878 IBEditorPositions 1617 @@ -25,11 +25,12 @@ IBOpenObjects - 2416 - 29 21 - 2730 2197 + 2416 + 2730 + 29 + 2769 IBSystem Version 8J135 diff --git a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/keyedobjects.nib b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/keyedobjects.nib index b4a7ac6b27..9558cf51da 100644 Binary files a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/keyedobjects.nib and b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/extras/MacOSX/vlc.pbproj/project.pbxproj b/extras/MacOSX/vlc.pbproj/project.pbxproj index e23f63a64f..32bfc1aba9 100644 --- a/extras/MacOSX/vlc.pbproj/project.pbxproj +++ b/extras/MacOSX/vlc.pbproj/project.pbxproj @@ -10,6 +10,34 @@ 1058C7AFFEA557BF11CA2CBB /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; }; 2A16E08006C5074F00C87B09 /* equalizerdrawer_active.png in Resources */ = {isa = PBXBuildFile; fileRef = 2A16E07E06C5074F00C87B09 /* equalizerdrawer_active.png */; }; 2A16E08106C5074F00C87B09 /* equalizerdrawer_blue.png in Resources */ = {isa = PBXBuildFile; fileRef = 2A16E07F06C5074F00C87B09 /* equalizerdrawer_blue.png */; }; + 2AEF85F709A6623A00130822 /* FSBase.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85D309A6623A00130822 /* FSBase.tif */; }; + 2AEF85F809A6623A00130822 /* FSExitOff.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85D409A6623A00130822 /* FSExitOff.tif */; }; + 2AEF85F909A6623A00130822 /* FSExitOn.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85D509A6623A00130822 /* FSExitOn.tif */; }; + 2AEF85FA09A6623A00130822 /* FSFastForwardOff.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85D609A6623A00130822 /* FSFastForwardOff.tif */; }; + 2AEF85FB09A6623A00130822 /* FSFastForwardOn.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85D709A6623A00130822 /* FSFastForwardOn.tif */; }; + 2AEF85FC09A6623A00130822 /* FSGotoBeginningOff.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85D809A6623A00130822 /* FSGotoBeginningOff.tif */; }; + 2AEF85FD09A6623A00130822 /* FSGotoBeginningOn.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85D909A6623A00130822 /* FSGotoBeginningOn.tif */; }; + 2AEF85FE09A6623A00130822 /* FSGotoEndOff.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85DA09A6623A00130822 /* FSGotoEndOff.tif */; }; + 2AEF85FF09A6623A00130822 /* FSGotoEndOn.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85DB09A6623A00130822 /* FSGotoEndOn.tif */; }; + 2AEF860009A6623A00130822 /* FSLCDChapterPopUp.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85DC09A6623A00130822 /* FSLCDChapterPopUp.tif */; }; + 2AEF860109A6623A00130822 /* FSLCDSliderCenter.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85DD09A6623A00130822 /* FSLCDSliderCenter.tif */; }; + 2AEF860209A6623A00130822 /* FSLCDSliderLeft.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85DE09A6623A00130822 /* FSLCDSliderLeft.tif */; }; + 2AEF860309A6623A00130822 /* FSLCDSliderPlayHead.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85DF09A6623A00130822 /* FSLCDSliderPlayHead.tif */; }; + 2AEF860409A6623A00130822 /* FSLCDSliderProgressiveDownloadCenter.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85E009A6623A00130822 /* FSLCDSliderProgressiveDownloadCenter.tif */; }; + 2AEF860509A6623A00130822 /* FSLCDSliderProgressiveDownloadLeft.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85E109A6623A00130822 /* FSLCDSliderProgressiveDownloadLeft.tif */; }; + 2AEF860609A6623A00130822 /* FSLCDSliderProgressiveDownloadRight.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85E209A6623A00130822 /* FSLCDSliderProgressiveDownloadRight.tif */; }; + 2AEF860709A6623A00130822 /* FSLCDSliderRight.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85E309A6623A00130822 /* FSLCDSliderRight.tif */; }; + 2AEF860809A6623A00130822 /* FSLCDTimeBackground.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85E409A6623A00130822 /* FSLCDTimeBackground.tif */; }; + 2AEF860909A6623A00130822 /* FSPauseOff.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85E509A6623A00130822 /* FSPauseOff.tif */; }; + 2AEF860A09A6623A00130822 /* FSPauseOn.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85E609A6623A00130822 /* FSPauseOn.tif */; }; + 2AEF860B09A6623A00130822 /* FSPlayOff.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85E709A6623A00130822 /* FSPlayOff.tif */; }; + 2AEF860C09A6623A00130822 /* FSPlayOn.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85E809A6623A00130822 /* FSPlayOn.tif */; }; + 2AEF860D09A6623A00130822 /* FSRewindOff.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85E909A6623A00130822 /* FSRewindOff.tif */; }; + 2AEF860E09A6623A00130822 /* FSRewindOn.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85EA09A6623A00130822 /* FSRewindOn.tif */; }; + 2AEF860F09A6623A00130822 /* FSVolumeBackground.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85EB09A6623A00130822 /* FSVolumeBackground.tif */; }; + 2AEF861009A6623A00130822 /* FSVolumeThumbOff.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85EC09A6623A00130822 /* FSVolumeThumbOff.tif */; }; + 2AEF861109A6623A00130822 /* FSVolumeThumbOn.tif in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF85ED09A6623A00130822 /* FSVolumeThumbOn.tif */; }; + 2AEF861F09A6665700130822 /* qt.png in Resources */ = {isa = PBXBuildFile; fileRef = 2AEF861E09A6665700130822 /* qt.png */; }; 8E445F9D04728A700059A3A7 /* a52.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8E445F8704728A700059A3A7 /* a52.icns */; }; 8E445F9E04728A700059A3A7 /* aac.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8E445F8804728A700059A3A7 /* aac.icns */; }; 8E445F9F04728A700059A3A7 /* asf.icns in Resources */ = {isa = PBXBuildFile; fileRef = 8E445F8904728A700059A3A7 /* asf.icns */; }; @@ -816,6 +844,36 @@ 2A16E04006C4F08700C87B09 /* equalizer.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = equalizer.m; path = ../../modules/gui/macosx/equalizer.m; sourceTree = SOURCE_ROOT; }; 2A16E07E06C5074F00C87B09 /* equalizerdrawer_active.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = equalizerdrawer_active.png; path = Resources/equalizerdrawer_active.png; sourceTree = ""; }; 2A16E07F06C5074F00C87B09 /* equalizerdrawer_blue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = equalizerdrawer_blue.png; path = Resources/equalizerdrawer_blue.png; sourceTree = ""; }; + 2AEF857609A5FEC900130822 /* fspanel.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = fspanel.h; path = ../../modules/gui/macosx/fspanel.h; sourceTree = SOURCE_ROOT; }; + 2AEF857709A5FEC900130822 /* fspanel.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = fspanel.m; path = ../../modules/gui/macosx/fspanel.m; sourceTree = SOURCE_ROOT; }; + 2AEF85D309A6623A00130822 /* FSBase.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSBase.tif; path = Resources/FSBase.tif; sourceTree = ""; }; + 2AEF85D409A6623A00130822 /* FSExitOff.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSExitOff.tif; path = Resources/FSExitOff.tif; sourceTree = ""; }; + 2AEF85D509A6623A00130822 /* FSExitOn.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSExitOn.tif; path = Resources/FSExitOn.tif; sourceTree = ""; }; + 2AEF85D609A6623A00130822 /* FSFastForwardOff.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSFastForwardOff.tif; path = Resources/FSFastForwardOff.tif; sourceTree = ""; }; + 2AEF85D709A6623A00130822 /* FSFastForwardOn.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSFastForwardOn.tif; path = Resources/FSFastForwardOn.tif; sourceTree = ""; }; + 2AEF85D809A6623A00130822 /* FSGotoBeginningOff.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSGotoBeginningOff.tif; path = Resources/FSGotoBeginningOff.tif; sourceTree = ""; }; + 2AEF85D909A6623A00130822 /* FSGotoBeginningOn.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSGotoBeginningOn.tif; path = Resources/FSGotoBeginningOn.tif; sourceTree = ""; }; + 2AEF85DA09A6623A00130822 /* FSGotoEndOff.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSGotoEndOff.tif; path = Resources/FSGotoEndOff.tif; sourceTree = ""; }; + 2AEF85DB09A6623A00130822 /* FSGotoEndOn.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSGotoEndOn.tif; path = Resources/FSGotoEndOn.tif; sourceTree = ""; }; + 2AEF85DC09A6623A00130822 /* FSLCDChapterPopUp.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSLCDChapterPopUp.tif; path = Resources/FSLCDChapterPopUp.tif; sourceTree = ""; }; + 2AEF85DD09A6623A00130822 /* FSLCDSliderCenter.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSLCDSliderCenter.tif; path = Resources/FSLCDSliderCenter.tif; sourceTree = ""; }; + 2AEF85DE09A6623A00130822 /* FSLCDSliderLeft.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSLCDSliderLeft.tif; path = Resources/FSLCDSliderLeft.tif; sourceTree = ""; }; + 2AEF85DF09A6623A00130822 /* FSLCDSliderPlayHead.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSLCDSliderPlayHead.tif; path = Resources/FSLCDSliderPlayHead.tif; sourceTree = ""; }; + 2AEF85E009A6623A00130822 /* FSLCDSliderProgressiveDownloadCenter.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSLCDSliderProgressiveDownloadCenter.tif; path = Resources/FSLCDSliderProgressiveDownloadCenter.tif; sourceTree = ""; }; + 2AEF85E109A6623A00130822 /* FSLCDSliderProgressiveDownloadLeft.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSLCDSliderProgressiveDownloadLeft.tif; path = Resources/FSLCDSliderProgressiveDownloadLeft.tif; sourceTree = ""; }; + 2AEF85E209A6623A00130822 /* FSLCDSliderProgressiveDownloadRight.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSLCDSliderProgressiveDownloadRight.tif; path = Resources/FSLCDSliderProgressiveDownloadRight.tif; sourceTree = ""; }; + 2AEF85E309A6623A00130822 /* FSLCDSliderRight.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSLCDSliderRight.tif; path = Resources/FSLCDSliderRight.tif; sourceTree = ""; }; + 2AEF85E409A6623A00130822 /* FSLCDTimeBackground.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSLCDTimeBackground.tif; path = Resources/FSLCDTimeBackground.tif; sourceTree = ""; }; + 2AEF85E509A6623A00130822 /* FSPauseOff.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSPauseOff.tif; path = Resources/FSPauseOff.tif; sourceTree = ""; }; + 2AEF85E609A6623A00130822 /* FSPauseOn.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSPauseOn.tif; path = Resources/FSPauseOn.tif; sourceTree = ""; }; + 2AEF85E709A6623A00130822 /* FSPlayOff.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSPlayOff.tif; path = Resources/FSPlayOff.tif; sourceTree = ""; }; + 2AEF85E809A6623A00130822 /* FSPlayOn.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSPlayOn.tif; path = Resources/FSPlayOn.tif; sourceTree = ""; }; + 2AEF85E909A6623A00130822 /* FSRewindOff.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSRewindOff.tif; path = Resources/FSRewindOff.tif; sourceTree = ""; }; + 2AEF85EA09A6623A00130822 /* FSRewindOn.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSRewindOn.tif; path = Resources/FSRewindOn.tif; sourceTree = ""; }; + 2AEF85EB09A6623A00130822 /* FSVolumeBackground.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSVolumeBackground.tif; path = Resources/FSVolumeBackground.tif; sourceTree = ""; }; + 2AEF85EC09A6623A00130822 /* FSVolumeThumbOff.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSVolumeThumbOff.tif; path = Resources/FSVolumeThumbOff.tif; sourceTree = ""; }; + 2AEF85ED09A6623A00130822 /* FSVolumeThumbOn.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = FSVolumeThumbOn.tif; path = Resources/FSVolumeThumbOn.tif; sourceTree = ""; }; + 2AEF861E09A6665700130822 /* qt.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = qt.png; path = Resources/qt.png; sourceTree = ""; }; 8E445F8704728A700059A3A7 /* a52.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = a52.icns; path = Resources/a52.icns; sourceTree = SOURCE_ROOT; }; 8E445F8804728A700059A3A7 /* aac.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = aac.icns; path = Resources/aac.icns; sourceTree = SOURCE_ROOT; }; 8E445F8904728A700059A3A7 /* asf.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = asf.icns; path = Resources/asf.icns; sourceTree = SOURCE_ROOT; }; @@ -914,6 +972,8 @@ CC26BF3109A7A08C00E94D62 /* update.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = update.h; path = ../../modules/gui/macosx/update.h; sourceTree = SOURCE_ROOT; }; CC26BF3209A7A08C00E94D62 /* update.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = update.m; path = ../../modules/gui/macosx/update.m; sourceTree = SOURCE_ROOT; }; CC3DC89B0A7CDB9600B53F32 /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = ""; }; + CC6D8D9C0A878DED006F2BBE /* AppleRemote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppleRemote.h; path = ../../modules/gui/macosx/AppleRemote.h; sourceTree = SOURCE_ROOT; }; + CC6D8D9D0A878DED006F2BBE /* AppleRemote.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppleRemote.m; path = ../../modules/gui/macosx/AppleRemote.m; sourceTree = SOURCE_ROOT; }; CCF3C64B0923B99D00401862 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = Resources/English.lproj/SFilters.nib; sourceTree = ""; }; CCF3C6500923B9D100401862 /* sfilters.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = sfilters.h; path = ../../modules/gui/macosx/sfilters.h; sourceTree = SOURCE_ROOT; }; CCF3C6510923B9D100401862 /* sfilters.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = sfilters.m; path = ../../modules/gui/macosx/sfilters.m; sourceTree = SOURCE_ROOT; }; @@ -977,6 +1037,7 @@ 089C167CFE841241C02AAC07 /* Resources */ = { isa = PBXGroup; children = ( + 2AEF85D009A661A500130822 /* FSPanel */, DCF358BC077F1236007DB450 /* nibs */, DCDA5E6408F94518009D93A8 /* about_bg.png */, 8E445F86047289E50059A3A7 /* fileicons */, @@ -1037,6 +1098,10 @@ CCF3C6510923B9D100401862 /* sfilters.m */, CC26BF3109A7A08C00E94D62 /* update.h */, CC26BF3209A7A08C00E94D62 /* update.m */, + CC6D8D9C0A878DED006F2BBE /* AppleRemote.h */, + CC6D8D9D0A878DED006F2BBE /* AppleRemote.m */, + 2AEF857609A5FEC900130822 /* fspanel.h */, + 2AEF857709A5FEC900130822 /* fspanel.m */, ); name = Classes; sourceTree = ""; @@ -1067,6 +1132,41 @@ name = Products; sourceTree = ""; }; + 2AEF85D009A661A500130822 /* FSPanel */ = { + isa = PBXGroup; + children = ( + 2AEF861E09A6665700130822 /* qt.png */, + 2AEF85D309A6623A00130822 /* FSBase.tif */, + 2AEF85D409A6623A00130822 /* FSExitOff.tif */, + 2AEF85D509A6623A00130822 /* FSExitOn.tif */, + 2AEF85D609A6623A00130822 /* FSFastForwardOff.tif */, + 2AEF85D709A6623A00130822 /* FSFastForwardOn.tif */, + 2AEF85D809A6623A00130822 /* FSGotoBeginningOff.tif */, + 2AEF85D909A6623A00130822 /* FSGotoBeginningOn.tif */, + 2AEF85DA09A6623A00130822 /* FSGotoEndOff.tif */, + 2AEF85DB09A6623A00130822 /* FSGotoEndOn.tif */, + 2AEF85DC09A6623A00130822 /* FSLCDChapterPopUp.tif */, + 2AEF85DD09A6623A00130822 /* FSLCDSliderCenter.tif */, + 2AEF85DE09A6623A00130822 /* FSLCDSliderLeft.tif */, + 2AEF85DF09A6623A00130822 /* FSLCDSliderPlayHead.tif */, + 2AEF85E009A6623A00130822 /* FSLCDSliderProgressiveDownloadCenter.tif */, + 2AEF85E109A6623A00130822 /* FSLCDSliderProgressiveDownloadLeft.tif */, + 2AEF85E209A6623A00130822 /* FSLCDSliderProgressiveDownloadRight.tif */, + 2AEF85E309A6623A00130822 /* FSLCDSliderRight.tif */, + 2AEF85E409A6623A00130822 /* FSLCDTimeBackground.tif */, + 2AEF85E509A6623A00130822 /* FSPauseOff.tif */, + 2AEF85E609A6623A00130822 /* FSPauseOn.tif */, + 2AEF85E709A6623A00130822 /* FSPlayOff.tif */, + 2AEF85E809A6623A00130822 /* FSPlayOn.tif */, + 2AEF85E909A6623A00130822 /* FSRewindOff.tif */, + 2AEF85EA09A6623A00130822 /* FSRewindOn.tif */, + 2AEF85EB09A6623A00130822 /* FSVolumeBackground.tif */, + 2AEF85EC09A6623A00130822 /* FSVolumeThumbOff.tif */, + 2AEF85ED09A6623A00130822 /* FSVolumeThumbOn.tif */, + ); + name = FSPanel; + sourceTree = ""; + }; 8E445F86047289E50059A3A7 /* fileicons */ = { isa = PBXGroup; children = ( @@ -1266,6 +1366,34 @@ C2F2A707095AE51700018C74 /* play_embedded_blue.png in Resources */, C2F2A708095AE51700018C74 /* skip_forward_embedded_blue.png in Resources */, C2F2A709095AE51700018C74 /* skip_previous_embedded_blue.png in Resources */, + 2AEF85F709A6623A00130822 /* FSBase.tif in Resources */, + 2AEF85F809A6623A00130822 /* FSExitOff.tif in Resources */, + 2AEF85F909A6623A00130822 /* FSExitOn.tif in Resources */, + 2AEF85FA09A6623A00130822 /* FSFastForwardOff.tif in Resources */, + 2AEF85FB09A6623A00130822 /* FSFastForwardOn.tif in Resources */, + 2AEF85FC09A6623A00130822 /* FSGotoBeginningOff.tif in Resources */, + 2AEF85FD09A6623A00130822 /* FSGotoBeginningOn.tif in Resources */, + 2AEF85FE09A6623A00130822 /* FSGotoEndOff.tif in Resources */, + 2AEF85FF09A6623A00130822 /* FSGotoEndOn.tif in Resources */, + 2AEF860009A6623A00130822 /* FSLCDChapterPopUp.tif in Resources */, + 2AEF860109A6623A00130822 /* FSLCDSliderCenter.tif in Resources */, + 2AEF860209A6623A00130822 /* FSLCDSliderLeft.tif in Resources */, + 2AEF860309A6623A00130822 /* FSLCDSliderPlayHead.tif in Resources */, + 2AEF860409A6623A00130822 /* FSLCDSliderProgressiveDownloadCenter.tif in Resources */, + 2AEF860509A6623A00130822 /* FSLCDSliderProgressiveDownloadLeft.tif in Resources */, + 2AEF860609A6623A00130822 /* FSLCDSliderProgressiveDownloadRight.tif in Resources */, + 2AEF860709A6623A00130822 /* FSLCDSliderRight.tif in Resources */, + 2AEF860809A6623A00130822 /* FSLCDTimeBackground.tif in Resources */, + 2AEF860909A6623A00130822 /* FSPauseOff.tif in Resources */, + 2AEF860A09A6623A00130822 /* FSPauseOn.tif in Resources */, + 2AEF860B09A6623A00130822 /* FSPlayOff.tif in Resources */, + 2AEF860C09A6623A00130822 /* FSPlayOn.tif in Resources */, + 2AEF860D09A6623A00130822 /* FSRewindOff.tif in Resources */, + 2AEF860E09A6623A00130822 /* FSRewindOn.tif in Resources */, + 2AEF860F09A6623A00130822 /* FSVolumeBackground.tif in Resources */, + 2AEF861009A6623A00130822 /* FSVolumeThumbOff.tif in Resources */, + 2AEF861109A6623A00130822 /* FSVolumeThumbOn.tif in Resources */, + 2AEF861F09A6665700130822 /* qt.png in Resources */, CC26BF2C09A7A05000E94D62 /* Update.nib in Resources */, CC1B4B4D09A8CF9E0078AD2E /* Interaction.nib in Resources */, CC1AC1BC0A7BDA41002478C3 /* InteractionErrorPanel.nib in Resources */, diff --git a/modules/gui/macosx/Modules.am b/modules/gui/macosx/Modules.am index 008c51f398..887a4d11a2 100644 --- a/modules/gui/macosx/Modules.am +++ b/modules/gui/macosx/Modules.am @@ -42,6 +42,8 @@ SOURCES_macosx = \ sfilters.m \ embeddedwindow.h \ embeddedwindow.m \ + fspanel.m \ + fspanel.h \ update.h \ update.m \ $(NULL) diff --git a/modules/gui/macosx/controls.h b/modules/gui/macosx/controls.h index f7a190cb60..311645a9d1 100644 --- a/modules/gui/macosx/controls.h +++ b/modules/gui/macosx/controls.h @@ -23,6 +23,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ +#import "fspanel.h" + /***************************************************************************** * VLCControls interface *****************************************************************************/ @@ -41,6 +43,8 @@ IBOutlet id o_specificTime_sec_lbl; IBOutlet id o_specificTime_stepper; IBOutlet id o_specificTime_mi; + + VLCFSPanel *o_fs_panel; } - (IBAction)play:(id)sender; @@ -79,6 +83,8 @@ - (IBAction)goToSpecificTime:(id)sender; +- (id)getFSPanel; + @end /***************************************************************************** diff --git a/modules/gui/macosx/controls.m b/modules/gui/macosx/controls.m index 63fceb6410..2379f988df 100644 --- a/modules/gui/macosx/controls.m +++ b/modules/gui/macosx/controls.m @@ -32,6 +32,7 @@ #include #include "intf.h" +#include "fspanel.h" #include "vout.h" #include "open.h" #include "controls.h" @@ -43,6 +44,13 @@ *****************************************************************************/ @implementation VLCControls +- (id)init +{ + [super init]; + o_fs_panel = [[VLCFSPanel alloc] init]; + return self; +} + - (void)awakeFromNib { [o_specificTime_mi setTitle: _NS("Jump To Time")]; @@ -670,6 +678,17 @@ } } +- (id)getFSPanel +{ + if( o_fs_panel ) + return o_fs_panel; + else + { + msg_Err( VLCIntf, "FSPanel is nil" ); + return NULL; + } +} + @end @implementation VLCControls (NSMenuValidation) diff --git a/modules/gui/macosx/embeddedwindow.m b/modules/gui/macosx/embeddedwindow.m index eb28ac833f..4f3ca03871 100644 --- a/modules/gui/macosx/embeddedwindow.m +++ b/modules/gui/macosx/embeddedwindow.m @@ -26,6 +26,7 @@ *****************************************************************************/ #include "intf.h" +#include "fspanel.h" #include "vout.h" #include "embeddedwindow.h" diff --git a/modules/gui/macosx/fspanel.h b/modules/gui/macosx/fspanel.h new file mode 100644 index 0000000000..df41eb20f1 --- /dev/null +++ b/modules/gui/macosx/fspanel.h @@ -0,0 +1,93 @@ +/***************************************************************************** + * fspanel.h: MacOS X full screen panel + ***************************************************************************** + * Copyright (C) 2006 the VideoLAN team + * $Id$ + * + * Authors: JŽr™me Decoodt + * Felix KŸhne + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + *****************************************************************************/ + +@interface VLCFSPanel : NSWindow +{ + NSTimer *fadeTimer,*hideAgainTimer; + NSPoint mouseClic; + BOOL b_fadeQueued; + BOOL b_keptVisible; + BOOL b_alreadyCounting; + int i_timeToKeepVisibleInSec; +} +- (id)initWithContentRect: (NSRect)contentRect + styleMask: (unsigned int)aStyle + backing: (NSBackingStoreType)bufferingType + defer: (BOOL)flag; +- (void)awakeFromNib; +- (BOOL)canBecomeKeyWindow; +- (void)dealloc; + +- (void)setPlay; +- (void)setPause; +- (void)setStreamTitle:(NSString *)o_title; +- (void)setStreamPos:(float) f_pos setSeconds:(int)i_seconds; + +- (void)focus:(NSTimer *)timer; +- (void)unfocus:(NSTimer *)timer; +- (void)mouseEntered:(NSEvent *)theEvent; +- (void)mouseExited:(NSEvent *)theEvent; + +- (void)fadeIn; +- (void)fadeOut; + +- (NSTimer *)fadeTimer; +- (void)setFadeTimer:(NSTimer *)timer; +- (void)autoHide; +- (void)keepVisible:(NSTimer *)timer; + +- (void)mouseDown:(NSEvent *)theEvent; +- (void)mouseDragged:(NSEvent *)theEvent; + +@end + +@interface VLCFSPanelView : NSView +{ + NSColor *fillColor; + NSButton *o_prev, *o_next, *o_slow, *o_fast, *o_play, *o_fullscreen; + NSTextField *o_textfield, *o_textPos; + NSSlider *o_time_slider; +} +- (id)initWithFrame:(NSRect)frameRect; +- (void)drawRect:(NSRect)rect; + +- (void) setPlay; +- (void) setPause; +- (void) setStreamTitle: (NSString *)o_title; +- (void) setStreamPos:(float) f_pos setSeconds:(int)i_seconds; +- (IBAction)play:(id)sender; +- (IBAction)prev:(id)sender; +- (IBAction)next:(id)sender; +- (IBAction)faster:(id)sender; +- (IBAction)slower:(id)sender; + +@end + +@interface VLCFSTimeSlider : NSSlider +{} +void drawKnobInRect(NSRect knobRect); +void drawFrameInRect(NSRect frameRect); +- (void)drawRect:(NSRect)rect; + +@end diff --git a/modules/gui/macosx/fspanel.m b/modules/gui/macosx/fspanel.m new file mode 100644 index 0000000000..a42ef97c5d --- /dev/null +++ b/modules/gui/macosx/fspanel.m @@ -0,0 +1,468 @@ +/***************************************************************************** + * fspanel.m: MacOS X full screen panel + ***************************************************************************** + * Copyright (C) 2006 the VideoLAN team + * $Id$ + * + * Authors: JŽr™me Decoodt + * Felix KŸhne + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + *****************************************************************************/ + +/***************************************************************************** + * Preamble + *****************************************************************************/ +#import "intf.h" +#import "fspanel.h" + +#define KEEP_VISIBLE_AFTER_ACTION 4 /* time in half-sec until this panel will hide again after an user's action */ + +/***************************************************************************** + * VLCFSPanel + *****************************************************************************/ +@implementation VLCFSPanel +// We override this initializer so we can set the NSBorderlessWindowMask styleMask, and set a few other important settings +- (id)initWithContentRect:(NSRect)contentRect + styleMask:(unsigned int)aStyle + backing:(NSBackingStoreType)bufferingType + defer:(BOOL)flag +{ + id win=[super initWithContentRect:contentRect styleMask:NSBorderlessWindowMask backing:bufferingType defer:flag]; + [win setOpaque:NO]; + [win setHasShadow: NO]; + [win setBackgroundColor:[NSColor clearColor]]; + [win setLevel:NSFloatingWindowLevel]; // Let's make it sit on top of everything else + [win setAlphaValue:0.2]; // It'll start out mostly transparent + return win; +} + +- (void)awakeFromNib +{ + [self setContentView:[[VLCFSPanelView alloc] initWithFrame: [self frame]]]; + BOOL isInside=(NSPointInRect([NSEvent mouseLocation],[self frame])); + [[self contentView] addTrackingRect:[[self contentView] bounds] owner:self userData:nil assumeInside:isInside]; + if (isInside) + [self mouseEntered:NULL]; + if (!isInside) + [self mouseExited:NULL]; +} + +// Windows created with NSBorderlessWindowMask normally can't be key, but we want ours to be +- (BOOL)canBecomeKeyWindow +{ + return YES; +} + +-(void)dealloc +{ + if( hideAgainTimer ) + [hideAgainTimer release]; + [self setFadeTimer:nil]; + [super dealloc]; +} + +- (void)setPlay +{ + [[self contentView] setPlay]; +} + +- (void)setPause +{ + [[self contentView] setPause]; +} + +- (void)setStreamTitle:(NSString *)o_title +{ + [[self contentView] setStreamTitle: o_title]; +} + +- (void)setStreamPos:(float) f_pos setSeconds:(int)i_seconds; +{ + [[self contentView] setStreamPos:f_pos setSeconds:i_seconds]; +} + +// This routine is called repeatedly when the mouse enters the window from outside it. +- (void)focus:(NSTimer *)timer +{ + if( [self alphaValue] < 1.0 ) + [self setAlphaValue:[self alphaValue]+0.1]; + if( [self alphaValue] >= 1.0 ) + { + [self setAlphaValue: 1.0]; + [self setFadeTimer:nil]; + if( b_fadeQueued ) + { + b_fadeQueued=NO; + [self setFadeTimer:[NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(unfocus:) userInfo:NULL repeats:YES]]; + } + } +} + +// This routine is called repeatedly when the mouse exits the window from inside it. +- (void)unfocus:(NSTimer *)timer +{ + if( [self alphaValue] > 0.0 ) + [self setAlphaValue:[self alphaValue]-0.1]; + if( [self alphaValue] <= 0.1 ) + { + [self setAlphaValue:0.0]; + [self setFadeTimer:nil]; + if( b_fadeQueued ) + { + b_fadeQueued=NO; + [self setFadeTimer: + [NSTimer scheduledTimerWithTimeInterval:0.1 + target:self + selector:@selector(focus:) + userInfo:NULL + repeats:YES]]; + } + } +} + +// If the mouse enters a window, go make sure we fade in +- (void)mouseEntered:(NSEvent *)theEvent +{ + [self fadeIn]; +} + +// If the mouse exits a window, go make sure we fade out +- (void)mouseExited:(NSEvent *)theEvent +{ + /* the user left the window, fade out immediatelly and prevent any timer action */ + if( b_alreadyCounting ) + { + [hideAgainTimer invalidate]; + [hideAgainTimer release]; + b_alreadyCounting = NO; + hideAgainTimer = NULL; + } + + [self fadeOut]; +} + +- (void)fadeIn +{ + if( [self alphaValue] < 1.0 ) + { + if (![self fadeTimer]) + [self setFadeTimer:[NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(focus:) userInfo:[NSNumber numberWithShort:1] repeats:YES]]; + else if ([[[self fadeTimer] userInfo] shortValue]==0) + b_fadeQueued=YES; + } + [self autoHide]; +} + +- (void)fadeOut +{ + if(( [self alphaValue] > 0.0 ) && !NSPointInRect( [NSEvent mouseLocation], [self frame] ) ) + { + if (![self fadeTimer]) + [self setFadeTimer:[NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(unfocus:) userInfo:[NSNumber numberWithShort:0] repeats:YES]]; + else if ([[[self fadeTimer] userInfo] shortValue]==1) + b_fadeQueued=YES; + } +} + +/* triggers a timer to autoHide us again after some seconds of no activity */ +- (void)autoHide +{ + /* this will tell the timer to start over again or to start at all */ + b_keptVisible = YES; + + /* get us a valid timer */ + if(! b_alreadyCounting ) + { + hideAgainTimer = [NSTimer scheduledTimerWithTimeInterval: 0.5 + target: self + selector: @selector(keepVisible:) + userInfo: nil + repeats: YES]; + [hideAgainTimer fire]; + [hideAgainTimer retain]; + b_alreadyCounting = YES; + } +} + +- (void)keepVisible:(NSTimer *)timer +{ + /* if the user triggered an action, start over again */ + if( b_keptVisible ) + { + i_timeToKeepVisibleInSec = KEEP_VISIBLE_AFTER_ACTION; + b_keptVisible = NO; + } + + /* count down until we hide ourselfes again and do so if necessary */ + i_timeToKeepVisibleInSec -= 1; + if( i_timeToKeepVisibleInSec < 1 ) + { + [self fadeOut]; + [timer invalidate]; + [timer release]; + b_alreadyCounting = NO; + timer = NULL; + } +} + +// A getter and setter for our main timer that handles window fading +- (NSTimer *)fadeTimer +{ + return fadeTimer; +} + +- (void)setFadeTimer:(NSTimer *)timer +{ + [timer retain]; + [fadeTimer invalidate]; + [fadeTimer release]; + fadeTimer=timer; +} + +- (void)mouseDown:(NSEvent *)theEvent +{ + mouseClic = [theEvent locationInWindow]; +} + +- (void)mouseDragged:(NSEvent *)theEvent +{ + NSPoint point = [NSEvent mouseLocation]; + point.x -= mouseClic.x; + point.y -= mouseClic.y; + [self setFrameOrigin:point]; +} +@end + +/***************************************************************************** + * FSPanelView + *****************************************************************************/ +@implementation VLCFSPanelView + +#define addButton( o_button, imageOff, imageOn, _x, _y, action ) \ + s_rc.origin.x = _x; \ + s_rc.origin.y = _y; \ + o_button = [[NSButton alloc] initWithFrame: s_rc]; \ + [o_button setButtonType: NSMomentaryChangeButton]; \ + [o_button setBezelStyle: NSRegularSquareBezelStyle]; \ + [o_button setBordered: NO]; \ + [o_button setFont:[NSFont systemFontOfSize:0]]; \ + image = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:imageOff]]; \ + [o_button setImage:image]; \ + image = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:imageOn]]; \ + [o_button setAlternateImage:image]; \ + [o_button sizeToFit]; \ + [o_button setTarget: self]; \ + [o_button setAction: @selector(action:)]; \ + [self addSubview:o_button]; + +#define addTextfield( o_text, align, font, color, size ) \ + o_text = [[NSTextField alloc] initWithFrame: s_rc]; \ + [o_text setDrawsBackground: NO]; \ + [o_text setBordered: NO]; \ + [o_text setEditable: NO]; \ + [o_text setSelectable: NO]; \ + [o_text setStringValue: _NS("(no item is being played)")]; \ + [o_text setAlignment: align]; \ + [o_text setTextColor: [NSColor color]]; \ + [o_text setFont:[NSFont font:[NSFont smallSystemFontSize] - size]]; \ + [self addSubview:o_text]; + +- (id)initWithFrame:(NSRect)frameRect +{ + NSBundle * bundle = [NSBundle mainBundle]; + id view = [super initWithFrame:frameRect]; + fillColor = [[NSColor clearColor] retain]; + NSRect s_rc = [self frame]; + NSImage * image; + addButton( o_prev, @"FSGotoBeginningOff.tif" , @"FSGotoBeginningOn.tif", 106, 37, prev ); + addButton( o_slow, @"FSRewindOff.tif" , @"FSRewindOn.tif" , 143, 37, slower ); + addButton( o_play, @"FSPlayOff.tif" , @"FSPlayOn.tif" , 191, 37, play ); + addButton( o_fast, @"FSFastForwardOff.tif" , @"FSFastForwardOn.tif" , 238, 37, faster ); + addButton( o_next, @"FSGotoEndOff.tif" , @"FSGotoEndOn.tif" , 286, 37, next ); + addButton( o_fullscreen, @"FSExitOff.tif", @"FSExitOn.tif", 382, 45, windowAction ); +// addButton( o_button, @"FSVolumeThumbOff.tif" , @"FSVolumeThumbOn.tif" , 38, 51, something ); + + s_rc = [self frame]; + s_rc.origin.x = 25; + s_rc.origin.y = 14; + s_rc.size.width = 329; + s_rc.size.height = 13; + o_time_slider = [[[VLCFSTimeSlider alloc] initWithFrame: s_rc] retain]; + [o_time_slider setMinValue:0]; + [o_time_slider setMaxValue:1]; + [o_time_slider setFloatValue: 0]; + [o_time_slider setAction: @selector(timesliderUpdate:)]; + [self addSubview: o_time_slider]; + + s_rc = [self frame]; + s_rc.origin.x = 25; + s_rc.origin.y = 83; + s_rc.size.width = s_rc.size.width - s_rc.origin.x * 2; + s_rc.size.height = 16; + addTextfield( o_textfield, NSCenterTextAlignment, systemFontOfSize, whiteColor, 0 ); + s_rc.origin.x = 349; + s_rc.origin.y = 10; + s_rc.size.width = 50; + addTextfield( o_textPos, NSRightTextAlignment, systemFontOfSize, blackColor, 2 ); + + return view; +} + +- (void)setPlay +{ + NSBundle *bundle = [NSBundle mainBundle]; + NSImage *image; + [[o_play image] release]; + [[o_play alternateImage] release]; + image = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"FSPlayOff.tif"]]; + [o_play setImage:image]; + image = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"FSPlayOn.tif"]]; + [o_play setAlternateImage:image]; +} + +- (void)setPause +{ + NSBundle *bundle = [NSBundle mainBundle]; + NSImage *image; + [[o_play image] release]; + [[o_play alternateImage] release]; + image = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"FSPauseOff.tif"]]; + [o_play setImage:image]; + image = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"FSPauseOn.tif"]]; + [o_play setAlternateImage:image]; +} + +- (void)setStreamTitle:(NSString *)o_title +{ + [o_textfield setStringValue: o_title]; +} + +- (void)setStreamPos:(float) f_pos setSeconds:(int)i_seconds +{ + NSString *o_pos = [NSString stringWithFormat: @"%d:%02d:%02d", + (int) (i_seconds / (60 * 60)), + (int) (i_seconds / 60 % 60), + (int) (i_seconds % 60)]; + + [o_textPos setStringValue: o_pos]; + [o_time_slider setFloatValue: f_pos]; +} + +- (IBAction)play:(id)sender +{ + [[[VLCMain sharedInstance] getControls] play: sender]; +} + +- (IBAction)faster:(id)sender +{ + [[[VLCMain sharedInstance] getControls] faster: sender]; +} + +- (IBAction)slower:(id)sender +{ + [[[VLCMain sharedInstance] getControls] slower: sender]; +} + +- (IBAction)prev:(id)sender +{ + [[[VLCMain sharedInstance] getControls] prev: sender]; +} + +- (IBAction)next:(id)sender +{ + [[[VLCMain sharedInstance] getControls] next: sender]; +} + +- (IBAction)windowAction:(id)sender +{ + [[[VLCMain sharedInstance] getControls] windowAction: sender]; +} + +- (IBAction)timesliderUpdate:(id)sender +{ + [[VLCMain sharedInstance] timesliderUpdate: sender]; +} + +#define addImage(image, _x, _y, mode, _width) \ + img = [[[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:image]] autorelease]; \ + image_rect.size = [img size]; \ + image_rect.origin.x = 0; \ + image_rect.origin.y = 0; \ + frame.origin.x = _x; \ + frame.origin.y = _y; \ + frame.size = [img size]; \ + if( _width ) frame.size.width = _width; \ + [img drawInRect:frame fromRect:image_rect operation:mode fraction:1]; + +- (void)drawRect:(NSRect)rect +{ + NSBundle *bundle = [NSBundle mainBundle]; + NSRect frame = [self frame]; + NSRect image_rect; + NSImage *img; + addImage( @"FSBase.tif", 0, 0, NSCompositeCopy, 0 ); + addImage( @"FSVolumeBackground.tif" , 25, 49, NSCompositeSourceOver, 0 ); + addImage( @"FSLCDTimeBackground.tif", 354, 14, NSCompositeSourceOver, 0 ); +} + +@end + +/***************************************************************************** + * VLCFSTimeSlider + *****************************************************************************/ +@implementation VLCFSTimeSlider +void drawKnobInRect(NSRect knobRect) +{ + NSBundle *bundle = [NSBundle mainBundle]; + NSRect image_rect; + NSImage *img = [[NSImage alloc] initWithContentsOfFile:[bundle pathForImageResource:@"FSLCDSliderPlayHead"]]; + image_rect.size = [img size]; + image_rect.origin.x = 0; + image_rect.origin.y = 0; + knobRect.origin.x += (knobRect.size.width - image_rect.size.width) / 2; + knobRect.size.width = image_rect.size.width; + knobRect.size.height = image_rect.size.height; + [img drawInRect:knobRect fromRect:image_rect operation:NSCompositeSourceOver fraction:1]; +} + +void drawFrameInRect(NSRect frameRect) +{ + // Draw frame + NSBundle *bundle = [NSBundle mainBundle]; + NSRect frame = frameRect; + NSRect image_rect; + NSImage *img; + addImage(@"FSLCDSliderLeft.tif" , 0, 0, NSCompositeSourceOver, 0); + addImage(@"FSLCDSliderCenter.tif" , 9, 0, NSCompositeSourceOver, 311); + addImage(@"FSLCDSliderRight.tif" , 320, 0, NSCompositeSourceOver, 0); +} + +- (void)drawRect:(NSRect)rect +{ + // Draw default to make sure the slider behaves correctly + [[NSGraphicsContext currentContext] saveGraphicsState]; + NSRectClip(NSZeroRect); + [super drawRect:rect]; + [[NSGraphicsContext currentContext] restoreGraphicsState]; + + NSRect knobRect = [[self cell] knobRectFlipped:NO]; + knobRect.origin.y+=6; + [[[NSColor blackColor] colorWithAlphaComponent:0.6] set]; + drawFrameInRect(rect); + drawKnobInRect(knobRect); +} + +@end diff --git a/modules/gui/macosx/intf.h b/modules/gui/macosx/intf.h index fbc8516e20..b6e68797e4 100644 --- a/modules/gui/macosx/intf.h +++ b/modules/gui/macosx/intf.h @@ -146,6 +146,7 @@ struct intf_sys_t IBOutlet id o_msgs_btn_crashlog; /* messages open crashlog */ IBOutlet id o_info_window; /* Info panel */ + IBOutlet id o_fs_panel; /* Full screen panel*/ /* main menu */ diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m index 8e8432f1f3..10b28d0736 100644 --- a/modules/gui/macosx/intf.m +++ b/modules/gui/macosx/intf.m @@ -32,21 +32,22 @@ #include #include -#include "intf.h" -#include "vout.h" -#include "prefs.h" -#include "playlist.h" -#include "controls.h" -#include "about.h" -#include "open.h" -#include "wizard.h" -#include "extended.h" -#include "bookmarks.h" -#include "sfilters.h" -#include "interaction.h" -#include "embeddedwindow.h" -#include "update.h" -#include "AppleRemote.h" +#import "intf.h" +#import "fspanel.h" +#import "vout.h" +#import "prefs.h" +#import "playlist.h" +#import "controls.h" +#import "about.h" +#import "open.h" +#import "wizard.h" +#import "extended.h" +#import "bookmarks.h" +#import "sfilters.h" +#import "interaction.h" +#import "embeddedwindow.h" +#import "update.h" +#import "AppleRemote.h" /***************************************************************************** * Local prototypes. @@ -479,6 +480,9 @@ static VLCMain *_o_sharedMainInstance = nil; var_AddCallback( p_intf, "interaction", InteractCallback, self ); p_intf->b_interaction = VLC_TRUE; + // First we setup the blue selection box - another window that will be attached as a child window + // to this one, and will be moved by timers as needed. + nib_main_loaded = TRUE; } @@ -1064,6 +1068,7 @@ static VLCMain *_o_sharedMainInstance = nil; [o_timeslider setFloatValue: 0.0]; [o_timeslider setEnabled: b_seekable]; [o_timefield setStringValue: @"0:00:00"]; + [[[self getControls] getFSPanel] setStreamPos: 0 setSeconds: 0]; [o_embedded_window setSeekable: b_seekable]; @@ -1120,6 +1125,7 @@ static VLCMain *_o_sharedMainInstance = nil; o_temp = [NSString stringWithCString: p_playlist->status.p_item->p_input->psz_name]; [self setScrollField: o_temp stopAfter:-1]; + [[[self getControls] getFSPanel] setStreamTitle: o_temp]; p_vout = vlc_object_find( p_intf->p_sys->p_input, VLC_OBJECT_VOUT, FIND_PARENT ); @@ -1166,6 +1172,7 @@ static VLCMain *_o_sharedMainInstance = nil; (int) (i_seconds / 60 % 60), (int) (i_seconds % 60)]; [o_timefield setStringValue: o_time]; + [[[self getControls] getFSPanel] setStreamPos: pos.f_float setSeconds: i_seconds]; [o_embedded_window setTime: o_time position: f_updated]; } @@ -1389,6 +1396,7 @@ static VLCMain *_o_sharedMainInstance = nil; { if( i_status == PLAYING_S ) { + [[[self getControls] getFSPanel] setPause]; [o_btn_play setImage: o_img_pause]; [o_btn_play setAlternateImage: o_img_pause_pressed]; [o_btn_play setToolTip: _NS("Pause")]; @@ -1398,6 +1406,7 @@ static VLCMain *_o_sharedMainInstance = nil; } else { + [[[self getControls] getFSPanel] setPlay]; [o_btn_play setImage: o_img_play]; [o_btn_play setAlternateImage: o_img_play_pressed]; [o_btn_play setToolTip: _NS("Play")]; @@ -1473,6 +1482,7 @@ static VLCMain *_o_sharedMainInstance = nil; (int) (i_seconds / 60 % 60), (int) (i_seconds % 60)]; [o_timefield setStringValue: o_time]; + [[[self getControls] getFSPanel] setStreamPos: pos.f_float setSeconds: i_seconds]; [o_embedded_window setTime: o_time position: f_updated]; } #undef p_input diff --git a/modules/gui/macosx/vout.m b/modules/gui/macosx/vout.m index 5890f94c20..1b788c6f7d 100644 --- a/modules/gui/macosx/vout.m +++ b/modules/gui/macosx/vout.m @@ -40,7 +40,9 @@ #include #include "intf.h" +#include "fspanel.h" #include "vout.h" +#import "controls.h" /***************************************************************************** * DeviceCallback: Callback triggered when the video-device variable is changed @@ -377,6 +379,10 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, var_Get( p_real_vout, "fullscreen", &val ); val.b_bool = !val.b_bool; var_Set( p_real_vout, "fullscreen", val ); + if( [self isFullscreen] ) + [[[[VLCMain sharedInstance] getControls] getFSPanel] orderFront: self]; + else + [[[[VLCMain sharedInstance] getControls] getFSPanel] orderOut: self]; } - (BOOL)isFullscreen @@ -609,6 +615,8 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, val.b_bool = VLC_TRUE; var_Set( p_vout, "mouse-moved", val ); } + if( [self isFullscreen] ) + [[[[VLCMain sharedInstance] getControls] getFSPanel] fadeIn]; } [super mouseMoved: o_event]; @@ -943,7 +951,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, styleMask: NSBorderlessWindowMask backing: NSBackingStoreBuffered defer: YES screen: o_screen]; - + if( var_GetBool( p_real_vout, "macosx-black" ) ) if( b_black == VLC_TRUE ) {