Commit 2c267525 authored by Felix Paul Kühne's avatar Felix Paul Kühne

VLCMediaList: To match the KVC bindings, all NSInteger arguments were moved to...

VLCMediaList: To match the KVC bindings, all NSInteger arguments were moved to NSUInteger as appropriate

(cherry picked from commit 9b655ffe)
parent 40f8e1dc
......@@ -50,7 +50,7 @@ extern NSString *const VLCMediaListItemDeleted;
* \param media the media object that was added
* \param index the index the media object was added at
*/
- (void)mediaList:(VLCMediaList *)aMediaList mediaAdded:(VLCMedia *)media atIndex:(NSInteger)index;
- (void)mediaList:(VLCMediaList *)aMediaList mediaAdded:(VLCMedia *)media atIndex:(NSUInteger)index;
/**
* delegate method triggered when a media was removed from the list
......@@ -58,7 +58,7 @@ extern NSString *const VLCMediaListItemDeleted;
* \param aMediaList the media list
* \param index the index a media item was deleted at
*/
- (void)mediaList:(VLCMediaList *)aMediaList mediaRemovedAtIndex:(NSInteger)index;
- (void)mediaList:(VLCMediaList *)aMediaList mediaRemovedAtIndex:(NSUInteger)index;
@end
/**
......@@ -92,7 +92,7 @@ extern NSString *const VLCMediaListItemDeleted;
* \return the index of the newly added media
* \note this function silently fails if the list is read-only
*/
- (NSInteger)addMedia:(VLCMedia *)media;
- (NSUInteger)addMedia:(VLCMedia *)media;
/**
* add a media to a read-write list at a given position
......@@ -101,7 +101,7 @@ extern NSString *const VLCMediaListItemDeleted;
* \param index the index where to add the given media
* \note this function silently fails if the list is read-only
*/
- (void)insertMedia:(VLCMedia *)media atIndex:(NSInteger)index;
- (void)insertMedia:(VLCMedia *)media atIndex:(NSUInteger)index;
/**
* remove a media from a given position
......@@ -109,7 +109,7 @@ extern NSString *const VLCMediaListItemDeleted;
* \param index the index of the media to remove
* \note this function silently fails if the list is read-only
*/
- (void)removeMediaAtIndex:(NSInteger)index;
- (void)removeMediaAtIndex:(NSUInteger)index;
/**
* retrieve a media from a given position
......@@ -117,7 +117,7 @@ extern NSString *const VLCMediaListItemDeleted;
* \param index the index of the media you want
* \return the media object
*/
- (VLCMedia *)mediaAtIndex:(NSInteger)index;
- (VLCMedia *)mediaAtIndex:(NSUInteger)index;
/**
* retrieve the position of a media item
......
......@@ -74,6 +74,16 @@ New APIs:
- VLCAudio
- added property: passthrough
Modified APIs:
- VLCMediaList
- To match the KVC bindings, all NSInteger arguments were moved to NSUInteger as appropriate
- mediaList:mediaAdded:atIndex:
- mediaList:mediaRemovedAtIndex:
- addMedia:
- insertMedia:atIndex:
- removeMediaAtIndex:
- mediaAtIndex:
Deprecated APIs:
- VLCAudio
- setMute:
......
......@@ -143,14 +143,14 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
libvlc_media_list_unlock( p_mlist );
}
- (NSInteger)addMedia:(VLCMedia *)media
- (NSUInteger)addMedia:(VLCMedia *)media
{
NSInteger index = [self count];
[self insertMedia:media atIndex:index];
return index;
}
- (void)insertMedia:(VLCMedia *)media atIndex: (NSInteger)index
- (void)insertMedia:(VLCMedia *)media atIndex: (NSUInteger)index
{
// Add the media object to our cache
[_mediaObjects setObject:media forKey:[NSValue valueWithPointer:[media libVLCMediaDescriptor]]];
......@@ -161,18 +161,18 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
// we will add the media object to cachedMedia in the callback when libvlc acknowledges its addition
}
- (void)removeMediaAtIndex:(NSInteger)index
- (void)removeMediaAtIndex:(NSUInteger)index
{
if (index >= libvlc_media_list_count(p_mlist) || index < 0)
if (index >= libvlc_media_list_count(p_mlist))
return;
// Remove it from libvlc's medialist
libvlc_media_list_remove_index(p_mlist, (int)index);
}
- (VLCMedia *)mediaAtIndex:(NSInteger)index
- (VLCMedia *)mediaAtIndex:(NSUInteger)index
{
if (index >= libvlc_media_list_count(p_mlist) || index < 0)
if (index >= libvlc_media_list_count(p_mlist))
return nil;
libvlc_media_t *mediaItem = libvlc_media_list_item_at_index(p_mlist, (int)index);
......@@ -308,7 +308,7 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
// Let the delegate know that the item is being removed
if (delegate && [delegate respondsToSelector:@selector(mediaList:mediaRemovedAtIndex:)])
[delegate mediaList:self mediaRemovedAtIndex:[index intValue]];
[delegate mediaList:self mediaRemovedAtIndex:index];
}
[self didChange:NSKeyValueChangeRemoval valuesAtIndexes:[NSIndexSet indexSetWithIndexesInRange:range] forKey:@"media"];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment