VLCMediaThumbnailer.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*****************************************************************************
  2. * VLCKit: VLCMediaThumbnailer
  3. *****************************************************************************
  4. * Copyright (C) 2010-2012 Pierre d'Herbemont and VideoLAN
  5. *
  6. * Authors: Pierre d'Herbemont
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU Lesser General Public License as published by
  10. * the Free Software Foundation; either version 2.1 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public License
  19. * along with this program; if not, write to the Free Software Foundation,
  20. * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  21. *****************************************************************************/
  22. #import <Foundation/Foundation.h>
  23. #if TARGET_OS_IPHONE
  24. # import <CoreGraphics/CoreGraphics.h>
  25. #endif
  26. @class VLCMedia;
  27. @class VLCLibrary;
  28. @protocol VLCMediaThumbnailerDelegate;
  29. @interface VLCMediaThumbnailer : NSObject
  30. + (VLCMediaThumbnailer *)thumbnailerWithMedia:(VLCMedia *)media andDelegate:(id<VLCMediaThumbnailerDelegate>)delegate;
  31. + (VLCMediaThumbnailer *)thumbnailerWithMedia:(VLCMedia *)media delegate:(id<VLCMediaThumbnailerDelegate>)delegate andVLCLibrary:(VLCLibrary *)library;
  32. - (void)fetchThumbnail;
  33. @property (readwrite, weak, nonatomic) id<VLCMediaThumbnailerDelegate> delegate;
  34. @property (readwrite, nonatomic) VLCMedia *media;
  35. @property (readwrite, assign, nonatomic) CGImageRef thumbnail;
  36. @property (readwrite) void * libVLCinstance;
  37. /**
  38. * Thumbnail Height
  39. * You shouldn't change this after -fetchThumbnail
  40. * has been called.
  41. * @return thumbnail height. Default value 240.
  42. */
  43. @property (readwrite, assign, nonatomic) CGFloat thumbnailHeight;
  44. /**
  45. * Thumbnail Width
  46. * You shouldn't change this after -fetchThumbnail
  47. * has been called.
  48. * @return thumbnail height. Default value 320
  49. */
  50. @property (readwrite, assign, nonatomic) CGFloat thumbnailWidth;
  51. /**
  52. * Snapshot Position
  53. * You shouldn't change this after -fetchThumbnail
  54. * has been called.
  55. * @return snapshot position. Default value 0.5
  56. */
  57. @property (readwrite, assign, nonatomic) float snapshotPosition;
  58. @end
  59. @protocol VLCMediaThumbnailerDelegate
  60. @required
  61. - (void)mediaThumbnailerDidTimeOut:(VLCMediaThumbnailer *)mediaThumbnailer;
  62. - (void)mediaThumbnailer:(VLCMediaThumbnailer *)mediaThumbnailer didFinishThumbnail:(CGImageRef)thumbnail;
  63. @end