[vlc-commits] macosx/renderer item: simplify, improve debug and expose type
Felix Paul Kühne
git at videolan.org
Mon Sep 2 11:57:47 CEST 2019
vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Sat Aug 31 12:20:15 2019 +0200| [b787e09dbe6d23421428d2ac698be99e021383dc] | committer: Felix Paul Kühne
macosx/renderer item: simplify, improve debug and expose type
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b787e09dbe6d23421428d2ac698be99e021383dc
---
.../gui/macosx/menus/renderers/VLCRendererItem.h | 19 ++++++++++----
.../gui/macosx/menus/renderers/VLCRendererItem.m | 29 +++++++++++-----------
2 files changed, 29 insertions(+), 19 deletions(-)
diff --git a/modules/gui/macosx/menus/renderers/VLCRendererItem.h b/modules/gui/macosx/menus/renderers/VLCRendererItem.h
index 760f2efb75..23a375c9ca 100644
--- a/modules/gui/macosx/menus/renderers/VLCRendererItem.h
+++ b/modules/gui/macosx/menus/renderers/VLCRendererItem.h
@@ -1,7 +1,7 @@
/*****************************************************************************
* VLCRendererItem.h: Wrapper class for vlc_renderer_item_t
*****************************************************************************
- * Copyright (C) 2016 VLC authors and VideoLAN
+ * Copyright (C) 2016, 2019 VLC authors and VideoLAN
*
* Authors: Marvin Scholz <epirat07 at gmail dot com>
*
@@ -24,6 +24,8 @@
#include <vlc_common.h>
+NS_ASSUME_NONNULL_BEGIN
+
@class VLCPlayerController;
/**
@@ -47,14 +49,19 @@
/**
The name of the renderer item
*/
-- (NSString*)name;
+ at property (readonly) NSString *name;
-- (NSString*)identifier;
+ at property (readonly) NSString *identifier;
+
+/**
+ * the type of renderer item
+ */
+ at property (readonly) NSString *type;
/**
The iconURI of the renderer item
*/
-- (NSString*)iconURI;
+ at property (readonly) NSString *iconURI;
/**
Flags indicating capabilities of the renderer item
@@ -63,7 +70,7 @@
\li \c VLC_RENDERER_CAN_AUDIO
\li \c VLC_RENDERER_CAN_VIDEO
*/
-- (int)capabilityFlags;
+ at property (readonly) int capabilityFlags;
/**
Sets the renderer represented by this \c VLCRendererItem as active
@@ -74,3 +81,5 @@
- (void)setRendererForPlayerController:(VLCPlayerController *)playerController;
@end
+
+NS_ASSUME_NONNULL_END
diff --git a/modules/gui/macosx/menus/renderers/VLCRendererItem.m b/modules/gui/macosx/menus/renderers/VLCRendererItem.m
index 6cf5dc5669..2eba69d174 100644
--- a/modules/gui/macosx/menus/renderers/VLCRendererItem.m
+++ b/modules/gui/macosx/menus/renderers/VLCRendererItem.m
@@ -1,7 +1,7 @@
/*****************************************************************************
* VLCRendererItem.m: Wrapper class for vlc_renderer_item_t
*****************************************************************************
- * Copyright (C) 2016 VLC authors and VideoLAN
+ * Copyright (C) 2016, 2019 VLC authors and VideoLAN
*
* Authors: Marvin Scholz <epirat07 at gmail dot com>
*
@@ -48,28 +48,29 @@
_rendererItem = nil;
}
-- (NSString*)name
+- (NSString *)description
{
- const char *name = vlc_renderer_item_name(_rendererItem);
- if (!name)
- return nil;
- return [NSString stringWithUTF8String:name];
+ return [NSString stringWithFormat:@"%@: name: %@, type: %@", [self className], self.name, self.type];
+}
+
+- (NSString *)name
+{
+ return toNSStr(vlc_renderer_item_name(_rendererItem));
}
- (NSString*)identifier
{
- const char *sout = vlc_renderer_item_sout(_rendererItem);
- if (!sout)
- return nil;
- return [NSString stringWithUTF8String:sout];
+ return toNSStr(vlc_renderer_item_sout(_rendererItem));
}
- (NSString*)iconURI
{
- const char *uri = vlc_renderer_item_icon_uri(_rendererItem);
- if (!uri)
- return nil;
- return [NSString stringWithUTF8String:uri];
+ return toNSStr(vlc_renderer_item_icon_uri(_rendererItem));
+}
+
+- (NSString *)type
+{
+ return toNSStr(vlc_renderer_item_type(_rendererItem));
}
- (int)capabilityFlags
More information about the vlc-commits
mailing list