VLCExtension.m 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*****************************************************************************
  2. * VLCKit: VLCExtensions
  3. *****************************************************************************
  4. * Copyright (C) 2010-2012, 2014 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 "VLCExtension.h"
  23. #import <vlc_extensions.h>
  24. @interface VLCExtension ()
  25. {
  26. struct extension_t *_instance;
  27. }
  28. @end
  29. @implementation VLCExtension
  30. - (NSString *)description
  31. {
  32. return [NSString stringWithFormat:@"VLC Extension %@", [self name]];
  33. }
  34. - (instancetype)initWithInstance:(struct extension_t *)instance
  35. {
  36. self = [super init];
  37. if (!self)
  38. return nil;
  39. _instance = instance;
  40. return self;
  41. }
  42. - (struct extension_t *)instance
  43. {
  44. return _instance;
  45. }
  46. - (NSString *)name
  47. {
  48. return @(_instance->psz_name);
  49. }
  50. - (NSString *)title
  51. {
  52. return @(_instance->psz_title);
  53. }
  54. @end