Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videolan/vlc
  • chouquette/vlc
  • bakiewicz.marek122/vlc
  • devnexen/vlc
  • rohanrajpal/vlc
  • blurrrb/vlc
  • gsoc/gsoc2019/darkapex/vlc
  • b1ue/vlc
  • fkuehne/vlc
  • magsoft/vlc
  • chub/vlc
  • cramiro9/vlc
  • robUx4/vlc
  • rom1v/vlc
  • akshayaky/vlc
  • tmk907/vlc
  • akymaster/vlc
  • govind.sharma/vlc
  • psilokos/vlc
  • xjbeta/vlc
  • jahan/vlc
  • 1480c1/vlc
  • amanchande/vlc
  • aaqib/vlc
  • rist/vlc
  • apol/vlc
  • mindfreeze/vlc
  • alexandre-janniaux/vlc
  • sandsmark/vlc
  • jagannatharjun/vlc
  • gsoc/gsoc2020/matiaslgonzalez/vlc
  • gsoc/gsoc2020/jagannatharjun/vlc
  • mstorsjo/vlc
  • gsoc/gsoc2020/vedenta/vlc
  • gsoc/gsoc2020/arnav-ishaan/vlc
  • gsoc/gsoc2020/andreduong/vlc
  • fuzun/vlc
  • gsoc/gsoc2020/vatsin/vlc
  • gsoc/gsoc2020/sagid/vlc
  • yaron/vlc
  • Phoenix/vlc
  • Garf/vlc
  • ePiratWorkarounds/vlc
  • tguillem/vlc
  • jnqnfe/vlc
  • mdc/vlc
  • Vedaa/vlc
  • rasa/vlc
  • quink/vlc
  • yealo/vlc
  • aleksey_ak/vlc
  • ePirat/vlc
  • ilya.yanok/vlc
  • asenat/vlc
  • m/vlc
  • bunjee/vlc
  • BLumia/vlc
  • sagudev/vlc
  • hamedmonji30/vlc
  • nullgemm/vlc
  • DivyamAhuja/vlc
  • thesamesam/vlc
  • dag7/vlc
  • snehil101/vlc
  • haasn/vlc
  • jbk/vlc
  • ValZapod/vlc
  • mfkl/vlc
  • WangChuan/vlc
  • core1024/vlc
  • GhostVaibhav/vlc
  • dfuhrmann/vlc
  • davide.prade/vlc
  • tmatth/vlc
  • Courmisch/vlc
  • zouya/vlc
  • hpi/vlc
  • EwoutH/vlc
  • aleung27/vlc
  • hengwu0/vlc
  • saladin/vlc
  • ashuio/vlc
  • richselwood/vlc
  • verma16Ayush/vlc
  • chemicalflash/vlc
  • PoignardAzur/vlc
  • huangjieNT/vlc
  • Blake-Haydon/vlc
  • AnuthaDev/vlc
  • gsoc/gsoc2021/mpd/vlc
  • nicolas_lequec/vlc
  • sambassaly/vlc
  • thresh/vlc
  • bonniegong/vlc
  • myaashish/vlc
  • stavros.vagionitis/vlc
  • ileoo/vlc
  • louis-santucci/vlc
  • cchristiansen/vlc
  • sabyasachi07/vlc
  • AbduAmeen/vlc
  • ashishb0410/vlc
  • urbanhusky/vlc
  • davidepietrasanta/vlc
  • riksleutelstad/vlc
  • jeremyVignelles/vlc
  • komh/vlc
  • iamjithinjohn/vlc
  • JohannesKauffmann/vlc2
  • kunglao/vlc
  • natzberg/vlc
  • jill/vlc
  • cwendling/vlc
  • adufou/vlc
  • ErwanAirone/vlc
  • HasinduDilshan10/vlc
  • vagrantc/vlc
  • rafiv/macos-bigsur-icon
  • Aymeriic/vlc
  • saranshg20/vlc
  • metzlove24/vlc
  • linkfanel/vlc
  • Ds886/vlc
  • metehan-arslan/vlc
  • Skantes/vlc
  • kgsandundananjaya96/vlc
  • mitchcapper/vlc
  • advaitgupta/vlc
  • StefanBruens/vlc
  • ratajs/vlc
  • T.M.F.B.3761/vlc
  • m222059/vlc
  • casemerrick/vlc
  • joshuaword2alt/vlc
  • sjwaddy/vlc
  • dima/vlc
  • Ybalrid/vlc
  • umxprime/vlc
  • eschmidt/vlc
  • vannieuwenhuysenmichelle/vlc
  • badcf00d/vlc
  • wesinator/vlc
  • louis/vlc
  • xqq/vlc
  • EmperorYP7/vlc
  • NicoLiam/vlc
  • loveleen/vlc
  • rofferom/vlc
  • rbultje/vlc
  • TheUnamed/vlc
  • pratiksharma341/vlc
  • Saurab17/vlc
  • purist.coder/vlc
  • Shuicheng/vlc
  • mdrrubel292/vlc
  • silverbleu00/vlc
  • metif12/vlc
  • asher-m/vlc
  • jeffk/vlc
  • Brandonbr1/vlc
  • beautyyuyanli/vlc
  • rego21/vlc
  • muyangren907/vlc
  • collectionbylawrencejason/vlc
  • evelez/vlc
  • GSMgeeth/vlc
  • Oneric/vlc
  • TJ5/vlc
  • XuanTung95/vlc
  • darrenjenny21/vlc
  • Trenly/vlc
  • RockyTDR/vlc
  • mjakubowski/vlc
  • caprica/vlc
  • ForteFrankie/vlc
  • seannamiller19/vlc
  • junlon2006/vlc
  • kiwiren6666/vlc
  • iuseiphonexs/vlc
  • fenngtun/vlc
  • Rajdutt999/vlc
  • typx/vlc
  • leon.vitanos/vlc
  • robertogarci0938/vlc
  • gsoc/gsoc2022/luc65r/vlc-mpd
  • skeller/vlc
  • MCJack123/vlc
  • luc65r/vlc-mpd
  • popov895/vlc
  • claucambra/vlc
  • brad/vlc
  • matthewmurua88/vlc
  • Tomas8874/vlc
  • philenotfound/vlc
  • makita-do3/vlc
  • LZXCorp/vlc
  • mar0x/vlc
  • senojetkennedy0102/vlc
  • shaneb243/vlc
  • ahmadbader/vlc
  • rajduttcse26/vlc-audio-filters
  • Juniorzito8415/vlc
  • achernyakov/vlc
  • lucasjetgroup/vlc
  • pupdoggy666/vlc
  • gmde9363/vlc
  • alexnwayne/vlc
  • bahareebrahimi781/vlc
  • hamad633666/vlc
  • umghof3112/vlc
  • joe0199771874/vlc
  • Octocats66666666/vlc
  • jjm_223/vlc
  • btech10110.19/vlc
  • sunnykfc028/vlc-audio-filters
  • loic/vlc
  • nguyenminhducmx1/vlc
  • JanekKrueger/vlc
  • bstubbington2/vlc
  • rcombs/vlc
  • Ordissimo/vlc
  • king7532/vlc
  • noobsauce101/vlc
  • schong0525/vlc
  • myQwil/vlc
  • apisbg91/vlc
  • geeboy0101017/vlc
  • kim.faughey/vlc
  • nurupo/vlc
  • yyusea/vlc
  • 0711235879.khco/vlc
  • ialo/vlc
  • iloveyeye2/vlc
  • gdtdftdqtd/vlc
  • leandroconsiglio/vlc
  • AndyHTML2012/vlc
  • ncz/vlc
  • lucenticus/vlc
  • knr1931/vlc
  • kjoonlee/vlc
  • chandrakant100/vlc-qt
  • johge42/vlc
  • polter/vlc
  • hexchain/vlc
  • Tushwrld/vlc
  • mztea928/vlc
  • jbelloncastro/vlc
  • alvinhochun/vlc
  • ghostpiratecrow/vlc
  • ujjwaltwitx/vlc
  • alexsonarin06/vlc
  • adrianbon76/vlc
  • altsod/vlc
  • damien.lucas44/vlc
  • dmytrivtaisa/vlc
  • utk202/vlc
  • aaxhrj/vlc
  • thomas.hermes/vlc
  • structurenewworldorder/vlc
  • slomo/vlc
  • wantlamy/vlc
  • musc.o3cminc/vlc
  • thebarshablog/vlc
  • kerrick/vlc
  • kratos142518/vlc
  • leogps/vlc
  • vacantron/vlc
  • luna_koly/vlc
  • Ratio2/vlc
  • anuoshemohammad/vlc
  • apsun/vlc
  • aaa1115910/vlc
  • alimotmoyo/vlc
  • Ambossmann/vlc
  • Sam-LearnsToCode/vlc
  • Chilledheart/vlc
  • Labnann/vlc
  • ktcoooot1/vlc
  • mohit-marathe/vlc
  • johnddx/vlc
  • manstabuk/vlc
  • Omar-ahmed314/vlc
  • vineethkm/vlc
  • 9Enemi86/vlc
  • radoslav.m.panteleev/vlc
  • ashishami2002/vlc
  • Corbax/vlc
  • firnasahmed/vlc
  • pelayarmalam4/vlc
  • c0ff330k/vlc
  • shikhindahikar/vlc
  • l342723951/vlc
  • christianschwandner/vlc
  • douniwan5788/vlc
  • 7damian7/vlc
  • ferdnyc/vlc
  • f.ales1/vlc
  • pandagby/vlc
  • BaaBaa/vlc
  • jewe37/vlc
  • w00drow/vlc
  • russelltg/vlc
  • ironicallygod/vlc
  • soumyaDghosh/vlc
  • linzihao1999/vlc
  • deyayush6/vlc
  • mibi88/vlc
  • newabdallah10/vlc
  • jhorbincolombia/vlc
  • rimvihaqueshupto/vlc
  • andrewkhon98/vlc
  • fab78/vlc
  • lapaz17/vlc
  • amanna13/vlc
  • mdakram28/vlc
  • 07jw1980/vlc
  • sohamgupta/vlc
  • Eson-Jia1/vlc
  • Sumou/vlc
  • vikram-kangotra/vlc
  • chalice191/vlc
  • olivercalder/vlc
  • aaasg4001/vlc
  • zipdox/vlc
  • kwizart/vlc
  • Dragon-S/vlc
  • jdemeule/vlc
  • gabriel_lt/vlc
  • locutusofborg/vlc
  • sammirata/vlc-librist
  • another/vlc
  • Benjamin_Loison/vlc
  • ahmedmoselhi/vlc
  • petergaal/vlc
  • huynhsontung/vlc
  • dariusmihut/vlc
  • tvermaashutosh/vlc
  • buti/vlc
  • Niram7777/vlc
  • rohan-here/vlc
  • balaji-sivasakthi/vlc
  • rlindner81/vlc
  • Kakadus/vlc
  • djain/vlc
  • ABBurmeister/vlc
  • craighuggins/vlc
  • orbea/vlc
  • maxos/vlc
  • aakarshmj/vlc
  • kblaschke/vlc
  • ankitm/vlc
  • advait-0/vlc
  • mohak2003/vlc
  • yselkowitz/vlc
  • AZM999/vlc-azm
  • andrey.turkin/vlc
  • Disha-Baghel/vlc
  • nowrep/vlc
  • Apeng/vlc
  • Choucroute_melba/vlc
  • autra/vlc
  • eclipseo/vlc
  • fhuber/vlc
  • olafhering/vlc
  • sdasda7777/vlc
  • 1div0/vlc
  • skosnits/vlc-extended-playlist-support
  • dnicolson/vlc
  • Timshel/vlc
  • octopols/vlc
  • MangalK/vlc
  • nima64/vlc
  • misawai/vlc
  • Alexander-Wilms/vlc
  • Maxime2/vlc-fork-for-visualizer
  • ww/vlc
  • jeske/vlc
  • sgross-emlix/vlc
  • morenonatural/vlc
  • freakingLovesVLC/vlc
  • borisgolovnev/vlc
  • mpromonet/vlc
  • diogo.simao-marques/vlc
  • masstock/vlc
  • pratikpatel8982/vlc
  • hugok79/vlc
  • longervision/vlc
  • abhiudaysurya/vlc
  • rishabhgarg/vlc
  • tumic/vlc
  • cart/vlc
  • shubham442/vlc
  • Aditya692005/vlc
  • sammirata/vlc4
  • syrykh/vlc
  • Vvorcun/macos-new-icon
  • AyaanshC/vlc
  • nasso/vlc
  • Quark/vlc
  • sebastinas/vlc
  • rhstone/vlc
  • talregev/vlc
  • Managor/vlc
