13#import <Foundation/Foundation.h>
15NS_ASSUME_NONNULL_BEGIN
29@property(nonatomic, strong, nullable) NSString *
filePath;
42- (instancetype)initWithFile:(nonnull NSString *)file;
66- (nullable NSMutableDictionary *)playlistAtIndex:(NSUInteger)index;
74- (NSUInteger)indexOfPlaylist:(nonnull NSDictionary *)playlist;
82- (NSUInteger)indexOfPlaylistWithIdentifier:(nullable NSString *)identifier;
90- (nullable NSString *)nameOfPlaylistAtIndex:(NSUInteger)index;
98- (nullable NSString *)identifierOfPlaylistAtIndex:(NSUInteger)index;
107- (BOOL)setNameOfPlaylist:(nonnull NSString *)name atIndex:(NSUInteger)index;
118- (BOOL)addPlaylistWithName:(nonnull NSString *)name;
126- (BOOL)removePlaylistAtIndex:(NSUInteger)index;
134- (NSUInteger)numberOfMusicInPlaylistAtIndex:(NSUInteger)index;
143- (BOOL)containsMusic:(NSUInteger)musicIdentifier inPlaylistAtIndex:(NSUInteger)index;
155- (void)addMusic:(NSUInteger)musicIdentifier toPlaylistAtIndex:(NSUInteger)index;
164- (BOOL)removeMusic:(NSUInteger)musicIdentifier fromPlaylistAtIndex:(NSUInteger)index;
Manages the user's music playlists, persisting them to a property-list file.
Definition MusicPlaylistManager.h:25
void synchronize()
Writes the current playlists back to the file, atomically.
Definition MusicPlaylistManager.m:44
NSMutableArray * arrayPlaylist
The playlists, each an NSMutableDictionary keyed by identifier, name, and music list.
Definition MusicPlaylistManager.h:27
NSString * filePath
The property-list file the playlists are loaded from and written back to.
Definition MusicPlaylistManager.h:29
NSUInteger numberOfPlaylists()
Returns the number of playlists.
Definition MusicPlaylistManager.m:48