VLCMediaDiscoverer.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*****************************************************************************
  2. * VLCMediaDiscoverer.h: VLCKit.framework VLCMediaDiscoverer header
  3. *****************************************************************************
  4. * Copyright (C) 2007 Pierre d'Herbemont
  5. * Copyright (C) 2015 Felix Paul Kühne
  6. * Copyright (C) 2007, 2015 VLC authors and VideoLAN
  7. * $Id$
  8. *
  9. * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
  10. * Felix Paul Kühne <fkuehne # videolan.org>
  11. *
  12. * This program is free software; you can redistribute it and/or modify it
  13. * under the terms of the GNU Lesser General Public License as published by
  14. * the Free Software Foundation; either version 2.1 of the License, or
  15. * (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Lesser General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Lesser General Public License
  23. * along with this program; if not, write to the Free Software Foundation,
  24. * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  25. *****************************************************************************/
  26. #import <Foundation/Foundation.h>
  27. #import "VLCMediaList.h"
  28. @class VLCLibrary;
  29. @class VLCMediaList;
  30. @class VLCMediaDiscoverer;
  31. typedef NS_ENUM(unsigned, VLCMediaDiscovererCategoryType)
  32. {
  33. VLCMediaDiscovererCategoryTypeDevices = 0,
  34. VLCMediaDiscovererCategoryTypeLAN,
  35. VLCMediaDiscovererCategoryTypePodcasts,
  36. VLCMediaDiscovererCategoryTypeLocalDirectories
  37. };
  38. /* discoverer keys */
  39. extern NSString *const VLCMediaDiscovererName;
  40. extern NSString *const VLCMediaDiscovererLongName;
  41. extern NSString *const VLCMediaDiscovererCategory;
  42. /**
  43. * VLCMediaDiscoverer
  44. */
  45. @interface VLCMediaDiscoverer : NSObject
  46. /**
  47. * The library instance used by the discoverers
  48. * \note unless for debug, you are wrong if you want to use this selector
  49. */
  50. @property (nonatomic, readonly) VLCLibrary *libraryInstance;
  51. /**
  52. * The full list of available media discoverers
  53. * \return returns an empty array for binary compatibility, will be removed in subsequent releases
  54. * \deprecated use availableMediaDiscovererForCategoryType instead
  55. */
  56. + (NSArray *)availableMediaDiscoverer __attribute__((deprecated));
  57. /**
  58. * \param categoryType VLCMediaDiscovererCategory you are looking for
  59. * \return an array of dictionaries describing the available discoverers for the requested type
  60. */
  61. + (NSArray *)availableMediaDiscovererForCategoryType:(VLCMediaDiscovererCategoryType)categoryType;
  62. /* Initializers */
  63. /**
  64. * Initializes new object with specified name.
  65. * \param aServiceName Name of the service for this VLCMediaDiscoverer object.
  66. * \returns Newly created media discoverer.
  67. * \note with VLCKit 3.0 and above, you need to start the discoverer explicitly after creation
  68. */
  69. - (instancetype)initWithName:(NSString *)aServiceName;
  70. /**
  71. * same as above but with a custom VLCLibrary instance
  72. * \note Using this mode can lead to a significant performance impact - use only if you know what you are doing
  73. */
  74. - (instancetype)initWithName:(NSString *)aServiceName libraryInstance:(VLCLibrary *)libraryInstance;
  75. /**
  76. * start media discovery
  77. * \returns -1 if start failed, otherwise 0
  78. */
  79. - (int)startDiscoverer;
  80. /**
  81. * stop media discovery
  82. */
  83. - (void)stopDiscoverer;
  84. /**
  85. * a read-only property to retrieve the list of discovered media items
  86. */
  87. @property (weak, readonly) VLCMediaList *discoveredMedia;
  88. /**
  89. * localized name of the discovery module if available, otherwise in US English
  90. * \deprecated Will be removed in the next major release, may return an empty string for binary compatibility
  91. */
  92. @property (readonly, copy) NSString *localizedName __attribute__((deprecated));
  93. /**
  94. * read-only property to check if the discovery service is active
  95. * \return boolean value
  96. */
  97. @property (readonly) BOOL isRunning;
  98. @end