VLCMediaDiscoverer.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. OBJC_VISIBLE OBJC_EXTERN
  40. NSString *const VLCMediaDiscovererName;
  41. OBJC_VISIBLE OBJC_EXTERN
  42. NSString *const VLCMediaDiscovererLongName;
  43. OBJC_VISIBLE OBJC_EXTERN
  44. NSString *const VLCMediaDiscovererCategory;
  45. /**
  46. * VLCMediaDiscoverer
  47. */
  48. OBJC_VISIBLE
  49. @interface VLCMediaDiscoverer : NSObject
  50. /**
  51. * The library instance used by the discoverers
  52. * \note unless for debug, you are wrong if you want to use this selector
  53. */
  54. @property (nonatomic, readonly) VLCLibrary *libraryInstance;
  55. /**
  56. * \param categoryType VLCMediaDiscovererCategory you are looking for
  57. * \return an array of dictionaries describing the available discoverers for the requested type
  58. */
  59. + (NSArray *)availableMediaDiscovererForCategoryType:(VLCMediaDiscovererCategoryType)categoryType;
  60. /* Initializers */
  61. /**
  62. * Initializes new object with specified name.
  63. * \param aServiceName Name of the service for this VLCMediaDiscoverer object.
  64. * \returns Newly created media discoverer.
  65. * \note with VLCKit 3.0 and above, you need to start the discoverer explicitly after creation
  66. */
  67. - (instancetype)initWithName:(NSString *)aServiceName;
  68. /**
  69. * same as above but with a custom VLCLibrary instance
  70. * \note Using this mode can lead to a significant performance impact - use only if you know what you are doing
  71. */
  72. - (instancetype)initWithName:(NSString *)aServiceName libraryInstance:(VLCLibrary *)libraryInstance;
  73. /**
  74. * start media discovery
  75. * \returns -1 if start failed, otherwise 0
  76. */
  77. - (int)startDiscoverer;
  78. /**
  79. * stop media discovery
  80. */
  81. - (void)stopDiscoverer;
  82. /**
  83. * a read-only property to retrieve the list of discovered media items
  84. */
  85. @property (weak, readonly) VLCMediaList *discoveredMedia;
  86. /**
  87. * read-only property to check if the discovery service is active
  88. * \return boolean value
  89. */
  90. @property (readonly) BOOL isRunning;
  91. @end