diff --git a/extras/package/macosx/VLC.xcodeproj/project.pbxproj b/extras/package/macosx/VLC.xcodeproj/project.pbxproj index e878b5a495d7a699b35b16ea006f245ddcd99fdb..651eafced98c863835b623a26641418f9e41e683 100644 --- a/extras/package/macosx/VLC.xcodeproj/project.pbxproj +++ b/extras/package/macosx/VLC.xcodeproj/project.pbxproj @@ -125,6 +125,7 @@ 7D66D4362200BC340040D04A /* VLCClickerManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D66D4352200BC340040D04A /* VLCClickerManager.m */; }; 7D66D4392200C5B80040D04A /* VLCVideoFilterHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D66D4382200C5B80040D04A /* VLCVideoFilterHelper.m */; }; 7D66D43C2200D6090040D04A /* VLCDetachedVideoWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D66D43B2200D6090040D04A /* VLCDetachedVideoWindow.m */; }; + 7D713D322201AE350042BEB7 /* VLCLibraryWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D713D312201AE350042BEB7 /* VLCLibraryWindow.m */; }; 7DB40D2A20CBCEB500F63173 /* VLCMainMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DB40D2920CBCEB500F63173 /* VLCMainMenu.m */; }; 7DB40D2D20CBCEC200F63173 /* VLCStatusBarIcon.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DB40D2B20CBCEC200F63173 /* VLCStatusBarIcon.m */; }; 7DB7F1EC20CC036D00C2CAED /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7DB7F1EB20CC036D00C2CAED /* AudioUnit.framework */; }; @@ -446,6 +447,9 @@ 7D66D4382200C5B80040D04A /* VLCVideoFilterHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCVideoFilterHelper.m; sourceTree = "<group>"; }; 7D66D43A2200D6090040D04A /* VLCDetachedVideoWindow.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCDetachedVideoWindow.h; sourceTree = "<group>"; }; 7D66D43B2200D6090040D04A /* VLCDetachedVideoWindow.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCDetachedVideoWindow.m; sourceTree = "<group>"; }; + 7D713D302201AE350042BEB7 /* VLCLibraryWindow.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLibraryWindow.h; sourceTree = "<group>"; }; + 7D713D312201AE350042BEB7 /* VLCLibraryWindow.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryWindow.m; sourceTree = "<group>"; }; + 7D713D332201BB130042BEB7 /* VLCLibraryWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = VLCLibraryWindow.xib; sourceTree = "<group>"; }; 7D871D371B5E6844000B56C0 /* VLCMain+OldPrefs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "VLCMain+OldPrefs.h"; sourceTree = "<group>"; }; 7D871D381B5E6844000B56C0 /* VLCMain+OldPrefs.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "VLCMain+OldPrefs.m"; sourceTree = "<group>"; }; 7D871D391B5E684D000B56C0 /* helpers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = helpers.h; sourceTree = "<group>"; }; @@ -636,6 +640,7 @@ 7D349C9220CBC6DE003359A1 /* Application & App Delegate */, 7D349C9C20CBC94D003359A1 /* Menus */, 7D0A387A20CBCCAB00D4BF3B /* Playback */, + 7D713D2F2201ADFD0042BEB7 /* Library Window */, 7D349C9320CBC770003359A1 /* Main Window */, 7D0A387B20CBCCB900D4BF3B /* Streaming and Remote Playback */, 7D349C9520CBC823003359A1 /* Playlist */, @@ -1284,6 +1289,15 @@ name = "Open media"; sourceTree = "<group>"; }; + 7D713D2F2201ADFD0042BEB7 /* Library Window */ = { + isa = PBXGroup; + children = ( + 7D713D302201AE350042BEB7 /* VLCLibraryWindow.h */, + 7D713D312201AE350042BEB7 /* VLCLibraryWindow.m */, + ); + name = "Library Window"; + sourceTree = "<group>"; + }; 7DB317A120CBCA8500673FB8 /* Model */ = { isa = PBXGroup; children = ( @@ -1499,6 +1513,7 @@ children = ( 6B8224091E4D2A9000833BE1 /* MainMenu.xib */, 6B82240A1E4D2A9000833BE1 /* MainWindow.xib */, + 7D713D332201BB130042BEB7 /* VLCLibraryWindow.xib */, 6B82241A1E4D2A9000833BE1 /* VLCStatusBarIconMainMenu.xib */, 6B8224181E4D2A9000833BE1 /* VLCFullScreenPanel.xib */, 6B8223FE1E4D2A8F00833BE1 /* About.xib */, @@ -1678,6 +1693,7 @@ 6B0292E61F43256300A50082 /* VLCBottomBarView.m in Sources */, 1C3113C51E508C6900D4DD76 /* misc.m in Sources */, 1C3113C71E508C6900D4DD76 /* VLCOpenWindowController.m in Sources */, + 7D713D322201AE350042BEB7 /* VLCLibraryWindow.m in Sources */, 1C3113C91E508C6900D4DD76 /* VLCOutput.m in Sources */, 1C1C62011F8260A90052DD4F /* VLCWrappableTextField.m in Sources */, 6BBB05DA1EEFEA29003A1019 /* VLCHUDOutlineView.m in Sources */, diff --git a/modules/gui/macosx/Makefile.am b/modules/gui/macosx/Makefile.am index bb8a70b275264bab08d191ece3d01c62d94a764a..957202e4b44761089eaa65d07adc648b4a623d1b 100644 --- a/modules/gui/macosx/Makefile.am +++ b/modules/gui/macosx/Makefile.am @@ -91,6 +91,7 @@ libmacosx_plugin_la_SOURCES = \ gui/macosx/VLCInputManager.h gui/macosx/VLCInputManager.m \ gui/macosx/VLCRemoteControlService.h gui/macosx/VLCRemoteControlService.m \ gui/macosx/VLCMainWindow.h gui/macosx/VLCMainWindow.m \ + gui/macosx/VLCLibraryWindow.h gui/macosx/VLCLibraryWindow.m \ gui/macosx/VLCDetachedVideoWindow.h gui/macosx/VLCDetachedVideoWindow.m \ gui/macosx/VLCRendererDiscovery.h gui/macosx/VLCRendererDiscovery.m \ gui/macosx/VLCRendererItem.h gui/macosx/VLCRendererItem.m \ @@ -149,6 +150,7 @@ libmacosx_plugin_la_XIB_SOURCES = \ gui/macosx/UI/LogMessageWindow.xib \ gui/macosx/UI/MainMenu.xib \ gui/macosx/UI/MainWindow.xib \ + gui/macosx/UI/VLCLibraryWindow.xib \ gui/macosx/UI/MediaInfo.xib \ gui/macosx/UI/Open.xib \ gui/macosx/UI/PlaylistAccessoryView.xib \ diff --git a/modules/gui/macosx/UI/VLCLibraryWindow.xib b/modules/gui/macosx/UI/VLCLibraryWindow.xib new file mode 100644 index 0000000000000000000000000000000000000000..87acd7add01bd73d4d82e8ab197ad5e6deea63ba --- /dev/null +++ b/modules/gui/macosx/UI/VLCLibraryWindow.xib @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="UTF-8"?> +<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES"> + <dependencies> + <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14460.31"/> + <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> + </dependencies> + <objects> + <customObject id="-2" userLabel="File's Owner" customClass="VLCLibraryWindowController"> + <connections> + <outlet property="window" destination="QvC-M9-y7g" id="V4U-WR-QYC"/> + </connections> + </customObject> + <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/> + <customObject id="-3" userLabel="Application" customClass="NSObject"/> + <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" frameAutosaveName="librarywindow" animationBehavior="default" titlebarAppearsTransparent="YES" titleVisibility="hidden" id="QvC-M9-y7g" customClass="VLCLibraryWindow"> + <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/> + <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/> + <rect key="contentRect" x="196" y="240" width="480" height="270"/> + <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1177"/> + <view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ"> + <rect key="frame" x="0.0" y="0.0" width="480" height="270"/> + <autoresizingMask key="autoresizingMask"/> + <subviews> + <segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="W1M-0o-qYG"> + <rect key="frame" x="88" y="240" width="304" height="24"/> + <constraints> + <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="300" id="Wg7-mn-ahw"/> + </constraints> + <segmentedCell key="cell" borderStyle="border" alignment="left" style="rounded" trackingMode="selectOne" id="Twg-gp-8ng"> + <font key="font" metaFont="system"/> + <segments> + <segment width="99"/> + <segment width="99" selected="YES" tag="1"/> + <segment width="98"/> + </segments> + </segmentedCell> + </segmentedControl> + <customView hidden="YES" translatesAutoresizingMaskIntoConstraints="NO" id="12s-0J-Uvj" customClass="VLCVoutView"> + <rect key="frame" x="0.0" y="0.0" width="480" height="235"/> + </customView> + <scrollView wantsLayer="YES" borderType="none" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nXS-11-7iK"> + <rect key="frame" x="0.0" y="0.0" width="480" height="235"/> + <clipView key="contentView" id="OKa-dt-1yY"> + <rect key="frame" x="0.0" y="0.0" width="480" height="235"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <subviews> + <collectionView id="B8x-e8-7zp"> + <rect key="frame" x="0.0" y="0.0" width="480" height="158"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES"/> + <collectionViewFlowLayout key="collectionViewLayout" minimumInteritemSpacing="10" minimumLineSpacing="10" id="Rag-cM-k1g"> + <size key="itemSize" width="50" height="50"/> + </collectionViewFlowLayout> + <color key="primaryBackgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> + </collectionView> + </subviews> + </clipView> + <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="7ik-B8-JYg"> + <rect key="frame" x="1" y="144" width="233" height="15"/> + <autoresizingMask key="autoresizingMask"/> + </scroller> + <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="rUh-Qg-gUL"> + <rect key="frame" x="234" y="1" width="15" height="143"/> + <autoresizingMask key="autoresizingMask"/> + </scroller> + </scrollView> + </subviews> + <constraints> + <constraint firstAttribute="bottom" secondItem="nXS-11-7iK" secondAttribute="bottom" id="0pQ-dO-rse"/> + <constraint firstItem="B8x-e8-7zp" firstAttribute="top" secondItem="W1M-0o-qYG" secondAttribute="bottom" constant="7" id="3Wf-d4-dN1"/> + <constraint firstItem="W1M-0o-qYG" firstAttribute="centerX" secondItem="EiT-Mj-1SZ" secondAttribute="centerX" id="4k0-zs-btE"/> + <constraint firstItem="12s-0J-Uvj" firstAttribute="leading" secondItem="nXS-11-7iK" secondAttribute="leading" id="69M-D7-5Yc"/> + <constraint firstItem="12s-0J-Uvj" firstAttribute="bottom" secondItem="nXS-11-7iK" secondAttribute="bottom" id="GcY-YM-Uyd"/> + <constraint firstItem="12s-0J-Uvj" firstAttribute="trailing" secondItem="nXS-11-7iK" secondAttribute="trailing" id="HPG-6j-8DO"/> + <constraint firstItem="12s-0J-Uvj" firstAttribute="top" secondItem="nXS-11-7iK" secondAttribute="top" id="OqY-5k-2vb"/> + <constraint firstItem="nXS-11-7iK" firstAttribute="leading" secondItem="EiT-Mj-1SZ" secondAttribute="leading" id="pXs-j9-TqM"/> + <constraint firstAttribute="trailing" secondItem="nXS-11-7iK" secondAttribute="trailing" id="rle-L3-teF"/> + <constraint firstItem="W1M-0o-qYG" firstAttribute="top" secondItem="EiT-Mj-1SZ" secondAttribute="top" constant="7" id="y9h-yj-Ufq"/> + </constraints> + </view> + <connections> + <outlet property="libraryCollectionView" destination="B8x-e8-7zp" id="djF-Lw-nXT"/> + <outlet property="segmentedTitleControl" destination="W1M-0o-qYG" id="Gw1-T6-78k"/> + <outlet property="videoView" destination="12s-0J-Uvj" id="zTg-s0-qZ5"/> + </connections> + </window> + </objects> +</document> diff --git a/modules/gui/macosx/VLCLibraryWindow.h b/modules/gui/macosx/VLCLibraryWindow.h new file mode 100644 index 0000000000000000000000000000000000000000..1fdf7f628b1ff3f623ba3e9b86a28dc445638e9e --- /dev/null +++ b/modules/gui/macosx/VLCLibraryWindow.h @@ -0,0 +1,44 @@ +/***************************************************************************** + * VLCLibraryWindow.h: MacOS X interface module + ***************************************************************************** + * Copyright (C) 2019 VLC authors and VideoLAN + * + * Authors: Felix Paul Kühne <fkuehne # videolan -dot- org> + * + * 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. + *****************************************************************************/ + +#import "VLCVideoWindowCommon.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface VLCLibraryWindowController : NSWindowController + +- (instancetype)initWithLibraryWindow; + +@end + +@interface VLCLibraryWindow : VLCVideoWindowCommon + +@property (readwrite, weak) IBOutlet NSSegmentedControl *segmentedTitleControl; +@property (readwrite, weak) IBOutlet NSCollectionView *libraryCollectionView; + +@end + +@interface VLCTitlebarAccessoryViewController : NSTitlebarAccessoryViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/modules/gui/macosx/VLCLibraryWindow.m b/modules/gui/macosx/VLCLibraryWindow.m new file mode 100644 index 0000000000000000000000000000000000000000..b6976ef86d5f6726e980aa48116f64c02fda9284 --- /dev/null +++ b/modules/gui/macosx/VLCLibraryWindow.m @@ -0,0 +1,65 @@ +/***************************************************************************** + * VLCLibraryWindow.m: MacOS X interface module + ***************************************************************************** + * Copyright (C) 2019 VLC authors and VideoLAN + * + * Authors: Felix Paul Kühne <fkuehne # videolan -dot- org> + * + * 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. + *****************************************************************************/ + +#import "VLCLibraryWindow.h" +#import "VLCStringUtility.h" + +static const float f_min_window_width = 604.; +static const float f_min_window_height = 307.; + +@implementation VLCLibraryWindow + +- (void)awakeFromNib +{ + _segmentedTitleControl.segmentCount = 3; + [_segmentedTitleControl setTarget:self]; + [_segmentedTitleControl setAction:@selector(segmentedControlAction)]; + [_segmentedTitleControl setLabel:_NS("Music") forSegment:0]; + [_segmentedTitleControl setLabel:_NS("Video") forSegment:1]; + [_segmentedTitleControl setLabel:_NS("Network") forSegment:2]; + [_segmentedTitleControl sizeToFit]; +} + +- (void)segmentedControlAction +{ +} + +@end + +@implementation VLCLibraryWindowController + +- (instancetype)initWithLibraryWindow +{ + self = [super initWithWindowNibName:@"VLCLibraryWindow"]; + return self; +} + +- (void)windowDidLoad +{ + NSWindow *window = self.window; + [window setRestorable:NO]; + [window setExcludedFromWindowsMenu:YES]; + [window setAcceptsMouseMovedEvents:YES]; + [window setContentMinSize:NSMakeSize(f_min_window_width, f_min_window_height)]; +} + +@end diff --git a/modules/gui/macosx/VLCMain.h b/modules/gui/macosx/VLCMain.h index e3395aa103fc3c4b5145950802cd21fd7e1b8c6c..16158e8d0f954cd430cb9d40d2eab4084678b5ee 100644 --- a/modules/gui/macosx/VLCMain.h +++ b/modules/gui/macosx/VLCMain.h @@ -69,6 +69,7 @@ static NSString * VLCAppleRemoteSettingChangedNotification = @"VLCAppleRemoteSet @class VLCBookmarksWindowController; @class VLCOpenWindowController; @class VLCLogWindowController; +@class VLCLibraryWindowController; @class VLCTrackSynchronizationWindowController; @class VLCAudioEffectsWindowController; @class VLCVideoEffectsWindowController; @@ -82,6 +83,7 @@ static NSString * VLCAppleRemoteSettingChangedNotification = @"VLCAppleRemoteSet @property (readonly) VLCVideoOutputProvider* voutProvider; @property (readonly) BOOL nativeFullscreenMode; @property (nonatomic, readwrite) BOOL playlistUpdatedSelectorInQueue; +@property (readonly) VLCLibraryWindowController *libraryWindowController; + (VLCMain *)sharedInstance; + (void)killInstance; diff --git a/modules/gui/macosx/VLCMain.m b/modules/gui/macosx/VLCMain.m index a8d052167ec5827a03d67fc3af1e42603df9c6a6..c2c07f08599f8b14e31e0f2e8e2e0ae4393bb178 100644 --- a/modules/gui/macosx/VLCMain.m +++ b/modules/gui/macosx/VLCMain.m @@ -60,6 +60,7 @@ #import "VLCResumeDialogController.h" #import "VLCLogWindowController.h" #import "VLCConvertAndSaveWindowController.h" +#import "VLCLibraryWindow.h" #import "VLCVideoEffectsWindowController.h" #import "VLCAudioEffectsWindowController.h" @@ -180,6 +181,7 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable, VLCConvertAndSaveWindowController *_convertAndSaveWindow; VLCExtensionsManager *_extensionsManager; VLCInfo *_currentMediaInfoPanel; + VLCLibraryWindowController *_libraryWindowController; bool b_intf_terminating; /* Makes sure applicationWillTerminate will be called only once */ } @@ -233,6 +235,7 @@ static VLCMain *sharedInstance = nil; _playlist = [[VLCPlaylist alloc] init]; _mainWindowController = [[NSWindowController alloc] initWithWindowNibName:@"MainWindow"]; + _libraryWindowController = [[VLCLibraryWindowController alloc] initWithLibraryWindow]; var_AddCallback(pl_Get(p_intf), "intf-toggle-fscontrol", ShowController, (__bridge void *)self); var_AddCallback(pl_Get(p_intf), "intf-show", ShowController, (__bridge void *)self); @@ -465,6 +468,11 @@ static VLCMain *sharedInstance = nil; return (VLCMainWindow *)[_mainWindowController window]; } +- (VLCLibraryWindowController *)libraryWindowController +{ + return _libraryWindowController; +} + - (VLCInputManager *)inputManager { return _input_manager; diff --git a/modules/gui/macosx/VLCMainMenu.m b/modules/gui/macosx/VLCMainMenu.m index de811e52ebbea4142fb896b92cb82287949d4d8d..7a7c3c201f6ccc32b0abb662c967e4c136d1b7c3 100644 --- a/modules/gui/macosx/VLCMainMenu.m +++ b/modules/gui/macosx/VLCMainMenu.m @@ -42,6 +42,7 @@ #import "VLCCoreDialogProvider.h" #import "VLCCoreInteraction.h" #import "VLCMainWindow.h" +#import "VLCLibraryWindow.h" #import "VLCMainWindowControlsBar.h" #import "VLCExtensionsManager.h" #import "VLCConvertAndSaveWindowController.h" @@ -1253,7 +1254,7 @@ - (IBAction)showPlaylist:(id)sender { - [[[VLCMain sharedInstance] mainWindow] changePlaylistState: psUserMenuEvent]; + [[[[VLCMain sharedInstance] libraryWindowController] window] makeKeyAndOrderFront:sender]; } #pragma mark - Help and Docs diff --git a/po/POTFILES.in b/po/POTFILES.in index 1f15f8097e71117ddb90c9405af356a21a81083c..1d01b5b8fd9b1ed2d876514bbbb0f611ccb954af 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -493,8 +493,8 @@ modules/gui/macosx/VLCFSPanelController.h modules/gui/macosx/VLCFSPanelController.m modules/gui/macosx/helpers.h modules/gui/macosx/macosx.m -modules/gui/macosx/VLCMain.h -modules/gui/macosx/VLCMain.m +modules/gui/macosx/VLCLibraryWindow.h +modules/gui/macosx/VLCLibraryWindow.m modules/gui/macosx/VLCMain+OldPrefs.h modules/gui/macosx/VLCMain+OldPrefs.m modules/gui/macosx/VLCMain.h