AppleTVAppDelegate.m 4.58 KB
Newer Older
Felix Paul Kühne's avatar
Felix Paul Kühne committed
1 2 3 4 5 6 7 8 9 10 11
/*****************************************************************************
 * VLC for iOS
 *****************************************************************************
 * Copyright (c) 2015 VideoLAN. All rights reserved.
 * $Id$
 *
 * Authors: Felix Paul Kühne <fkuehne # videolan.org>
 *
 * Refer to the COPYING file of the official project for license.
 *****************************************************************************/

12
#import "AppleTVAppDelegate.h"
13
#import "VLCServerListTVViewController.h"
14
#import "VLCOpenNetworkStreamTVViewController.h"
15
#import "VLCSettingsViewController.h"
16
#import "VLCCloudServicesTVViewController.h"
17
#import "VLCHTTPUploaderController.h"
18
#import "VLCRemotePlaybackViewController.h"
19
#import <HockeySDK/HockeySDK.h>
Felix Paul Kühne's avatar
Felix Paul Kühne committed
20

21
@interface AppleTVAppDelegate ()
22 23 24
{
    UITabBarController *_mainViewController;

25
    VLCServerListTVViewController *_localNetworkVC;
26
    VLCCloudServicesTVViewController *_cloudServicesVC;
27
    VLCRemotePlaybackViewController *_remotePlaybackVC;
28
    VLCOpenNetworkStreamTVViewController *_openNetworkVC;
29
    VLCSettingsViewController *_settingsVC;
30
}
Felix Paul Kühne's avatar
Felix Paul Kühne committed
31 32 33

@end

34
@implementation AppleTVAppDelegate
Felix Paul Kühne's avatar
Felix Paul Kühne committed
35

36 37 38 39 40
+ (void)initialize
{
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

    NSDictionary *appDefaults = @{kVLCSettingContinueAudioInBackgroundKey : @(YES),
41
                                  kVLCSettingStretchAudio : @(YES),
42 43 44 45 46 47 48
                                  kVLCSettingTextEncoding : kVLCSettingTextEncodingDefaultValue,
                                  kVLCSettingSkipLoopFilter : kVLCSettingSkipLoopFilterNonRef,
                                  kVLCSettingSubtitlesFont : kVLCSettingSubtitlesFontDefaultValue,
                                  kVLCSettingSubtitlesFontColor : kVLCSettingSubtitlesFontColorDefaultValue,
                                  kVLCSettingSubtitlesFontSize : kVLCSettingSubtitlesFontSizeDefaultValue,
                                  kVLCSettingSubtitlesBoldFont: kVLCSettingSubtitlesBoldFontDefaultValue,
                                  kVLCSettingDeinterlace : kVLCSettingDeinterlaceDefaultValue,
49
                                  kVLCSettingHardwareDecoding : kVLCSettingHardwareDecodingDefault,
50 51 52
                                  kVLCSettingNetworkCaching : kVLCSettingNetworkCachingDefaultValue,
                                  kVLCSettingEqualizerProfile : kVLCSettingEqualizerProfileDefaultValue,
                                  kVLCSettingPlaybackForwardSkipLength : kVLCSettingPlaybackForwardSkipLengthDefaultValue,
53 54
                                  kVLCSettingPlaybackBackwardSkipLength : kVLCSettingPlaybackBackwardSkipLengthDefaultValue,
                                  kVLCSettingFTPTextEncoding : kVLCSettingFTPTextEncodingDefaultValue,
55
                                  kVLCSettingWiFiSharingIPv6 : kVLCSettingWiFiSharingIPv6DefaultValue,
56 57
                                  kVLCAutomaticallyPlayNextItem : @(YES),
                                  kVLCSettingDownloadArtwork : @(YES)};
58 59
    [defaults registerDefaults:appDefaults];
}
Felix Paul Kühne's avatar
Felix Paul Kühne committed
60

61 62
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
63
    BITHockeyManager *hockeyManager = [BITHockeyManager sharedHockeyManager];
64
    [hockeyManager configureWithIdentifier:@"f8697706993b44bba1c03cb7016cc325"];
65 66 67 68

    // Configure the SDK in here only!
    [hockeyManager startManager];

69
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
70
    _localNetworkVC = [[VLCServerListTVViewController alloc] initWithNibName:nil bundle:nil];
71
    _remotePlaybackVC = [[VLCRemotePlaybackViewController alloc] initWithNibName:nil bundle:nil];
72
    _openNetworkVC = [[VLCOpenNetworkStreamTVViewController alloc] initWithNibName:nil bundle:nil];
73
    _settingsVC = [[VLCSettingsViewController alloc] initWithNibName:nil bundle:nil];
74 75

    _mainViewController = [[UITabBarController alloc] init];
Felix Paul Kühne's avatar
Felix Paul Kühne committed
76
    _mainViewController.tabBar.barTintColor = [UIColor VLCOrangeTintColor];
77

78
    _mainViewController.viewControllers = @[[[UINavigationController alloc] initWithRootViewController:_localNetworkVC],
79
                                            [[UINavigationController alloc] initWithRootViewController:_remotePlaybackVC],
80
                                            [[UINavigationController alloc] initWithRootViewController:_openNetworkVC],
81
                                            [[UINavigationController alloc] initWithRootViewController:_settingsVC]];
82

83
    self.window.rootViewController = _mainViewController;
84

85 86
    // Init the HTTP Server
    [VLCHTTPUploaderController sharedInstance];
87

88
    [self.window makeKeyAndVisible];
Felix Paul Kühne's avatar
Felix Paul Kühne committed
89 90 91 92
    return YES;
}

@end