[vlc-commits] [Git][videolan/vlc][master] 12 commits: macosx: Do not apply thumbnail for album in album table cell view if the...
Steve Lhomme (@robUx4)
gitlab at videolan.org
Sat Dec 7 17:56:19 UTC 2024
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
75fba7a3 by Claudio Cambra at 2024-12-07T17:08:52+00:00
macosx: Do not apply thumbnail for album in album table cell view if the view's represented album changed
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
ad66a674 by Claudio Cambra at 2024-12-07T17:08:52+00:00
macosx: Do not apply media source collection view item's thumbnail if the represented item changed during fetch
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
52484000 by Claudio Cambra at 2024-12-07T17:08:52+00:00
macosx: Do not set carousel view item view's thumbnail if the item changed during retrieval
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
475a2225 by Claudio Cambra at 2024-12-07T17:08:52+00:00
macosx: Do not set library collection view item's thumbnail if the represented item changed during fetch
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
af8c65aa by Claudio Cambra at 2024-12-07T17:08:52+00:00
macosx: Do not media item list supplmentary detail view's thumbnail if the represented item changed during retreival
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
855edbed by Claudio Cambra at 2024-12-07T17:08:52+00:00
macosx: Do not apply thumbnail for media item supplementary detail view if its represented item changed during fetch
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
0f3ab9b1 by Claudio Cambra at 2024-12-07T17:08:52+00:00
macosx: Do not apply image on hero view if its represented item changed during fetch
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
afb0480f by Claudio Cambra at 2024-12-07T17:08:52+00:00
macosx: Do not set image for table cell view if the represented item or input item changed during fetch
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
e75f429c by Claudio Cambra at 2024-12-07T17:08:52+00:00
macosx: Do not set information window's image if the set of represented input items changed during the thumbnail fetch
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
6d0c889a by Claudio Cambra at 2024-12-07T17:08:52+00:00
macosx: Do not set thumbnail on play queue table cell view if the represented item changed during fetch
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
a221caaf by Claudio Cambra at 2024-12-07T17:08:52+00:00
macosx: Do not set audio media decorative view's image if the current playing item changed during fetch
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
91cc4092 by Claudio Cambra at 2024-12-07T17:08:52+00:00
macosx: Nilify inputItem/representedItem when one is set over the other in VLCLibraryTableCellView
Helps make the switch over in time more obvious and also ensures certain
procedures (e.g. checking if the current item/input item has changed
during async thumbnail fetch) can properly detech item changes
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
11 changed files:
- modules/gui/macosx/library/VLCLibraryCarouselViewItemView.m
- modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
- modules/gui/macosx/library/VLCLibraryCollectionViewMediaItemListSupplementaryDetailView.m
- modules/gui/macosx/library/VLCLibraryCollectionViewMediaItemSupplementaryDetailView.m
- modules/gui/macosx/library/VLCLibraryHeroView.m
- modules/gui/macosx/library/VLCLibraryTableCellView.m
- modules/gui/macosx/library/audio-library/VLCLibraryAlbumTableCellView.m
- modules/gui/macosx/library/media-source/VLCMediaSourceCollectionViewItem.m
- modules/gui/macosx/panels/VLCInformationWindowController.m
- modules/gui/macosx/playqueue/VLCPlayQueueTableCellView.m
- modules/gui/macosx/windows/video/VLCMainVideoViewAudioMediaDecorativeView.m
Changes:
=====================================
modules/gui/macosx/library/VLCLibraryCarouselViewItemView.m
=====================================
@@ -115,6 +115,9 @@
const id<VLCMediaLibraryItemProtocol> actualItem = self.representedItem.item;
[VLCLibraryImageCache thumbnailForLibraryItem:actualItem withCompletion:^(NSImage * const thumbnail) {
+ if (self.representedItem.item != actualItem) {
+ return;
+ }
self.imageView.image = thumbnail;
}];
=====================================
modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
=====================================
@@ -221,6 +221,9 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
[VLCLibraryImageCache thumbnailForLibraryItem:actualItem
withCompletion:^(NSImage * const thumbnail) {
+ if (self.representedItem.item != actualItem) {
+ return;
+ }
self.mediaImageView.image = thumbnail;
}];
=====================================
modules/gui/macosx/library/VLCLibraryCollectionViewMediaItemListSupplementaryDetailView.m
=====================================
@@ -148,6 +148,9 @@ NSCollectionViewSupplementaryElementKind const VLCLibraryCollectionViewMediaItem
}
[VLCLibraryImageCache thumbnailForLibraryItem:item withCompletion:^(NSImage * const thumbnail) {
+ if (self.representedItem.item != item) {
+ return;
+ }
self.artworkImageView.image = thumbnail;
}];
=====================================
modules/gui/macosx/library/VLCLibraryCollectionViewMediaItemSupplementaryDetailView.m
=====================================
@@ -120,6 +120,9 @@ NSCollectionViewSupplementaryElementKind const VLCLibraryCollectionViewMediaItem
}
[VLCLibraryImageCache thumbnailForLibraryItem:actualItem withCompletion:^(NSImage * const thumbnail) {
+ if (self.representedItem.item != actualItem) {
+ return;
+ }
self->_mediaItemArtworkImageView.image = thumbnail;
}];
}
=====================================
modules/gui/macosx/library/VLCLibraryHeroView.m
=====================================
@@ -66,6 +66,9 @@
self.titleTextField.stringValue = actualItem.displayString;
self.detailTextField.stringValue = actualItem.primaryDetailString;
[VLCLibraryImageCache thumbnailForLibraryItem:actualItem withCompletion:^(NSImage * const image) {
+ if (self.representedItem.item != actualItem) {
+ return;
+ }
self.largeImageView.image = image;
}];
}
=====================================
modules/gui/macosx/library/VLCLibraryTableCellView.m
=====================================
@@ -72,6 +72,8 @@ NSString * const VLCLibraryTableCellViewIdentifier = @"VLCLibraryTableCellViewId
- (void)setRepresentedItem:(VLCLibraryRepresentedItem *)representedItem
{
_representedItem = representedItem;
+ _representedInputItem = nil; // Reset and ensure the change is obvious
+
id<VLCMediaLibraryItemProtocol> const actualItem = representedItem.item;
NSAssert(actualItem != nil, @"Should not update nil represented item!");
@@ -80,6 +82,9 @@ NSString * const VLCLibraryTableCellViewIdentifier = @"VLCLibraryTableCellViewId
self.playInstantlyButton.target = self;
[VLCLibraryImageCache thumbnailForLibraryItem:actualItem withCompletion:^(NSImage * const thumbnail) {
+ if (self.representedItem.item != actualItem) {
+ return;
+ }
self.representedImageView.image = thumbnail;
}];
@@ -97,11 +102,15 @@ NSString * const VLCLibraryTableCellViewIdentifier = @"VLCLibraryTableCellViewId
- (void)setRepresentedInputItem:(VLCInputItem *)representedInputItem
{
_representedInputItem = representedInputItem;
+ _representedItem = nil; // Reset and ensure the change is obvious
self.singlePrimaryTitleTextField.hidden = NO;
self.singlePrimaryTitleTextField.stringValue = _representedInputItem.name;
[VLCLibraryImageCache thumbnailForInputItem:self->_representedInputItem withCompletion:^(NSImage * const thumbnail) {
+ if (representedInputItem != self->_representedInputItem) {
+ return;
+ }
self->_representedImageView.image = thumbnail;
}];
=====================================
modules/gui/macosx/library/audio-library/VLCLibraryAlbumTableCellView.m
=====================================
@@ -328,6 +328,9 @@ const CGFloat VLCLibraryAlbumTableCellViewDefaultHeight = 168.;
}
[VLCLibraryImageCache thumbnailForLibraryItem:album withCompletion:^(NSImage * const thumbnail) {
+ if (self.representedItem.item != album) {
+ return;
+ }
self.representedImageView.image = thumbnail;
}];
=====================================
modules/gui/macosx/library/media-source/VLCMediaSourceCollectionViewItem.m
=====================================
@@ -125,8 +125,14 @@ NSString *VLCMediaSourceCellIdentifier = @"VLCLibraryCellIdentifier";
return;
}
- _mediaTitleTextField.stringValue = _representedInputItem.name;
- [VLCLibraryImageCache thumbnailForInputItem:self->_representedInputItem withCompletion:^(NSImage * const thumbnail) {
+ VLCInputItem * const inputItem = _representedInputItem;
+ _mediaTitleTextField.stringValue = inputItem.name;
+
+ [VLCLibraryImageCache thumbnailForInputItem:inputItem
+ withCompletion:^(NSImage * const thumbnail) {
+ if (self->_representedInputItem != inputItem) {
+ return;
+ }
self->_mediaImageView.image = thumbnail;
}];
=====================================
modules/gui/macosx/panels/VLCInformationWindowController.m
=====================================
@@ -301,7 +301,8 @@ _##field##TextField.delegate = self
}
NSParameterAssert(inputItems.count > 0);
- _representedInputItems = inputItems.copy;
+ NSArray<VLCInputItem *> * const nonMutableInputItems = inputItems.copy;
+ _representedInputItems = nonMutableInputItems;
NSMutableSet * const artworkMrlSet = NSMutableSet.set;
@@ -326,6 +327,10 @@ _##field##TextField.delegate = self
dispatch_group_enter(group);
[VLCLibraryImageCache thumbnailForLibraryItem:mediaItem
withCompletion:^(NSImage * const image) {
+ if (nonMutableInputItems != self.representedInputItems) {
+ dispatch_group_leave(group);
+ return;
+ }
if (image) {
[artworkImages addObject:image];
}
@@ -378,6 +383,10 @@ _##field##TextField.delegate = self
dispatch_group_enter(group);
[VLCLibraryImageCache thumbnailForInputItem:item
withCompletion:^(NSImage * const image) {
+ if (representedInputItems != self.representedInputItems) {
+ dispatch_group_leave(group);
+ return;
+ }
if (image) {
[artworkImages addObject:image];
}
=====================================
modules/gui/macosx/playqueue/VLCPlayQueueTableCellView.m
=====================================
@@ -79,6 +79,9 @@
- (void)setRepresentedPlayQueueItem:(VLCPlayQueueItem *)item
{
[VLCLibraryImageCache thumbnailForPlayQueueItem:item withCompletion:^(NSImage * const thumbnail) {
+ if (item != self.representedPlayQueueItem) {
+ return;
+ }
self.audioArtworkImageView.image = thumbnail;
self.mediaImageView.image = thumbnail;
}];
=====================================
modules/gui/macosx/windows/video/VLCMainVideoViewAudioMediaDecorativeView.m
=====================================
@@ -60,9 +60,13 @@
{
VLCPlayerController * const controller =
VLCMain.sharedInstance.playQueueController.playerController;
+ VLCInputItem * const currentInputItem = controller.currentMedia;
if (controller.currentMedia) {
- [VLCLibraryImageCache thumbnailForInputItem:controller.currentMedia
+ [VLCLibraryImageCache thumbnailForInputItem:currentInputItem
withCompletion:^(NSImage * const thumbnail) {
+ if (currentInputItem != controller.currentMedia) {
+ return;
+ }
[self setCoverArt:thumbnail];
}];
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e09283e428e4fa0ba7663243de7b4f198a86c6e2...91cc4092bfa0c9f27292deac0332b95dc343e41a
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/e09283e428e4fa0ba7663243de7b4f198a86c6e2...91cc4092bfa0c9f27292deac0332b95dc343e41a
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list