VLCMediaListPlayer.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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. @interface VLCMediaListPlayer : NSObject
  59. /**
  60. * setter/getter for mediaList to play within the player
  61. * \note This list is erased when setting a rootMedia on the list player instance
  62. */
  63. @property (readwrite) VLCMediaList *mediaList;
  64. /**
  65. * rootMedia - Use this method to play a media and its subitems.
  66. * This will erase mediaList.
  67. * Setting mediaList will erase rootMedia.
  68. */
  69. @property (readwrite) VLCMedia *rootMedia;
  70. /**
  71. * the media player instance used for playback by the list player
  72. */
  73. @property (readonly) VLCMediaPlayer *mediaPlayer;
  74. /**
  75. * Receiver's delegate
  76. */
  77. @property (nonatomic, weak) id <VLCMediaListPlayerDelegate> delegate;
  78. /**
  79. * initializer with a certain drawable
  80. * \note drawable can also be set later
  81. */
  82. - (instancetype)initWithDrawable:(id)drawable;
  83. /**
  84. * initializer with a custom options
  85. * \note This is will initialize a new VLCLibrary instance, which WILL have a major memory impact
  86. */
  87. - (instancetype)initWithOptions:(NSArray *)options;
  88. /**
  89. * initializer with a certain drawable and options
  90. * \see initWithDrawable
  91. * \see initWithOptions
  92. */
  93. - (instancetype)initWithOptions:(NSArray *)options andDrawable:(id)drawable;
  94. /**
  95. * start playback
  96. */
  97. - (void)play;
  98. /**
  99. * pause playback
  100. */
  101. - (void)pause;
  102. /**
  103. * stop playback
  104. */
  105. - (void)stop;
  106. /**
  107. * play next item
  108. * \returns YES on success, NO if there is no such item
  109. */
  110. @property (NS_NONATOMIC_IOSONLY, readonly) BOOL next;
  111. /**
  112. * play previous item
  113. * \returns YES on success, NO if there is no such item
  114. */
  115. @property (NS_NONATOMIC_IOSONLY, readonly) BOOL previous;
  116. /**
  117. * play an item at a given index in the media list attached to the player
  118. */
  119. - (void)playItemAtNumber:(NSNumber *)index;
  120. /**
  121. * Playmode selection (don't repeat anything, repeat one, repeat all)
  122. * See VLCRepeatMode.
  123. */
  124. @property (readwrite) VLCRepeatMode repeatMode;
  125. /**
  126. * media must be in the current media list.
  127. */
  128. - (void)playMedia:(VLCMedia *)media;
  129. @end