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 (47)
Showing
with 377 additions and 110 deletions
......@@ -108,6 +108,7 @@
539BA79F298C726200918C36 /* VLCAspectRatioRetainingVideoWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 539BA79E298C726200918C36 /* VLCAspectRatioRetainingVideoWindow.m */; };
539F114B29E83A4200F13460 /* VLCLibraryTwoPaneSplitViewDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 539F114A29E83A4200F13460 /* VLCLibraryTwoPaneSplitViewDelegate.m */; };
539F116D29F9785C00F13460 /* VLCMainVideoViewAudioMediaDecorativeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 539F116C29F9785C00F13460 /* VLCMainVideoViewAudioMediaDecorativeView.m */; };
53A1F1172AB7168000686BAA /* VLCLibraryAllAudioGroupsMediaLibraryItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 53A1F1162AB7168000686BAA /* VLCLibraryAllAudioGroupsMediaLibraryItem.m */; };
53B40FD72AA878E400C814E4 /* VLCLibraryHeroView.m in Sources */ = {isa = PBXBuildFile; fileRef = 53B40FD62AA878E400C814E4 /* VLCLibraryHeroView.m */; };
53B447CA2939823E00857588 /* VLCLibrarySongsTableViewSongPlayingTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 53B447C92939823E00857588 /* VLCLibrarySongsTableViewSongPlayingTableCellView.m */; };
53B447F6293BB47B00857588 /* VLCLibraryVideoCollectionViewContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 53B447EC293BB47A00857588 /* VLCLibraryVideoCollectionViewContainerView.m */; };
......@@ -332,6 +333,8 @@
539F116A29F9756000F13460 /* VLCMainVideoViewAudioMediaDecorativeView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = VLCMainVideoViewAudioMediaDecorativeView.xib; sourceTree = "<group>"; };
539F116B29F9785C00F13460 /* VLCMainVideoViewAudioMediaDecorativeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCMainVideoViewAudioMediaDecorativeView.h; sourceTree = "<group>"; };
539F116C29F9785C00F13460 /* VLCMainVideoViewAudioMediaDecorativeView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCMainVideoViewAudioMediaDecorativeView.m; sourceTree = "<group>"; };
53A1F1152AB7168000686BAA /* VLCLibraryAllAudioGroupsMediaLibraryItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLibraryAllAudioGroupsMediaLibraryItem.h; sourceTree = "<group>"; };
53A1F1162AB7168000686BAA /* VLCLibraryAllAudioGroupsMediaLibraryItem.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryAllAudioGroupsMediaLibraryItem.m; sourceTree = "<group>"; };
53B40FD42AA7618000C814E4 /* VLCLibraryHeroView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = VLCLibraryHeroView.xib; sourceTree = "<group>"; };
53B40FD52AA878E400C814E4 /* VLCLibraryHeroView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLibraryHeroView.h; sourceTree = "<group>"; };
53B40FD62AA878E400C814E4 /* VLCLibraryHeroView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryHeroView.m; sourceTree = "<group>"; };
......@@ -1392,6 +1395,8 @@
536283DF291146BC00640C15 /* VLCLibraryAlbumTracksDataSource.m */,
53ED472929C8FF9D00795DB1 /* VLCLibraryAlbumTracksTableViewDelegate.h */,
53ED472A29C8FF9D00795DB1 /* VLCLibraryAlbumTracksTableViewDelegate.m */,
53A1F1152AB7168000686BAA /* VLCLibraryAllAudioGroupsMediaLibraryItem.h */,
53A1F1162AB7168000686BAA /* VLCLibraryAllAudioGroupsMediaLibraryItem.m */,
7DE2F0422282C84A0040DD0A /* VLCLibraryAudioDataSource.h */,
7DE2F0432282C84A0040DD0A /* VLCLibraryAudioDataSource.m */,
53903D3829576ED500D0B308 /* VLCLibraryAudioGroupDataSource.h */,
......@@ -2116,6 +2121,7 @@
6B6FFF701EF9EC350001CEB1 /* CompatibilityFixes.m in Sources */,
7D1BF28A22A153E20027C50F /* VLCRoundedCornerTextField.m in Sources */,
7DFBDCB4226CD00900B700A5 /* VLCLibraryDataTypes.m in Sources */,
53A1F1172AB7168000686BAA /* VLCLibraryAllAudioGroupsMediaLibraryItem.m in Sources */,
1C3113DF1E508C6900D4DD76 /* VLCVideoEffectsWindowController.m in Sources */,
53F0E92D299B002300491D49 /* VLCInputNodePathControlItem.m in Sources */,
1C3113E11E508C6900D4DD76 /* VLCVoutView.m in Sources */,
......
......@@ -161,6 +161,8 @@ libmacosx_plugin_la_SOURCES = \
gui/macosx/library/audio-library/VLCLibraryAlbumTracksDataSource.m \
gui/macosx/library/audio-library/VLCLibraryAlbumTracksTableViewDelegate.h \
gui/macosx/library/audio-library/VLCLibraryAlbumTracksTableViewDelegate.m \
gui/macosx/library/audio-library/VLCLibraryAllAudioGroupsMediaLibraryItem.h \
gui/macosx/library/audio-library/VLCLibraryAllAudioGroupsMediaLibraryItem.m \
gui/macosx/library/audio-library/VLCLibraryAudioDataSource.h \
gui/macosx/library/audio-library/VLCLibraryAudioDataSource.m \
gui/macosx/library/audio-library/VLCLibraryAudioGroupDataSource.h \
......
......@@ -35,19 +35,22 @@
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="U23-gv-Pf6">
<rect key="frame" x="142" y="386" width="86" height="19"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Artist name" id="3Ae-qv-Wyy">
<font key="font" metaFont="systemMedium" size="15"/>
<color key="textColor" name="VLCAccentColor"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="kvo-td-z48">
<rect key="frame" x="144" y="386" width="92" height="19"/>
<buttonCell key="cell" type="bevel" title="Album artist" bezelStyle="rounded" alignment="left" imageScaling="proportionallyDown" inset="2" id="WVL-LH-ZiA">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="systemSemibold" size="15"/>
</buttonCell>
<color key="contentTintColor" name="VLCAccentColor"/>
<connections>
<action selector="detailAction:" target="c22-O7-iKe" id="Onc-S8-WGY"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="lyR-U9-HKd" firstAttribute="top" secondItem="dd9-b1-XEf" secondAttribute="bottom" constant="5" id="36N-Cq-Zjf"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="kvo-td-z48" secondAttribute="trailing" constant="20" id="Wg0-Tn-f2L"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="lyR-U9-HKd" secondAttribute="trailing" constant="20" id="dzL-hG-1nc"/>
<constraint firstItem="U23-gv-Pf6" firstAttribute="trailing" relation="lessThanOrEqual" secondItem="cAS-FG-otl" secondAttribute="trailing" constant="-20" id="gAZ-If-sHJ"/>
</constraints>
</customView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="xJW-ps-ycn">
......@@ -78,13 +81,14 @@
</subviews>
<constraints>
<constraint firstItem="dd9-b1-XEf" firstAttribute="leading" secondItem="Ydb-7n-5Cd" secondAttribute="leading" id="5Gn-ze-Gf7"/>
<constraint firstItem="kvo-td-z48" firstAttribute="leading" secondItem="Ydb-7n-5Cd" secondAttribute="trailing" constant="20" id="7bs-tQ-eAW"/>
<constraint firstItem="KVh-Zn-l7I" firstAttribute="centerY" secondItem="Ydb-7n-5Cd" secondAttribute="centerY" id="AZI-Eo-9so"/>
<constraint firstItem="kvo-td-z48" firstAttribute="top" secondItem="xJW-ps-ycn" secondAttribute="bottom" constant="5" id="BvS-ax-Ct6"/>
<constraint firstItem="Ydb-7n-5Cd" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="20" id="IWI-9l-HnJ"/>
<constraint firstItem="lyR-U9-HKd" firstAttribute="trailing" secondItem="Ydb-7n-5Cd" secondAttribute="trailing" id="MCe-hU-gES"/>
<constraint firstItem="KVh-Zn-l7I" firstAttribute="centerX" secondItem="Ydb-7n-5Cd" secondAttribute="centerX" id="Mnq-he-JXh"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="xJW-ps-ycn" secondAttribute="trailing" constant="20" id="NhG-8C-EDX"/>
<constraint firstItem="cAS-FG-otl" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" id="O89-IU-nIf"/>
<constraint firstItem="U23-gv-Pf6" firstAttribute="top" secondItem="xJW-ps-ycn" secondAttribute="bottom" constant="5" id="a6g-MU-jOX"/>
<constraint firstItem="xJW-ps-ycn" firstAttribute="leading" secondItem="Ydb-7n-5Cd" secondAttribute="trailing" constant="20" id="dai-Pj-DEx"/>
<constraint firstItem="Ydb-7n-5Cd" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" constant="20" id="gVW-Rd-TA5"/>
<constraint firstAttribute="bottom" secondItem="cAS-FG-otl" secondAttribute="bottom" id="hr4-VR-MQ0"/>
......@@ -93,12 +97,11 @@
<constraint firstItem="dd9-b1-XEf" firstAttribute="trailing" secondItem="Ydb-7n-5Cd" secondAttribute="trailing" id="sFl-F3-GQN"/>
<constraint firstAttribute="trailing" secondItem="cAS-FG-otl" secondAttribute="trailing" id="w5r-Yv-oeN"/>
<constraint firstItem="xJW-ps-ycn" firstAttribute="top" secondItem="Ydb-7n-5Cd" secondAttribute="top" id="xQf-rb-J0b"/>
<constraint firstItem="U23-gv-Pf6" firstAttribute="leading" secondItem="Ydb-7n-5Cd" secondAttribute="trailing" constant="20" id="xp8-bi-OAa"/>
<constraint firstItem="cAS-FG-otl" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" id="zdo-e5-cek"/>
</constraints>
<connections>
<outlet property="albumNameTextField" destination="xJW-ps-ycn" id="nX9-SH-RZA"/>
<outlet property="artistNameTextField" destination="U23-gv-Pf6" id="n1x-05-ZAR"/>
<outlet property="artistNameTextButton" destination="kvo-td-z48" id="U94-du-RqP"/>
<outlet property="playInstantlyButton" destination="KVh-Zn-l7I" id="Ri1-YF-Fe2"/>
<outlet property="representedImageView" destination="Ydb-7n-5Cd" id="qBu-r5-jIY"/>
<outlet property="summaryTextField" destination="dd9-b1-XEf" id="ne9-oA-zPw"/>
......
......@@ -81,27 +81,32 @@
<stackView distribution="fill" orientation="vertical" alignment="leading" spacing="5" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="bw7-QB-Ssc">
<rect key="frame" x="257" y="0.0" width="794" height="282"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="nCe-dY-YMM">
<rect key="frame" x="-2" y="224" width="124" height="58"/>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="nCe-dY-YMM">
<rect key="frame" x="-2" y="256" width="124" height="26"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" title="Album name" id="6RM-x8-Y4y">
<font key="font" textStyle="title1" name=".SFNS-Regular"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="SvO-zd-2zo">
<rect key="frame" x="0.0" y="203" width="794" height="16"/>
<customView id="SvO-zd-2zo">
<rect key="frame" x="0.0" y="203" width="794" height="48"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="751" translatesAutoresizingMaskIntoConstraints="NO" id="HnP-Fk-juB">
<rect key="frame" x="-2" y="0.0" width="87" height="16"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" title="Album details" id="Nwk-76-Wx9">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="o9Q-0s-xRU">
<rect key="frame" x="0.0" y="0.0" width="154" height="48"/>
<buttonCell key="cell" type="bevel" title="Album detail string" bezelStyle="rounded" alignment="left" imageScaling="proportionallyDown" inset="2" id="SqJ-99-uiI">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="systemSemibold" size="17"/>
</buttonCell>
<color key="contentTintColor" name="VLCAccentColor"/>
<connections>
<action selector="detailAction:" target="HAc-or-XD8" id="gEr-Qz-9KQ"/>
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="QuO-3G-BMT">
<rect key="frame" x="687" y="0.0" width="94" height="16"/>
<rect key="frame" x="687" y="16" width="94" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Year · Duration" id="JBg-wo-ZeE">
<font key="font" metaFont="system"/>
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
......@@ -110,14 +115,12 @@
</textField>
</subviews>
<constraints>
<constraint firstItem="QuO-3G-BMT" firstAttribute="top" relation="greaterThanOrEqual" secondItem="SvO-zd-2zo" secondAttribute="top" id="Fdn-jn-Iaj"/>
<constraint firstAttribute="bottom" secondItem="HnP-Fk-juB" secondAttribute="bottom" id="ImH-Vf-Khl"/>
<constraint firstItem="HnP-Fk-juB" firstAttribute="top" secondItem="SvO-zd-2zo" secondAttribute="top" id="OUS-PH-e6K"/>
<constraint firstItem="QuO-3G-BMT" firstAttribute="centerY" secondItem="HnP-Fk-juB" secondAttribute="centerY" id="Som-Jr-qAy"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="QuO-3G-BMT" secondAttribute="bottom" id="UDs-9f-Og5"/>
<constraint firstItem="HnP-Fk-juB" firstAttribute="leading" secondItem="SvO-zd-2zo" secondAttribute="leading" id="Uuo-gf-FxL"/>
<constraint firstItem="o9Q-0s-xRU" firstAttribute="top" secondItem="SvO-zd-2zo" secondAttribute="top" id="QuO-Ev-i98"/>
<constraint firstItem="o9Q-0s-xRU" firstAttribute="trailing" relation="lessThanOrEqual" secondItem="QuO-3G-BMT" secondAttribute="leading" id="R8I-I6-uGg"/>
<constraint firstItem="QuO-3G-BMT" firstAttribute="centerY" secondItem="SvO-zd-2zo" secondAttribute="centerY" id="TX6-cF-dnh"/>
<constraint firstAttribute="trailing" secondItem="QuO-3G-BMT" secondAttribute="trailing" constant="15" id="Wfo-47-OGd"/>
<constraint firstItem="QuO-3G-BMT" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="HnP-Fk-juB" secondAttribute="trailing" constant="5" id="aD2-Ry-CuA"/>
<constraint firstAttribute="bottom" secondItem="o9Q-0s-xRU" secondAttribute="bottom" id="lvh-r5-QzT"/>
<constraint firstItem="o9Q-0s-xRU" firstAttribute="leading" secondItem="SvO-zd-2zo" secondAttribute="leading" id="nYc-fo-IyN"/>
</constraints>
</customView>
<scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="52" horizontalPageScroll="10" verticalLineScroll="52" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" horizontalScrollElasticity="none" id="9ZS-oy-iP9" customClass="VLCSubScrollView">
......@@ -170,7 +173,6 @@
</scrollView>
</subviews>
<constraints>
<constraint firstItem="SvO-zd-2zo" firstAttribute="leading" secondItem="nCe-dY-YMM" secondAttribute="leading" id="gSC-OW-Sld"/>
<constraint firstAttribute="trailing" secondItem="SvO-zd-2zo" secondAttribute="trailing" id="hZf-vs-RlK"/>
</constraints>
<visibilityPriorities>
......@@ -211,7 +213,7 @@
</constraints>
<connections>
<outlet property="albumArtworkImageView" destination="xZd-Hk-h2M" id="J8l-V9-P06"/>
<outlet property="albumDetailsTextField" destination="HnP-Fk-juB" id="Hm3-l8-a9s"/>
<outlet property="albumDetailsTextButton" destination="o9Q-0s-xRU" id="vQv-Q6-HdR"/>
<outlet property="albumTitleTextField" destination="nCe-dY-YMM" id="h3l-p0-w3e"/>
<outlet property="albumTracksTableView" destination="eEJ-WA-0aM" id="l8k-M9-a8e"/>
<outlet property="albumYearAndDurationTextField" destination="QuO-3G-BMT" id="y34-rD-uR"/>
......@@ -224,7 +226,7 @@
<resources>
<image name="no-art" width="128" height="128"/>
<image name="play.fill" catalog="system" width="12" height="13"/>
<image name="plus" catalog="system" width="15" height="13"/>
<image name="plus" catalog="system" width="14" height="13"/>
<namedColor name="VLCAccentColor">
<color red="1" green="0.37999999523162842" blue="0.039999999105930328" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
......
......@@ -79,35 +79,38 @@
<real value="3.4028234663852886e+38"/>
</customSpacing>
</stackView>
<stackView distribution="fill" orientation="vertical" alignment="leading" spacing="5" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" horizontalCompressionResistancePriority="250" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="bw7-QB-Ssc">
<rect key="frame" x="200" y="0.0" width="877" height="225"/>
<stackView distribution="fillEqually" orientation="vertical" alignment="leading" spacing="5" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" horizontalCompressionResistancePriority="250" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="bw7-QB-Ssc">
<rect key="frame" x="200" y="115" width="877" height="110"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="nCe-dY-YMM">
<rect key="frame" x="-2" y="199" width="167" height="26"/>
<rect key="frame" x="-2" y="84" width="167" height="26"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" title="Media item name" id="6RM-x8-Y4y">
<font key="font" textStyle="title1" name=".SFNS-Regular"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Slp-lt-fZv">
<rect key="frame" x="-2" y="178" width="146" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Media item detail string" id="S8T-h9-WYr">
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="S5i-gd-zkt">
<rect key="frame" x="0.0" y="63" width="146" height="16"/>
<buttonCell key="cell" type="bevel" title="Media item detail string" bezelStyle="rounded" alignment="left" imageScaling="proportionallyDown" inset="2" id="zkC-9p-xFn">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<color key="textColor" name="VLCAccentColor"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</buttonCell>
<color key="contentTintColor" name="VLCAccentColor"/>
<connections>
<action selector="detailAction:" target="HAc-or-XD8" id="JiQ-Ss-fTO"/>
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="QuO-3G-BMT">
<rect key="frame" x="-2" y="157" width="94" height="16"/>
<rect key="frame" x="-2" y="42" width="94" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Year · Duration" id="JBg-wo-ZeE">
<font key="font" metaFont="system"/>
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<stackView distribution="fill" orientation="horizontal" alignment="top" spacing="6" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="fiJ-9f-ecF">
<rect key="frame" x="0.0" y="136" width="107" height="16"/>
<stackView distribution="fill" orientation="horizontal" alignment="top" spacing="5" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="fiJ-9f-ecF">
<rect key="frame" x="0.0" y="21" width="106" height="16"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="1000" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="NZk-WW-Uay">
<rect key="frame" x="-2" y="0.0" width="72" height="16"/>
......@@ -118,7 +121,7 @@
</textFieldCell>
</textField>
<textField verticalHuggingPriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="VxL-BW-3eh">
<rect key="frame" x="72" y="0.0" width="37" height="16"/>
<rect key="frame" x="71" y="0.0" width="37" height="16"/>
<textFieldCell key="cell" title="Label" id="Pzf-s3-rHC">
<font key="font" usesAppearanceFont="YES"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
......@@ -135,8 +138,8 @@
<real value="3.4028234663852886e+38"/>
</customSpacing>
</stackView>
<stackView distribution="fill" orientation="horizontal" alignment="top" spacing="6" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="B2d-Zo-xAO">
<rect key="frame" x="0.0" y="115" width="73" height="16"/>
<stackView distribution="fill" orientation="horizontal" alignment="top" spacing="5" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="B2d-Zo-xAO">
<rect key="frame" x="0.0" y="0.0" width="72" height="16"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="1000" verticalCompressionResistancePriority="1000" translatesAutoresizingMaskIntoConstraints="NO" id="hEf-79-49a">
<rect key="frame" x="-2" y="0.0" width="38" height="16"/>
......@@ -167,9 +170,6 @@
<real value="3.4028234663852886e+38"/>
</customSpacing>
</stackView>
<stackView distribution="fill" orientation="horizontal" alignment="top" spacing="6" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" verticalHuggingPriority="750" ambiguous="YES" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="gn0-fR-mbx">
<rect key="frame" x="0.0" y="0.0" width="50" height="110"/>
</stackView>
</subviews>
<visibilityPriorities>
<integer value="1000"/>
......@@ -177,7 +177,6 @@
<integer value="1000"/>
<integer value="1000"/>
<integer value="1000"/>
<integer value="1000"/>
</visibilityPriorities>
<customSpacing>
<real value="3.4028234663852886e+38"/>
......@@ -185,14 +184,13 @@
<real value="3.4028234663852886e+38"/>
<real value="3.4028234663852886e+38"/>
<real value="3.4028234663852886e+38"/>
<real value="3.4028234663852886e+38"/>
</customSpacing>
</stackView>
</subviews>
<constraints>
<constraint firstItem="TOx-1e-6D9" firstAttribute="top" secondItem="FWp-yd-2Pm" secondAttribute="top" id="7hM-jR-3N3"/>
<constraint firstAttribute="bottom" secondItem="TOx-1e-6D9" secondAttribute="bottom" constant="10" id="bdR-rj-nKk"/>
<constraint firstAttribute="bottom" secondItem="bw7-QB-Ssc" secondAttribute="bottom" id="elF-5e-5LQ"/>
<constraint firstAttribute="bottom" relation="greaterThanOrEqual" secondItem="bw7-QB-Ssc" secondAttribute="bottom" id="elF-5e-5LQ"/>
<constraint firstAttribute="trailing" secondItem="bw7-QB-Ssc" secondAttribute="trailing" id="uvg-NE-l4m"/>
<constraint firstItem="TOx-1e-6D9" firstAttribute="leading" secondItem="FWp-yd-2Pm" secondAttribute="leading" id="vAN-Ww-VKA"/>
<constraint firstItem="bw7-QB-Ssc" firstAttribute="top" secondItem="FWp-yd-2Pm" secondAttribute="top" id="xYi-0p-Tii"/>
......@@ -215,7 +213,7 @@
</constraints>
<connections>
<outlet property="mediaItemArtworkImageView" destination="xZd-Hk-h2M" id="J8l-V9-P06"/>
<outlet property="mediaItemDetailTextField" destination="Slp-lt-fZv" id="d3t-41-l5t"/>
<outlet property="mediaItemDetailButton" destination="S5i-gd-zkt" id="SsE-11-GwE"/>
<outlet property="mediaItemFileNameTextField" destination="VxL-BW-3eh" id="fiL-3N-m3P"/>
<outlet property="mediaItemPathTextField" destination="7gY-3s-Kay" id="P4t-h1-m3P"/>
<outlet property="mediaItemTitleTextField" destination="nCe-dY-YMM" id="h3l-p0-w3e"/>
......@@ -228,7 +226,7 @@
<resources>
<image name="no-art" width="128" height="128"/>
<image name="play.fill" catalog="system" width="12" height="13"/>
<image name="plus" catalog="system" width="15" height="13"/>
<image name="plus" catalog="system" width="14" height="13"/>
<namedColor name="VLCAccentColor">
<color red="1" green="0.37999999523162842" blue="0.039999999105930328" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
......
......@@ -30,6 +30,7 @@ NS_ASSUME_NONNULL_BEGIN
- (id<VLCMediaLibraryItemProtocol>)libraryItemAtIndexPath:(NSIndexPath *)indexPath
forCollectionView:(NSCollectionView *)collectionView;
- (NSIndexPath *)indexPathForLibraryItem:(id<VLCMediaLibraryItemProtocol>)libraryItem;
@end
......
......@@ -35,7 +35,7 @@ extern NSCollectionViewSupplementaryElementKind const VLCLibraryCollectionViewMe
@property (readwrite, retain, nonatomic) VLCMediaLibraryMediaItem *representedMediaItem;
@property (readwrite, weak) IBOutlet NSTextField *mediaItemTitleTextField;
@property (readwrite, weak) IBOutlet NSTextField *mediaItemDetailTextField;
@property (readwrite, weak) IBOutlet NSButton *mediaItemDetailButton;
@property (readwrite, weak) IBOutlet NSTextField *mediaItemYearAndDurationTextField;
@property (readwrite, weak) IBOutlet NSTextField *mediaItemFileNameTextField;
@property (readwrite, weak) IBOutlet NSTextField *mediaItemPathTextField;
......
......@@ -35,6 +35,7 @@
#import "library/VLCLibraryImageCache.h"
#import "library/VLCLibraryModel.h"
#import "library/VLCLibraryMenuController.h"
#import "library/VLCLibraryWindow.h"
#import "views/VLCImageView.h"
......@@ -53,8 +54,11 @@ NSCollectionViewSupplementaryElementKind const VLCLibraryCollectionViewMediaItem
- (void)awakeFromNib
{
_mediaItemTitleTextField.font = NSFont.VLCLibrarySubsectionHeaderFont;
_mediaItemDetailTextField.font = NSFont.VLCLibrarySubsectionSubheaderFont;
_mediaItemDetailTextField.textColor = NSColor.VLCAccentColor;
_mediaItemDetailButton.font = NSFont.VLCLibrarySubsectionSubheaderFont;
if (@available(macOS 10.14, *)) {
_mediaItemDetailButton.contentTintColor = NSColor.VLCAccentColor;
}
if(@available(macOS 10.12.2, *)) {
_playMediaItemButton.bezelColor = NSColor.VLCAccentColor;
......@@ -93,11 +97,18 @@ NSCollectionViewSupplementaryElementKind const VLCLibraryCollectionViewMediaItem
}
_mediaItemTitleTextField.stringValue = _representedMediaItem.displayString;
_mediaItemDetailTextField.stringValue = _representedMediaItem.detailString;
_mediaItemDetailButton.title = _representedMediaItem.detailString;
_mediaItemYearAndDurationTextField.stringValue = [self formattedYearAndDurationString];
_mediaItemFileNameTextField.stringValue = _representedMediaItem.inputItem.name;
_mediaItemPathTextField.stringValue = _representedMediaItem.inputItem.decodedMRL;
const BOOL actionableDetail = self.representedMediaItem.actionableDetail;
self.mediaItemDetailButton.enabled = actionableDetail;
if (@available(macOS 10.14, *)) {
self.mediaItemDetailButton.contentTintColor = actionableDetail ? NSColor.VLCAccentColor : NSColor.secondaryLabelColor;
}
self.mediaItemDetailButton.action = @selector(detailAction:);
[VLCLibraryImageCache thumbnailForLibraryItem:_representedMediaItem withCompletion:^(NSImage * const thumbnail) {
self->_mediaItemArtworkImageView.image = thumbnail;
}];
......@@ -121,4 +132,15 @@ NSCollectionViewSupplementaryElementKind const VLCLibraryCollectionViewMediaItem
[_libraryController appendItemToPlaylist:_representedMediaItem playImmediately:NO];
}
- (IBAction)detailAction:(id)sender
{
if (!self.representedMediaItem.actionableDetail) {
return;
}
VLCLibraryWindow * const libraryWindow = VLCMain.sharedInstance.libraryWindow;
id<VLCMediaLibraryItemProtocol> libraryItem = self.representedMediaItem.actionableDetailLibraryItem;
[libraryWindow presentLibraryItem:libraryItem];
}
@end
......@@ -117,6 +117,11 @@ extern const long long int VLCMediaLibraryMediaItemDurationDenominator;
@property (readonly) NSString *detailString;
@property (readonly) NSString *durationString;
@property (readonly) VLCMediaLibraryMediaItem *firstMediaItem;
// If the info in detailString contains a library object that can be used for nav
// We lazy load the actionable library item so avoid using the property until we
// actually need to, resort to `actionableDetail` to know if there is one instead
@property (readonly) BOOL actionableDetail;
@property (readonly) id<VLCMediaLibraryItemProtocol> actionableDetailLibraryItem;
- (void)iterateMediaItemsWithBlock:(void (^)(VLCMediaLibraryMediaItem*))mediaItemBlock;
......@@ -257,10 +262,4 @@ extern const long long int VLCMediaLibraryMediaItemDurationDenominator;
@end
@interface VLCMediaLibraryAllItemsGroup : VLCMediaLibraryDummyItem<VLCMediaLibraryAudioGroupProtocol>
- (nullable instancetype)initWithDisplayString:(NSString *)displayString;
@end
NS_ASSUME_NONNULL_END
......@@ -25,9 +25,6 @@
#import "main/VLCMain.h"
#import "extensions/NSString+Helpers.h"
#import "library/VLCInputItem.h"
#import "library/VLCLibraryImageCache.h"
#import "library/VLCLibraryController.h"
#import "library/VLCLibraryModel.h"
#import <vlc_url.h>
......@@ -46,7 +43,7 @@ typedef vlc_ml_media_list_t* (*library_mediaitem_list_fetch_f)(vlc_medialibrary_
typedef vlc_ml_album_list_t* (*library_album_list_fetch_f)(vlc_medialibrary_t*, const vlc_ml_query_params_t*, int64_t);
typedef vlc_ml_artist_list_t* (*library_artist_list_fetch_f)(vlc_medialibrary_t*, const vlc_ml_query_params_t*, int64_t);
static vlc_medialibrary_t *getMediaLibrary()
static vlc_medialibrary_t *getMediaLibrary(void)
{
intf_thread_t *p_intf = getIntf();
if (!p_intf) {
......@@ -261,6 +258,7 @@ static NSArray<VLCMediaLibraryArtist *> *fetchArtistsForLibraryItem(library_arti
@property (readwrite, assign) int64_t libraryID;
@property (readwrite, assign) BOOL smallArtworkGenerated;
@property (readwrite, assign) BOOL actionableDetail;
@property (readwrite, atomic, strong) NSString *smallArtworkMRL;
@property (readwrite, atomic, strong) NSString *displayString;
@property (readwrite, atomic, strong) NSString *detailString;
......@@ -276,6 +274,12 @@ static NSArray<VLCMediaLibraryArtist *> *fetchArtistsForLibraryItem(library_arti
return nil;
}
- (id<VLCMediaLibraryItemProtocol>)actionableDetailLibraryItem
{
[self doesNotRecognizeSelector:_cmd];
return nil;
}
- (void)moveToTrash
{
[self doesNotRecognizeSelector:_cmd];
......@@ -368,6 +372,7 @@ static NSArray<VLCMediaLibraryArtist *> *fetchArtistsForLibraryItem(library_arti
self.libraryID = p_artist->i_id;
self.smallArtworkGenerated = p_artist->thumbnails[VLC_ML_THUMBNAIL_SMALL].psz_mrl != NULL;
self.smallArtworkMRL = self.smallArtworkGenerated ? toNSStr(p_artist->thumbnails[VLC_ML_THUMBNAIL_SMALL].psz_mrl) : nil;
self.actionableDetail = NO;
_name = toNSStr(p_artist->psz_name);
if ([_name isEqualToString:@""]) {
......@@ -436,6 +441,7 @@ static NSArray<VLCMediaLibraryArtist *> *fetchArtistsForLibraryItem(library_arti
@implementation VLCMediaLibraryAlbum
@synthesize numberOfTracks = _numberOfTracks;
@synthesize actionableDetailLibraryItem = _actionableDetailLibraryItem;
+ (nullable instancetype)albumWithID:(int64_t)albumID
{
......@@ -458,6 +464,7 @@ static NSArray<VLCMediaLibraryArtist *> *fetchArtistsForLibraryItem(library_arti
self.libraryID = p_album->i_id;
self.smallArtworkGenerated = p_album->thumbnails[VLC_ML_THUMBNAIL_SMALL].psz_mrl != NULL;
self.smallArtworkMRL = self.smallArtworkGenerated ? toNSStr(p_album->thumbnails[VLC_ML_THUMBNAIL_SMALL].psz_mrl) : nil;
self.actionableDetail = YES;
_title = toNSStr(p_album->psz_title);
if ([_title isEqualToString:@""]) {
......@@ -504,6 +511,15 @@ static NSArray<VLCMediaLibraryArtist *> *fetchArtistsForLibraryItem(library_arti
return fetchMediaItemsForLibraryItem(vlc_ml_list_album_tracks, self.libraryID);
}
- (id<VLCMediaLibraryItemProtocol>)actionableDetailLibraryItem
{
if (_actionableDetailLibraryItem == nil) {
_actionableDetailLibraryItem = [VLCMediaLibraryArtist artistWithID:self.artistID];
}
return _actionableDetailLibraryItem;
}
- (void)iterateMediaItemsWithBlock:(void (^)(VLCMediaLibraryMediaItem*))mediaItemBlock
{
for(VLCMediaLibraryMediaItem* mediaItem in self.tracksAsMediaItems) {
......@@ -524,6 +540,7 @@ static NSArray<VLCMediaLibraryArtist *> *fetchArtistsForLibraryItem(library_arti
self.libraryID = p_genre->i_id;
self.smallArtworkGenerated = p_genre->thumbnails[VLC_ML_THUMBNAIL_SMALL].psz_mrl != NULL;
self.smallArtworkMRL = self.smallArtworkGenerated ? toNSStr(p_genre->thumbnails[VLC_ML_THUMBNAIL_SMALL].psz_mrl) : nil;
self.actionableDetail = NO;
_name = toNSStr(p_genre->psz_name);
if ([_name isEqualToString:@""]) {
......@@ -620,6 +637,8 @@ static NSArray<VLCMediaLibraryArtist *> *fetchArtistsForLibraryItem(library_arti
@implementation VLCMediaLibraryMediaItem
@synthesize actionableDetailLibraryItem = _actionableDetailLibraryItem;
#pragma mark - initialization
+ (nullable instancetype)mediaItemForLibraryID:(int64_t)libraryID
......@@ -678,10 +697,12 @@ static NSArray<VLCMediaLibraryArtist *> *fetchArtistsForLibraryItem(library_arti
self.libraryID = p_mediaItem->i_id;
self.smallArtworkGenerated = p_mediaItem->thumbnails[VLC_ML_THUMBNAIL_SMALL].psz_mrl != NULL;
self.smallArtworkMRL = self.smallArtworkGenerated ? toNSStr(p_mediaItem->thumbnails[VLC_ML_THUMBNAIL_SMALL].psz_mrl) : nil;
self.actionableDetail = p_mediaItem->i_subtype == VLC_ML_MEDIA_SUBTYPE_ALBUMTRACK;
_p_mediaLibrary = p_mediaLibrary;
_mediaType = p_mediaItem->i_type;
_mediaSubType = p_mediaItem->i_subtype;
NSMutableArray *mutArray = [[NSMutableArray alloc] initWithCapacity:p_mediaItem->p_files->i_nb_items];
for (size_t x = 0; x < p_mediaItem->p_files->i_nb_items; x++) {
VLCMediaLibraryFile *file = [[VLCMediaLibraryFile alloc] initWithFile:&p_mediaItem->p_files->p_items[x]];
......@@ -690,6 +711,7 @@ static NSArray<VLCMediaLibraryArtist *> *fetchArtistsForLibraryItem(library_arti
}
}
_files = [mutArray copy];
mutArray = [[NSMutableArray alloc] initWithCapacity:p_mediaItem->p_tracks->i_nb_items];
for (size_t x = 0; x < p_mediaItem->p_tracks->i_nb_items; x++) {
VLCMediaLibraryTrack *track = [[VLCMediaLibraryTrack alloc] initWithTrack:&p_mediaItem->p_tracks->p_items[x]];
......@@ -701,6 +723,7 @@ static NSArray<VLCMediaLibraryArtist *> *fetchArtistsForLibraryItem(library_arti
}
}
_tracks = [mutArray copy];
_year = p_mediaItem->i_year;
_duration = p_mediaItem->i_duration;
_playCount = p_mediaItem->i_playcount;
......@@ -899,6 +922,15 @@ static NSArray<VLCMediaLibraryArtist *> *fetchArtistsForLibraryItem(library_arti
return self;
}
- (id<VLCMediaLibraryItemProtocol>)actionableDetailLibraryItem
{
if (_mediaSubType == VLC_ML_MEDIA_SUBTYPE_ALBUMTRACK && _actionableDetailLibraryItem == nil) {
_actionableDetailLibraryItem = [VLCMediaLibraryAlbum albumWithID:self.albumID];
}
return _actionableDetailLibraryItem;
}
- (void)iterateMediaItemsWithBlock:(void (^)(VLCMediaLibraryMediaItem*))mediaItemBlock;
{
mediaItemBlock(self);
......@@ -1178,6 +1210,8 @@ static NSArray<VLCMediaLibraryArtist *> *fetchArtistsForLibraryItem(library_arti
@synthesize libraryID = _libraryId;
@synthesize smallArtworkGenerated = _smallArtworkGenerated;
@synthesize smallArtworkMRL = _smallArtworkMRL;
@synthesize actionableDetail = _actionableDetail;
@synthesize actionableDetailLibraryItem = _actionableDetailLibraryItem;
- (instancetype)initWithDisplayString:(NSString*)displayString
withDetailString:(NSString*)detailString
......@@ -1190,40 +1224,28 @@ static NSArray<VLCMediaLibraryArtist *> *fetchArtistsForLibraryItem(library_arti
_libraryId = -1;
_smallArtworkGenerated = NO;
_smallArtworkMRL = @"";
_actionableDetail = NO;
_actionableDetailLibraryItem = nil;
}
return self;
}
- (void)iterateMediaItemsWithBlock:(nonnull void (^)(VLCMediaLibraryMediaItem * _Nonnull))mediaItemBlock
- (void)moveToTrash
{
[self doesNotRecognizeSelector:_cmd];
return;
}
- (void)revealInFinder
{
[self doesNotRecognizeSelector:_cmd];
return;
}
@end
@implementation VLCMediaLibraryAllItemsGroup
@synthesize albums = _albums;
@synthesize artists = _artists;
@synthesize numberOfTracks = _numberOfTracks;
@synthesize tracksAsMediaItems = _tracksAsMediaItems;
- (instancetype)initWithDisplayString:(NSString *)displayString
- (void)iterateMediaItemsWithBlock:(nonnull void (^)(VLCMediaLibraryMediaItem * _Nonnull))mediaItemBlock
{
VLCLibraryModel * const libraryModel = VLCMain.sharedInstance.libraryController.libraryModel;
_albums = libraryModel.listOfAlbums;
_artists = libraryModel.listOfArtists;
_numberOfTracks = libraryModel.numberOfAudioMedia;
_tracksAsMediaItems = libraryModel.listOfAudioMedia;
NSString * const detailString = [NSString stringWithFormat:_NS("%li albums, %li songs"), _albums.count, _tracksAsMediaItems.count];
return [super initWithDisplayString:displayString withDetailString:detailString];
[self doesNotRecognizeSelector:_cmd];
return;
}
@end
......@@ -28,6 +28,7 @@ NS_ASSUME_NONNULL_BEGIN
@protocol VLCLibraryTableViewDataSource <NSTableViewDataSource>
- (NSInteger)rowForLibraryItem:(id<VLCMediaLibraryItemProtocol>)libraryItem;
- (id<VLCMediaLibraryItemProtocol>)libraryItemAtRow:(NSInteger)row
forTableView:(NSTableView *)tableView;
......
......@@ -38,6 +38,8 @@ NS_ASSUME_NONNULL_BEGIN
@class VLCPlaylistSortingMenuController;
@class VLCCustomEmptyLibraryBrowseButton;
@protocol VLCMediaLibraryItemProtocol;
typedef NS_ENUM(NSUInteger, VLCLibrarySegment) {
VLCLibraryVideoSegment = 0,
VLCLibraryMusicSegment,
......@@ -150,6 +152,8 @@ extern const NSUserInterfaceItemIdentifier VLCLibraryWindowIdentifier;
- (void)showControlsBar;
- (void)updateGridVsListViewModeSegmentedControl;
- (void)presentLibraryItem:(id<VLCMediaLibraryItemProtocol>)libraryItem;
- (IBAction)playlistDoubleClickAction:(id)sender;
- (IBAction)shuffleAction:(id)sender;
- (IBAction)repeatAction:(id)sender;
......
......@@ -614,6 +614,42 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
}
}
- (void)presentAudioLibraryItem:(id<VLCMediaLibraryItemProtocol>)libraryItem
{
[self showAudioLibrary];
[self.libraryAudioViewController presentLibraryItem:libraryItem];
}
- (void)presentVideoLibraryItem:(id<VLCMediaLibraryItemProtocol>)libraryItem
{
[self showVideoLibrary];
[self.libraryVideoViewController presentLibraryItem:libraryItem];
}
- (void)presentLibraryItem:(id<VLCMediaLibraryItemProtocol>)libraryItem
{
const BOOL isAudioGroup = [libraryItem isKindOfClass:VLCMediaLibraryAlbum.class] ||
[libraryItem isKindOfClass:VLCMediaLibraryArtist.class] ||
[libraryItem isKindOfClass:VLCMediaLibraryGenre.class];
if (isAudioGroup) {
[self presentAudioLibraryItem:libraryItem];
return;
}
VLCMediaLibraryMediaItem * const mediaItem = (VLCMediaLibraryMediaItem *)libraryItem;
const BOOL validMediaItem = mediaItem != nil;
if (validMediaItem && mediaItem.mediaType == VLC_ML_MEDIA_TYPE_AUDIO) {
[self presentAudioLibraryItem:libraryItem];
return;
} else if (validMediaItem && mediaItem.mediaType == VLC_ML_MEDIA_TYPE_VIDEO) {
[self presentVideoLibraryItem:libraryItem];
return;
}
NSLog(@"Unknown kind of library item provided, cannot present library view for it: %@", libraryItem.displayString);
}
- (IBAction)playlistDoubleClickAction:(id)sender
{
NSInteger selectedRow = self.playlistTableView.selectedRow;
......
......@@ -42,7 +42,7 @@ extern NSString * const VLCLibraryAlbumTableCellTableViewColumnIdentifier;
@property (readwrite, assign) IBOutlet VLCTrackingView *trackingView;
@property (readwrite, assign) IBOutlet VLCImageView *representedImageView;
@property (readwrite, assign) IBOutlet NSTextField *albumNameTextField;
@property (readwrite, assign) IBOutlet NSTextField *artistNameTextField;
@property (readwrite, assign) IBOutlet NSButton *artistNameTextButton;
@property (readwrite, assign) IBOutlet NSTextField *summaryTextField;
@property (readwrite, assign) IBOutlet NSTextField *yearTextField;
@property (readwrite, assign) IBOutlet NSButton *playInstantlyButton;
......@@ -51,6 +51,7 @@ extern NSString * const VLCLibraryAlbumTableCellTableViewColumnIdentifier;
@property (readwrite, assign, nonatomic) VLCMediaLibraryAlbum *representedAlbum;
- (IBAction)playInstantly:(id)sender;
- (IBAction)detailAction:(id)sender;
@end
......
......@@ -39,6 +39,7 @@
#import "library/VLCLibraryTableCellView.h"
#import "library/VLCLibraryTableView.h"
#import "library/VLCLibraryUIUnits.h"
#import "library/VLCLibraryWindow.h"
#import "library/audio-library/VLCLibraryAlbumTracksDataSource.h"
#import "library/audio-library/VLCLibraryAlbumTracksTableViewDelegate.h"
......@@ -80,13 +81,13 @@ const CGFloat VLCLibraryAlbumTableCellViewDefaultHeight = 168.;
}
const CGFloat artworkAndSecondaryLabelsHeight = VLCLibraryUIUnits.largeSpacing +
_representedImageView.frame.size.height +
_representedImageView.frame.size.height +
VLCLibraryUIUnits.mediumSpacing +
_summaryTextField.frame.size.height +
_summaryTextField.frame.size.height +
VLCLibraryUIUnits.smallSpacing +
_yearTextField.frame.size.height +
_yearTextField.frame.size.height +
VLCLibraryUIUnits.largeSpacing;
if(_tracksTableView == nil) {
return artworkAndSecondaryLabelsHeight;
}
......@@ -94,7 +95,7 @@ const CGFloat VLCLibraryAlbumTableCellViewDefaultHeight = 168.;
const CGFloat titleAndTableViewHeight = VLCLibraryUIUnits.largeSpacing +
_albumNameTextField.frame.size.height +
VLCLibraryUIUnits.smallSpacing +
_artistNameTextField.frame.size.height +
_artistNameTextButton.frame.size.height +
VLCLibraryUIUnits.smallSpacing +
[self expectedTableViewHeight] +
VLCLibraryUIUnits.largeSpacing;
......@@ -122,9 +123,13 @@ const CGFloat VLCLibraryAlbumTableCellViewDefaultHeight = 168.;
{
[self setupTracksTableView];
self.albumNameTextField.font = NSFont.VLCLibrarySubsectionHeaderFont;
self.artistNameTextField.font = NSFont.VLCLibrarySubsectionSubheaderFont;
self.artistNameTextButton.font = NSFont.VLCLibrarySubsectionSubheaderFont;
self.artistNameTextButton.action = @selector(detailAction:);
self.trackingView.viewToHide = self.playInstantlyButton;
self.artistNameTextField.textColor = NSColor.VLCAccentColor;
if (@available(macOS 10.14, *)) {
self.artistNameTextButton.contentTintColor = NSColor.VLCAccentColor;
}
[self prepareForReuse];
......@@ -164,12 +169,12 @@ const CGFloat VLCLibraryAlbumTableCellViewDefaultHeight = 168.;
VLCLibraryUIUnits.largeSpacing,
VLCLibraryUIUnits.largeSpacing,
VLCLibraryUIUnits.largeSpacing];
NSString *verticalVisualContraints = [NSString stringWithFormat:@"V:|-%f-[_albumNameTextField]-%f-[_artistNameTextField]-%f-[_tracksTableView]->=%f-|",
NSString *verticalVisualContraints = [NSString stringWithFormat:@"V:|-%f-[_albumNameTextField]-%f-[_artistNameTextButton]-%f-[_tracksTableView]->=%f-|",
VLCLibraryUIUnits.largeSpacing,
VLCLibraryUIUnits.smallSpacing,
VLCLibraryUIUnits.mediumSpacing,
VLCLibraryUIUnits.largeSpacing];
NSDictionary *dict = NSDictionaryOfVariableBindings(_tracksTableView, _representedImageView, _albumNameTextField, _artistNameTextField);
NSDictionary *dict = NSDictionaryOfVariableBindings(_tracksTableView, _representedImageView, _albumNameTextField, _artistNameTextButton);
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:horizontalVisualConstraints options:0 metrics:0 views:dict]];
[self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:verticalVisualContraints options:0 metrics:0 views:dict]];
......@@ -186,12 +191,16 @@ const CGFloat VLCLibraryAlbumTableCellViewDefaultHeight = 168.;
self.representedImageView.image = nil;
self.albumNameTextField.stringValue = @"";
self.artistNameTextField.stringValue = @"";
self.artistNameTextButton.title = @"";
self.yearTextField.stringValue = @"";
self.summaryTextField.stringValue = @"";
self.yearTextField.hidden = NO;
self.playInstantlyButton.hidden = YES;
if (@available(macOS 10.14, *)) {
self.artistNameTextButton.contentTintColor = NSColor.VLCAccentColor;
}
_tracksDataSource.representedAlbum = nil;
[_tracksTableView reloadData];
}
......@@ -241,12 +250,23 @@ const CGFloat VLCLibraryAlbumTableCellViewDefaultHeight = 168.;
}
}
- (void)detailAction:(id)sender
{
if (!self.representedAlbum.actionableDetail) {
return;
}
VLCLibraryWindow * const libraryWindow = VLCMain.sharedInstance.libraryWindow;
id<VLCMediaLibraryItemProtocol> libraryItem = self.representedAlbum.actionableDetailLibraryItem;
[libraryWindow presentLibraryItem:libraryItem];
}
- (void)setRepresentedAlbum:(VLCMediaLibraryAlbum *)representedAlbum
{
_representedAlbum = representedAlbum;
self.albumNameTextField.stringValue = _representedAlbum.title;
self.artistNameTextField.stringValue = _representedAlbum.artistName;
self.artistNameTextButton.title = _representedAlbum.artistName;
if (_representedAlbum.year > 0) {
self.yearTextField.intValue = _representedAlbum.year;
} else {
......@@ -259,6 +279,12 @@ const CGFloat VLCLibraryAlbumTableCellViewDefaultHeight = 168.;
self.summaryTextField.stringValue = _representedAlbum.durationString;
}
const BOOL actionableDetail = self.representedAlbum.actionableDetail;
self.artistNameTextButton.enabled = actionableDetail;
if (@available(macOS 10.14, *)) {
self.artistNameTextButton.contentTintColor = actionableDetail ? NSColor.VLCAccentColor : NSColor.secondaryLabelColor;
}
[VLCLibraryImageCache thumbnailForLibraryItem:_representedAlbum withCompletion:^(NSImage * const thumbnail) {
self.representedImageView.image = thumbnail;
}];
......
......@@ -89,4 +89,23 @@ const CGFloat VLCLibraryTracksRowHeight = 40.;
return self.tracks[row];
}
- (NSInteger)rowForLibraryItem:(id<VLCMediaLibraryItemProtocol>)libraryItem
{
if (libraryItem == nil) {
return NSNotFound;
}
NSArray<id<VLCMediaLibraryItemProtocol>> * const libraryItems = self.tracks;
const NSUInteger itemCount = libraryItems.count;
for (NSUInteger i = 0; i < itemCount; ++i) {
const id<VLCMediaLibraryItemProtocol> collectionItem = [libraryItems objectAtIndex:i];
if (collectionItem.libraryID == libraryItem.libraryID) {
return i;
}
}
return NSNotFound;
}
@end
/*****************************************************************************
* VLCLibraryAllAudioGroupsMediaLibraryItem.h: MacOS X interface module
*****************************************************************************
* 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 "library/VLCLibraryDataTypes.h"
NS_ASSUME_NONNULL_BEGIN
@interface VLCLibraryAllAudioGroupsMediaLibraryItem : VLCMediaLibraryDummyItem<VLCMediaLibraryAudioGroupProtocol>
- (nullable instancetype)initWithDisplayString:(NSString *)displayString;
@end
NS_ASSUME_NONNULL_END
/*****************************************************************************
* VLCLibraryAllAudioGroupsMediaLibraryItem.m: MacOS X interface module
*****************************************************************************
* 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 "VLCLibraryAllAudioGroupsMediaLibraryItem.h"
#import "extensions/NSString+Helpers.h"
#import "main/VLCMain.h"
#import "library/VLCLibraryController.h"
#import "library/VLCLibraryModel.h"
@implementation VLCLibraryAllAudioGroupsMediaLibraryItem
@synthesize albums = _albums;
@synthesize artists = _artists;
@synthesize numberOfTracks = _numberOfTracks;
@synthesize tracksAsMediaItems = _tracksAsMediaItems;
- (instancetype)initWithDisplayString:(NSString *)displayString
{
VLCLibraryModel * const libraryModel = VLCMain.sharedInstance.libraryController.libraryModel;
_albums = libraryModel.listOfAlbums;
_artists = libraryModel.listOfArtists;
_numberOfTracks = libraryModel.numberOfAudioMedia;
_tracksAsMediaItems = libraryModel.listOfAudioMedia;
const NSUInteger numberOfAlbums = libraryModel.numberOfAlbums;
NSString * const detailString = [NSString stringWithFormat:_NS("%li albums, %li songs"), numberOfAlbums, _numberOfTracks];
return [super initWithDisplayString:displayString withDetailString:detailString];
}
@end
......@@ -54,6 +54,8 @@ extern NSString * const VLCLibraryAlbumSortDescriptorKey;
extern NSString * const VLCLibraryPlayCountSortDescriptorKey;
extern NSString * const VLCLibraryYearSortDescriptorKey;
extern NSString * const VLCLibraryAudioDataSourceDisplayedCollectionChangedNotification;
@interface VLCLibraryAudioDataSource : NSObject <VLCLibraryTableViewDataSource, VLCLibraryCollectionViewDataSource>
@property (readwrite, assign) VLCLibraryModel *libraryModel;
......@@ -65,6 +67,8 @@ extern NSString * const VLCLibraryYearSortDescriptorKey;
@property (nonatomic, readwrite, assign) VLCAudioLibrarySegment audioLibrarySegment;
@property (readonly) BOOL displayedCollectionUpdating;
+ (void)setupCollectionView:(NSCollectionView *)collectionView;
- (void)setup;
......
......@@ -36,6 +36,7 @@
#import "library/VLCLibraryCollectionViewMediaItemSupplementaryDetailView.h"
#import "library/audio-library/VLCLibraryAlbumTableCellView.h"
#import "library/audio-library/VLCLibraryAllAudioGroupsMediaLibraryItem.h"
#import "library/audio-library/VLCLibraryAudioGroupDataSource.h"
#import "library/audio-library/VLCLibraryCollectionViewAlbumSupplementaryDetailView.h"
#import "library/audio-library/VLCLibraryCollectionViewAudioGroupSupplementaryDetailView.h"
......@@ -69,6 +70,8 @@ NSString * const VLCLibraryPlayCountSortDescriptorKey = @"VLCLibraryPlayCountSor
NSString * const VLCLibraryYearSortDescriptorKey = @"VLCLibraryYearSortDescriptorKey";
// TODO: Add sorting by genre
NSString * const VLCLibraryAudioDataSourceDisplayedCollectionChangedNotification = @"VLCLibraryAudioDataSourceDisplayedCollectionChangedNotification";
@interface VLCLibraryAudioDataSource ()
{
enum vlc_ml_parent_type _currentParentType;
......@@ -143,6 +146,8 @@ NSString * const VLCLibraryYearSortDescriptorKey = @"VLCLibraryYearSortDescripto
selector:@selector(currentlyPlayingItemChanged:)
name:VLCPlayerCurrentMediaItemChanged
object:nil];
_displayedCollectionUpdating = NO;
}
return self;
......@@ -481,17 +486,19 @@ NSString * const VLCLibraryYearSortDescriptorKey = @"VLCLibraryYearSortDescripto
- (void)reloadData
{
_displayedCollectionUpdating = YES;
dispatch_async(dispatch_get_main_queue(), ^{
self.displayedCollection = [self collectionToDisplay];
if (self.displayAllArtistsGenresTableEntry) {
NSMutableArray * const mutableCollectionCopy = self.displayedCollection.mutableCopy;
VLCMediaLibraryAllItemsGroup *group;
VLCLibraryAllAudioGroupsMediaLibraryItem *group;
if (self->_currentParentType == VLC_ML_PARENT_GENRE) {
group = [[VLCMediaLibraryAllItemsGroup alloc] initWithDisplayString:_NS("All genres")];
group = [[VLCLibraryAllAudioGroupsMediaLibraryItem alloc] initWithDisplayString:_NS("All genres")];
} else if (self->_currentParentType == VLC_ML_PARENT_ARTIST) {
group = [[VLCMediaLibraryAllItemsGroup alloc] initWithDisplayString:_NS("All artists")];
group = [[VLCLibraryAllAudioGroupsMediaLibraryItem alloc] initWithDisplayString:_NS("All artists")];
}
NSAssert(group != nil, @"All items group should not be nil");
......@@ -499,12 +506,16 @@ NSString * const VLCLibraryYearSortDescriptorKey = @"VLCLibraryYearSortDescripto
self.displayedCollection = mutableCollectionCopy;
}
self->_displayedCollectionUpdating = NO;
[self resetLayoutsForOperation:^{
[self.collectionView reloadData];
[self.gridModeListTableView reloadData];
[self.collectionSelectionTableView reloadData];
[self.songsTableView reloadData];
}];
[NSNotificationCenter.defaultCenter postNotificationName:VLCLibraryAudioDataSourceDisplayedCollectionChangedNotification object:self];
});
}
......@@ -570,6 +581,8 @@ NSString * const VLCLibraryYearSortDescriptorKey = @"VLCLibraryYearSortDescripto
return;
}
_displayedCollectionUpdating = YES;
_audioLibrarySegment = audioLibrarySegment;
switch (_audioLibrarySegment) {
case VLCAudioLibraryArtistsSegment:
......@@ -611,6 +624,15 @@ NSString * const VLCLibraryYearSortDescriptorKey = @"VLCLibraryYearSortDescripto
return self.displayedCollection.count;
}
- (NSInteger)rowForLibraryItem:(id<VLCMediaLibraryItemProtocol>)libraryItem
{
if (libraryItem == nil) {
return NSNotFound;
}
return [self indexForMediaLibraryItemWithId:libraryItem.libraryID];
}
- (id<VLCMediaLibraryItemProtocol>)libraryItemAtRow:(NSInteger)row
forTableView:(NSTableView *)tableView
{
......@@ -638,7 +660,7 @@ NSString * const VLCLibraryYearSortDescriptorKey = @"VLCLibraryYearSortDescripto
return;
}
if (_currentParentType == VLC_ML_PARENT_UNKNOWN || selectedRow < 0) {
if (_currentParentType == VLC_ML_PARENT_UNKNOWN || selectedRow < 0 || _displayedCollectionUpdating) {
_audioGroupDataSource.representedAudioGroup = nil;
} else {
_audioGroupDataSource.representedAudioGroup = self.displayedCollection[selectedRow];
......@@ -792,4 +814,14 @@ viewForSupplementaryElementOfKind:(NSCollectionViewSupplementaryElementKind)kind
return self.displayedCollection[indexPathItem];
}
- (NSIndexPath *)indexPathForLibraryItem:(id<VLCMediaLibraryItemProtocol>)libraryItem
{
const NSInteger libraryItemRow = [self rowForLibraryItem:libraryItem];
if (libraryItemRow == NSNotFound) {
return nil;
}
return [NSIndexPath indexPathForItem:libraryItemRow inSection:0];
}
@end