[vlc-commits] macosx/library: add abstraction for entry points

Felix Paul Kühne git at videolan.org
Mon Apr 29 19:27:01 CEST 2019


vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | 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
 
+ at interface VLCMediaLibraryEntryPoint : NSObject
+
+- (instancetype)initWithEntryPoint:(struct vlc_ml_entry_point_t *)p_entryPoint;
+
+ at property (readonly) NSString *MRL;
+ at property (readonly) BOOL isPresent;
+ at property (readonly) BOOL isBanned;
+
+ at 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
+
+ at 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];
+}
+
+ at end



More information about the vlc-commits mailing list