VLCKit: VLCMediaList Class Reference

VLCKit

Instance Methods | Properties | List of all members
VLCMediaList Class Reference

`#import <VLCMediaList.h>`

Inheritance diagram for VLCMediaList:

## Instance Methods
(instancetype) | - initWithArray:
(void) | - lock
(void) | - unlock
(NSUInteger) | - addMedia:
(void) | - insertMedia:atIndex:
(BOOL) | - removeMediaAtIndex:
(VLCMedia *) | - mediaAtIndex:
(NSUInteger) | - indexOfMedia:

## Properties
NSInteger | count
id | delegate
BOOL | isReadOnly

## Detailed Description

VLCMediaList

## Method Documentation

## ◆ addMedia:

- (NSUInteger) addMedia: |  | (VLCMedia *) | media |

add a media to a read-write list

Parameters

  media | the media object to add

Returns
  the index of the newly added media

Note
  this function silently fails if the list is read-only

## ◆ indexOfMedia:

- (NSUInteger) indexOfMedia: |  | (VLCMedia *) | media |

retrieve the position of a media item

Parameters

  media | the media object to search for

Returns
  The lowest index of the provided media in the list If media does not exist in the list, returns NSNotFound.

## ◆ initWithArray:

- (instancetype) initWithArray: |  | (NSArray *) | array |

initializer with a set of VLCMedia instances

Parameters

  array | the NSArray of VLCMedia instances

Returns
  instance of VLCMediaList equipped with the VLCMedia instances

See also
  VLCMedia

## ◆ insertMedia:atIndex:

- (void) insertMedia: |  | (VLCMedia *) | media
atIndex: |  | (NSUInteger) | index

add a media to a read-write list at a given position

Parameters

  media | the media object to add
  index | the index where to add the given media

Note
  this function silently fails if the list is read-only

## ◆ lock

- (void) lock |  |  |

lock the media list from being edited by another thread

## ◆ mediaAtIndex:

- (VLCMedia *) mediaAtIndex: |  | (NSUInteger) | index |

retrieve a media from a given position

Parameters

  index | the index of the media you want

Returns
  the media object

## ◆ removeMediaAtIndex:

- (BOOL) removeMediaAtIndex: |  | (NSUInteger) | index |

remove media at position index and return true if the operation was successful. An unsuccessful operation occurs when the index is greater than the medialists count

Parameters

  index | the index of the media to remove

Returns
  boolean result of the removal operation

Note
  this function silently fails if the list is read-only

## ◆ unlock

- (void) unlock |  |  |

unlock the media list from being edited by another thread

## Property Documentation

## ◆ count

- (NSInteger) count
| readatomicassign

count number of media items in the list

Returns
  the number of media objects

## ◆ delegate

- (id) delegate
| readwritenonatomicweak

delegate property to listen to addition/removal events

## ◆ isReadOnly

- (BOOL) isReadOnly
| readatomicassign

read-only property to check if the media list is writable or not

Returns
  boolean value if the list is read-only

The documentation for this class was generated from the following file:

- Headers/Public/VLCMediaList.h