committed by
Steve Lhomme
5 changed files with 0 additions and 252 deletions
@ -1,98 +0,0 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="20037" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct"> |
|||
<dependencies> |
|||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="20037"/> |
|||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> |
|||
</dependencies> |
|||
<objects> |
|||
<customObject id="-2" userLabel="File's Owner" customClass="VLCLibraryCollectionViewAudioGroupSupplementaryDetailView"/> |
|||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/> |
|||
<customObject id="-3" userLabel="Application" customClass="NSObject"/> |
|||
<view id="HAc-or-XD8" customClass="VLCLibraryCollectionViewAudioGroupSupplementaryDetailView"> |
|||
<rect key="frame" x="0.0" y="0.0" width="1071" height="322"/> |
|||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" heightSizable="YES" flexibleMaxY="YES"/> |
|||
<subviews> |
|||
<stackView distribution="fill" orientation="vertical" alignment="leading" spacing="5" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="bw7-QB-Ssc"> |
|||
<rect key="frame" x="10" y="10" width="1051" height="282"/> |
|||
<subviews> |
|||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="nCe-dY-YMM"> |
|||
<rect key="frame" x="-2" y="203" width="178" height="79"/> |
|||
<textFieldCell key="cell" lineBreakMode="truncatingTail" title="Audio group name" id="6RM-x8-Y4y"> |
|||
<font key="font" textStyle="title1" name=".SFNS-Regular"/> |
|||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> |
|||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> |
|||
</textFieldCell> |
|||
</textField> |
|||
<scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" horizontalScrollElasticity="none" id="9ZS-oy-iP9" customClass="VLCSubScrollView"> |
|||
<rect key="frame" x="0.0" y="0.0" width="701" height="198"/> |
|||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> |
|||
<clipView key="contentView" drawsBackground="NO" id="3V4-tX-owM"> |
|||
<rect key="frame" x="0.0" y="0.0" width="701" height="198"/> |
|||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
|||
<subviews> |
|||
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" tableStyle="fullWidth" columnReordering="NO" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" rowSizeStyle="automatic" viewBased="YES" id="eEJ-WA-0aM" customClass="VLCLibraryTableView"> |
|||
<rect key="frame" x="0.0" y="0.0" width="701" height="188"/> |
|||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
|||
<size key="intercellSpacing" width="3" height="2"/> |
|||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/> |
|||
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/> |
|||
<tableColumns> |
|||
<tableColumn width="689" minWidth="10" maxWidth="3.4028234663852886e+38" id="fqq-am-CS8"> |
|||
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left"> |
|||
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/> |
|||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> |
|||
</tableHeaderCell> |
|||
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="1js-Fu-KuW"> |
|||
<font key="font" metaFont="system"/> |
|||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> |
|||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/> |
|||
</textFieldCell> |
|||
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/> |
|||
</tableColumn> |
|||
</tableColumns> |
|||
</tableView> |
|||
</subviews> |
|||
<nil key="backgroundColor"/> |
|||
</clipView> |
|||
<edgeInsets key="contentInsets" left="0.0" right="0.0" top="0.0" bottom="10"/> |
|||
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="ZBY-pE-E7T"> |
|||
<rect key="frame" x="-100" y="-100" width="701" height="15"/> |
|||
<autoresizingMask key="autoresizingMask"/> |
|||
</scroller> |
|||
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="WRE-VM-L7s"> |
|||
<rect key="frame" x="224" y="17" width="15" height="102"/> |
|||
<autoresizingMask key="autoresizingMask"/> |
|||
</scroller> |
|||
</scrollView> |
|||
</subviews> |
|||
<visibilityPriorities> |
|||
<integer value="1000"/> |
|||
<integer value="1000"/> |
|||
</visibilityPriorities> |
|||
<customSpacing> |
|||
<real value="3.4028234663852886e+38"/> |
|||
<real value="3.4028234663852886e+38"/> |
|||
</customSpacing> |
|||
</stackView> |
|||
</subviews> |
|||
<constraints> |
|||
<constraint firstAttribute="trailing" secondItem="bw7-QB-Ssc" secondAttribute="trailing" constant="10" id="8QK-wS-vnX"/> |
|||
<constraint firstItem="bw7-QB-Ssc" firstAttribute="leading" secondItem="HAc-or-XD8" secondAttribute="leading" constant="10" id="L0r-A5-7Xq"/> |
|||
<constraint firstAttribute="bottom" secondItem="bw7-QB-Ssc" secondAttribute="bottom" constant="10" id="eS3-iK-oGV"/> |
|||
<constraint firstItem="bw7-QB-Ssc" firstAttribute="top" secondItem="HAc-or-XD8" secondAttribute="top" constant="30" id="oWk-8b-f1e"/> |
|||
</constraints> |
|||
<connections> |
|||
<outlet property="audioGroupAlbumsTableView" destination="eEJ-WA-0aM" id="l8k-M9-a8e"/> |
|||
<outlet property="audioGroupNameTextField" destination="nCe-dY-YMM" id="h3l-p0-w3e"/> |
|||
<outlet property="contentViewBottomConstraint" destination="eS3-iK-oGV" id="T0p-C1-8jm"/> |
|||
<outlet property="contentViewLeftConstraint" destination="L0r-A5-7Xq" id="T0p-C1-a8j"/> |
|||
<outlet property="contentViewRightConstraint" destination="8QK-wS-vnX" id="T0p-C1-a7l"/> |
|||
<outlet property="contentViewTopConstraint" destination="oWk-8b-f1e" id="T0p-C1-1nv"/> |
|||
<outlet property="internalScrollView" destination="9ZS-oy-iP9" id="afa-6P-b12"/> |
|||
<outlet property="tableClipView" destination="3V4-tX-owM" id="t4b-1e-Cl1"/> |
|||
<outlet property="tableScrollView" destination="9ZS-oy-iP9" id="tab-L3-Scr"/> |
|||
</connections> |
|||
<point key="canvasLocation" x="-237.5" y="-284"/> |
|||
</view> |
|||
</objects> |
|||
</document> |
|||
@ -1,43 +0,0 @@ |
|||
/*****************************************************************************
|
|||
* VLCLibraryCollectionViewAudioGroupSupplementaryDetailView.h: MacOS X interface module |
|||
***************************************************************************** |
|||
* Copyright (C) 2022 VLC authors and VideoLAN |
|||
* |
|||
* Authors: Claudio Cambra <claudio.cambra@gmail.com> |
|||
* |
|||
* 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 <Cocoa/Cocoa.h> |
|||
|
|||
#import "library/VLCLibraryCollectionViewSupplementaryDetailView.h" |
|||
|
|||
NS_ASSUME_NONNULL_BEGIN |
|||
|
|||
@class VLCImageView; |
|||
|
|||
extern NSString *const VLCLibraryCollectionViewAudioGroupSupplementaryDetailViewIdentifier; |
|||
extern NSCollectionViewSupplementaryElementKind const VLCLibraryCollectionViewAudioGroupSupplementaryDetailViewKind; |
|||
|
|||
@interface VLCLibraryCollectionViewAudioGroupSupplementaryDetailView : VLCLibraryCollectionViewSupplementaryDetailView |
|||
|
|||
@property (readwrite, weak) IBOutlet NSTextField *audioGroupNameTextField; |
|||
@property (readwrite, weak) IBOutlet NSTableView *audioGroupAlbumsTableView; |
|||
@property (readwrite, weak) IBOutlet NSClipView *tableClipView; |
|||
@property (readwrite, weak) IBOutlet NSScrollView *tableScrollView; |
|||
|
|||
@end |
|||
|
|||
NS_ASSUME_NONNULL_END |
|||
@ -1,100 +0,0 @@ |
|||
/***************************************************************************** |
|||
* VLCLibraryCollectionViewAudioGroupSupplementaryDetailView.m: MacOS X interface module |
|||
***************************************************************************** |
|||
* Copyright (C) 2022 VLC authors and VideoLAN |
|||
* |
|||
* Authors: Claudio Cambra <claudio.cambra@gmail.com> |
|||
* |
|||
* 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 "VLCLibraryCollectionViewAudioGroupSupplementaryDetailView.h" |
|||
|
|||
#import "extensions/NSFont+VLCAdditions.h" |
|||
|
|||
#import "library/VLCLibraryDataTypes.h" |
|||
#import "library/VLCLibraryModel.h" |
|||
#import "library/VLCLibraryRepresentedItem.h" |
|||
|
|||
#import "library/audio-library/VLCLibraryAudioGroupDataSource.h" |
|||
#import "library/audio-library/VLCLibraryAudioGroupTableViewDelegate.h" |
|||
|
|||
NSString *const VLCLibraryCollectionViewAudioGroupSupplementaryDetailViewIdentifier = @"VLCLibraryCollectionViewAudioGroupSupplementaryDetailViewIdentifier"; |
|||
NSCollectionViewSupplementaryElementKind const VLCLibraryCollectionViewAudioGroupSupplementaryDetailViewKind = @"VLCLibraryCollectionViewAudioGroupSupplementaryDetailViewIdentifier"; |
|||
|
|||
@interface VLCLibraryCollectionViewAudioGroupSupplementaryDetailView () |
|||
{ |
|||
VLCLibraryAudioGroupDataSource *_audioGroupAlbumsDataSource; |
|||
VLCLibraryAudioGroupTableViewDelegate *_audioGroupAlbumsTableViewDelegate; |
|||
} |
|||
|
|||
@end |
|||
|
|||
@implementation VLCLibraryCollectionViewAudioGroupSupplementaryDetailView |
|||
|
|||
- (void)awakeFromNib |
|||
{ |
|||
_audioGroupAlbumsDataSource = [[VLCLibraryAudioGroupDataSource alloc] init]; |
|||
_audioGroupAlbumsDataSource.tableViews = @[_audioGroupAlbumsTableView]; |
|||
|
|||
_audioGroupAlbumsTableViewDelegate = [[VLCLibraryAudioGroupTableViewDelegate alloc] init]; |
|||
|
|||
_audioGroupAlbumsTableView.dataSource = _audioGroupAlbumsDataSource; |
|||
_audioGroupAlbumsTableView.delegate = _audioGroupAlbumsTableViewDelegate; |
|||
|
|||
_audioGroupNameTextField.font = NSFont.VLCLibrarySubsectionHeaderFont; |
|||
|
|||
NSNotificationCenter * const notificationCenter = NSNotificationCenter.defaultCenter; |
|||
[notificationCenter addObserver:self |
|||
selector:@selector(handleAudioGroupUpdated:) |
|||
name:VLCLibraryModelAlbumUpdated |
|||
object:nil]; |
|||
[notificationCenter addObserver:self |
|||
selector:@selector(handleAudioGroupUpdated:) |
|||
name:VLCLibraryModelArtistUpdated |
|||
object:nil]; |
|||
[notificationCenter addObserver:self |
|||
selector:@selector(handleAudioGroupUpdated:) |
|||
name:VLCLibraryModelGenreUpdated |
|||
object:nil]; |
|||
} |
|||
|
|||
- (void)handleAudioGroupUpdated:(NSNotification *)notification |
|||
{ |
|||
NSParameterAssert(notification); |
|||
|
|||
if (self.representedItem == nil || |
|||
notification.object == nil || |
|||
![notification.object conformsToProtocol:@protocol(VLCMediaLibraryAudioGroupProtocol)]) { |
|||
|
|||
return; |
|||
} |
|||
|
|||
const id<VLCMediaLibraryAudioGroupProtocol> audioGroup = (id<VLCMediaLibraryAudioGroupProtocol>)notification.object; |
|||
VLCLibraryRepresentedItem * const representedItem = [[VLCLibraryRepresentedItem alloc] initWithItem:audioGroup parentType:self.representedItem.parentType]; |
|||
self.representedItem = representedItem; |
|||
} |
|||
|
|||
- (void)updateRepresentation |
|||
{ |
|||
NSAssert(self.representedItem != nil, @"no media item assigned for collection view item", nil); |
|||
const id<VLCMediaLibraryAudioGroupProtocol> audioGroup = (id<VLCMediaLibraryAudioGroupProtocol>)self.representedItem.item; |
|||
NSAssert(audioGroup != nil, @"audio group should not be nil!"); |
|||
|
|||
_audioGroupNameTextField.stringValue = audioGroup.displayString; |
|||
_audioGroupAlbumsDataSource.representedAudioGroup = audioGroup; |
|||
} |
|||
|
|||
@end |
|||
Loading…
Reference in new issue