MLFile.h 4.08 KB
Newer Older
1 2 3 4 5 6 7 8 9
/*****************************************************************************
 * MLFile.h
 * Lunettes
 *****************************************************************************
 * Copyright (C) 2010 Pierre d'Herbemont
 * Copyright (C) 2010-2013 VLC authors and VideoLAN
 * $Id$
 *
 * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
10
 *          Felix Paul Kühne <fkuehne # videolan.org>
11
 *
12 13 14
 * 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
15 16 17 18
 * (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
19 20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
21
 *
22 23 24
 * 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.
25
 *****************************************************************************/
Pierre's avatar
Pierre committed
26 27 28

#import <CoreData/CoreData.h>

Pierre's avatar
Pierre committed
29
@class MLShowEpisode;
30
@class MLAlbumTrack;
Pierre's avatar
Pierre committed
31

Pierre's avatar
Pierre committed
32 33 34
extern NSString *kMLFileTypeMovie;
extern NSString *kMLFileTypeClip;
extern NSString *kMLFileTypeTVShowEpisode;
35
extern NSString *kMLFileTypeAudio;
Pierre's avatar
Pierre committed
36 37

@interface MLFile :  NSManagedObject
Pierre's avatar
Pierre committed
38

Pierre's avatar
Pierre committed
39 40 41 42 43 44
+ (NSArray *)allFiles;

- (BOOL)isKindOfType:(NSString *)type;
- (BOOL)isMovie;
- (BOOL)isClip;
- (BOOL)isShowEpisode;
45 46
- (BOOL)isAlbumTrack;
- (BOOL)isSupportedAudioFile;
Pierre's avatar
Pierre committed
47

48 49 50 51
@property (nonatomic, retain) NSNumber *seasonNumber;
@property (nonatomic, retain) NSNumber *remainingTime;
@property (nonatomic, retain) NSString *releaseYear;
@property (nonatomic, retain) NSNumber *lastPosition;
52 53
@property (nonatomic, retain) NSNumber *lastSubtitleTrack;
@property (nonatomic, retain) NSNumber *lastAudioTrack;
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
@property (nonatomic, retain) NSNumber *playCount;
@property (nonatomic, retain) NSString *artworkURL;
@property (nonatomic, retain) NSString *url;
@property (nonatomic, retain) NSString *type;
@property (nonatomic, retain) NSString *title;
@property (nonatomic, retain) NSString *shortSummary;
@property (nonatomic, retain) NSNumber *currentlyWatching;
@property (nonatomic, retain) NSNumber *episodeNumber;
@property (nonatomic, retain) NSNumber *unread;
@property (nonatomic, retain) NSNumber *hasFetchedInfo;
@property (nonatomic, retain) NSNumber *noOnlineMetaData;
@property (nonatomic, retain) MLShowEpisode *showEpisode;
@property (nonatomic, retain) NSSet *labels;
@property (nonatomic, retain) NSSet *tracks;
@property (nonatomic, retain) NSNumber *isOnDisk;
@property (nonatomic, retain) NSNumber *duration;
70 71 72 73 74
@property (nonatomic, retain) NSString *artist;
@property (nonatomic, retain) NSString *album;
@property (nonatomic, retain) NSNumber *albumTrackNumber;
@property (nonatomic, retain) NSString *genre;
@property (nonatomic, retain) MLAlbumTrack *albumTrack;
Pierre's avatar
Pierre committed
75

76
@property (nonatomic, retain) UIImage *computedThumbnail;
77 78
@property (nonatomic, assign) BOOL isSafe;
@property (nonatomic, assign) BOOL isBeingParsed;
Pierre's avatar
Pierre committed
79
@property (nonatomic, assign) BOOL thumbnailTimeouted;
80

81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
/**
 * the data in this object are about to be put on screen
 *
 * If multiple MLFile object are processed, this
 * increase the priority of the processing for this MLFile.
 */
- (void)willDisplay;

/**
 * We don't display the data of this object on screen.
 *
 * This put back the eventually increased priority for this MLFile,
 * to a default one.
 * \see willDisplay
 */
- (void)didHide;
97 98 99 100 101 102 103 104

/**
 * Shortcuts to the videoTracks.
 */
- (NSManagedObject *)videoTrack;

- (size_t)fileSizeInBytes;

Pierre's avatar
Pierre committed
105 106 107
@end


Pierre's avatar
Pierre committed
108
@interface MLFile (CoreDataGeneratedAccessors)
Pierre's avatar
Pierre committed
109 110 111 112 113
- (void)addLabelsObject:(NSManagedObject *)value;
- (void)removeLabelsObject:(NSManagedObject *)value;
- (void)addLabels:(NSSet *)value;
- (void)removeLabels:(NSSet *)value;

114 115 116 117
- (void)addTracksObject:(NSManagedObject *)value;
- (void)removeTracksObject:(NSManagedObject *)value;
- (void)addTracks:(NSSet *)value;
- (void)removeTracks:(NSSet *)value;
Pierre's avatar
Pierre committed
118 119
@end