403 results
Show changes
Commits on Source (40)
Showing
with 684 additions and 463 deletions
......@@ -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 */,
......
......@@ -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 \
......
<?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>
......@@ -33,24 +33,13 @@
@property (readwrite, weak) IBOutlet NSButton *removeButton;
@property (readwrite, weak) IBOutlet NSTableView *dataTable;
/* edit window */
@property (readwrite) IBOutlet NSWindow *editBookmarksWindow;
@property (readwrite, weak) IBOutlet NSButton *editOKButton;
@property (readwrite, weak) IBOutlet NSButton *editCancelButton;
@property (readwrite, weak) IBOutlet NSTextField *editNameLabel;
@property (readwrite, weak) IBOutlet NSTextField *editTimeLabel;
@property (readwrite, weak) IBOutlet NSTextField *editNameTextField;
@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
......@@ -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"
@interface VLCBookmarksWindowController() <NSTableViewDataSource, NSTableViewDelegate>
@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
/*****************************************************************************
* VLCBookmark.h: MacOS X interface module bookmarking functionality
*****************************************************************************
* Copyright (C) 2023 VLC authors and VideoLAN
*
* Authors: Claudio Cambra <developer@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
@interface VLCBookmark : NSObject<NSCopying>
+ (instancetype)bookmarkWithVlcBookmark:(vlc_ml_bookmark_t)vlcBookmark;
@property (readonly) int64_t mediaLibraryItemId;
@property (readwrite, assign) int64_t bookmarkTime;
@property (readwrite) NSString *bookmarkName;
@property (readwrite) NSString *bookmarkDescription;
@end
NS_ASSUME_NONNULL_END
/*****************************************************************************
* VLCBookmark.m: MacOS X interface module bookmarking functionality
*****************************************************************************
* Copyright (C) 2023 VLC authors and VideoLAN
*
* Authors: Claudio Cambra <developer@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"
@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;
}
@end
/*****************************************************************************
* VLCBookmarksTableViewDataSource.h: MacOS X interface module bookmarking functionality
*****************************************************************************
* Copyright (C) 2023 VLC authors and VideoLAN
*
* Authors: Claudio Cambra <developer@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
@class VLCBookmark;
extern NSString * const VLCBookmarksTableViewCellIdentifier;
extern NSString * const VLCBookmarksTableViewNameTableColumnIdentifier;
extern NSString * const VLCBookmarksTableViewDescriptionTableColumnIdentifier;
extern NSString * const VLCBookmarksTableViewTimeTableColumnIdentifier;
@interface VLCBookmarksTableViewDataSource : NSObject<NSTableViewDataSource>
@property (nonatomic, readwrite, assign) int64_t libraryItemId;
@property (readonly) NSArray<VLCBookmark *> *bookmarks;
@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;
@end
NS_ASSUME_NONNULL_END
/*****************************************************************************
* VLCBookmarksTableViewDataSource.m: MacOS X interface module bookmarking functionality
*****************************************************************************
* Copyright (C) 2023 VLC authors and VideoLAN
*
* Authors: Claudio Cambra <developer@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;
}
}
@interface VLCBookmarksTableViewDataSource ()
{
vlc_medialibrary_t *_mediaLibrary;
VLCPlayerController *_playerController;
vlc_ml_event_callback_t *_eventCallback;
}
@end
@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];
}
@end
/*****************************************************************************
* VLCBookmarksTableViewDelegate.h: MacOS X interface module bookmarking functionality
*****************************************************************************
* Copyright (C) 2023 VLC authors and VideoLAN
*
* Authors: Claudio Cambra <developer@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
@class VLCBookmarksWindowController;
@interface VLCBookmarksTableViewDelegate : NSObject <NSTableViewDelegate>
- (instancetype)initWithBookmarksWindowController:(VLCBookmarksWindowController *)controller;
@end
NS_ASSUME_NONNULL_END
/*****************************************************************************
* VLCBookmarksTableViewDataSource.m: MacOS X interface module bookmarking functionality
*****************************************************************************
* Copyright (C) 2023 VLC authors and VideoLAN
*
* Authors: Claudio Cambra <developer@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"
@interface VLCBookmarksTableViewDelegate ()
{
VLCBookmarksWindowController* _parentController;
}
@end
@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];
}
@end