[vlc-commits] [Git][videolan/vlc][master] 40 commits: macosx: Add VLCBookmarksTableViewDataSource

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Jun 16 10:38:47 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
2044e2ca by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Add VLCBookmarksTableViewDataSource

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
440f49ee by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Make VLCBookmarksTableViewDataSource fetch relevant bookmarks

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
df8acebf by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Implement numberOfRowsInTableView for VLCBookmarksTableViewDataSource

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
b2888fe2 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Add VLCBookmarksTableViewDelegate

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
68f083ed by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Add VLCBookmark

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
837b12f8 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Add bookmark properties to VLCBookmark

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
d422a27a by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Add convenience init to create VLCBookmark with vlc_ml_bookmark_t

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
e611f51d by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Add convenience bookmarkForRow method to VLCBookmarksTableViewDataSource

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
26dedcd0 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Add name column to Bookmarks window

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
d1b44150 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: objectValueForTableColumn:row: in VLCBookmarksTableViewDelegate

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
4172eb99 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Set current media item for VLCBookmarksTableViewDataSource according to changes in player controller

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
e435b405 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Use VLCBookmarksTableViewDataSource and VLCBookmarksTableViewDelegate for bookmarks table view

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
09c4ec80 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Move objectValueForTableColumn from delegate to datasource VLCBookmarks

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
a9b0599f by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Extract updating of media item update in VLCBookmarksTableViewDataSource to separate method

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
2a7cce55 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Implement addBookmark in VLCBookmarksTableViewDataSource

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
f973c198 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Remove objectValueForTableColumn in VLCBookmarksWindowController

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
119572f0 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Set placeholder name and description for new bookmarks

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
7ecfc942 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Store bookmarks in VLCBookmarksTableViewDataSource as array of VLCBookmarks

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
30b0e418 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Remove unused data source methods in VLCBookmarksWindowController

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
06c167e2 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Implement bookmark clearing

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
9c312bde by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Make bookmarks table view delegate toggle enabling of row dependent buttons in bookmarks table view window

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
4868b5a6 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Implement bookmark deletion

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
a4acde47 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Implement functioning goToBookmark in VLCBookmarksWindowController

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
28fa7ce6 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Expose updateBookmarks publicly in VLCBookmarksTableViewDataSource

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
04e44232 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Implement bookmark editing in VLCBookmarksTableViewDataSource

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
6d411e58 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Implement copying in VLCBookmark

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
a45f4cd1 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Properly implement edit start in VLCBookmarksWindowController

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
fe70ad2e by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Properly implement edit end in VLCBookmarksWindowController

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
6241f501 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Properly implement copy in VLCBookmarksWindowController

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
457da283 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Add description text field to bookmark editor window

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
a7cdf16a by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Fix name column in bookmarks table view

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
ab6be0cc by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Remove bookmark editor window

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
d9bba507 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Fix alignments in bookmarks window

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
1177b743 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Make bookmarks table view cells editable

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
bb72d9c5 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Remove now unused editing implementation in VLCBookmarksWindowController

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
aa7a8dcb by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Remove table view delegate and data source protocol from VLCBookmarksWindowController interface

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
429ac70a by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Set translatable bookmarks table view name header string

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
60979b53 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Stop using magic strings for bookmarks table column identifiers

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
19f78c93 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Reload data of table view internally within VLCBookmarksTableViewDataSource

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
c35f9ca0 by Claudio Cambra at 2023-06-16T10:15:27+00:00
macosx: Make VLCBookmarksTableViewDataSource listen to library events

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -


11 changed files:

- extras/package/macosx/VLC.xcodeproj/project.pbxproj
- modules/gui/macosx/Makefile.am
- modules/gui/macosx/UI/Bookmarks.xib
- modules/gui/macosx/panels/VLCBookmarksWindowController.h
- modules/gui/macosx/panels/VLCBookmarksWindowController.m
- + modules/gui/macosx/panels/bookmarks/VLCBookmark.h
- + modules/gui/macosx/panels/bookmarks/VLCBookmark.m
- + modules/gui/macosx/panels/bookmarks/VLCBookmarksTableViewDataSource.h
- + modules/gui/macosx/panels/bookmarks/VLCBookmarksTableViewDataSource.m
- + modules/gui/macosx/panels/bookmarks/VLCBookmarksTableViewDelegate.h
- + modules/gui/macosx/panels/bookmarks/VLCBookmarksTableViewDelegate.m


Changes:

=====================================
extras/package/macosx/VLC.xcodeproj/project.pbxproj
=====================================
@@ -78,6 +78,9 @@
 		5307A6F82969904D001E0C6A /* VLCLibraryMediaSourceViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5307A6F72969904D001E0C6A /* VLCLibraryMediaSourceViewController.m */; };
 		5317FE04294E3DD3001702F0 /* VLCLibraryCollectionViewDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5317FE03294E3DD3001702F0 /* VLCLibraryCollectionViewDelegate.m */; };
 		5325C57D29302E6800B2B63A /* VLCLibraryAudioViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5325C57B29302E6800B2B63A /* VLCLibraryAudioViewController.m */; };
+		533B5D2C29CF94C6003DE887 /* VLCBookmarksTableViewDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 533B5D2B29CF94C6003DE887 /* VLCBookmarksTableViewDataSource.m */; };
+		534E73E229D2EDB1009982DE /* VLCBookmarksTableViewDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 534E73E129D2EDB1009982DE /* VLCBookmarksTableViewDelegate.m */; };
+		534E73E529D2FF07009982DE /* VLCBookmark.m in Sources */ = {isa = PBXBuildFile; fileRef = 534E73E429D2FF07009982DE /* VLCBookmark.m */; };
 		534E8E3A29A06325009503F8 /* VLCMainVideoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 534E8E3929A06325009503F8 /* VLCMainVideoViewController.m */; };
 		5352B37329DF29BF0011CE03 /* VLCMainVideoViewControlsBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 5352B37229DF29BF0011CE03 /* VLCMainVideoViewControlsBar.m */; };
 		5352B37629E149AC0011CE03 /* VLCLibraryWindowPersistentPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 5352B37529E149AC0011CE03 /* VLCLibraryWindowPersistentPreferences.m */; };
