瀏覽代碼

VLCMediaListPlayer: add previous, next, playItemAtIndex selectors

Felix Paul Kühne 11 年之前
父節點
當前提交
bb2eb018b1
共有 3 個文件被更改,包括 24 次插入0 次删除
  1. 8 0
      Headers/Public/VLCMediaListPlayer.h
  2. 1 0
      NEWS
  3. 15 0
      Sources/VLCMediaListPlayer.m

+ 8 - 0
Headers/Public/VLCMediaListPlayer.h

@@ -65,6 +65,14 @@ typedef NSInteger VLCRepeatMode;
 - (void)stop;
 
 /**
+ * previous, next, play item at index
+ * \return 0 on success, -1 if there is no such item
+ */
+- (int)next;
+- (int)previous;
+- (int)playItemAtIndex:(int)index;
+
+/**
  * Playmode selection (don't repeat anything, repeat one, repeat all)
  * See VLCRepeatMode.
  */

+ 1 - 0
NEWS

@@ -23,6 +23,7 @@ New APIs:
 - VLCMediaListPlayer:
   - added initWithOptions selector matching VLCMediaPlayer's implementation
   - added pause selector
+  - added previous, next and playItemAtIndex selectors
 
 Modified API behavior:
 - VLCMediaPlayer:

+ 15 - 0
Sources/VLCMediaListPlayer.m

@@ -128,6 +128,21 @@
     libvlc_media_list_player_stop(instance);
 }
 
+- (int)next
+{
+    return libvlc_media_list_player_next(instance);
+}
+
+- (int)previous
+{
+    return libvlc_media_list_player_previous(instance);
+}
+
+- (int)playItemAtIndex:(int)index
+{
+    return libvlc_media_list_player_play_item_at_index(instance, index);
+}
+
 - (void)setRepeatMode:(VLCRepeatMode)repeatMode
 {
     libvlc_playback_mode_t mode;