vlc | branch: master | Felix Paul Kühne <[email protected]> | Sat Apr 27 20:06:51 2019 +0200| [e72372d937fd2f29228658a95ebe297b5e169d08] | committer: Felix Paul Kühne
macosx/library: add abstraction for entry points > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e72372d937fd2f29228658a95ebe297b5e169d08 --- modules/gui/macosx/library/VLCLibraryDataTypes.h | 10 ++++++++++ modules/gui/macosx/library/VLCLibraryDataTypes.m | 21 +++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/modules/gui/macosx/library/VLCLibraryDataTypes.h b/modules/gui/macosx/library/VLCLibraryDataTypes.h index e2a9ac77ef..2b366ffee8 100644 --- a/modules/gui/macosx/library/VLCLibraryDataTypes.h +++ b/modules/gui/macosx/library/VLCLibraryDataTypes.h @@ -120,4 +120,14 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface VLCMediaLibraryEntryPoint : NSObject + +- (instancetype)initWithEntryPoint:(struct vlc_ml_entry_point_t *)p_entryPoint; + +@property (readonly) NSString *MRL; +@property (readonly) BOOL isPresent; +@property (readonly) BOOL isBanned; + +@end + NS_ASSUME_NONNULL_END diff --git a/modules/gui/macosx/library/VLCLibraryDataTypes.m b/modules/gui/macosx/library/VLCLibraryDataTypes.m index a42a2e6306..e4e20a944c 100644 --- a/modules/gui/macosx/library/VLCLibraryDataTypes.m +++ b/modules/gui/macosx/library/VLCLibraryDataTypes.m @@ -187,3 +187,24 @@ } @end + +@implementation VLCMediaLibraryEntryPoint + +- (instancetype)initWithEntryPoint:(struct vlc_ml_entry_point_t *)p_entryPoint +{ + self = [super init]; + if (self && p_entryPoint != NULL) { + _MRL = toNSStr(p_entryPoint->psz_mrl); + _isPresent = p_entryPoint->b_present; + _isBanned = p_entryPoint->b_banned; + } + return self; +} + +- (NSString *)description +{ + return [NSString stringWithFormat:@"%@ — MRL: %@, present: %i, banned: %i", + NSStringFromClass([self class]), _MRL, _isPresent, _isBanned]; +} + +@end _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
