VLCMediaListPlayer.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /*****************************************************************************
  2. * VLCMediaListPlayer.h: VLCKit.framework VLCMediaListPlayer implementation
  3. *****************************************************************************
  4. * Copyright (C) 2009 Pierre d'Herbemont
  5. * Partial Copyright (C) 2009-2013 Felix Paul Kühne
  6. * Copyright (C) 2009-2019 VLC authors and VideoLAN
  7. * $Id$
  8. *
  9. * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
  10. * Felix Paul Kühne <fkuehne # videolan.org>
  11. * Soomin Lee <bubu # mikan.io>
  12. *
  13. * This program is free software; you can redistribute it and/or modify it
  14. * under the terms of the GNU Lesser General Public License as published by
  15. * the Free Software Foundation; either version 2.1 of the License, or
  16. * (at your option) any later version.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU Lesser General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU Lesser General Public License
  24. * along with this program; if not, write to the Free Software Foundation,
  25. * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  26. *****************************************************************************/
  27. @class VLCMedia, VLCMediaPlayer, VLCMediaList, VLCMediaListPlayer;
  28. /**
  29. * VLCRepeatMode
  30. * (don't repeat anything, repeat one, repeat all)
  31. */
  32. typedef NS_ENUM(NSInteger, VLCRepeatMode) {
  33. VLCDoNotRepeat,
  34. VLCRepeatCurrentItem,
  35. VLCRepeatAllItems
  36. };
  37. @protocol VLCMediaListPlayerDelegate <NSObject>
  38. @optional
  39. /**
  40. * Sent when VLCMediaListPlayer has finished playing.
  41. */
  42. - (void)mediaListPlayerFinishedPlayback:(VLCMediaListPlayer *)player;
  43. /**
  44. * Sent when VLCMediaListPlayer going to play next media
  45. */
  46. - (void)mediaListPlayer:(VLCMediaListPlayer *)player
  47. nextMedia:(VLCMedia *)media;
  48. /**
  49. * Sent when VLCMediaListPlayer is stopped.
  50. * Internally or by using the stop()
  51. * \see stop
  52. */
  53. - (void)mediaListPlayerStopped:(VLCMediaListPlayer *)player;
  54. @end
  55. /**
  56. * A media list player, which eases the use of playlists
  57. */
  58. OBJC_VISIBLE
  59. @interface VLCMediaListPlayer : NSObject
  60. /**
  61. * setter/getter for mediaList to play within the player
  62. * \note This list is erased when setting a rootMedia on the list player instance
  63. */
  64. @property (readwrite) VLCMediaList *mediaList;
  65. /**
  66. * rootMedia - Use this method to play a media and its subitems.
  67. * This will erase mediaList.
  68. * Setting mediaList will erase rootMedia.
  69. */
  70. @property (readwrite) VLCMedia *rootMedia;
  71. /**
  72. * the media player instance used for playback by the list player
  73. */
  74. @property (readonly) VLCMediaPlayer *mediaPlayer;
  75. /**
  76. * Receiver's delegate
  77. */
  78. @property (nonatomic, weak) id <VLCMediaListPlayerDelegate> delegate;
  79. /**
  80. * initializer with a certain drawable
  81. * \note drawable can also be set later
  82. */
  83. - (instancetype)initWithDrawable:(id)drawable;
  84. /**
  85. * initializer with a custom options
  86. * \note This is will initialize a new VLCLibrary instance, which WILL have a major memory impact
  87. */
  88. - (instancetype)initWithOptions:(NSArray *)options;
  89. /**
  90. * initializer with a certain drawable and options
  91. * \see initWithDrawable
  92. * \see initWithOptions
  93. */
  94. - (instancetype)initWithOptions:(NSArray *)options andDrawable:(id)drawable;
  95. /**
  96. * start playback
  97. */
  98. - (void)play;
  99. /**
  100. * pause playback
  101. */
  102. - (void)pause;
  103. /**
  104. * stop playback
  105. */
  106. - (void)stop;
  107. /**
  108. * play next item
  109. * \returns YES on success, NO if there is no such item
  110. */
  111. @property (NS_NONATOMIC_IOSONLY, readonly) BOOL next;
  112. /**
  113. * play previous item
  114. * \returns YES on success, NO if there is no such item
  115. */
  116. @property (NS_NONATOMIC_IOSONLY, readonly) BOOL previous;
  117. /**
  118. * play an item at a given index in the media list attached to the player
  119. */
  120. - (void)playItemAtNumber:(NSNumber *)index;
  121. /**
  122. * Playmode selection (don't repeat anything, repeat one, repeat all)
  123. * See VLCRepeatMode.
  124. */
  125. @property (readwrite) VLCRepeatMode repeatMode;
  126. /**
  127. * media must be in the current media list.
  128. */
  129. - (void)playMedia:(VLCMedia *)media;
  130. @end