Browse Source

VLCMediaListPlayer: make API additions more cooca like

Felix Paul Kühne 11 years ago
parent
commit
d0e7b32b41
2 changed files with 10 additions and 10 deletions
  1. 4 4
      Headers/Public/VLCMediaListPlayer.h
  2. 6 6
      Sources/VLCMediaListPlayer.m

+ 4 - 4
Headers/Public/VLCMediaListPlayer.h

@@ -66,11 +66,11 @@ typedef NSInteger VLCRepeatMode;
 
 /**
  * previous, next, play item at index
- * \return 0 on success, -1 if there is no such item
+ * \returns YES on success, NO if there is no such item
  */
-- (int)next;
-- (int)previous;
-- (int)playItemAtIndex:(int)index;
+- (BOOL)next;
+- (BOOL)previous;
+- (BOOL)playItemAtIndex:(int)index;
 
 /**
  * Playmode selection (don't repeat anything, repeat one, repeat all)

+ 6 - 6
Sources/VLCMediaListPlayer.m

@@ -128,19 +128,19 @@
     libvlc_media_list_player_stop(instance);
 }
 
-- (int)next
+- (BOOL)next
 {
-    return libvlc_media_list_player_next(instance);
+    return libvlc_media_list_player_next(instance) == 0 ? YES : NO;
 }
 
-- (int)previous
+- (BOOL)previous
 {
-    return libvlc_media_list_player_previous(instance);
+    return libvlc_media_list_player_previous(instance) == 0 ? YES : NO;
 }
 
-- (int)playItemAtIndex:(int)index
+- (BOOL)playItemAtIndex:(int)index
 {
-    return libvlc_media_list_player_play_item_at_index(instance, index);
+    return libvlc_media_list_player_play_item_at_index(instance, index) == 0 ? YES : NO;
 }
 
 - (void)setRepeatMode:(VLCRepeatMode)repeatMode