AppleTVAppDelegate.m 4.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*****************************************************************************
  2. * VLC for iOS
  3. *****************************************************************************
  4. * Copyright (c) 2015 VideoLAN. All rights reserved.
  5. * $Id$
  6. *
  7. * Authors: Felix Paul Kühne <fkuehne # videolan.org>
  8. *
  9. * Refer to the COPYING file of the official project for license.
  10. *****************************************************************************/
  11. #import "AppleTVAppDelegate.h"
  12. #import "VLCServerListTVViewController.h"
  13. #import "VLCOpenNetworkStreamTVViewController.h"
  14. #import "VLCSettingsViewController.h"
  15. #import "VLCCloudServicesTVViewController.h"
  16. #import "VLCHTTPUploaderController.h"
  17. #import "VLCRemotePlaybackViewController.h"
  18. #import <HockeySDK/HockeySDK.h>
  19. @interface AppleTVAppDelegate ()
  20. {
  21. UITabBarController *_mainViewController;
  22. VLCServerListTVViewController *_localNetworkVC;
  23. VLCCloudServicesTVViewController *_cloudServicesVC;
  24. VLCRemotePlaybackViewController *_remotePlaybackVC;
  25. VLCOpenNetworkStreamTVViewController *_openNetworkVC;
  26. VLCSettingsViewController *_settingsVC;
  27. }
  28. @end
  29. @implementation AppleTVAppDelegate
  30. + (void)initialize
  31. {
  32. NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
  33. NSDictionary *appDefaults = @{kVLCSettingContinueAudioInBackgroundKey : @(YES),
  34. kVLCSettingStretchAudio : @(YES),
  35. kVLCSettingTextEncoding : kVLCSettingTextEncodingDefaultValue,
  36. kVLCSettingSkipLoopFilter : kVLCSettingSkipLoopFilterNonRef,
  37. kVLCSettingSubtitlesFont : kVLCSettingSubtitlesFontDefaultValue,
  38. kVLCSettingSubtitlesFontColor : kVLCSettingSubtitlesFontColorDefaultValue,
  39. kVLCSettingSubtitlesFontSize : kVLCSettingSubtitlesFontSizeDefaultValue,
  40. kVLCSettingSubtitlesBoldFont: kVLCSettingSubtitlesBoldFontDefaultValue,
  41. kVLCSettingDeinterlace : kVLCSettingDeinterlaceDefaultValue,
  42. kVLCSettingHardwareDecoding : kVLCSettingHardwareDecodingDefault,
  43. kVLCSettingNetworkCaching : kVLCSettingNetworkCachingDefaultValue,
  44. kVLCSettingEqualizerProfileDisabled : @(YES),
  45. kVLCSettingEqualizerProfile : kVLCSettingEqualizerProfileDefaultValue,
  46. kVLCSettingPlaybackForwardSkipLength : kVLCSettingPlaybackForwardSkipLengthDefaultValue,
  47. kVLCSettingPlaybackBackwardSkipLength : kVLCSettingPlaybackBackwardSkipLengthDefaultValue,
  48. kVLCSettingFTPTextEncoding : kVLCSettingFTPTextEncodingDefaultValue,
  49. kVLCSettingWiFiSharingIPv6 : kVLCSettingWiFiSharingIPv6DefaultValue,
  50. kVLCAutomaticallyPlayNextItem : @(YES),
  51. kVLCSettingDownloadArtwork : @(YES)};
  52. [defaults registerDefaults:appDefaults];
  53. }
  54. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  55. {
  56. BITHockeyManager *hockeyManager = [BITHockeyManager sharedHockeyManager];
  57. [hockeyManager configureWithIdentifier:@"f8697706993b44bba1c03cb7016cc325"];
  58. // Configure the SDK in here only!
  59. [hockeyManager startManager];
  60. self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
  61. _localNetworkVC = [[VLCServerListTVViewController alloc] initWithNibName:nil bundle:nil];
  62. _remotePlaybackVC = [[VLCRemotePlaybackViewController alloc] initWithNibName:nil bundle:nil];
  63. _openNetworkVC = [[VLCOpenNetworkStreamTVViewController alloc] initWithNibName:nil bundle:nil];
  64. _settingsVC = [[VLCSettingsViewController alloc] initWithNibName:nil bundle:nil];
  65. _mainViewController = [[UITabBarController alloc] init];
  66. _mainViewController.tabBar.barTintColor = [UIColor VLCOrangeTintColor];
  67. _mainViewController.viewControllers = @[[[UINavigationController alloc] initWithRootViewController:_localNetworkVC],
  68. [[UINavigationController alloc] initWithRootViewController:_remotePlaybackVC],
  69. [[UINavigationController alloc] initWithRootViewController:_openNetworkVC],
  70. [[UINavigationController alloc] initWithRootViewController:_settingsVC]];
  71. self.window.rootViewController = _mainViewController;
  72. // Init the HTTP Server
  73. [VLCHTTPUploaderController sharedInstance];
  74. [self.window makeKeyAndVisible];
  75. return YES;
  76. }
  77. @end