VLCRendererDiscoverer.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /*****************************************************************************
  2. * VLCRendererDiscoverer.h
  3. *****************************************************************************
  4. * Copyright © 2018 VLC authors, VideoLAN
  5. * Copyright © 2018 Videolabs
  6. *
  7. * Authors: Soomin Lee<bubu@mikan.io>
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU Lesser General Public License as published by
  11. * the Free Software Foundation; either version 2.1 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public License
  20. * along with this program; if not, write to the Free Software Foundation,
  21. * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  22. *****************************************************************************/
  23. @class VLCRendererItem;
  24. @class VLCRendererDiscoverer;
  25. NS_ASSUME_NONNULL_BEGIN
  26. /**
  27. * Renderer Discoverer delegate protocol
  28. * Allows to be notified upon discovery/changes of an renderer item
  29. */
  30. @protocol VLCRendererDiscovererDelegate <NSObject>
  31. - (void)rendererDiscovererItemAdded:(VLCRendererDiscoverer *)rendererDiscoverer
  32. item:(VLCRendererItem *)item;
  33. - (void)rendererDiscovererItemDeleted:(VLCRendererDiscoverer *)rendererDiscoverer
  34. item:(VLCRendererItem *)item;
  35. @end
  36. /**
  37. * Renderer Discoverer description
  38. */
  39. @interface VLCRendererDiscovererDescription : NSObject
  40. /**
  41. * Name of the renderer discoverer
  42. */
  43. @property (nonatomic, readonly, copy) NSString *name;
  44. /**
  45. * Long name of the renderer discoverer
  46. */
  47. @property (nonatomic, readonly, copy) NSString *longName;
  48. /**
  49. * Instanciates an object that holds information about a renderer discoverer
  50. * \param name Name of the renderer discoverer
  51. * \param longName Long name of the renderer discoverer
  52. * \return A new `VLCRendererDiscovererDescription` object, only if there were no errors
  53. */
  54. - (instancetype)initWithName:(NSString *)name longName:(NSString *)longName;
  55. @end
  56. /**
  57. * Renderer Discoverer
  58. */
  59. @interface VLCRendererDiscoverer : NSObject
  60. /**
  61. * Name of the renderer discoverer
  62. */
  63. @property (nonatomic, readonly, copy) NSString *name;
  64. /**
  65. * Renderers of the discoverer
  66. */
  67. @property (nonatomic, readonly, copy) NSArray<VLCRendererItem *> *renderers;
  68. /**
  69. * Receiver's delegate
  70. */
  71. @property (nonatomic, weak) id <VLCRendererDiscovererDelegate> _Nullable delegate;
  72. - (instancetype)init NS_UNAVAILABLE;
  73. /**
  74. * Instanciates a `VLCRendererDiscoverer`
  75. * \param name Name of the renderer discoverer
  76. * \return A new `VLCRendererDiscoverer` object, only if there were no errors
  77. */
  78. - (instancetype _Nullable)initWithName:(NSString *)name;
  79. /**
  80. * Returns discovered renderers
  81. * \return discovered renderers
  82. */
  83. - (NSArray<VLCRendererItem *> *)renderers;
  84. /**
  85. * Start the renderer discoverer
  86. * \return `YES` if successful, `NO` otherwise
  87. */
  88. - (BOOL)start;
  89. /**
  90. * Stops the renderer discoverer
  91. * \note This cannot fail
  92. */
  93. - (void)stop;
  94. /**
  95. * Returns an `NSArray` of `VLCRendererDiscovererDescription`
  96. * \note Call this method to retreive information in order to instanciate a `
  97. * `VLCRendererDiscoverer`
  98. * \return An `NSArray` of `VLCRendererDiscovererDescription`
  99. */
  100. + (NSArray<VLCRendererDiscovererDescription *> * _Nullable)list;
  101. @end
  102. NS_ASSUME_NONNULL_END