[vlc-commits] [Git][videolan/vlc][master] 19 commits: macosx: Just use sidebar child view controllers' title property in root sidebar vc
Steve Lhomme (@robUx4)
gitlab at videolan.org
Wed Oct 30 14:34:49 UTC 2024
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
9fd4dfc4 by Claudio Cambra at 2024-10-30T13:55:14+00:00
macosx: Just use sidebar child view controllers' title property in root sidebar vc
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
42bef66c by Claudio Cambra at 2024-10-30T13:55:14+00:00
macosx: Add starter VLCLibraryWindowTitlesSidebarViewController
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
58b89e60 by Claudio Cambra at 2024-10-30T13:55:14+00:00
macosx: Fix chapters view XIB identifier
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
47498179 by Claudio Cambra at 2024-10-30T13:55:14+00:00
macosx: Add titles view XIB
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
e17516ca by Claudio Cambra at 2024-10-30T13:55:14+00:00
macosx: Fix view selector being set up with invalid strings
Need to wait for the view controllers to be instantiated to set the
segmented view control labels
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
07a6cdb2 by Claudio Cambra at 2024-10-30T13:55:14+00:00
macosx: Add titles segment in sidebar root view
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
53ce5f3e by Claudio Cambra at 2024-10-30T13:55:14+00:00
macosx: Take titles into account when updating view selector visibility and selection state
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
4997dffe by Claudio Cambra at 2024-10-30T13:55:14+00:00
macosx: Use labels instead of segment index to check selection
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
2d4e8a2c by Claudio Cambra at 2024-10-30T13:55:14+00:00
macosx: Present relevant segments, not simply *all* segments in sidebar
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
28215801 by Claudio Cambra at 2024-10-30T13:55:14+00:00
macosx: Give each segment an equal width in sidebar segmented view
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
feb4fa21 by Claudio Cambra at 2024-10-30T13:55:14+00:00
macosx: Add starter VLCPlayerTitle
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
4486f389 by Claudio Cambra at 2024-10-30T13:55:14+00:00
macosx: Add init from vlc_player_title in VLCPlayerTitle
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
3a74bbf9 by Claudio Cambra at 2024-10-30T13:55:14+00:00
macosx: Fix up identifier names in titles view XIB
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
942867c4 by Claudio Cambra at 2024-10-30T13:55:14+00:00
macosx: Add an index property to VLCPlayerTitle
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
6382c885 by Claudio Cambra at 2024-10-30T13:55:14+00:00
macosx: Add a property for titles of current media in VLCPlayerController
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
f7bd4fc6 by Claudio Cambra at 2024-10-30T13:55:14+00:00
macosx: Setup superclass relevant stuff on title sidebar view controller
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
e88bc860 by Claudio Cambra at 2024-10-30T13:55:14+00:00
macosx: Handle table view populating in titles sidebar view controller
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
2e070842 by Claudio Cambra at 2024-10-30T13:55:14+00:00
macosx: Handle table view selection change in titles sidebar view controller
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
b940068a by Claudio Cambra at 2024-10-30T13:55:14+00:00
macosx: React to title list changes in titles sidebar vc
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
12 changed files:
- extras/package/macosx/VLC.xcodeproj/project.pbxproj
- modules/gui/macosx/Makefile.am
- modules/gui/macosx/UI/VLCLibraryWindowChaptersView.xib
- + modules/gui/macosx/UI/VLCLibraryWindowTitlesView.xib
- modules/gui/macosx/library/VLCLibraryWindowSidebarRootViewController.h
- modules/gui/macosx/library/VLCLibraryWindowSidebarRootViewController.m
- + modules/gui/macosx/library/VLCLibraryWindowTitlesSidebarViewController.h
- + modules/gui/macosx/library/VLCLibraryWindowTitlesSidebarViewController.m
- modules/gui/macosx/playlist/VLCPlayerController.h
- modules/gui/macosx/playlist/VLCPlayerController.m
- + modules/gui/macosx/playlist/VLCPlayerTitle.h
- + modules/gui/macosx/playlist/VLCPlayerTitle.m
Changes:
=====================================
extras/package/macosx/VLC.xcodeproj/project.pbxproj
=====================================
@@ -142,6 +142,8 @@
53C1EF8B2B466B13001AEEF5 /* VLCLibraryHomeViewVideoGridContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 53C1EF852B466B13001AEEF5 /* VLCLibraryHomeViewVideoGridContainerView.m */; };
53C1EF8C2B466B13001AEEF5 /* VLCLibraryHomeViewStackViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 53C1EF862B466B13001AEEF5 /* VLCLibraryHomeViewStackViewController.m */; };
53CBE30B2C159A4D006BF2E3 /* VLCNoResultsLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 53CBE30A2C159A4D006BF2E3 /* VLCNoResultsLabel.m */; };
+ 53D021352CC225C6003C008F /* VLCLibraryWindowTitlesSidebarViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 53D021332CC225C6003C008F /* VLCLibraryWindowTitlesSidebarViewController.m */; };
+ 53D0213D2CC25520003C008F /* VLCPlayerTitle.m in Sources */ = {isa = PBXBuildFile; fileRef = 53D0213C2CC25520003C008F /* VLCPlayerTitle.m */; };
53D21A1F2BB465600085C71B /* VLCLibraryWindowPlaylistSidebarViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 53D21A1E2BB465600085C71B /* VLCLibraryWindowPlaylistSidebarViewController.m */; };
53D8ED9A2B583AAF00142EAD /* VLCLibraryModelChangeDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 53D8ED992B583AAF00142EAD /* VLCLibraryModelChangeDelegate.m */; };
53ED472329C74D1F00795DB1 /* VLCLibraryAudioTableViewDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 53ED472229C74D1F00795DB1 /* VLCLibraryAudioTableViewDelegate.m */; };
@@ -438,6 +440,11 @@
53C1EF8A2B466B13001AEEF5 /* VLCLibraryHomeViewStackViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCLibraryHomeViewStackViewController.h; sourceTree = "<group>"; };
53CBE3092C159A4D006BF2E3 /* VLCNoResultsLabel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCNoResultsLabel.h; sourceTree = "<group>"; };
53CBE30A2C159A4D006BF2E3 /* VLCNoResultsLabel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCNoResultsLabel.m; sourceTree = "<group>"; };
+ 53D021322CC225C6003C008F /* VLCLibraryWindowTitlesSidebarViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLibraryWindowTitlesSidebarViewController.h; sourceTree = "<group>"; };
+ 53D021332CC225C6003C008F /* VLCLibraryWindowTitlesSidebarViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryWindowTitlesSidebarViewController.m; sourceTree = "<group>"; };
+ 53D021362CC22852003C008F /* VLCLibraryWindowTitlesView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = VLCLibraryWindowTitlesView.xib; sourceTree = "<group>"; };
+ 53D0213B2CC25520003C008F /* VLCPlayerTitle.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCPlayerTitle.h; sourceTree = "<group>"; };
+ 53D0213C2CC25520003C008F /* VLCPlayerTitle.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCPlayerTitle.m; sourceTree = "<group>"; };
53D21A1B2BB428A20085C71B /* VLCLibraryWindowNavigationSidebarView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = VLCLibraryWindowNavigationSidebarView.xib; sourceTree = "<group>"; };
53D21A1C2BB428F00085C71B /* VLCLibraryWindowPlaylistView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = VLCLibraryWindowPlaylistView.xib; sourceTree = "<group>"; };
53D21A1D2BB465600085C71B /* VLCLibraryWindowPlaylistSidebarViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLibraryWindowPlaylistSidebarViewController.h; sourceTree = "<group>"; };
@@ -1410,6 +1417,8 @@
5341F1522C9865DD003BDF0A /* VLCLibraryWindowSidebarRootViewController.m */,
53F0209F2A91115D00E79705 /* VLCLibraryWindowSplitViewController.h */,
53F020A02A91115D00E79705 /* VLCLibraryWindowSplitViewController.m */,
+ 53D021322CC225C6003C008F /* VLCLibraryWindowTitlesSidebarViewController.h */,
+ 53D021332CC225C6003C008F /* VLCLibraryWindowTitlesSidebarViewController.m */,
53F020A22A91D4A100E79705 /* VLCLibraryWindowToolbarDelegate.h */,
53F020A32A91D4A100E79705 /* VLCLibraryWindowToolbarDelegate.m */,
);
@@ -1425,6 +1434,8 @@
5341F14F2C983AF1003BDF0A /* VLCPlayerChapter.m */,
7DE9C7DB220728420089108F /* VLCPlayerController.h */,
7DE9C7DC220728420089108F /* VLCPlayerController.m */,
+ 53D0213B2CC25520003C008F /* VLCPlayerTitle.h */,
+ 53D0213C2CC25520003C008F /* VLCPlayerTitle.m */,
7D445D7F2202524000263D34 /* VLCPlaylistController.h */,
7D445D802202524000263D34 /* VLCPlaylistController.m */,
7D0F640A2202163E00FDB91F /* VLCPlaylistDataSource.h */,
@@ -2075,6 +2086,7 @@
6B82241A1E4D2A9000833BE1 /* VLCStatusBarIconMainMenu.xib */,
7D713D332201BB130042BEB7 /* VLCLibraryWindow.xib */,
5341F1472C96E544003BDF0A /* VLCLibraryWindowChaptersView.xib */,
+ 53D021362CC22852003C008F /* VLCLibraryWindowTitlesView.xib */,
53D21A1B2BB428A20085C71B /* VLCLibraryWindowNavigationSidebarView.xib */,
53D21A1C2BB428F00085C71B /* VLCLibraryWindowPlaylistView.xib */,
53A5021D2C9ADFF3000C3CD3 /* VLCLibraryWindowSidebarRootView.xib */,
@@ -2219,6 +2231,7 @@
1CCC89032078A3D500E5626F /* SimplePreferences.xib in Sources */,
537BD6862C59216600446ED0 /* VLCLibraryGroupsViewController.m in Sources */,
530F32B32C8C757600233C03 /* VLCLibraryAbstractSegmentViewController.m in Sources */,
+ 53D021352CC225C6003C008F /* VLCLibraryWindowTitlesSidebarViewController.m in Sources */,
7DE82E7922843781002D341A /* VLCLibraryAlbumTableCellView.m in Sources */,
7D67318622C8F4060000AD40 /* VLCMediaSourceCollectionViewItem.m in Sources */,
536283F0291146BC00640C15 /* VLCLibraryTableView.m in Sources */,
@@ -2345,6 +2358,7 @@
53A8F9D12A7E1E6300BC11BF /* VLCLibraryPlaylistViewController.m in Sources */,
1C3113D51E508C6900D4DD76 /* VLCTextfieldPanelController.m in Sources */,
53628403291147C500640C15 /* VLCSubScrollView.m in Sources */,
+ 53D0213D2CC25520003C008F /* VLCPlayerTitle.m in Sources */,
1C3113D71E508C6900D4DD76 /* VLCPopupPanelController.m in Sources */,
5360E9A52C5BE5550046BA8B /* VLCLibraryMasterDetailViewTableViewDelegate.m in Sources */,
7DF0994F23E71E76007CA6EE /* NSMenu+VLCAdditions.m in Sources */,
=====================================
modules/gui/macosx/Makefile.am
=====================================
@@ -185,6 +185,8 @@ libmacosx_plugin_la_SOURCES = \
gui/macosx/library/VLCLibraryWindowSidebarRootViewController.m \
gui/macosx/library/VLCLibraryWindowSplitViewController.h \
gui/macosx/library/VLCLibraryWindowSplitViewController.m \
+ gui/macosx/library/VLCLibraryWindowTitlesSidebarViewController.h \
+ gui/macosx/library/VLCLibraryWindowTitlesSidebarViewController.m \
gui/macosx/library/VLCLibraryWindowToolbarDelegate.h \
gui/macosx/library/VLCLibraryWindowToolbarDelegate.m \
gui/macosx/library/groups-library/VLCLibraryGroupsDataSource.h \
@@ -324,6 +326,8 @@ libmacosx_plugin_la_SOURCES = \
gui/macosx/playlist/VLCPlayerChapter.m \
gui/macosx/playlist/VLCPlayerController.h \
gui/macosx/playlist/VLCPlayerController.m \
+ gui/macosx/playlist/VLCPlayerTitle.h \
+ gui/macosx/playlist/VLCPlayerTitle.m \
gui/macosx/playlist/VLCPlaylistController.h \
gui/macosx/playlist/VLCPlaylistController.m \
gui/macosx/playlist/VLCPlaylistDataSource.h \
@@ -480,6 +484,7 @@ libmacosx_plugin_la_XIB_SOURCES = \
gui/macosx/UI/VLCLibraryWindowNavigationSidebarView.xib \
gui/macosx/UI/VLCLibraryWindowPlaylistView.xib \
gui/macosx/UI/VLCLibraryWindowSidebarRootView.xib \
+ gui/macosx/UI/VLCLibraryWindowTitlesView.xib \
gui/macosx/UI/VLCLibraryTableCellView.xib \
gui/macosx/UI/VLCPlaylistTableCellView.xib \
gui/macosx/UI/VLCLibraryCarouselViewItemView.xib \
=====================================
modules/gui/macosx/UI/VLCLibraryWindowChaptersView.xib
=====================================
@@ -14,7 +14,7 @@
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
- <customView identifier="VLCLibraryWindowPlaylistSidebarIdentifier" id="SIR-0h-28I">
+ <customView identifier="VLCLibraryWindowChaptersViewIdentifier" id="SIR-0h-28I">
<rect key="frame" x="0.0" y="0.0" width="835" height="246"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
=====================================
modules/gui/macosx/UI/VLCLibraryWindowTitlesView.xib
=====================================
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23094" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
+ <dependencies>
+ <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23094"/>
+ <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+ </dependencies>
+ <objects>
+ <customObject id="-2" userLabel="File's Owner" customClass="VLCLibraryWindowTitlesSidebarViewController">
+ <connections>
+ <outlet property="tableView" destination="5mv-Qc-JwM" id="C8u-Vw-BUa"/>
+ <outlet property="titleSeparator" destination="zf4-pf-0V2" id="MJk-Fh-4O3"/>
+ <outlet property="view" destination="SIR-0h-28I" id="yx0-b1-Be5"/>
+ </connections>
+ </customObject>
+ <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+ <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+ <customView identifier="VLCLibraryWindowTitlesViewIdentifier" id="SIR-0h-28I">
+ <rect key="frame" x="0.0" y="0.0" width="835" height="246"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+ <subviews>
+ <box verticalHuggingPriority="751" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="zf4-pf-0V2">
+ <rect key="frame" x="20" y="243" width="795" height="5"/>
+ </box>
+ <scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4vZ-4x-fwW">
+ <rect key="frame" x="0.0" y="0.0" width="835" height="245"/>
+ <clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="H6H-Cp-iPh">
+ <rect key="frame" x="0.0" y="0.0" width="835" height="245"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <subviews>
+ <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="firstColumnOnly" columnReordering="NO" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" rowSizeStyle="automatic" viewBased="YES" id="5mv-Qc-JwM" customClass="VLCPlaylistTableView">
+ <rect key="frame" x="0.0" y="0.0" width="835" height="245"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <size key="intercellSpacing" width="3" height="2"/>
+ <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
+ <color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
+ <tableColumns>
+ <tableColumn identifier="VLCLibraryWindowTitlesTableViewNameColumnIdentifier" editable="NO" width="736" minWidth="100" maxWidth="1000" id="9yW-DI-c08">
+ <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="Title">
+ <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
+ </tableHeaderCell>
+ <textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="JOU-jI-2dC">
+ <font key="font" metaFont="message"/>
+ <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
+ </textFieldCell>
+ <tableColumnResizingMask key="resizingMask" resizeWithTable="YES"/>
+ <prototypeCellViews>
+ <tableCellView identifier="VLCLibraryWindowTitlesTableViewNameCellIdentifier" id="ZTp-fs-5fE">
+ <rect key="frame" x="11" y="1" width="741" height="16"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <subviews>
+ <textField focusRingType="none" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Wdd-df-zUi">
+ <rect key="frame" x="0.0" y="0.0" width="96" height="16"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+ <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="deP-dG-o27">
+ <font key="font" metaFont="message"/>
+ <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+ </textFieldCell>
+ </textField>
+ </subviews>
+ <connections>
+ <outlet property="textField" destination="Wdd-df-zUi" id="61g-Ze-nvR"/>
+ </connections>
+ </tableCellView>
+ </prototypeCellViews>
+ </tableColumn>
+ <tableColumn identifier="VLCLibraryWindowTitlesTableViewLengthColumnIdentifier" editable="NO" width="64" minWidth="64" maxWidth="100" id="KEN-Nu-Iyj">
+ <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" title="Length">
+ <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="rLm-NE-gfo">
+ <font key="font" metaFont="system"/>
+ <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
+ </textFieldCell>
+ <tableColumnResizingMask key="resizingMask" resizeWithTable="YES"/>
+ <prototypeCellViews>
+ <tableCellView identifier="VLCLibraryWindowTitlesTableViewTimeCellIdentifier" id="frg-DF-b49">
+ <rect key="frame" x="755" y="1" width="68" height="17"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <subviews>
+ <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="kUX-VS-xeX">
+ <rect key="frame" x="0.0" y="1" width="68" height="16"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
+ <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="O2P-TI-H9Y">
+ <font key="font" usesAppearanceFont="YES"/>
+ <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+ </textFieldCell>
+ </textField>
+ </subviews>
+ <connections>
+ <outlet property="textField" destination="kUX-VS-xeX" id="eEl-G2-cu4"/>
+ </connections>
+ </tableCellView>
+ </prototypeCellViews>
+ </tableColumn>
+ </tableColumns>
+ <connections>
+ <outlet property="delegate" destination="-2" id="n2S-Eb-GVz"/>
+ </connections>
+ </tableView>
+ </subviews>
+ <nil key="backgroundColor"/>
+ </clipView>
+ <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="L1S-02-OQF">
+ <rect key="frame" x="-100" y="-100" width="0.0" height="16"/>
+ <autoresizingMask key="autoresizingMask"/>
+ </scroller>
+ <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="IJr-bf-Dsz">
+ <rect key="frame" x="494" y="0.0" width="16" height="27"/>
+ <autoresizingMask key="autoresizingMask"/>
+ </scroller>
+ </scrollView>
+ </subviews>
+ <constraints>
+ <constraint firstAttribute="trailing" secondItem="zf4-pf-0V2" secondAttribute="trailing" constant="20" id="0Sl-8y-RFJ"/>
+ <constraint firstItem="zf4-pf-0V2" firstAttribute="leading" secondItem="SIR-0h-28I" secondAttribute="leading" constant="20" id="Ekv-lb-XRR"/>
+ <constraint firstItem="4vZ-4x-fwW" firstAttribute="top" secondItem="zf4-pf-0V2" secondAttribute="bottom" id="Q2S-Bl-E4g"/>
+ <constraint firstAttribute="trailing" secondItem="4vZ-4x-fwW" secondAttribute="trailing" id="Vo4-sT-MAu"/>
+ <constraint firstAttribute="bottom" secondItem="4vZ-4x-fwW" secondAttribute="bottom" id="aRK-vR-wkV"/>
+ <constraint firstItem="zf4-pf-0V2" firstAttribute="top" secondItem="SIR-0h-28I" secondAttribute="top" id="fUf-47-MSy"/>
+ <constraint firstItem="4vZ-4x-fwW" firstAttribute="leading" secondItem="SIR-0h-28I" secondAttribute="leading" id="ran-Af-QyV"/>
+ </constraints>
+ <point key="canvasLocation" x="-312.5" y="45"/>
+ </customView>
+ </objects>
+</document>
=====================================
modules/gui/macosx/library/VLCLibraryWindowSidebarRootViewController.h
=====================================
@@ -26,6 +26,7 @@
@class VLCLibraryWindow;
@class VLCLibraryWindowChaptersSidebarViewController;
@class VLCLibraryWindowPlaylistSidebarViewController;
+ at class VLCLibraryWindowTitlesSidebarViewController;
NS_ASSUME_NONNULL_BEGIN
@@ -51,6 +52,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (readonly) VLCLibraryWindowPlaylistSidebarViewController *playlistSidebarViewController;
@property (readonly) VLCLibraryWindowChaptersSidebarViewController *chaptersSidebarViewController;
+ at property (readonly) VLCLibraryWindowTitlesSidebarViewController *titlesSidebarViewController;
- (instancetype)initWithLibraryWindow:(VLCLibraryWindow *)libraryWindow;
=====================================
modules/gui/macosx/library/VLCLibraryWindowSidebarRootViewController.m
=====================================
@@ -33,15 +33,13 @@
#import "library/VLCLibraryWindowChaptersSidebarViewController.h"
#import "library/VLCLibraryWindowPlaylistSidebarViewController.h"
#import "library/VLCLibraryWindowSidebarChildViewController.h"
+#import "library/VLCLibraryWindowTitlesSidebarViewController.h"
#import "playlist/VLCPlayerController.h"
#import "playlist/VLCPlaylistController.h"
#include "views/VLCRoundedCornerTextField.h"
-const NSInteger VLCLibraryWindowSidebarViewPlaylistSegment = 0;
-const NSInteger VLCLibraryWindowSidebarViewChaptersSegment = 1;
-
@interface VLCLibraryWindowSidebarRootViewController ()
@property (readwrite) NSViewController<VLCLibraryWindowSidebarChildViewController> *currentChildVc;
@@ -64,7 +62,6 @@ const NSInteger VLCLibraryWindowSidebarViewChaptersSegment = 1;
[super viewDidLoad];
[self setupPlaylistTitle];
[self setupCounterLabel];
- [self setupViewSelector];
self.mainVideoModeEnabled = NO;
@@ -72,9 +69,16 @@ const NSInteger VLCLibraryWindowSidebarViewChaptersSegment = 1;
[[VLCLibraryWindowPlaylistSidebarViewController alloc] initWithLibraryWindow:self.libraryWindow];
_chaptersSidebarViewController =
[[VLCLibraryWindowChaptersSidebarViewController alloc] initWithLibraryWindow:self.libraryWindow];
+ _titlesSidebarViewController =
+ [[VLCLibraryWindowTitlesSidebarViewController alloc] initWithLibraryWindow:self.libraryWindow];
self.targetView.translatesAutoresizingMaskIntoConstraints = NO;
+ if (@available(macOS 10.13, *)) {
+ self.viewSelector.segmentDistribution = NSSegmentDistributionFillEqually;
+ }
+
+ [self setupViewSelectorSegments];
[self updateViewSelectorState];
[self viewSelectorAction:self.viewSelector];
@@ -90,7 +94,6 @@ const NSInteger VLCLibraryWindowSidebarViewChaptersSegment = 1;
_playlistHeaderLabel = [[NSTextField alloc] init];
self.playlistHeaderLabel.translatesAutoresizingMaskIntoConstraints = NO;
self.playlistHeaderLabel.font = NSFont.VLClibrarySectionHeaderFont;
- self.playlistHeaderLabel.stringValue = _NS("Playlist");
self.playlistHeaderLabel.editable = NO;
self.playlistHeaderLabel.bezeled = NO;
self.playlistHeaderLabel.drawsBackground = NO;
@@ -109,14 +112,24 @@ const NSInteger VLCLibraryWindowSidebarViewChaptersSegment = 1;
]];
}
-- (void)setupViewSelector
+- (void)setupViewSelectorSegments
{
- self.viewSelector.segmentCount = 2;
- [self.viewSelector setLabel:_NS("Playlist")
- forSegment:VLCLibraryWindowSidebarViewPlaylistSegment];
- [self.viewSelector setLabel:_NS("Chapters")
- forSegment:VLCLibraryWindowSidebarViewChaptersSegment];
- self.viewSelector.selectedSegment = VLCLibraryWindowSidebarViewPlaylistSegment;
+ self.viewSelector.segmentCount = 1;
+ [self.viewSelector setLabel:self.playlistSidebarViewController.title
+ forSegment:self.viewSelector.segmentCount - 1];
+
+ VLCPlaylistController * const playlistController = VLCMain.sharedInstance.playlistController;
+ VLCPlayerController * const playerController = playlistController.playerController;
+ if (playerController.numberOfTitlesOfCurrentMedia > 0) {
+ self.viewSelector.segmentCount++;
+ [self.viewSelector setLabel:self.titlesSidebarViewController.title
+ forSegment:self.viewSelector.segmentCount - 1];
+ }
+ if (playerController.numberOfChaptersForCurrentTitle > 0) {
+ self.viewSelector.segmentCount++;
+ [self.viewSelector setLabel:self.chaptersSidebarViewController.title
+ forSegment:self.viewSelector.segmentCount - 1];
+ }
}
- (void)setupCounterLabel
@@ -151,19 +164,20 @@ const NSInteger VLCLibraryWindowSidebarViewChaptersSegment = 1;
- (void)updateViewSelectorState
{
+ [self setupViewSelectorSegments];
+
VLCPlaylistController * const playlistController = VLCMain.sharedInstance.playlistController;
VLCPlayerController * const playerController = playlistController.playerController;
+ const BOOL titlesEnabled = playerController.numberOfTitlesOfCurrentMedia > 0;
const BOOL chaptersEnabled = playerController.numberOfChaptersForCurrentTitle > 0;
- [self.viewSelector setEnabled:chaptersEnabled
- forSegment:VLCLibraryWindowSidebarViewChaptersSegment];
- self.viewSelector.hidden = !chaptersEnabled;
+ self.viewSelector.hidden = !chaptersEnabled && !titlesEnabled;
self.topInternalConstraint.active = !self.viewSelector.hidden;
- const NSLayoutPriority priority =
- chaptersEnabled ? NSLayoutPriorityDefaultLow : NSLayoutPriorityRequired;
+ const NSLayoutPriority playlistCompressionPriority =
+ self.viewSelector.hidden ? NSLayoutPriorityDefaultLow : NSLayoutPriorityRequired;
self.playlistHeaderLabel.hidden = chaptersEnabled;
- [self.playlistHeaderLabel setContentCompressionResistancePriority:priority
+ [self.playlistHeaderLabel setContentCompressionResistancePriority:playlistCompressionPriority
forOrientation:NSLayoutConstraintOrientationVertical];
self.playlistHeaderTopConstraint.active = !self.playlistHeaderLabel.hidden;
@@ -176,9 +190,10 @@ const NSInteger VLCLibraryWindowSidebarViewChaptersSegment = 1;
counterLabelConstraintToActivate.active = YES;
counterLabelConstraintToDeactivate.active = NO;
- if (!chaptersEnabled &&
- self.viewSelector.selectedSegment == VLCLibraryWindowSidebarViewChaptersSegment) {
- self.viewSelector.selectedSegment = VLCLibraryWindowSidebarViewPlaylistSegment;
+ NSString * const selectedSegmentLabel = [self.viewSelector labelForSegment:self.viewSelector.selectedSegment];
+ if ((!chaptersEnabled && [selectedSegmentLabel isEqualToString:self.chaptersSidebarViewController.title]) ||
+ (!titlesEnabled && [selectedSegmentLabel isEqualToString:self.titlesSidebarViewController.title])) {
+ self.viewSelector.selectedSegment = 0;
[self viewSelectorAction:self.viewSelector];
}
}
@@ -187,9 +202,12 @@ const NSInteger VLCLibraryWindowSidebarViewChaptersSegment = 1;
{
NSParameterAssert(sender == self.viewSelector);
const NSInteger selectedSegment = self.viewSelector.selectedSegment;
- if (selectedSegment == VLCLibraryWindowSidebarViewPlaylistSegment) {
+ NSString * const selectedSegmentLabel = [self.viewSelector labelForSegment:selectedSegment];
+ if ([selectedSegmentLabel isEqualToString:self.playlistSidebarViewController.title]) {
[self setChildViewController:self.playlistSidebarViewController];
- } else if (selectedSegment == VLCLibraryWindowSidebarViewChaptersSegment) {
+ } else if ([selectedSegmentLabel isEqualToString:self.titlesSidebarViewController.title]) {
+ [self setChildViewController:self.titlesSidebarViewController];
+ } else if ([selectedSegmentLabel isEqualToString:self.chaptersSidebarViewController.title]) {
[self setChildViewController:self.chaptersSidebarViewController];
} else {
NSAssert(NO, @"Invalid or unknown segment selected for sidebar!");
@@ -206,6 +224,8 @@ const NSInteger VLCLibraryWindowSidebarViewChaptersSegment = 1;
viewController.counterLabel = self.counterLabel;
}
+ self.playlistHeaderLabel.stringValue = viewController.title;
+
NSView * const view = viewController.view;
self.targetView.subviews = @[view];
view.translatesAutoresizingMaskIntoConstraints = NO;
=====================================
modules/gui/macosx/library/VLCLibraryWindowTitlesSidebarViewController.h
=====================================
@@ -0,0 +1,41 @@
+/*****************************************************************************
+ * VLCLibraryWindowTitlesSidebarViewController.h: MacOS X interface module
+ *****************************************************************************
+ * Copyright (C) 2024 VLC authors and VideoLAN
+ *
+ * Authors: Claudio Cambra <developer at claudiocambra.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/VLCLibraryWindowAbstractSidebarViewController.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+ at class VLCLibraryWindow;
+
+ at interface VLCLibraryWindowTitlesSidebarViewController : VLCLibraryWindowAbstractSidebarViewController<NSTableViewDelegate>
+
+ at property (readwrite, weak) IBOutlet NSTableView *tableView;
+ at property (readonly) NSArrayController *titlesArrayController;
+ at property (readwrite, nonatomic) NSTextField *counterLabel;
+
+- (instancetype)initWithLibraryWindow:(VLCLibraryWindow *)libraryWindow;
+
+ at end
+
+NS_ASSUME_NONNULL_END
=====================================
modules/gui/macosx/library/VLCLibraryWindowTitlesSidebarViewController.m
=====================================
@@ -0,0 +1,149 @@
+/*****************************************************************************
+ * VLCLibraryWindowTitlesSidebarViewController.m: MacOS X interface module
+ *****************************************************************************
+ * Copyright (C) 2024 VLC authors and VideoLAN
+ *
+ * Authors: Claudio Cambra <developer at claudiocambra.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 "VLCLibraryWindowTitlesSidebarViewController.h"
+
+#import "extensions/NSString+Helpers.h"
+#import "library/VLCLibraryDataTypes.h"
+#import "main/VLCMain.h"
+#import "playlist/VLCPlayerController.h"
+#import "playlist/VLCPlayerTitle.h"
+#import "playlist/VLCPlaylistController.h"
+
+ at interface VLCLibraryWindowTitlesSidebarViewController ()
+
+ at property (readwrite) NSUInteger internalItemCount;
+
+ at end
+
+ at implementation VLCLibraryWindowTitlesSidebarViewController
+
+ at synthesize counterLabel = _counterLabel;
+
+- (instancetype)initWithLibraryWindow:(VLCLibraryWindow *)libraryWindow
+{
+ return [super initWithLibraryWindow:libraryWindow
+ nibName:@"VLCLibraryWindowTitlesView"];
+}
+
+- (void)viewDidLoad
+{
+ [super viewDidLoad];
+
+ _titlesArrayController = [[NSArrayController alloc] init];
+
+ [self.tableView deselectAll:self];
+ [self.tableView bind:NSContentBinding
+ toObject:self.titlesArrayController
+ withKeyPath:@"arrangedObjects"
+ options:nil];
+ [self.tableView bind:NSSelectionIndexesBinding
+ toObject:self.titlesArrayController
+ withKeyPath:@"selectionIndexes"
+ options:nil];
+ [self.tableView bind:NSSortDescriptorsBinding
+ toObject:self.titlesArrayController
+ withKeyPath:@"sortDescriptors"
+ options:nil];
+
+ [self updateTitleList];
+
+ NSNotificationCenter * const notificationCenter = NSNotificationCenter.defaultCenter;
+ [notificationCenter addObserver:self
+ selector:@selector(titleListChanged:)
+ name:VLCPlayerTitleListChanged
+ object:nil];
+}
+
+- (NSString *)title
+{
+ return _NS("Titles");
+}
+
+- (BOOL)supportsItemCount
+{
+ return YES;
+}
+
+- (void)setCounterLabel:(NSTextField *)counterLabel
+{
+ _counterLabel = counterLabel;
+ self.counterLabel.stringValue = [NSString stringWithFormat:@"%lu", self.internalItemCount];
+}
+
+- (void)titleListChanged:(NSNotification *)notification
+{
+ [self updateTitleList];
+}
+
+- (void)updateTitleList
+{
+ VLCPlayerController * const playerController =
+ VLCMain.sharedInstance.playlistController.playerController;
+ const size_t titleCount = playerController.numberOfTitlesOfCurrentMedia;
+ self.internalItemCount = titleCount;
+ self.titlesArrayController.content = playerController.titlesOfCurrentMedia;
+ self.counterLabel.stringValue = [NSString stringWithFormat:@"%lu", titleCount];
+}
+
+# pragma mark - NSTableView delegation
+
+- (NSView *)tableView:(NSTableView *)tableView
+ viewForTableColumn:(NSTableColumn *)tableColumn
+ row:(NSInteger)row
+{
+ if ([tableColumn.identifier isEqualToString:@"VLCLibraryWindowTitlesTableViewNameColumnIdentifier"]) {
+ NSTableCellView * const cellView =
+ [tableView makeViewWithIdentifier:@"VLCLibraryWindowTitlesTableViewNameCellIdentifier"
+ owner:self];
+ [cellView.textField bind:NSValueBinding
+ toObject:cellView
+ withKeyPath:@"objectValue.name"
+ options:nil];
+ return cellView;
+ } else if ([tableColumn.identifier isEqualToString:@"VLCLibraryWindowTitlesTableViewLengthColumnIdentifier"]) {
+ NSTableCellView * const cellView =
+ [tableView makeViewWithIdentifier:@"VLCLibraryWindowTitlesTableViewLengthCellIdentifier"
+ owner:self];
+ [cellView.textField bind:NSValueBinding
+ toObject:cellView
+ withKeyPath:@"objectValue.lengthString"
+ options:nil];
+ return cellView;
+ }
+
+ NSAssert(NO, @"Provided cell view for titles table view should be valid!");
+ return nil;
+}
+
+- (void)tableViewSelectionDidChange:(NSNotification *)notification
+{
+ VLCPlayerTitle * const selectedTitle =
+ self.titlesArrayController.selectedObjects.firstObject;
+ if (selectedTitle == nil) {
+ return;
+ }
+
+ [VLCMain.sharedInstance.playlistController.playerController setSelectedTitleIndex:selectedTitle.index];
+}
+
+ at end
=====================================
modules/gui/macosx/playlist/VLCPlayerController.h
=====================================
@@ -27,6 +27,7 @@ NS_ASSUME_NONNULL_BEGIN
@class VLCInputStats;
@class VLCTrackMetaData;
+ at class VLCPlayerTitle;
@class VLCProgramMetaData;
@class VLCInputItem;
@@ -529,6 +530,8 @@ extern const CGFloat VLCVolumeDefault;
*/
@property (readonly) size_t numberOfTitlesOfCurrentMedia;
+ at property (readonly) NSArray<VLCPlayerTitle *> *titlesOfCurrentMedia;
+
/**
* get a vlc_player_title by the index
* @note listen to VLCPlayerTitleListChanged in case the list changes so previous indexes will no longer be valid anymore
=====================================
modules/gui/macosx/playlist/VLCPlayerController.m
=====================================
@@ -27,11 +27,16 @@
#import <vlc_url.h>
#import "extensions/NSString+Helpers.h"
+
+#import "library/VLCInputItem.h"
+
#import "main/VLCMain.h"
+
#import "os-integration/VLCRemoteControlService.h"
#import "os-integration/iTunes.h"
#import "os-integration/Spotify.h"
-#import "library/VLCInputItem.h"
+
+#import "playlist/VLCPlayerTitle.h"
#import "windows/video/VLCVoutView.h"
#import "windows/video/VLCMainVideoViewController.h"
@@ -1155,6 +1160,18 @@ static int BossCallback(vlc_object_t *p_this,
return vlc_player_title_list_GetCount(_currentTitleList);
}
+- (NSArray<VLCPlayerTitle *> *)titlesOfCurrentMedia
+{
+ const size_t count = [self numberOfTitlesOfCurrentMedia];
+ NSMutableArray<VLCPlayerTitle *> * const titles = NSMutableArray.array;
+ for (size_t i = 0; i < count; i++) {
+ const struct vlc_player_title * const p_title = [self titleAtIndexForCurrentMedia:i];
+ VLCPlayerTitle * const title = [[VLCPlayerTitle alloc] initWithTitle:p_title atIndex:i];
+ [titles addObject:title];
+ }
+ return titles.copy;
+}
+
- (void)selectedChapterChanged:(size_t)chapterIndex
{
_selectedChapterIndex = chapterIndex;
=====================================
modules/gui/macosx/playlist/VLCPlayerTitle.h
=====================================
@@ -0,0 +1,45 @@
+/*****************************************************************************
+ * VLCPlayerTitle.h: MacOS X interface module
+ *****************************************************************************
+ * Copyright (C) 2024 VLC authors and VideoLAN
+ *
+ * Authors: Claudio Cambra <developer at claudiocambra.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 <Foundation/Foundation.h>
+
+#include <vlc_player.h>
+
+ at class VLCPlayerChapter;
+
+NS_ASSUME_NONNULL_BEGIN
+
+ at interface VLCPlayerTitle : NSObject
+
+ at property (readonly) size_t index;
+ at property (readonly) NSString *name;
+ at property (readonly) vlc_tick_t length;
+ at property (readonly) NSString *lengthString;
+ at property (readonly) NSUInteger flags;
+ at property (readonly) NSUInteger chapterCount;
+ at property (readonly) NSArray<VLCPlayerChapter *> *chapters;
+
+- (instancetype)initWithTitle:(const struct vlc_player_title *)p_title atIndex:(size_t)index;
+
+ at end
+
+NS_ASSUME_NONNULL_END
=====================================
modules/gui/macosx/playlist/VLCPlayerTitle.m
=====================================
@@ -0,0 +1,52 @@
+/*****************************************************************************
+ * VLCPlayerTitle.m: MacOS X interface module
+ *****************************************************************************
+ * Copyright (C) 2024 VLC authors and VideoLAN
+ *
+ * Authors: Claudio Cambra <developer at claudiocambra.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 "VLCPlayerTitle.h"
+
+#import "extensions/NSString+Helpers.h"
+#import "playlist/VLCPlayerChapter.h"
+
+ at implementation VLCPlayerTitle
+
+- (instancetype)initWithTitle:(const struct vlc_player_title *)p_title atIndex:(size_t)index
+{
+ self = [super init];
+ if (self) {
+ _index = index;
+ _name = toNSStr(p_title->name);
+ _length = p_title->length;
+ _lengthString = [NSString stringWithTimeFromTicks:_length];
+ _flags = p_title->flags;
+ _chapterCount = p_title->chapter_count;
+
+ NSMutableArray * const chapters = [NSMutableArray arrayWithCapacity:self.chapterCount];
+ for (int i = 0; i < self.chapterCount; i++) {
+ VLCPlayerChapter * const chapter =
+ [[VLCPlayerChapter alloc] initWithChapter:&p_title->chapters[i]];
+ [chapters addObject:chapter];
+ }
+ _chapters = chapters.copy;
+ }
+ return self;
+}
+
+ at end
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a187304c75176bd5c76427d3360378111f49abf7...b940068a192bc3a3f1edba759ecfae6746a00f0f
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a187304c75176bd5c76427d3360378111f49abf7...b940068a192bc3a3f1edba759ecfae6746a00f0f
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list