[vlc-commits] macosx: fix compilation broken in 5961eeaa
Felix Paul Kühne
git at videolan.org
Wed Jun 26 20:28:17 CEST 2019
vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Wed Jun 26 20:21:26 2019 +0200| [1ccb8dfc7a96545e3194dd6740803171d05d5aa9] | committer: Felix Paul Kühne
macosx: fix compilation broken in 5961eeaa
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1ccb8dfc7a96545e3194dd6740803171d05d5aa9
---
modules/gui/macosx/library/VLCLibraryAlbumTableCellView.m | 6 +++---
modules/gui/macosx/library/VLCLibraryAudioDataSource.m | 6 +++---
modules/gui/macosx/library/VLCLibraryCollectionViewItem.m | 4 ++--
modules/gui/macosx/library/VLCLibraryController.m | 11 ++++++++++-
modules/gui/macosx/library/VLCLibraryDataTypes.h | 4 ++--
modules/gui/macosx/library/VLCLibraryDataTypes.m | 10 +++++-----
6 files changed, 25 insertions(+), 16 deletions(-)
diff --git a/modules/gui/macosx/library/VLCLibraryAlbumTableCellView.m b/modules/gui/macosx/library/VLCLibraryAlbumTableCellView.m
index ec216b9415..5c670a119d 100644
--- a/modules/gui/macosx/library/VLCLibraryAlbumTableCellView.m
+++ b/modules/gui/macosx/library/VLCLibraryAlbumTableCellView.m
@@ -159,9 +159,9 @@ const CGFloat VLCLibraryTracksRowHeight = 50.;
VLCMediaLibraryMediaItem *mediaItem = _tracks[row];
NSImage *image;
- if (mediaItem.artworkGenerated) {
- if (mediaItem.artworkMRL.length > 0) {
- image = [[NSImage alloc] initWithContentsOfURL:[NSURL URLWithString:mediaItem.artworkMRL]];
+ if (mediaItem.smallArtworkGenerated) {
+ if (mediaItem.smallArtworkMRL.length > 0) {
+ image = [[NSImage alloc] initWithContentsOfURL:[NSURL URLWithString:mediaItem.smallArtworkMRL]];
}
}
if (!image) {
diff --git a/modules/gui/macosx/library/VLCLibraryAudioDataSource.m b/modules/gui/macosx/library/VLCLibraryAudioDataSource.m
index c0713eb6c4..cb3adc788e 100644
--- a/modules/gui/macosx/library/VLCLibraryAudioDataSource.m
+++ b/modules/gui/macosx/library/VLCLibraryAudioDataSource.m
@@ -156,9 +156,9 @@ static NSString *VLCAudioLibraryCellIdentifier = @"VLCAudioLibraryCellIdentifier
VLCMediaLibraryMediaItem *mediaItem = listOfAudioMedia[row];
NSImage *image;
- if (mediaItem.artworkGenerated) {
- if (mediaItem.artworkMRL.length > 0) {
- image = [[NSImage alloc] initWithContentsOfURL:[NSURL URLWithString:mediaItem.artworkMRL]];
+ if (mediaItem.smallArtworkGenerated) {
+ if (mediaItem.smallArtworkMRL.length > 0) {
+ image = [[NSImage alloc] initWithContentsOfURL:[NSURL URLWithString:mediaItem.smallArtworkMRL]];
}
}
if (!image) {
diff --git a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
index a35a9ff405..ac97cfe211 100644
--- a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
+++ b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m
@@ -186,8 +186,8 @@ const CGFloat VLCLibraryCollectionViewItemMaximumDisplayedProgress = 0.95;
- (NSImage *)imageForMedia
{
NSImage *image;
- if (_representedMediaItem.artworkGenerated) {
- image = [[NSImage alloc] initWithContentsOfURL:[NSURL URLWithString:_representedMediaItem.artworkMRL]];
+ if (_representedMediaItem.smallArtworkGenerated) {
+ image = [[NSImage alloc] initWithContentsOfURL:[NSURL URLWithString:_representedMediaItem.smallArtworkMRL]];
} else {
if (_representedMediaItem.mediaType != VLC_ML_MEDIA_TYPE_AUDIO) {
[_libraryController attemptToGenerateThumbnailForMediaItem:_representedMediaItem];
diff --git a/modules/gui/macosx/library/VLCLibraryController.m b/modules/gui/macosx/library/VLCLibraryController.m
index 0d882e72e3..2a2194b670 100644
--- a/modules/gui/macosx/library/VLCLibraryController.m
+++ b/modules/gui/macosx/library/VLCLibraryController.m
@@ -30,6 +30,10 @@
#import <vlc_media_library.h>
+uint32_t kVLCDesiredThumbnailWidth = 512;
+uint32_t kVLCDesiredThumbnailHeight = 320;
+float kVLCDefaultThumbnailPosition = .15;
+
@interface VLCLibraryController()
{
vlc_medialibrary_t *_p_libraryInstance;
@@ -125,7 +129,12 @@
- (int)attemptToGenerateThumbnailForMediaItem:(VLCMediaLibraryMediaItem *)mediaItem
{
- return vlc_ml_media_generate_thumbnail(_p_libraryInstance, mediaItem.libraryID);
+ return vlc_ml_media_generate_thumbnail(_p_libraryInstance,
+ mediaItem.libraryID,
+ VLC_ML_THUMBNAIL_SMALL,
+ kVLCDesiredThumbnailWidth,
+ kVLCDesiredThumbnailHeight,
+ kVLCDefaultThumbnailPosition);
}
#pragma mark - folder management
diff --git a/modules/gui/macosx/library/VLCLibraryDataTypes.h b/modules/gui/macosx/library/VLCLibraryDataTypes.h
index 5d50c69e5b..aa27b7133d 100644
--- a/modules/gui/macosx/library/VLCLibraryDataTypes.h
+++ b/modules/gui/macosx/library/VLCLibraryDataTypes.h
@@ -161,9 +161,9 @@ extern const long long int VLCMediaLibraryMediaItemDurationDenominator;
@property (readonly) time_t lastPlayedDate;
@property (readonly) NSString *title;
- at property (readonly) NSString *artworkMRL;
+ at property (readonly) NSString *smallArtworkMRL;
- at property (readonly) BOOL artworkGenerated;
+ at property (readonly) BOOL smallArtworkGenerated;
@property (readonly) BOOL favorited;
@property (readonly, nullable) VLCMediaLibraryShowEpisode *showEpisode;
diff --git a/modules/gui/macosx/library/VLCLibraryDataTypes.m b/modules/gui/macosx/library/VLCLibraryDataTypes.m
index 76ec78fd4e..91f83363dd 100644
--- a/modules/gui/macosx/library/VLCLibraryDataTypes.m
+++ b/modules/gui/macosx/library/VLCLibraryDataTypes.m
@@ -137,7 +137,7 @@ const long long int VLCMediaLibraryMediaItemDurationDenominator = 1000;
_artistID = p_artist->i_id;
_name = toNSStr(p_artist->psz_name);
_shortBiography = toNSStr(p_artist->psz_shortbio);
- _artworkMRL = toNSStr(p_artist->psz_artwork_mrl);
+ _artworkMRL = toNSStr(p_artist->thumbnails[VLC_ML_THUMBNAIL_SMALL].psz_mrl);
_musicBrainzID = toNSStr(p_artist->psz_mb_id);
_numberOfAlbums = p_artist->i_nb_album;
_numberOfTracks = p_artist->i_nb_tracks;
@@ -156,7 +156,7 @@ const long long int VLCMediaLibraryMediaItemDurationDenominator = 1000;
_albumID = p_album->i_id;
_title = toNSStr(p_album->psz_title);
_summary = toNSStr(p_album->psz_summary);
- _artworkMRL = toNSStr(p_album->psz_artwork_mrl);
+ _artworkMRL = toNSStr(p_album->thumbnails[VLC_ML_THUMBNAIL_SMALL].psz_mrl);
_artistName = toNSStr(p_album->psz_artist);
_artistID = p_album->i_artist_id;
_numberOfTracks = p_album->i_nb_tracks;
@@ -273,8 +273,8 @@ const long long int VLCMediaLibraryMediaItemDurationDenominator = 1000;
_playCount = p_mediaItem->i_playcount;
_lastPlayedDate = p_mediaItem->i_last_played_date;
_title = toNSStr(p_mediaItem->psz_title);
- _artworkMRL = toNSStr(p_mediaItem->psz_artwork_mrl);
- _artworkGenerated = p_mediaItem->b_artwork_generated;
+ _smallArtworkMRL = toNSStr(p_mediaItem->thumbnails[VLC_ML_THUMBNAIL_SMALL].psz_mrl);
+ _smallArtworkGenerated = p_mediaItem->thumbnails[VLC_ML_THUMBNAIL_SMALL].b_generated;
_favorited = p_mediaItem->b_is_favorite;
switch (p_mediaItem->i_subtype) {
@@ -300,7 +300,7 @@ const long long int VLCMediaLibraryMediaItemDurationDenominator = 1000;
- (NSString *)description
{
return [NSString stringWithFormat:@"%@ — title: %@, ID: %lli, type: %i, artwork: %@",
- NSStringFromClass([self class]), _title, _libraryID, _mediaType, _artworkMRL];
+ NSStringFromClass([self class]), _title, _libraryID, _mediaType, _smallArtworkMRL];
}
#pragma mark - preference setters / getters
More information about the vlc-commits
mailing list