@@ -260,6 +263,12 @@
 		5317FE05294E8D1A001702F0 /* VLCLibraryCollectionViewDataSource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLibraryCollectionViewDataSource.h; sourceTree = "<group>"; };
 		5325C57B29302E6800B2B63A /* VLCLibraryAudioViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryAudioViewController.m; sourceTree = "<group>"; };
 		5325C57C29302E6800B2B63A /* VLCLibraryAudioViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCLibraryAudioViewController.h; sourceTree = "<group>"; };
+		533B5D2A29CF94C6003DE887 /* VLCBookmarksTableViewDataSource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCBookmarksTableViewDataSource.h; sourceTree = "<group>"; };
+		533B5D2B29CF94C6003DE887 /* VLCBookmarksTableViewDataSource.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCBookmarksTableViewDataSource.m; sourceTree = "<group>"; };
+		534E73E029D2EDB1009982DE /* VLCBookmarksTableViewDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCBookmarksTableViewDelegate.h; sourceTree = "<group>"; };
+		534E73E129D2EDB1009982DE /* VLCBookmarksTableViewDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCBookmarksTableViewDelegate.m; sourceTree = "<group>"; };
+		534E73E329D2FF07009982DE /* VLCBookmark.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCBookmark.h; sourceTree = "<group>"; };
+		534E73E429D2FF07009982DE /* VLCBookmark.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCBookmark.m; sourceTree = "<group>"; };
 		534E8E3729A04F95009503F8 /* VLCMainVideoView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = VLCMainVideoView.xib; sourceTree = "<group>"; };
 		534E8E3829A06325009503F8 /* VLCMainVideoViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCMainVideoViewController.h; sourceTree = "<group>"; };
 		534E8E3929A06325009503F8 /* VLCMainVideoViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCMainVideoViewController.m; sourceTree = "<group>"; };
@@ -929,6 +938,7 @@
 		1C1ED5032204A99400811EC0 /* panels */ = {
 			isa = PBXGroup;
 			children = (
+				533B5D2929CF94AB003DE887 /* bookmarks */,
 				1C1ED51A2205AAFE00811EC0 /* dialogs */,
 				CC5560231365CDC700D54038 /* VLCAudioEffectsWindowController.h */,
 				CC5560241365CDC800D54038 /* VLCAudioEffectsWindowController.m */,
@@ -1391,6 +1401,19 @@
 			path = "audio-library";
 			sourceTree = "<group>";
 		};
+		533B5D2929CF94AB003DE887 /* bookmarks */ = {
+			isa = PBXGroup;
+			children = (
+				534E73E329D2FF07009982DE /* VLCBookmark.h */,
+				534E73E429D2FF07009982DE /* VLCBookmark.m */,
+				533B5D2A29CF94C6003DE887 /* VLCBookmarksTableViewDataSource.h */,
+				533B5D2B29CF94C6003DE887 /* VLCBookmarksTableViewDataSource.m */,
+				534E73E029D2EDB1009982DE /* VLCBookmarksTableViewDelegate.h */,
+				534E73E129D2EDB1009982DE /* VLCBookmarksTableViewDelegate.m */,
+			);
+			path = bookmarks;
+			sourceTree = "<group>";
+		};
 		53B447EB293BB47A00857588 /* video-library */ = {
 			isa = PBXGroup;
 			children = (
@@ -2023,6 +2046,7 @@
 				7D460B0C229EB4C700097948 /* VLCDragDropView.m in Sources */,
 				7D445D872202574B00263D34 /* VLCPlaylistModel.m in Sources */,
 				7D2554C222C8A39300F2D9C2 /* VLCMediaSourceDataSource.m in Sources */,
+				534E73E529D2FF07009982DE /* VLCBookmark.m in Sources */,
 				7DE2F0442282C84A0040DD0A /* VLCLibraryAudioDataSource.m in Sources */,
 				7D0F640C2202163E00FDB91F /* VLCPlaylistDataSource.m in Sources */,
 				1C3113AD1E508C6900D4DD76 /* VLCExtensionsManager.m in Sources */,
@@ -2053,6 +2077,7 @@
 				539F114B29E83A4200F13460 /* VLCLibraryTwoPaneSplitViewDelegate.m in Sources */,
 				7D0F63FF2201F63400FDB91F /* VLCPlaylistTableCellView.m in Sources */,
 				1C3113D11E508C6900D4DD76 /* prefs.m in Sources */,
+				533B5D2C29CF94C6003DE887 /* VLCBookmarksTableViewDataSource.m in Sources */,
 				1C3113D31E508C6900D4DD76 /* VLCResumeDialogController.m in Sources */,
 				7D2FFA40227B8A5B0085D649 /* VLCLinearProgressIndicator.m in Sources */,
 				7DFBDCB1226A518400B700A5 /* VLCLibraryMenuController.m in Sources */,
@@ -2082,6 +2107,7 @@
 				1C3113E11E508C6900D4DD76 /* VLCVoutView.m in Sources */,
 				1C3113E51E508C6900D4DD76 /* VLCInformationWindowController.m in Sources */,
 				6B7F1FDF1F07DA920002BDD8 /* VLCHexNumberFormatter.m in Sources */,
+				534E73E229D2EDB1009982DE /* VLCBookmarksTableViewDelegate.m in Sources */,
 				7DB40D2A20CBCEB500F63173 /* VLCMainMenu.m in Sources */,
 				53ED472E29C907C200795DB1 /* VLCLibraryVideoTableViewDelegate.m in Sources */,
 				1C3113E91E508C6900D4DD76 /* VLCScrollingClipView.m in Sources */,


=====================================
modules/gui/macosx/Makefile.am
=====================================
@@ -238,6 +238,12 @@ libmacosx_plugin_la_SOURCES = \
 	gui/macosx/panels/VLCTrackSynchronizationWindowController.m \
 	gui/macosx/panels/VLCVideoEffectsWindowController.h \
 	gui/macosx/panels/VLCVideoEffectsWindowController.m \
+	gui/macosx/panels/bookmarks/VLCBookmark.h \
+	gui/macosx/panels/bookmarks/VLCBookmark.m \
+	gui/macosx/panels/bookmarks/VLCBookmarksTableViewDataSource.h \
+	gui/macosx/panels/bookmarks/VLCBookmarksTableViewDataSource.m \
+	gui/macosx/panels/bookmarks/VLCBookmarksTableViewDelegate.h \
+	gui/macosx/panels/bookmarks/VLCBookmarksTableViewDelegate.m \
 	gui/macosx/panels/dialogs/VLCCoreDialogProvider.h \
 	gui/macosx/panels/dialogs/VLCCoreDialogProvider.m \
 	gui/macosx/panels/dialogs/VLCCustomCropArWindowController.h \


=====================================
modules/gui/macosx/UI/Bookmarks.xib
=====================================
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="16097" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="16097"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -11,14 +11,6 @@
                 <outlet property="addButton" destination="88" id="163"/>
                 <outlet property="clearButton" destination="94" id="165"/>
                 <outlet property="dataTable" destination="110" id="166"/>
-                <outlet property="editBookmarksWindow" destination="133" id="170"/>
-                <outlet property="editButton" destination="90" id="167"/>
-                <outlet property="editCancelButton" destination="143" id="171"/>
-                <outlet property="editNameLabel" destination="145" id="175"/>
-                <outlet property="editNameTextField" destination="135" id="173"/>
-                <outlet property="editOKButton" destination="141" id="172"/>
-                <outlet property="editTimeLabel" destination="147" id="176"/>
-                <outlet property="editTimeTextField" destination="137" id="174"/>
                 <outlet property="removeButton" destination="92" id="169"/>
                 <outlet property="window" destination="84" id="184"/>
             </connections>
@@ -26,68 +18,70 @@
         <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
         <customObject id="-3" userLabel="Application" customClass="NSObject"/>
         <window title="Bookmarks" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" hidesOnDeactivate="YES" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="bookmarks" animationBehavior="default" id="84" userLabel="Bookmarks" customClass="NSPanel">
-            <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" utility="YES" HUD="YES"/>
+            <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" utility="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="340" y="330" width="566" height="263"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1280" height="800"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
             <view key="contentView" id="85">
                 <rect key="frame" x="0.0" y="0.0" width="566" height="263"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                     <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="88">
-                        <rect key="frame" x="20" y="224" width="59" height="19"/>
+                        <rect key="frame" x="10" y="234" width="62" height="19"/>
                         <buttonCell key="cell" type="roundRect" title="Add" bezelStyle="roundedRect" alignment="center" borderStyle="border" inset="2" id="89">
                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                            <font key="font" metaFont="titleBar" size="12"/>
+                            <font key="font" metaFont="titleBar" size="12" textStyle="headline"/>
                         </buttonCell>
                         <connections>
                             <action selector="add:" target="-2" id="177"/>
                         </connections>
                     </button>
-                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="90">
-                        <rect key="frame" x="20" y="199" width="59" height="19"/>
-                        <buttonCell key="cell" type="roundRect" title="Edit" bezelStyle="roundedRect" alignment="center" enabled="NO" borderStyle="border" inset="2" id="91">
-                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                            <font key="font" metaFont="titleBar" size="12"/>
-                        </buttonCell>
-                        <connections>
-                            <action selector="edit:" target="-2" id="179"/>
-                        </connections>
-                    </button>
                     <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="92">
-                        <rect key="frame" x="20" y="174" width="59" height="19"/>
+                        <rect key="frame" x="10" y="211" width="62" height="19"/>
                         <buttonCell key="cell" type="roundRect" title="Remove" bezelStyle="roundedRect" alignment="center" enabled="NO" borderStyle="border" inset="2" id="93">
                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                            <font key="font" metaFont="titleBar" size="12"/>
+                            <font key="font" metaFont="titleBar" size="12" textStyle="headline"/>
                         </buttonCell>
                         <connections>
                             <action selector="remove:" target="-2" id="183"/>
                         </connections>
                     </button>
                     <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="94">
-                        <rect key="frame" x="20" y="149" width="59" height="19"/>
+                        <rect key="frame" x="10" y="188" width="62" height="19"/>
                         <buttonCell key="cell" type="roundRect" title="Clear" bezelStyle="roundedRect" alignment="center" borderStyle="border" inset="2" id="95">
                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                            <font key="font" metaFont="titleBar" size="12"/>
+                            <font key="font" metaFont="titleBar" size="12" textStyle="headline"/>
                         </buttonCell>
                         <connections>
                             <action selector="clear:" target="-2" id="178"/>
                         </connections>
                     </button>
                     <scrollView horizontalCompressionResistancePriority="749" borderType="line" autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="107">
-                        <rect key="frame" x="87" y="20" width="459" height="232"/>
+                        <rect key="frame" x="82" y="10" width="474" height="243"/>
                         <clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="KmY-DA-2er">
-                            <rect key="frame" x="1" y="1" width="457" height="230"/>
+                            <rect key="frame" x="1" y="1" width="472" height="241"/>
                             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                             <subviews>
                                 <tableView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" autosaveColumns="NO" autosaveName="bookmarks-table" headerView="111" id="110" customClass="VLCHUDTableView">
-                                    <rect key="frame" x="0.0" y="0.0" width="457" height="207"/>
+                                    <rect key="frame" x="0.0" y="0.0" width="472" height="218"/>
                                     <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="calibratedRGB"/>
                                     <color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
                                     <tableColumns>
-                                        <tableColumn identifier="description" editable="NO" width="254.9296875" minWidth="157" maxWidth="1000" id="112">
+                                        <tableColumn identifier="name" width="128" minWidth="10" maxWidth="3.4028234663852886e+38" id="CfE-Sy-6N7">
+                                            <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="Name">
+                                                <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="Name" id="iNc-me-48t">
+                                                <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" userResizable="YES"/>
+                                        </tableColumn>
+                                        <tableColumn identifier="description" width="255" minWidth="157" maxWidth="1000" id="112">
                                             <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="Description">
                                                 <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
                                                 <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -99,7 +93,7 @@
                                             </textFieldCell>
                                             <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
                                         </tableColumn>
-                                        <tableColumn identifier="time_offset" editable="NO" width="196" minWidth="100" maxWidth="1000" id="113">
+                                        <tableColumn identifier="time_offset" width="71" minWidth="30" maxWidth="1000" id="113">
                                             <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="Time">
                                                 <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
                                                 <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -121,128 +115,36 @@
                             <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="100" id="vLK-mg-OaO"/>
                         </constraints>
                         <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="109">
-                            <rect key="frame" x="1" y="259" width="148" height="16"/>
+                            <rect key="frame" x="1" y="226" width="472" height="16"/>
                             <autoresizingMask key="autoresizingMask"/>
                         </scroller>
                         <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="108">
                             <rect key="frame" x="378" y="18" width="15" height="242"/>
                             <autoresizingMask key="autoresizingMask"/>
                         </scroller>
-                        <tableHeaderView key="headerView" id="111">
-                            <rect key="frame" x="0.0" y="0.0" width="457" height="23"/>
+                        <tableHeaderView key="headerView" wantsLayer="YES" id="111">
+                            <rect key="frame" x="0.0" y="0.0" width="472" height="23"/>
                             <autoresizingMask key="autoresizingMask"/>
                         </tableHeaderView>
                     </scrollView>
                 </subviews>
                 <constraints>
-                    <constraint firstItem="107" firstAttribute="leading" secondItem="90" secondAttribute="trailing" constant="8" id="9X9-yE-SIP"/>
-                    <constraint firstItem="92" firstAttribute="top" secondItem="90" secondAttribute="bottom" constant="7" id="A88-z3-fCb"/>
-                    <constraint firstAttribute="bottom" secondItem="107" secondAttribute="bottom" constant="20" id="BRp-2T-87k"/>
-                    <constraint firstItem="94" firstAttribute="leading" secondItem="85" secondAttribute="leading" constant="20" id="FOs-iP-fF8"/>
-                    <constraint firstAttribute="trailing" secondItem="107" secondAttribute="trailing" constant="20" id="G5G-Zl-egd"/>
-                    <constraint firstItem="90" firstAttribute="leading" secondItem="85" secondAttribute="leading" constant="20" id="IQa-1D-B9p"/>
-                    <constraint firstItem="107" firstAttribute="leading" secondItem="88" secondAttribute="trailing" constant="8" id="Ltc-GA-VMt"/>
-                    <constraint firstItem="107" firstAttribute="leading" secondItem="94" secondAttribute="trailing" constant="8" id="N3T-ZA-ej2"/>
-                    <constraint firstItem="88" firstAttribute="top" secondItem="85" secondAttribute="top" constant="20" id="WP1-gk-lha"/>
+                    <constraint firstAttribute="bottom" secondItem="107" secondAttribute="bottom" constant="10" id="BRp-2T-87k"/>
+                    <constraint firstItem="94" firstAttribute="leading" secondItem="85" secondAttribute="leading" constant="10" id="FOs-iP-fF8"/>
+                    <constraint firstAttribute="trailing" secondItem="107" secondAttribute="trailing" constant="10" id="G5G-Zl-egd"/>
+                    <constraint firstItem="107" firstAttribute="leading" secondItem="88" secondAttribute="trailing" constant="10" id="Ltc-GA-VMt"/>
+                    <constraint firstItem="92" firstAttribute="top" secondItem="88" secondAttribute="bottom" constant="5" id="Lxo-UF-Nea"/>
+                    <constraint firstItem="107" firstAttribute="leading" secondItem="94" secondAttribute="trailing" constant="10" id="N3T-ZA-ej2"/>
                     <constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="94" secondAttribute="bottom" constant="20" id="eNd-Mr-tyL"/>
-                    <constraint firstItem="92" firstAttribute="leading" secondItem="85" secondAttribute="leading" constant="20" id="epp-d9-CZ3"/>
-                    <constraint firstItem="94" firstAttribute="top" secondItem="92" secondAttribute="bottom" constant="7" id="hSm-2D-FnN"/>
-                    <constraint firstItem="107" firstAttribute="leading" secondItem="92" secondAttribute="trailing" constant="8" id="nMK-MO-8IJ"/>
-                    <constraint firstItem="90" firstAttribute="top" secondItem="88" secondAttribute="bottom" constant="7" id="qG7-2g-FtJ"/>
-                    <constraint firstItem="88" firstAttribute="leading" secondItem="85" secondAttribute="leading" constant="20" id="uNA-di-0LF"/>
-                    <constraint firstItem="107" firstAttribute="top" secondItem="85" secondAttribute="top" constant="11" id="xmY-ER-h97"/>
+                    <constraint firstItem="92" firstAttribute="leading" secondItem="85" secondAttribute="leading" constant="10" id="epp-d9-CZ3"/>
+                    <constraint firstItem="88" firstAttribute="top" secondItem="107" secondAttribute="top" id="fkG-Sm-DPC"/>
+                    <constraint firstItem="94" firstAttribute="top" secondItem="92" secondAttribute="bottom" constant="5" id="hSm-2D-FnN"/>
+                    <constraint firstItem="107" firstAttribute="leading" secondItem="92" secondAttribute="trailing" constant="10" id="nMK-MO-8IJ"/>
+                    <constraint firstItem="88" firstAttribute="leading" secondItem="85" secondAttribute="leading" constant="10" id="uNA-di-0LF"/>
+                    <constraint firstItem="107" firstAttribute="top" secondItem="85" secondAttribute="top" constant="10" id="xmY-ER-h97"/>
                 </constraints>
             </view>
             <point key="canvasLocation" x="261" y="295.5"/>
         </window>
-        <window title="Bookmark inspector" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="133" userLabel="EditBookmarks" customClass="NSPanel">
-            <windowStyleMask key="styleMask" titled="YES" closable="YES" utility="YES" HUD="YES"/>
-            <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
-            <rect key="contentRect" x="340" y="401" width="298" height="125"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1280" height="800"/>
-            <view key="contentView" id="134">
-                <rect key="frame" x="0.0" y="0.0" width="298" height="125"/>
-                <autoresizingMask key="autoresizingMask"/>
-                <subviews>
-                    <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="135">
-                        <rect key="frame" x="74" y="84" width="204" height="21"/>
-                        <constraints>
-                            <constraint firstAttribute="width" constant="204" id="bLc-El-nRp"/>
-                        </constraints>
-                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" id="136">
-                            <font key="font" metaFont="system"/>
-                            <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
-                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                        </textFieldCell>
-                    </textField>
-                    <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="137">
-                        <rect key="frame" x="74" y="53" width="204" height="21"/>
-                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" id="138">
-                            <font key="font" metaFont="system"/>
-                            <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
-                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
-                        </textFieldCell>
-                    </textField>
-                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="141">
-                        <rect key="frame" x="246" y="18" width="32" height="19"/>
-                        <buttonCell key="cell" type="roundRect" title="OK" bezelStyle="roundedRect" alignment="center" borderStyle="border" inset="2" id="142">
-                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                            <font key="font" metaFont="titleBar" size="12"/>
-                            <string key="keyEquivalent" base64-UTF8="YES">
-DQ
-</string>
-                        </buttonCell>
-                        <connections>
-                            <action selector="edit_ok:" target="-2" id="181"/>
-                        </connections>
-                    </button>
-                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="143">
-                        <rect key="frame" x="185" y="18" width="53" height="19"/>
-                        <buttonCell key="cell" type="roundRect" title="Cancel" bezelStyle="roundedRect" alignment="center" borderStyle="border" inset="2" id="144">
-                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                            <font key="font" metaFont="titleBar" size="12"/>
-                            <string key="keyEquivalent" base64-UTF8="YES">
-Gw
-</string>
-                        </buttonCell>
-                        <connections>
-                            <action selector="edit_cancel:" target="-2" id="180"/>
-                        </connections>
-                    </button>
-                    <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="145">
-                        <rect key="frame" x="25" y="87" width="44" height="16"/>
-                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Name:" id="146">
-                            <font key="font" metaFont="system"/>
-                            <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
-                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
-                        </textFieldCell>
-                    </textField>
-                    <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="147">
-                        <rect key="frame" x="31" y="56" width="38" height="16"/>
-                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Time:" id="148">
-                            <font key="font" metaFont="system"/>
-                            <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
-                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
-                        </textFieldCell>
-                    </textField>
-                </subviews>
-                <constraints>
-                    <constraint firstAttribute="bottom" secondItem="141" secondAttribute="bottom" constant="19" id="0Ll-rf-AZ3"/>
-                    <constraint firstAttribute="trailing" secondItem="141" secondAttribute="trailing" constant="20" id="51H-Gl-Wm6"/>
-                    <constraint firstItem="137" firstAttribute="trailing" secondItem="135" secondAttribute="trailing" id="Ibp-wb-N3K"/>
-                    <constraint firstItem="137" firstAttribute="width" secondItem="135" secondAttribute="width" id="KDT-cT-78n"/>
-                    <constraint firstItem="145" firstAttribute="centerY" secondItem="135" secondAttribute="centerY" id="N5h-2o-PKj"/>
-                    <constraint firstItem="135" firstAttribute="leading" secondItem="145" secondAttribute="trailing" constant="7" id="Ozi-Tq-KpZ"/>
-                    <constraint firstItem="137" firstAttribute="top" secondItem="135" secondAttribute="bottom" constant="10" id="SLF-If-gXP"/>
-                    <constraint firstItem="135" firstAttribute="top" secondItem="134" secondAttribute="top" constant="20" id="T08-hy-5Zj"/>
-                    <constraint firstItem="141" firstAttribute="leading" secondItem="143" secondAttribute="trailing" constant="8" id="TrP-09-F93"/>
-                    <constraint firstItem="147" firstAttribute="centerY" secondItem="137" secondAttribute="centerY" id="aQe-Z4-wmD"/>
-                    <constraint firstItem="137" firstAttribute="leading" secondItem="147" secondAttribute="trailing" constant="7" id="juq-Oe-r8e"/>
-                    <constraint firstAttribute="trailing" secondItem="135" secondAttribute="trailing" constant="20" id="mS1-KH-zaF"/>
-                    <constraint firstItem="143" firstAttribute="centerY" secondItem="141" secondAttribute="centerY" id="qXj-mZ-5ck"/>
-                </constraints>
-            </view>
-            <point key="canvasLocation" x="141" y="149"/>
-        </window>
     </objects>
 </document>


=====================================
modules/gui/macosx/panels/VLCBookmarksWindowController.h
=====================================
@@ -33,24 +33,13 @@
 @property (readwrite, weak) IBOutlet NSButton *removeButton;
 @property (readwrite, weak) IBOutlet NSTableView *dataTable;
 
-/* edit window */
- at property (readwrite) IBOutlet NSWindow *editBookmarksWindow;
- at property (readwrite, weak) IBOutlet NSButton *editOKButton;
- at property (readwrite, weak) IBOutlet NSButton *editCancelButton;
- at property (readwrite, weak) IBOutlet NSTextField *editNameLabel;
- at property (readwrite, weak) IBOutlet NSTextField *editTimeLabel;
- at property (readwrite, weak) IBOutlet NSTextField *editNameTextField;
- at property (readwrite, weak) IBOutlet NSTextField *editTimeTextField;
-
 - (IBAction)toggleWindow:(id)sender;
 
 - (IBAction)add:(id)sender;
 - (IBAction)clear:(id)sender;
-- (IBAction)edit:(id)sender;
 - (IBAction)remove:(id)sender;
 - (IBAction)goToBookmark:(id)sender;
 
-- (IBAction)edit_cancel:(id)sender;
-- (IBAction)edit_ok:(id)sender;
+- (void)toggleRowDependentButtonsEnabled:(BOOL)enabled;
 
 @end


=====================================
modules/gui/macosx/panels/VLCBookmarksWindowController.m
=====================================
@@ -35,13 +35,25 @@
 
 #import "VLCBookmarksWindowController.h"
 
+#import "bookmarks/VLCBookmark.h"
+#import "bookmarks/VLCBookmarksTableViewDataSource.h"
+#import "bookmarks/VLCBookmarksTableViewDelegate.h"
+
 #import "extensions/NSString+Helpers.h"
+
+#import "library/VLCInputItem.h"
+
 #import "main/CompatibilityFixes.h"
+
+#import "playlist/VLCPlaylistController.h"
+#import "playlist/VLCPlayerController.h"
+
 #import "windows/video/VLCVideoOutputProvider.h"
 
- at interface VLCBookmarksWindowController() <NSTableViewDataSource, NSTableViewDelegate>
+ at interface VLCBookmarksWindowController()
 {
-    //input_thread_t *p_old_input;
+    VLCBookmarksTableViewDataSource *_tableViewDataSource;
+    VLCBookmarksTableViewDelegate *_tableViewDelegate;
 }
 @end
 
@@ -55,16 +67,16 @@
 {
     self = [super initWithWindowNibName:@"Bookmarks"];
     if (self) {
-        [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(updateCocoaWindowLevel:) name:VLCWindowShouldUpdateLevel object:nil];
+        [NSNotificationCenter.defaultCenter addObserver:self
+                                               selector:@selector(updateCocoaWindowLevel:)
+                                                   name:VLCWindowShouldUpdateLevel
+                                                 object:nil];
     }
     return self;
 }
 
 - (void)dealloc
 {
-    //if (p_old_input)
-    //    input_Release(p_old_input);
-
     [NSNotificationCenter.defaultCenter removeObserver:self];
 }
 
@@ -72,8 +84,11 @@
 {
     [self.window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
 
-    _dataTable.dataSource = self;
-    _dataTable.delegate = self;
+    _tableViewDataSource = [[VLCBookmarksTableViewDataSource alloc] initWithTableView:_dataTable];
+    _tableViewDelegate = [[VLCBookmarksTableViewDelegate alloc] initWithBookmarksWindowController:self];
+
+    _dataTable.dataSource = _tableViewDataSource;
+    _dataTable.delegate = _tableViewDelegate;
     _dataTable.action = @selector(goToBookmark:);
     _dataTable.target = self;
 
@@ -81,18 +96,13 @@
     [self.window setTitle: _NS("Bookmarks")];
     [_addButton setTitle: _NS("Add")];
     [_clearButton setTitle: _NS("Clear")];
-    [_editButton setTitle: _NS("Edit")];
     [_removeButton setTitle: _NS("Remove")];
-    [[[_dataTable tableColumnWithIdentifier:@"description"] headerCell]
+    [[[_dataTable tableColumnWithIdentifier:VLCBookmarksTableViewNameTableColumnIdentifier] headerCell]
+     setStringValue: _NS("Name")];
+    [[[_dataTable tableColumnWithIdentifier:VLCBookmarksTableViewDescriptionTableColumnIdentifier] headerCell]
      setStringValue: _NS("Description")];
-    [[[_dataTable tableColumnWithIdentifier:@"time_offset"] headerCell]
+    [[[_dataTable tableColumnWithIdentifier:VLCBookmarksTableViewTimeTableColumnIdentifier] headerCell]
      setStringValue: _NS("Time")];
-
-    /* edit window */
-    [_editOKButton setTitle: _NS("OK")];
-    [_editCancelButton setTitle: _NS("Cancel")];
-    [_editNameLabel setStringValue: _NS("Name")];
-    [_editTimeLabel setStringValue: _NS("Time")];
 }
 
 - (void)updateCocoaWindowLevel:(NSNotification *)aNotification
@@ -119,329 +129,59 @@
 
 - (IBAction)add:(id)sender
 {
-#if 0
-    /* add item to list */
-    input_thread_t * p_input = pl_CurrentInput(getIntf());
-
-    if (!p_input)
-        return;
-
-    seekpoint_t bookmark;
-
-    if (!input_Control(p_input, INPUT_GET_BOOKMARK, &bookmark)) {
-        bookmark.psz_name = (char *)_("Untitled");
-        input_Control(p_input, INPUT_ADD_BOOKMARK, &bookmark);
-    }
-
-    input_Release(p_input);
-
-    [_dataTable reloadData];
-#endif
+    [_tableViewDataSource addBookmark];
 }
 
 - (IBAction)clear:(id)sender
 {
-#if 0
-    /* clear table */
-    input_thread_t * p_input = pl_CurrentInput(getIntf());
-
-    if (!p_input)
-        return;
-
-    input_Control(p_input, INPUT_CLEAR_BOOKMARKS);
-
-    input_Release(p_input);
-
-    [_dataTable reloadData];
-#endif
-}
-
-- (IBAction)edit:(id)sender
-{
-#if 0
-    /* put values to the sheet's fields and show sheet */
-    /* we take the values from the core and not the table, because we cannot
-     * really trust it */
-    input_thread_t * p_input = pl_CurrentInput(getIntf());
-    seekpoint_t **pp_bookmarks;
-    int i_bookmarks;
-    int row = (int)[_dataTable selectedRow];
-
-    if (!p_input)
-        return;
-
-    if (row < 0) {
-        input_Release(p_input);
-        return;
-    }
-
-    if (input_Control(p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks, &i_bookmarks) != VLC_SUCCESS) {
-        input_Release(p_input);
-        return;
-    }
-
-    [_editNameTextField setStringValue: toNSStr(pp_bookmarks[row]->psz_name)];
-    [_editTimeTextField setStringValue:[self timeStringForBookmark:pp_bookmarks[row]]];
-
-    /* Just keep the pointer value to check if it
-     * changes. Note, we don't need to keep a reference to the object.
-     * so release it now. */
-    p_old_input = p_input;
-    input_Release(p_input);
-
-    [self.window beginSheet:_editBookmarksWindow completionHandler:nil];
-
-    // Clear the bookmark list
-    for (int i = 0; i < i_bookmarks; i++)
-        vlc_seekpoint_Delete(pp_bookmarks[i]);
-    free(pp_bookmarks);
-#endif
-}
-
-- (IBAction)edit_cancel:(id)sender
-{
-    /* close sheet */
-    [NSApp endSheet:_editBookmarksWindow];
-    [_editBookmarksWindow close];
-}
-
-- (IBAction)edit_ok:(id)sender
-{
-#if 0
-    /* save field contents and close sheet */
-     seekpoint_t **pp_bookmarks;
-    int i_bookmarks;
-    NSInteger i;
-    input_thread_t * p_input = pl_CurrentInput(getIntf());
-
-    if (!p_input) {
-        NSAlert *alert = [[NSAlert alloc] init];
-        [alert setAlertStyle:NSCriticalAlertStyle];
-        [alert setMessageText:_NS("No input")];
-        [alert setInformativeText:_NS("No input found. A stream must be playing or paused for bookmarks to work.")];
-        [alert beginSheetModalForWindow:self.window
-                      completionHandler:nil];
-        return;
-    }
-    if (p_old_input != p_input) {
-        NSAlert *alert = [[NSAlert alloc] init];
-        [alert setAlertStyle:NSCriticalAlertStyle];
-        [alert setMessageText:_NS("Input has changed")];
-        [alert setInformativeText:_NS("Input has changed, unable to save bookmark. Suspending playback with \"Pause\" while editing bookmarks to ensure to keep the same input.")];
-        [alert beginSheetModalForWindow:self.window
-                      completionHandler:nil];
-        input_Release(p_input);
-        return;
-    }
-
-    if (input_Control(p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks, &i_bookmarks) != VLC_SUCCESS) {
-        input_Release(p_input);
-        return;
-    }
-
-    i = [_dataTable selectedRow];
-
-    free(pp_bookmarks[i]->psz_name);
-
-    pp_bookmarks[i]->psz_name = strdup([[_editNameTextField stringValue] UTF8String]);
-
-    NSArray * components = [[_editTimeTextField stringValue] componentsSeparatedByString:@":"];
-    NSUInteger componentCount = [components count];
-    if (componentCount == 1)
-        pp_bookmarks[i]->i_time_offset = vlc_tick_from_sec([[components firstObject] floatValue]);
-    else if (componentCount == 2)
-        pp_bookmarks[i]->i_time_offset = vlc_tick_from_sec([[components firstObject] longLongValue] * 60 + [[components objectAtIndex:1] longLongValue]);
-    else if (componentCount == 3)
-        pp_bookmarks[i]->i_time_offset = vlc_tick_from_sec([[components firstObject] longLongValue] * 3600 + [[components objectAtIndex:1] longLongValue] * 60 + [[components objectAtIndex:2] floatValue]);
-    else {
-        msg_Err(getIntf(), "Invalid string format for time");
-        goto clear;
-    }
-
-    if (input_Control(p_input, INPUT_CHANGE_BOOKMARK, pp_bookmarks[i], i) != VLC_SUCCESS) {
-        msg_Warn(getIntf(), "Unable to change the bookmark");
-        goto clear;
-    }
-
-    [_dataTable reloadData];
-    input_Release(p_input);
-
-    [NSApp endSheet: _editBookmarksWindow];
-    [_editBookmarksWindow close];
-
-clear:
-    // Clear the bookmark list
-    for (int i = 0; i < i_bookmarks; i++)
-        vlc_seekpoint_Delete(pp_bookmarks[i]);
-    free(pp_bookmarks);
-#endif
+    [_tableViewDataSource clearBookmarks];
 }
 
-
 - (IBAction)goToBookmark:(id)sender
 {
-#if 0
-    input_thread_t * p_input = pl_CurrentInput(getIntf());
-
-    if (!p_input)
-        return;
-
-    input_Control(p_input, INPUT_SET_BOOKMARK, [_dataTable selectedRow]);
+    const NSInteger selectedRow = [_dataTable selectedRow];
+    VLCBookmark * const bookmark = [_tableViewDataSource bookmarkForRow:selectedRow];
+    vlc_tick_t bookmarkTime = VLC_TICK_FROM_MS(bookmark.bookmarkTime);
 
-    input_Release(p_input);
-#endif
+    VLCPlayerController * const playerController = VLCMain.sharedInstance.playlistController.playerController;
+    [playerController setTimeFast:bookmarkTime];
 }
 
 - (IBAction)remove:(id)sender
 {
-#if 0
-    input_thread_t * p_input = pl_CurrentInput(getIntf());
-
-    if (!p_input)
-        return;
-
-    int i_focused = (int)[_dataTable selectedRow];
-
-    if (i_focused >= 0)
-        input_Control(p_input, INPUT_DEL_BOOKMARK, i_focused);
-
-    input_Release(p_input);
-
-    [_dataTable reloadData];
-#endif
-}
-
-- (NSString *)timeStringForBookmark:(seekpoint_t *)bookmark
-{
-    assert(bookmark != NULL);
-
-    vlc_tick_t total = bookmark->i_time_offset;
-    uint64_t hour = ( total / VLC_TICK_FROM_SEC(3600) );
-    uint64_t min = ( total % VLC_TICK_FROM_SEC(3600) ) / VLC_TICK_FROM_SEC(60);
-    float    sec = secf_from_vlc_tick( total % VLC_TICK_FROM_SEC(60) );
-
-    return [NSString stringWithFormat:@"%02llu:%02llu:%06.3f", hour, min, sec];
-}
-
-/*****************************************************************************
- * data source methods
- *****************************************************************************/
-
-- (NSInteger)numberOfRowsInTableView:(NSTableView *)theDataTable
-{
-#if 0
-    /* return the number of bookmarks */
-    input_thread_t * p_input = pl_CurrentInput(getIntf());
-    seekpoint_t **pp_bookmarks;
-    int i_bookmarks;
-
-    if (!p_input)
-        return 0;
-
-    int returnValue = input_Control(p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks, &i_bookmarks);
-    input_Release(p_input);
-
-    if (returnValue != VLC_SUCCESS)
-        return 0;
-
-    for (int i = 0; i < i_bookmarks; i++)
-        vlc_seekpoint_Delete(pp_bookmarks[i]);
-    free(pp_bookmarks);
-
-    return i_bookmarks;
-#endif
-    return 0;
-}
-
-- (id)tableView:(NSTableView *)theDataTable objectValueForTableColumn: (NSTableColumn *)theTableColumn row: (NSInteger)row
-{
-#if 0
-    /* return the corresponding data as NSString */
-    input_thread_t * p_input = pl_CurrentInput(getIntf());
-    seekpoint_t **pp_bookmarks;
-    int i_bookmarks;
-    id ret = @"";
-
-    if (!p_input)
-        return @"";
-    else if (input_Control(p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks, &i_bookmarks) != VLC_SUCCESS)
-        ret = @"";
-    else if (row >= i_bookmarks)
-        ret = @"";
-    else {
-        NSString * identifier = [theTableColumn identifier];
-        if ([identifier isEqualToString: @"description"])
-            ret = toNSStr(pp_bookmarks[row]->psz_name);
-		else if ([identifier isEqualToString: @"time_offset"]) {
-            ret = [self timeStringForBookmark:pp_bookmarks[row]];
-        }
-
-        // Clear the bookmark list
-        for (int i = 0; i < i_bookmarks; i++)
-            vlc_seekpoint_Delete(pp_bookmarks[i]);
-        free(pp_bookmarks);
-    }
-    input_Release(p_input);
-    return ret;
-#endif
-    return @"";
-}
-
-/*****************************************************************************
- * delegate methods
- *****************************************************************************/
-
-- (void)tableViewSelectionDidChange:(NSNotification *)aNotification
-{
-    /* check whether a row is selected and en-/disable the edit/remove buttons */
-    if ([_dataTable selectedRow] == -1) {
-        /* no row is selected */
-        [_editButton setEnabled: NO];
-        [_removeButton setEnabled: NO];
-    } else {
-        /* a row is selected */
-        [_editButton setEnabled: YES];
-        [_removeButton setEnabled: YES];
-    }
+    const NSInteger selectedRow = [_dataTable selectedRow];
+    VLCBookmark * const bookmark = [_tableViewDataSource bookmarkForRow:selectedRow];
+    [_tableViewDataSource removeBookmark:bookmark];
 }
 
 /* Called when the user hits CMD + C or copy is clicked in the edit menu
  */
-- (void) copy:(id)sender {
-#if 0
-    NSPasteboard *pasteBoard = [NSPasteboard generalPasteboard];
-    NSIndexSet *selectionIndices = [_dataTable selectedRowIndexes];
-
-
-    input_thread_t *p_input = pl_CurrentInput(getIntf());
-    int i_bookmarks;
-    seekpoint_t **pp_bookmarks;
-
-    if (input_Control(p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks, &i_bookmarks) != VLC_SUCCESS)
+- (void)copy:(id)sender
+{
+    NSArray<VLCBookmark *> * const bookmarks = _tableViewDataSource.bookmarks;
+    if (bookmarks == nil || bookmarks.count == 0) {
         return;
+    }
 
-    [pasteBoard clearContents];
+    NSPasteboard * const pasteBoard = [NSPasteboard generalPasteboard];
+    NSIndexSet * const selectionIndices = [_dataTable selectedRowIndexes];
     NSUInteger index = [selectionIndices firstIndex];
 
-    while(index != NSNotFound) {
+    while (index != NSNotFound) {
         /* Get values */
-        if (index >= i_bookmarks)
+        if (index >= bookmarks.count) {
             break;
-        NSString *name = toNSStr(pp_bookmarks[index]->psz_name);
-        NSString *time = [self timeStringForBookmark:pp_bookmarks[index]];
+        }
 
-        NSString *message = [NSString stringWithFormat:@"%@ - %@", name, time];
+        VLCBookmark * const bookmark = bookmarks[index];
+        NSString * const name = bookmark.bookmarkName;
+        NSString * const time = [NSString stringWithTime:bookmark.bookmarkTime / 1000];
+        NSString * const message = [NSString stringWithFormat:@"%@ - %@", name, time];
         [pasteBoard writeObjects:@[message]];
 
         /* Get next index */
         index = [selectionIndices indexGreaterThanIndex:index];
     }
-
-    // Clear the bookmark list
-    for (int i = 0; i < i_bookmarks; i++)
-        vlc_seekpoint_Delete(pp_bookmarks[i]);
-    free(pp_bookmarks);
-#endif
 }
 
 #pragma mark -
@@ -465,4 +205,9 @@ clear:
     return YES;
 }
 
+- (void)toggleRowDependentButtonsEnabled:(BOOL)enabled
+{
+    _removeButton.enabled = enabled;
+}
+
 @end


=====================================
modules/gui/macosx/panels/bookmarks/VLCBookmark.h
=====================================
@@ -0,0 +1,41 @@
+/*****************************************************************************
+ * VLCBookmark.h: MacOS X interface module bookmarking functionality
+ *****************************************************************************
+ * Copyright (C) 2023 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>
+
+#import <vlc_media_library.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+ at interface VLCBookmark : NSObject<NSCopying>
+
++ (instancetype)bookmarkWithVlcBookmark:(vlc_ml_bookmark_t)vlcBookmark;
+
+ at property (readonly) int64_t mediaLibraryItemId;
+ at property (readwrite, assign) int64_t bookmarkTime;
+ at property (readwrite) NSString *bookmarkName;
+ at property (readwrite) NSString *bookmarkDescription;
+
+
+ at end
+
+NS_ASSUME_NONNULL_END


=====================================
modules/gui/macosx/panels/bookmarks/VLCBookmark.m
=====================================
@@ -0,0 +1,53 @@
+/*****************************************************************************
+ * VLCBookmark.m: MacOS X interface module bookmarking functionality
+ *****************************************************************************
+ * Copyright (C) 2023 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 "VLCBookmark.h"
+
+#import "extensions/NSString+Helpers.h"
+
+ at implementation VLCBookmark
+
++ (instancetype)bookmarkWithVlcBookmark:(vlc_ml_bookmark_t)vlcBookmark
+{
+    VLCBookmark * const bookmark = [[VLCBookmark alloc] init];
+    
+    bookmark->_mediaLibraryItemId = vlcBookmark.i_media_id;
+    bookmark.bookmarkTime = vlcBookmark.i_time;
+    bookmark.bookmarkName = toNSStr(vlcBookmark.psz_name);
+    bookmark.bookmarkDescription = toNSStr(vlcBookmark.psz_description);
+
+    return bookmark;
+}
+
+- (nonnull id)copyWithZone:(nullable NSZone *)zone
+{
+    VLCBookmark * const bookmarkCopy = [[VLCBookmark alloc] init];
+
+    bookmarkCopy->_mediaLibraryItemId = self.mediaLibraryItemId;
+    bookmarkCopy.bookmarkTime = self.bookmarkTime;
+    bookmarkCopy.bookmarkName = self.bookmarkName;
+    bookmarkCopy.bookmarkDescription = self.bookmarkDescription;
+
+    return bookmarkCopy;
+}
+
+ at end


=====================================
modules/gui/macosx/panels/bookmarks/VLCBookmarksTableViewDataSource.h
=====================================
@@ -0,0 +1,54 @@
+/*****************************************************************************
+ * VLCBookmarksTableViewDataSource.h: MacOS X interface module bookmarking functionality
+ *****************************************************************************
+ * Copyright (C) 2023 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>
+
+NS_ASSUME_NONNULL_BEGIN
+
+ at class VLCBookmark;
+
+extern NSString * const VLCBookmarksTableViewCellIdentifier;
+
+extern NSString * const VLCBookmarksTableViewNameTableColumnIdentifier;
+extern NSString * const VLCBookmarksTableViewDescriptionTableColumnIdentifier;
+extern NSString * const VLCBookmarksTableViewTimeTableColumnIdentifier;
+
+ at interface VLCBookmarksTableViewDataSource : NSObject<NSTableViewDataSource>
+
+ at property (nonatomic, readwrite, assign) int64_t libraryItemId;
+ at property (readonly) NSArray<VLCBookmark *> *bookmarks;
+ at property (readwrite) NSTableView *tableView;
+
+- (instancetype)initWithTableView:(NSTableView *)tableView;
+
+- (void)addBookmark;
+- (void)editBookmark:(VLCBookmark *)editedBookmark originalBookmark:(VLCBookmark *)originalBookmark;
+- (void)removeBookmarkWithTime:(const int64_t)bookmarkTime;
+- (void)removeBookmark:(VLCBookmark *)bookmark;
+- (void)clearBookmarks;
+
+- (void)updateBookmarks;
+- (VLCBookmark *)bookmarkForRow:(NSInteger)row;
+
+ at end
+
+NS_ASSUME_NONNULL_END


=====================================
modules/gui/macosx/panels/bookmarks/VLCBookmarksTableViewDataSource.m
=====================================
@@ -0,0 +1,310 @@
+/*****************************************************************************
+ * VLCBookmarksTableViewDataSource.m: MacOS X interface module bookmarking functionality
+ *****************************************************************************
+ * Copyright (C) 2023 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 "VLCBookmarksTableViewDataSource.h"
+
+#import "VLCBookmark.h"
+
+#import "extensions/NSString+Helpers.h"
+
+#import "library/VLCInputItem.h"
+#import "library/VLCLibraryController.h"
+#import "library/VLCLibraryDataTypes.h"
+#import "library/VLCLibraryModel.h"
+
+#import "main/VLCMain.h"
+
+#import "playlist/VLCPlayerController.h"
+#import "playlist/VLCPlaylistController.h"
+
+#import <vlc_media_library.h>
+
+NSString * const VLCBookmarksTableViewCellIdentifier = @"VLCBookmarksTableViewCellIdentifier";
+
+NSString * const VLCBookmarksTableViewNameTableColumnIdentifier = @"name";
+NSString * const VLCBookmarksTableViewDescriptionTableColumnIdentifier = @"description";
+NSString * const VLCBookmarksTableViewTimeTableColumnIdentifier = @"time_offset";
+
+static void bookmarksLibraryCallback(void *p_data, const vlc_ml_event_t *p_event)
+{
+    switch (p_event->i_type)
+    {
+        case VLC_ML_EVENT_BOOKMARKS_ADDED:
+        case VLC_ML_EVENT_BOOKMARKS_DELETED:
+        case VLC_ML_EVENT_BOOKMARKS_UPDATED:
+        {
+            // Need to reload data on main queue
+            dispatch_async(dispatch_get_main_queue(), ^{
+                VLCBookmarksTableViewDataSource *dataSource = (__bridge VLCBookmarksTableViewDataSource *)p_data;
+                [dataSource updateBookmarks];
+            });
+        }
+        break;
+        default:
+            break;
+    }
+}
+
+ at interface VLCBookmarksTableViewDataSource ()
+{
+    vlc_medialibrary_t *_mediaLibrary;
+    VLCPlayerController *_playerController;
+    vlc_ml_event_callback_t *_eventCallback;
+}
+ at end
+
+ at implementation VLCBookmarksTableViewDataSource
+
+- (instancetype)init
+{
+    self = [super init];
+    if (self) {
+        [self setup];
+    }
+    return self;
+}
+
+- (instancetype)initWithTableView:(NSTableView *)tableView
+{
+    self = [super init];
+    if (self) {
+        [self setup];
+        _tableView = tableView;
+    }
+    return self;
+}
+
+- (void)setup
+{
+    _playerController = VLCMain.sharedInstance.playlistController.playerController;
+    _mediaLibrary = vlc_ml_instance_get(getIntf());
+    [self updateLibraryItemId];
+
+    [NSNotificationCenter.defaultCenter addObserver:self
+                                           selector:@selector(currentMediaItemChanged:)
+                                               name:VLCPlayerCurrentMediaItemChanged
+                                             object:nil];
+
+    _eventCallback = vlc_ml_event_register_callback(_mediaLibrary,
+                                                    bookmarksLibraryCallback,
+                                                    (__bridge void *)self);
+}
+
+- (void)updateLibraryItemId
+{
+    VLCMediaLibraryMediaItem * const currentMediaItem = [VLCMediaLibraryMediaItem mediaItemForURL:_playerController.URLOfCurrentMediaItem];
+    if (currentMediaItem == nil) {
+        _libraryItemId = -1;
+        [self updateBookmarks];
+        return;
+    }
+
+    const int64_t currentMediaItemId = currentMediaItem.libraryID;
+    [self setLibraryItemId:currentMediaItemId];
+    [self updateBookmarks];
+}
+
+- (void)updateBookmarks
+{
+    if (_libraryItemId <= 0) {
+        _bookmarks = [NSArray array];
+        [_tableView reloadData];
+        return;
+    }
+
+    vlc_ml_bookmark_list_t * const vlcBookmarks = vlc_ml_list_media_bookmarks(_mediaLibrary, nil, _libraryItemId);
+
+    if (vlcBookmarks == NULL) {
+        _bookmarks = [NSArray array];
+        [_tableView reloadData];
+        return;
+    }
+
+    NSMutableArray<VLCBookmark *> * const tempBookmarks = [NSMutableArray arrayWithCapacity:vlcBookmarks->i_nb_items];
+
+    for (int i = 0; i < vlcBookmarks->i_nb_items; i++) {
+        vlc_ml_bookmark_t vlcBookmark = vlcBookmarks->p_items[i];
+        VLCBookmark * const bookmark = [VLCBookmark bookmarkWithVlcBookmark:vlcBookmark];
+        [tempBookmarks addObject:bookmark];
+    }
+
+    _bookmarks = [tempBookmarks copy];
+    vlc_ml_bookmark_list_release(vlcBookmarks);
+
+    [_tableView reloadData];
+}
+
+- (void)currentMediaItemChanged:(NSNotification * const)notification
+{
+    [self updateLibraryItemId];
+}
+
+- (void)setLibraryItemId:(const int64_t)libraryItemId
+{
+    if (libraryItemId == _libraryItemId) {
+        return;
+    }
+
+    _libraryItemId = libraryItemId;
+    [self updateBookmarks];
+}
+
+- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView
+{
+    if (_bookmarks == nil) {
+        return 0;
+    }
+
+    return _bookmarks.count;
+}
+
+- (VLCBookmark *)bookmarkForRow:(NSInteger)row
+{
+    NSParameterAssert(row >= 0 || row < _bookmarks.count);
+    return [_bookmarks objectAtIndex:row];
+}
+
+- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
+{
+    if (_bookmarks == nil || _bookmarks.count == 0) {
+        return @"";
+    }
+
+    VLCBookmark * const bookmark = [self bookmarkForRow:row];
+    NSAssert(bookmark != nil, @"Should be a valid bookmark");
+
+    NSString * const identifier = [tableColumn identifier];
+
+    if ([identifier isEqualToString:VLCBookmarksTableViewNameTableColumnIdentifier]) {
+        return bookmark.bookmarkName;
+    } else if ([identifier isEqualToString:VLCBookmarksTableViewDescriptionTableColumnIdentifier]) {
+        return bookmark.bookmarkDescription;
+    } else if ([identifier isEqualToString:VLCBookmarksTableViewTimeTableColumnIdentifier]) {
+        return [NSString stringWithTime:bookmark.bookmarkTime / 1000];
+    }
+
+    return @"";
+}
+
+- (void)tableView:(NSTableView *)tableView
+   setObjectValue:(id)object
+   forTableColumn:(NSTableColumn *)tableColumn
+              row:(NSInteger)row;
+{
+    VLCBookmark * const bookmark = [self bookmarkForRow:row];
+    VLCBookmark * const originalBookmark = [bookmark copy];
+
+    NSString * const columnIdentifier = tableColumn.identifier;
+
+    if ([columnIdentifier isEqualToString:VLCBookmarksTableViewNameTableColumnIdentifier]) {
+        NSString * const newName = (NSString *)object;
+        bookmark.bookmarkName = newName;
+    } else if ([columnIdentifier isEqualToString:VLCBookmarksTableViewDescriptionTableColumnIdentifier]) {
+        NSString * const newDescription = (NSString *)object;
+        bookmark.bookmarkDescription = newDescription;
+    } else if ([columnIdentifier isEqualToString:VLCBookmarksTableViewTimeTableColumnIdentifier]) {
+        NSString * const timeString = (NSString *)object;
+        NSArray * const components = [object componentsSeparatedByString:@":"];
+        const NSUInteger componentCount = [components count];
+
+        if (componentCount == 1) {
+            bookmark.bookmarkTime = ([[components firstObject] longLongValue]) * 1000;
+        } else if (componentCount == 2) {
+            bookmark.bookmarkTime = ([[components firstObject] longLongValue] * 60 +
+                                     [[components objectAtIndex:1] longLongValue]) * 1000;
+        } else if (componentCount == 3) {
+            bookmark.bookmarkTime = ([[components firstObject] longLongValue] * 3600 +
+                                     [[components objectAtIndex:1] longLongValue] * 60 +
+                                     [[components objectAtIndex:2] longLongValue]) * 1000;
+        } else {
+            msg_Err(getIntf(), "Cannot set bookmark time as invalid string format for time was received");
+        }
+    }
+
+    [self editBookmark:bookmark originalBookmark:originalBookmark];
+    [tableView reloadData];
+}
+
+- (void)addBookmark
+{
+    if (_libraryItemId <= 0) {
+        return;
+    }
+
+    const vlc_tick_t currentTime = _playerController.time;
+    const int64_t bookmarkTime = MS_FROM_VLC_TICK(currentTime);
+    vlc_ml_media_add_bookmark(_mediaLibrary, _libraryItemId, bookmarkTime);
+    vlc_ml_media_update_bookmark(_mediaLibrary,
+                                 _libraryItemId,
+                                 bookmarkTime,
+                                 [_NS("New bookmark") UTF8String],
+                                 [_NS("Description of new bookmark.") UTF8String]);
+
+    [self updateBookmarks];
+}
+
+- (void)editBookmark:(VLCBookmark *)bookmark originalBookmark:(VLCBookmark *)originalBookmark
+{
+    if (_libraryItemId <= 0) {
+        return;
+    }
+
+    if (originalBookmark.bookmarkTime != bookmark.bookmarkTime) {
+        [self removeBookmark:originalBookmark];
+        vlc_ml_media_add_bookmark(_mediaLibrary, _libraryItemId, bookmark.bookmarkTime);
+    }
+
+    vlc_ml_media_update_bookmark(_mediaLibrary,
+                                 _libraryItemId,
+                                 bookmark.bookmarkTime,
+                                 bookmark.bookmarkName.UTF8String,
+                                 bookmark.bookmarkDescription.UTF8String);
+
+    [self updateBookmarks];
+}
+
+- (void)removeBookmarkWithTime:(const int64_t)bookmarkTime
+{
+    if (_libraryItemId <= 0) {
+        return;
+    }
+
+    vlc_ml_media_remove_bookmark(_mediaLibrary, _libraryItemId, bookmarkTime);
+    [self updateBookmarks];
+}
+
+- (void)removeBookmark:(VLCBookmark *)bookmark
+{
+    [self removeBookmarkWithTime:bookmark.bookmarkTime];
+}
+
+- (void)clearBookmarks
+{
+    if (_libraryItemId <= 0) {
+        return;
+    }
+
+    vlc_ml_media_remove_all_bookmarks(_mediaLibrary, _libraryItemId);
+    [self updateBookmarks];
+}
+
+ at end


=====================================
modules/gui/macosx/panels/bookmarks/VLCBookmarksTableViewDelegate.h
=====================================
@@ -0,0 +1,35 @@
+/*****************************************************************************
+ * VLCBookmarksTableViewDelegate.h: MacOS X interface module bookmarking functionality
+ *****************************************************************************
+ * Copyright (C) 2023 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>
+
+NS_ASSUME_NONNULL_BEGIN
+
+ at class VLCBookmarksWindowController;
+
+ at interface VLCBookmarksTableViewDelegate : NSObject <NSTableViewDelegate>
+
+- (instancetype)initWithBookmarksWindowController:(VLCBookmarksWindowController *)controller;
+
+ at end
+
+NS_ASSUME_NONNULL_END


=====================================
modules/gui/macosx/panels/bookmarks/VLCBookmarksTableViewDelegate.m
=====================================
@@ -0,0 +1,60 @@
+/*****************************************************************************
+ * VLCBookmarksTableViewDataSource.m: MacOS X interface module bookmarking functionality
+ *****************************************************************************
+ * Copyright (C) 2023 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 "VLCBookmarksTableViewDelegate.h"
+
+#import "VLCBookmark.h"
+#import "VLCBookmarksTableViewDataSource.h"
+
+#import "extensions/NSString+Helpers.h"
+#import "extensions/NSView+VLCAdditions.h"
+
+#import "panels/VLCBookmarksWindowController.h"
+
+ at interface VLCBookmarksTableViewDelegate ()
+{
+    VLCBookmarksWindowController* _parentController;
+}
+ at end
+
+ at implementation VLCBookmarksTableViewDelegate
+
+- (instancetype)initWithBookmarksWindowController:(VLCBookmarksWindowController *)controller
+{
+    self = [super init];
+    if (self) {
+        _parentController = controller;
+    }
+    return self;
+}
+
+- (void)tableViewSelectionDidChange:(NSNotification *)notification
+{
+    NSParameterAssert(notification);
+    NSTableView * const tableView = notification.object;
+    NSParameterAssert(tableView);
+
+    const BOOL enableRowDependentBookmarkWindowButtons = tableView.selectedRow >= 0;
+    [_parentController toggleRowDependentButtonsEnabled:enableRowDependentBookmarkWindowButtons];
+}
+
+ at end



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f4a9017dd422d31d956dbf6fc32afac3cc03bcd6...c35f9ca031fe2c4961151bb5677c4a88f3475749

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f4a9017dd422d31d956dbf6fc32afac3cc03bcd6...c35f9ca031fe2c4961151bb5677c4a88f3475749
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