VLCMediaThumbnailer.h 2.61 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
/*****************************************************************************
 * VLCKit: VLCMediaThumbnailer
 *****************************************************************************
 * Copyright (C) 2010-2012 Pierre d'Herbemont and VideoLAN
 *
 * Authors: Pierre d'Herbemont
 *
 * 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.
 *****************************************************************************/
Pierre's avatar
Pierre committed
22 23 24 25 26 27 28

#import <Foundation/Foundation.h>
#if TARGET_OS_IPHONE
# import <CoreGraphics/CoreGraphics.h>
#endif

@class VLCMedia;
29
@class VLCLibrary;
Pierre's avatar
Pierre committed
30 31
@protocol VLCMediaThumbnailerDelegate;

32
@interface VLCMediaThumbnailer : NSObject
Pierre's avatar
Pierre committed
33 34

+ (VLCMediaThumbnailer *)thumbnailerWithMedia:(VLCMedia *)media andDelegate:(id<VLCMediaThumbnailerDelegate>)delegate;
35
+ (VLCMediaThumbnailer *)thumbnailerWithMedia:(VLCMedia *)media delegate:(id<VLCMediaThumbnailerDelegate>)delegate andVLCLibrary:(VLCLibrary *)library;
Pierre's avatar
Pierre committed
36 37
- (void)fetchThumbnail;

38 39
@property (readwrite, weak) id<VLCMediaThumbnailerDelegate> delegate;
@property (readwrite) VLCMedia *media;
Pierre's avatar
Pierre committed
40
@property (readwrite, assign) CGImageRef thumbnail;
41
@property (readwrite) void * libVLCinstance;
Pierre's avatar
Pierre committed
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57

/**
 * Thumbnail Height
 * You shouldn't change this after -fetchThumbnail
 * has been called.
 * @return thumbnail height. Default value 240.
 */
@property (readwrite, assign) CGFloat thumbnailHeight;

/**
 * Thumbnail Width
 * You shouldn't change this after -fetchThumbnail
 * has been called.
 * @return thumbnail height. Default value 320
 */
@property (readwrite, assign) CGFloat thumbnailWidth;
58 59 60 61 62 63 64

/**
 * Snapshot Position
 * You shouldn't change this after -fetchThumbnail
 * has been called.
 * @return snapshot position. Default value 0.5
 */
65
@property (readwrite, assign) float snapshotPosition;
Pierre's avatar
Pierre committed
66 67 68 69
@end

@protocol VLCMediaThumbnailerDelegate
@required
70
- (void)mediaThumbnailerDidTimeOut:(VLCMediaThumbnailer *)mediaThumbnailer;
Pierre's avatar
Pierre committed
71 72
- (void)mediaThumbnailer:(VLCMediaThumbnailer *)mediaThumbnailer didFinishThumbnail:(CGImageRef)thumbnail;
@end