mirror of
https://code.videolan.org/videolan/vlc
synced 2024-09-04 09:11:33 +02:00
library/media types: support NSCoding
This commit is contained in:
parent
e9972af727
commit
fd2546f3c9
@ -34,6 +34,8 @@ const CGFloat VLCMediaLibrary720pWidth = 1280.;
|
||||
const CGFloat VLCMediaLibrary720pHeight = 720.;
|
||||
const long long int VLCMediaLibraryMediaItemDurationDenominator = 1000;
|
||||
|
||||
NSString *VLCMediaLibraryMediaItemLibraryID = @"VLCMediaLibraryMediaItemLibraryID";
|
||||
|
||||
@implementation VLCMediaLibraryFile
|
||||
|
||||
- (instancetype)initWithFile:(struct vlc_ml_file_t *)p_file
|
||||
@ -298,6 +300,18 @@ const long long int VLCMediaLibraryMediaItemDurationDenominator = 1000;
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithCoder:(NSCoder *)aDecoder
|
||||
{
|
||||
int64_t libraryID = [aDecoder decodeInt64ForKey:VLCMediaLibraryMediaItemLibraryID];
|
||||
self = [VLCMediaLibraryMediaItem mediaItemForLibraryID:libraryID];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)encodeWithCoder:(NSCoder *)aCoder
|
||||
{
|
||||
[aCoder encodeInt64:_libraryID forKey:VLCMediaLibraryMediaItemLibraryID];
|
||||
}
|
||||
|
||||
- (NSString *)description
|
||||
{
|
||||
return [NSString stringWithFormat:@"%@ — title: %@, ID: %lli, type: %i, artwork: %@",
|
||||
|
Loading…
Reference in New Issue
Block a user