VLCKit
VLCMediaList.h
1 /*****************************************************************************
2  * VLCMediaList.h: VLCKit.framework VLCMediaList header
3  *****************************************************************************
4  * Copyright (C) 2007 Pierre d'Herbemont
5  * Copyright (C) 2015 Felix Paul Kühne
6  * Copyright (C) 2007, 2015 VLC authors and VideoLAN
7  * $Id$
8  *
9  * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
10  *
11  * This program is free software; you can redistribute it and/or modify it
12  * under the terms of the GNU Lesser General Public License as published by
13  * the Free Software Foundation; either version 2.1 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * along with this program; if not, write to the Free Software Foundation,
23  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24  *****************************************************************************/
25 
26 #import <Foundation/Foundation.h>
27 
28 NS_ASSUME_NONNULL_BEGIN
29 
33 extern NSString *const VLCMediaListItemAdded;
37 extern NSString *const VLCMediaListItemDeleted;
38 
39 @class VLCMedia;
40 @class VLCMediaList;
41 
45 @protocol VLCMediaListDelegate <NSObject>
46 @optional
54 - (void)mediaList:(VLCMediaList *)aMediaList mediaAdded:(VLCMedia *)media atIndex:(NSUInteger)index;
55 
62 - (void)mediaList:(VLCMediaList *)aMediaList mediaRemovedAtIndex:(NSUInteger)index;
63 @end
64 
68 @interface VLCMediaList : NSObject
69 
76 - (instancetype)initWithArray:(NSArray<VLCMedia *> *)array;
77 
78 /* Operations */
82 - (void)lock;
83 
87 - (void)unlock;
88 
96 - (NSUInteger)addMedia:(VLCMedia *)media;
97 
105 - (void)insertMedia:(VLCMedia *)media atIndex:(NSUInteger)index;
106 
115 - (BOOL)removeMediaAtIndex:(NSUInteger)index;
116 
123 - (nullable VLCMedia *)mediaAtIndex:(NSUInteger)index;
124 
132 - (NSUInteger)indexOfMedia:(VLCMedia *)media;
133 
134 /* Properties */
139 @property (readonly) NSInteger count;
140 
144 @property (weak, nonatomic, nullable) id<VLCMediaListDelegate> delegate;
145 
150 @property (readonly) BOOL isReadOnly;
151 
152 @end
153 
154 NS_ASSUME_NONNULL_END
-[VLCMediaList unlock]
void unlock()
VLCMediaList
Definition: VLCMediaList.h:68
VLCMedia
Definition: VLCMedia.h:112
VLCMediaListDelegate-p
Definition: VLCMediaList.h:45
-[VLCMediaList lock]
void lock()
VLCMediaList::count
NSInteger count
Definition: VLCMediaList.h:139
VLCMediaList::isReadOnly
BOOL isReadOnly
Definition: VLCMediaList.h:150
VLCMediaList::delegate
id< VLCMediaListDelegate > delegate
Definition: VLCMediaList.h:144