MLAlbumTrack.h 3.55 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
/*****************************************************************************
 * MLAlbumTrack.h
 *****************************************************************************
 * Copyright (C) 2010 Pierre d'Herbemont
 * Copyright (C) 2013 Felix Paul Kühne
 * $Id$
 *
 * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
 *          Felix Paul Kühne <fkuehne # videolan.org>
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

#import "MLAlbum.h"

28 29 30 31 32
extern NSString *const MLAlbumTrackAlbumName;
extern NSString *const MLAlbumTrackNumber;
extern NSString *const MLAlbumTrackTrackName;
extern NSString *const MLAlbumTrackDiscNumber;

33 34
@class MLFile;

35 36 37 38
@interface MLAlbumTrack : NSManagedObject

+ (NSArray *)allTracks;

39 40
+ (MLAlbumTrack *)trackWithAlbum:(MLAlbum *)album
                     trackNumber:(NSNumber *)trackNumber
41
                  createIfNeeded:(BOOL)createIfNeeded __attribute__((deprecated));
42 43 44
+ (MLAlbumTrack *)trackWithAlbum:(MLAlbum *)album
                     trackNumber:(NSNumber *)trackNumber
                       trackName:(NSString *)trackName
45 46
                  createIfNeeded:(BOOL)createIfNeeded __attribute__((deprecated));

47 48 49
+ (MLAlbumTrack *)trackWithAlbumName:(NSString *)albumName
                         trackNumber:(NSNumber *)trackNumber
                      createIfNeeded:(BOOL)createIfNeeded
50
                          wasCreated:(BOOL *)wasCreated __attribute__((deprecated));
51 52 53 54
+ (MLAlbumTrack *)trackWithAlbumName:(NSString *)albumName
                         trackNumber:(NSNumber *)trackNumber
                           trackName:(NSString *)trackName
                      createIfNeeded:(BOOL)createIfNeeded
55 56 57 58 59 60 61 62 63 64
                          wasCreated:(BOOL *)wasCreated __attribute__((deprecated));

/* for available keys, see above */
+ (MLAlbumTrack *)trackWithAlbum:(MLAlbum *)album
                        metadata:(NSDictionary *)metadata
                  createIfNeeded:(BOOL)createIfNeeded
                      wasCreated:(BOOL *)wasCreated;
+ (MLAlbumTrack *)trackWithMetadata:(NSDictionary *)metadata
                     createIfNeeded:(BOOL)createIfNeeded
                         wasCreated:(BOOL *)wasCreated;
65

66 67 68 69 70
@property (nonatomic, strong) NSNumber *unread;
@property (nonatomic, strong) NSString *artist;
@property (nonatomic, strong) NSString *genre;
@property (nonatomic, strong) NSString *title;
@property (nonatomic, strong) NSNumber *trackNumber;
71
@property (nonatomic, strong) NSNumber *discNumber;
72 73 74

@property (nonatomic, strong) MLAlbum *album;
@property (nonatomic, strong) NSSet *files;
75
@property (nonatomic) BOOL containsArtwork;
76 77 78 79 80 81 82 83

@end

@interface MLAlbumTrack (CoreDataGeneratedAccessors)
- (void)addFilesObject:(NSManagedObject *)value;
- (void)removeFilesObject:(NSManagedObject *)value;
- (void)addFiles:(NSSet *)value;
- (void)removeFiles:(NSSet *)value;
84
- (MLFile *)anyFileFromTrack;
85
@end