VLCLibVLCBridging.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. /*****************************************************************************
  2. * VLCLibVLCbridging.h: VLCKit.framework VLCLibVLCBridging (Private) header
  3. *****************************************************************************
  4. * Copyright (C) 2007 Pierre d'Herbemont
  5. * Copyright (C) 2007 the VideoLAN team
  6. * $Id$
  7. *
  8. * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License, or
  13. * (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  23. *****************************************************************************/
  24. #import "VLCLibrary.h"
  25. #import "VLCMediaListAspect.h"
  26. #import "VLCStreamOutput.h"
  27. /* Utility functions */
  28. /**
  29. * \function catch_execption( ex )
  30. * Utility function that catches a LibVLC generated exception by throwing a Cocoa based NSException.
  31. * \param ex LibVLC exception returned by LibVLC internal functions.
  32. */
  33. #define catch_exception( ex ) __catch_exception( (void *)(ex), __FUNCTION__, __FILE__, __LINE__ )
  34. extern void __catch_exception( void * e, const char * function, const char * file, int line_number );
  35. /**
  36. * Bridges functionality between libvlc and VLCMediaList implementation.
  37. */
  38. @interface VLCMediaList (LibVLCBridging)
  39. /* Factories */
  40. /**
  41. * Manufactures new object wrapped around specified media list.
  42. * \param p_new_mlist LibVLC media list pointer.
  43. * \return Newly create media list instance using specified media list
  44. * pointer.
  45. */
  46. + (id)mediaListWithLibVLCMediaList:(void *)p_new_mlist;
  47. /* Initializers */
  48. /**
  49. * Initializes new object wrapped around specified media list.
  50. * \param p_new_mlist LibVLC media list pointer.
  51. * \return Newly create media list instance using specified media list
  52. * pointer.
  53. */
  54. - (id)initWithLibVLCMediaList:(void *)p_new_mlist;
  55. /* Properties */
  56. @property (readonly) void * libVLCMediaList; //< LibVLC media list pointer.
  57. @end
  58. /**
  59. * Bridges functionality between libvlc and VLCMedia implementation.
  60. */
  61. @interface VLCMedia (LibVLCBridging)
  62. /* Factories */
  63. /**
  64. * Manufactures new object wrapped around specified media descriptor.
  65. * \param md LibVLC media descriptor pointer.
  66. * \return Newly created media instance using specified descriptor.
  67. */
  68. + (id)mediaWithLibVLCMediaDescriptor:(void *)md;
  69. /* Initializers */
  70. /**
  71. * Initializes new object wrapped around specified media descriptor.
  72. * \param md LibVLC media descriptor pointer.
  73. * \return Newly created media instance using specified descriptor.
  74. */
  75. - (id)initWithLibVLCMediaDescriptor:(void *)md;
  76. + (id)mediaWithMedia:(VLCMedia *)media andLibVLCOptions:(NSDictionary *)options;
  77. /**
  78. * Returns the receiver's internal media descriptor pointer.
  79. * \return The receiver's internal media descriptor pointer.
  80. */
  81. @property (readonly) void * libVLCMediaDescriptor;
  82. @end
  83. /**
  84. * Bridges functionality between VLCMedia and VLCMediaPlayer
  85. */
  86. @interface VLCMedia (VLCMediaPlayerBridging)
  87. /**
  88. * Set's the length of the media object. This value becomes available once the
  89. * media object is being played.
  90. * \param value
  91. */
  92. - (void)setLength:(VLCTime *)value;
  93. @end
  94. /**
  95. * Bridges functionality between VLCLibrary and LibVLC core.
  96. */
  97. @interface VLCLibrary (VLCLibVLCBridging)
  98. /**
  99. * Shared singleton instance of libvlc library instance.
  100. * \return libvlc pointer of library instance.
  101. */
  102. + (void *)sharedInstance;
  103. /**
  104. * Instance of libvlc library instance.
  105. * \return libvlc pointer of library instance.
  106. */
  107. @property (readonly) void * instance;
  108. @end
  109. /**
  110. * Bridges functionality between VLCMediaListAspect and libvlc.
  111. */
  112. @interface VLCMediaListAspect (VLCLibVLCBridging)
  113. /* Factories */
  114. /**
  115. * Manufactures a new media list aspect object with libvlc media list view instance.
  116. * \return Newly created media list aspect using specified libvlc media list view.
  117. */
  118. + (id)mediaListAspectWithLibVLCMediaListView:(libvlc_media_list_view_t *)p_new_mlv;
  119. /**
  120. * Manufactures a new media list aspect object with libvlc media list view instance.
  121. * \return Newly created media list aspect using specified libvlc media list view.
  122. */
  123. + (id)mediaListAspectWithLibVLCMediaListView:(libvlc_media_list_view_t *)p_new_mlv andMediaList:(VLCMediaList*)mediaList;
  124. /* Initializers */
  125. /**
  126. * Initializes a new media list aspect object with libvlc media list view instance.
  127. * \return Newly created media list aspect using specified libvlc media list view.
  128. */
  129. - (id)initWithLibVLCMediaListView:(libvlc_media_list_view_t *)p_new_mlv andMediaList:(VLCMediaList*)mediaList;
  130. /* Properties */
  131. @property (readonly) libvlc_media_list_view_t * libVLCMediaListView; //< Libvlc pointer to media list view instance.
  132. @end
  133. /**
  134. * Bridges functionality between VLCLibrary and VLCAudio.
  135. */
  136. @interface VLCLibrary (VLCAudioBridging)
  137. /**
  138. * Called by VLCAudio, each library has a singleton VLCaudio instance. VLCAudio
  139. * calls this function to let the VLCLibrary instance know how to get in touch
  140. * with the VLCAudio instance. TODO: Each media player instance should have it's
  141. * own audio instance...not each library instance.
  142. */
  143. - (void)setAudio:(VLCAudio *)value;
  144. @end
  145. /**
  146. * Bridges functionality between VLCAudio and VLCLibrary.
  147. */
  148. @interface VLCAudio (VLCAudioBridging)
  149. /* Initializers */
  150. /**
  151. * Initializes a new object using the specified library instance.
  152. * \return Newly created audio object using specified VLCLibrary instance.
  153. */
  154. - (id)initWithLibrary:(VLCLibrary *)library;
  155. @end
  156. /**
  157. * TODO: Documentation
  158. */
  159. @interface VLCStreamOutput (LibVLCBridge)
  160. - (NSString *)representedLibVLCOptions;
  161. @end