diff --git a/Limelight.xcodeproj/project.pbxproj b/Limelight.xcodeproj/project.pbxproj index f4b39423..458f1879 100644 --- a/Limelight.xcodeproj/project.pbxproj +++ b/Limelight.xcodeproj/project.pbxproj @@ -25,8 +25,8 @@ FB290DB719B2C870004C83CF /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = FB290DB619B2C870004C83CF /* libz.dylib */; }; FB290DB919B2C877004C83CF /* libbz2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = FB290DB819B2C877004C83CF /* libbz2.dylib */; }; FB290DC419B2E98F004C83CF /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = FB290DC319B2E98F004C83CF /* libxml2.dylib */; }; - FB290E7919B37D81004C83CF /* MainFrame-iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FB290E7819B37D81004C83CF /* MainFrame-iPad.storyboard */; }; - FB290E7B19B38036004C83CF /* MainFrame-iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FB290E7A19B38036004C83CF /* MainFrame-iPhone.storyboard */; }; + FB290E7919B37D81004C83CF /* iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FB290E7819B37D81004C83CF /* iPad.storyboard */; }; + FB290E7B19B38036004C83CF /* iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FB290E7A19B38036004C83CF /* iPhone.storyboard */; }; FB7E794419C8B71B00A15F68 /* libiconv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = FB7E794319C8B71B00A15F68 /* libiconv.dylib */; }; FB89462819F646E200339C8A /* CryptoManager.m in Sources */ = {isa = PBXBuildFile; fileRef = FB89460619F646E200339C8A /* CryptoManager.m */; }; FB89462919F646E200339C8A /* mkcert.c in Sources */ = {isa = PBXBuildFile; fileRef = FB89460719F646E200339C8A /* mkcert.c */; }; @@ -47,6 +47,9 @@ FB8946EB19F6AFE100339C8A /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FB8946E019F6AFB800339C8A /* libcrypto.a */; }; FB8946EC19F6AFE400339C8A /* libssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FB8946E119F6AFB800339C8A /* libssl.a */; }; FB8946ED19F6AFE800339C8A /* libopus.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FB8946EA19F6AFB800339C8A /* libopus.a */; }; + FBDE86E019F7A837001C18A8 /* UIComputerView.m in Sources */ = {isa = PBXBuildFile; fileRef = FBDE86DF19F7A837001C18A8 /* UIComputerView.m */; }; + FBDE86E619F82297001C18A8 /* UIAppView.m in Sources */ = {isa = PBXBuildFile; fileRef = FBDE86E519F82297001C18A8 /* UIAppView.m */; }; + FBDE86E919F82315001C18A8 /* App.m in Sources */ = {isa = PBXBuildFile; fileRef = FBDE86E819F82315001C18A8 /* App.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -95,8 +98,8 @@ FB290DB619B2C870004C83CF /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; FB290DB819B2C877004C83CF /* libbz2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libbz2.dylib; path = usr/lib/libbz2.dylib; sourceTree = SDKROOT; }; FB290DC319B2E98F004C83CF /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = usr/lib/libxml2.dylib; sourceTree = SDKROOT; }; - FB290E7819B37D81004C83CF /* MainFrame-iPad.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = "MainFrame-iPad.storyboard"; sourceTree = SOURCE_ROOT; }; - FB290E7A19B38036004C83CF /* MainFrame-iPhone.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = "MainFrame-iPhone.storyboard"; sourceTree = SOURCE_ROOT; }; + FB290E7819B37D81004C83CF /* iPad.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = iPad.storyboard; sourceTree = SOURCE_ROOT; }; + FB290E7A19B38036004C83CF /* iPhone.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = iPhone.storyboard; sourceTree = SOURCE_ROOT; }; FB7E794319C8B71B00A15F68 /* libiconv.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libiconv.dylib; path = usr/lib/libiconv.dylib; sourceTree = SDKROOT; }; FB89460519F646E200339C8A /* CryptoManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoManager.h; sourceTree = ""; }; FB89460619F646E200339C8A /* CryptoManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CryptoManager.m; sourceTree = ""; }; @@ -211,6 +214,12 @@ FB8946E719F6AFB800339C8A /* opus_multistream.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = opus_multistream.h; sourceTree = ""; }; FB8946E819F6AFB800339C8A /* opus_types.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = opus_types.h; sourceTree = ""; }; FB8946EA19F6AFB800339C8A /* libopus.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libopus.a; sourceTree = ""; }; + FBDE86DE19F7A837001C18A8 /* UIComputerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIComputerView.h; sourceTree = ""; }; + FBDE86DF19F7A837001C18A8 /* UIComputerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIComputerView.m; sourceTree = ""; }; + FBDE86E419F82297001C18A8 /* UIAppView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIAppView.h; sourceTree = ""; }; + FBDE86E519F82297001C18A8 /* UIAppView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIAppView.m; sourceTree = ""; }; + FBDE86E719F82315001C18A8 /* App.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = App.h; sourceTree = ""; }; + FBDE86E819F82315001C18A8 /* App.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = App.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -302,11 +311,17 @@ FB290CFA19B2C406004C83CF /* Supporting Files */, FB290D0219B2C406004C83CF /* AppDelegate.h */, FB290D0319B2C406004C83CF /* AppDelegate.m */, - FB290E7819B37D81004C83CF /* MainFrame-iPad.storyboard */, - FB290E7A19B38036004C83CF /* MainFrame-iPhone.storyboard */, + FB290E7819B37D81004C83CF /* iPad.storyboard */, + FB290E7A19B38036004C83CF /* iPhone.storyboard */, FB89463719F6473800339C8A /* Launch Screen.xib */, FB290D0819B2C406004C83CF /* Images.xcassets */, FB290D0519B2C406004C83CF /* Limelight.xcdatamodeld */, + FBDE86DE19F7A837001C18A8 /* UIComputerView.h */, + FBDE86DF19F7A837001C18A8 /* UIComputerView.m */, + FBDE86E419F82297001C18A8 /* UIAppView.h */, + FBDE86E519F82297001C18A8 /* UIAppView.m */, + FBDE86E719F82315001C18A8 /* App.h */, + FBDE86E819F82315001C18A8 /* App.m */, ); path = Limelight; sourceTree = ""; @@ -668,9 +683,9 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - FB290E7919B37D81004C83CF /* MainFrame-iPad.storyboard in Resources */, + FB290E7919B37D81004C83CF /* iPad.storyboard in Resources */, FB290CFE19B2C406004C83CF /* InfoPlist.strings in Resources */, - FB290E7B19B38036004C83CF /* MainFrame-iPhone.storyboard in Resources */, + FB290E7B19B38036004C83CF /* iPhone.storyboard in Resources */, FB290D0919B2C406004C83CF /* Images.xcassets in Resources */, FB89463819F6473800339C8A /* Launch Screen.xib in Resources */, ); @@ -695,9 +710,12 @@ FB89463219F646E200339C8A /* VideoDecoderRenderer.m in Sources */, FB290D0419B2C406004C83CF /* AppDelegate.m in Sources */, FB89463419F646E200339C8A /* Utils.m in Sources */, + FBDE86E619F82297001C18A8 /* UIAppView.m in Sources */, FB89463319F646E200339C8A /* Computer.m in Sources */, FB89462F19F646E200339C8A /* Connection.m in Sources */, FB89462919F646E200339C8A /* mkcert.c in Sources */, + FBDE86E019F7A837001C18A8 /* UIComputerView.m in Sources */, + FBDE86E919F82315001C18A8 /* App.m in Sources */, FB89463019F646E200339C8A /* StreamConfiguration.m in Sources */, FB89462C19F646E200339C8A /* HttpManager.m in Sources */, FB89462D19F646E200339C8A /* MDNSManager.m in Sources */, diff --git a/Limelight/App.h b/Limelight/App.h new file mode 100644 index 00000000..31eab9d5 --- /dev/null +++ b/Limelight/App.h @@ -0,0 +1,15 @@ +// +// App.h +// Limelight +// +// Created by Diego Waxemberg on 10/22/14. +// Copyright (c) 2014 Limelight Stream. All rights reserved. +// + +#import + +@interface App : NSObject + +@property NSString* displayName; + +@end diff --git a/Limelight/App.m b/Limelight/App.m new file mode 100644 index 00000000..2e71b67a --- /dev/null +++ b/Limelight/App.m @@ -0,0 +1,13 @@ +// +// App.m +// Limelight +// +// Created by Diego Waxemberg on 10/22/14. +// Copyright (c) 2014 Limelight Stream. All rights reserved. +// + +#import "App.h" + +@implementation App + +@end diff --git a/Limelight/Images.xcassets/Computer.imageset/Contents.json b/Limelight/Images.xcassets/Computer.imageset/Contents.json new file mode 100644 index 00000000..8b6e0cc8 --- /dev/null +++ b/Limelight/Images.xcassets/Computer.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "limelight_computer_2x-1.png" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "limelight_computer_2x.png" + }, + { + "idiom" : "universal", + "scale" : "3x", + "filename" : "limelight_computer_2x-2.png" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Limelight/Images.xcassets/Computer.imageset/limelight_computer_2x-1.png b/Limelight/Images.xcassets/Computer.imageset/limelight_computer_2x-1.png new file mode 100644 index 00000000..df5cde9f Binary files /dev/null and b/Limelight/Images.xcassets/Computer.imageset/limelight_computer_2x-1.png differ diff --git a/Limelight/Images.xcassets/Computer.imageset/limelight_computer_2x-2.png b/Limelight/Images.xcassets/Computer.imageset/limelight_computer_2x-2.png new file mode 100644 index 00000000..df5cde9f Binary files /dev/null and b/Limelight/Images.xcassets/Computer.imageset/limelight_computer_2x-2.png differ diff --git a/Limelight/Images.xcassets/Computer.imageset/limelight_computer_2x.png b/Limelight/Images.xcassets/Computer.imageset/limelight_computer_2x.png new file mode 100644 index 00000000..df5cde9f Binary files /dev/null and b/Limelight/Images.xcassets/Computer.imageset/limelight_computer_2x.png differ diff --git a/Limelight/Images.xcassets/Left4Dead2.imageset/Contents.json b/Limelight/Images.xcassets/Left4Dead2.imageset/Contents.json new file mode 100644 index 00000000..52fbbb2c --- /dev/null +++ b/Limelight/Images.xcassets/Left4Dead2.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x", + "filename" : "Left4Dead2-2.jpg" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "Left4Dead2.jpg" + }, + { + "idiom" : "universal", + "scale" : "3x", + "filename" : "Left4Dead2-1.jpg" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Limelight/Images.xcassets/Left4Dead2.imageset/Left4Dead2-1.jpg b/Limelight/Images.xcassets/Left4Dead2.imageset/Left4Dead2-1.jpg new file mode 100644 index 00000000..ffd4f4af Binary files /dev/null and b/Limelight/Images.xcassets/Left4Dead2.imageset/Left4Dead2-1.jpg differ diff --git a/Limelight/Images.xcassets/Left4Dead2.imageset/Left4Dead2-2.jpg b/Limelight/Images.xcassets/Left4Dead2.imageset/Left4Dead2-2.jpg new file mode 100644 index 00000000..ffd4f4af Binary files /dev/null and b/Limelight/Images.xcassets/Left4Dead2.imageset/Left4Dead2-2.jpg differ diff --git a/Limelight/Images.xcassets/Left4Dead2.imageset/Left4Dead2.jpg b/Limelight/Images.xcassets/Left4Dead2.imageset/Left4Dead2.jpg new file mode 100644 index 00000000..ffd4f4af Binary files /dev/null and b/Limelight/Images.xcassets/Left4Dead2.imageset/Left4Dead2.jpg differ diff --git a/Limelight/Limelight-Info.plist b/Limelight/Limelight-Info.plist index 394d51ce..6b6e735e 100644 --- a/Limelight/Limelight-Info.plist +++ b/Limelight/Limelight-Info.plist @@ -29,9 +29,9 @@ UILaunchStoryboardName Launch Screen UIMainStoryboardFile - MainFrame-iPhone + iPhone UIMainStoryboardFile~ipad - MainFrame-iPad + iPad UIRequiredDeviceCapabilities armv7 @@ -44,8 +44,6 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown UISupportedInterfaceOrientations~ipad diff --git a/Limelight/UIAppView.h b/Limelight/UIAppView.h new file mode 100644 index 00000000..a184b1d5 --- /dev/null +++ b/Limelight/UIAppView.h @@ -0,0 +1,16 @@ +// +// UIAppView.h +// Limelight +// +// Created by Diego Waxemberg on 10/22/14. +// Copyright (c) 2014 Limelight Stream. All rights reserved. +// + +#import +#import "App.h" + +@interface UIAppView : UIView + +- (id) initWithApp:(App*)app; + +@end diff --git a/Limelight/UIAppView.m b/Limelight/UIAppView.m new file mode 100644 index 00000000..1d2ea6eb --- /dev/null +++ b/Limelight/UIAppView.m @@ -0,0 +1,50 @@ +// +// UIAppView.m +// Limelight +// +// Created by Diego Waxemberg on 10/22/14. +// Copyright (c) 2014 Limelight Stream. All rights reserved. +// + +#import "UIAppView.h" + +@implementation UIAppView { + App* _app; + UIButton* _appButton; + UILabel* _appLabel; +} +static int LABEL_DY = 20; + +- (id) initWithApp:(App*)app { + self = [super init]; + _app = app; + + _appButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_appButton setContentEdgeInsets:UIEdgeInsetsMake(0, 4, 0, 4)]; + [_appButton setBackgroundImage:[[UIImage imageNamed:@"Left4Dead2"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10)] forState:UIControlStateNormal]; + [_appButton sizeToFit]; + + _appLabel = [[UILabel alloc] init]; + [_appLabel setText:_app.displayName]; + [_appLabel sizeToFit]; + _appLabel.center = CGPointMake(_appButton.bounds.origin.x + (_appButton.bounds.size.width / 2), _appButton.bounds.origin.y + _appButton.bounds.size.height + LABEL_DY); + + [self addSubview:_appButton]; + [self addSubview:_appLabel]; + + self.frame = CGRectMake(0, 0, _appButton.frame.size.width > _appLabel.frame.size.width ? _appButton.frame.size.width : _appLabel.frame.size.width, _appButton.frame.size.height + _appLabel.frame.size.height); + + return self; +} + + + +/* +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +- (void)drawRect:(CGRect)rect { + // Drawing code +} +*/ + +@end diff --git a/Limelight/UIComputerView.h b/Limelight/UIComputerView.h new file mode 100644 index 00000000..c603bd06 --- /dev/null +++ b/Limelight/UIComputerView.h @@ -0,0 +1,16 @@ +// +// UIComputerView.h +// Limelight +// +// Created by Diego Waxemberg on 10/22/14. +// Copyright (c) 2014 Limelight Stream. All rights reserved. +// + +#import +#import "Computer.h" + +@interface UIComputerView : UIView + +- (id) initWithComputer:(Computer*)computer; + +@end diff --git a/Limelight/UIComputerView.m b/Limelight/UIComputerView.m new file mode 100644 index 00000000..0efb1115 --- /dev/null +++ b/Limelight/UIComputerView.m @@ -0,0 +1,48 @@ +// +// UIComputerView.m +// Limelight +// +// Created by Diego Waxemberg on 10/22/14. +// Copyright (c) 2014 Limelight Stream. All rights reserved. +// + +#import "UIComputerView.h" + +@implementation UIComputerView { + Computer* _computer; + UIButton* _hostButton; + UILabel* _hostLabel; +} +static int LABEL_DY = 20; + +- (id) initWithComputer:(Computer*)computer { + self = [super init]; + _computer = computer; + + _hostButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_hostButton setContentEdgeInsets:UIEdgeInsetsMake(0, 4, 0, 4)]; + [_hostButton setBackgroundImage:[[UIImage imageNamed:@"Computer"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 10, 10, 10)] forState:UIControlStateNormal]; + [_hostButton sizeToFit]; + + _hostLabel = [[UILabel alloc] init]; + [_hostLabel setText:[_computer displayName]]; + [_hostLabel sizeToFit]; + _hostLabel.center = CGPointMake(_hostButton.bounds.origin.x + (_hostButton.bounds.size.width / 2), _hostButton.bounds.origin.y + _hostButton.bounds.size.height + LABEL_DY); + + [self addSubview:_hostButton]; + [self addSubview:_hostLabel]; + + self.frame = CGRectMake(0, 0, _hostButton.frame.size.width > _hostLabel.frame.size.width ? _hostButton.frame.size.width : _hostLabel.frame.size.width, _hostButton.frame.size.height + _hostLabel.frame.size.height); + + return self; +} + +/* +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +- (void)drawRect:(CGRect)rect { + // Drawing code +} +*/ + +@end diff --git a/Limelight/ViewControllers/MainFrameViewController.h b/Limelight/ViewControllers/MainFrameViewController.h index d4777f96..7265ca9a 100644 --- a/Limelight/ViewControllers/MainFrameViewController.h +++ b/Limelight/ViewControllers/MainFrameViewController.h @@ -11,15 +11,7 @@ #import "PairManager.h" #import "StreamConfiguration.h" -@interface MainFrameViewController : UIViewController -@property (strong, nonatomic) IBOutlet UIPickerView *HostPicker; -- (IBAction)StreamButton:(UIButton *)sender; -- (IBAction)PairButton:(UIButton *)sender; - -@property (strong, nonatomic) IBOutlet UIPickerView *StreamConfigs; -@property (strong, nonatomic) NSArray* streamConfigVals; -@property (strong, nonatomic) NSArray* hostPickerVals; -@property (strong, nonatomic) IBOutlet UITextField *hostTextField; +@interface MainFrameViewController : UIViewController + (StreamConfiguration*) getStreamConfiguration; diff --git a/Limelight/ViewControllers/MainFrameViewController.m b/Limelight/ViewControllers/MainFrameViewController.m index f1419b3d..1ebcd910 100644 --- a/Limelight/ViewControllers/MainFrameViewController.m +++ b/Limelight/ViewControllers/MainFrameViewController.m @@ -1,4 +1,4 @@ -// + // MainFrameViewController.m // Limelight-iOS // @@ -14,6 +14,9 @@ #import "VideoDecoderRenderer.h" #import "StreamManager.h" #import "Utils.h" +#import "UIComputerView.h" +#import "UIAppView.h" +#import "App.h" @implementation MainFrameViewController { NSOperationQueue* _opQueue; @@ -27,6 +30,8 @@ static StreamConfiguration* streamConfig; return streamConfig; } +//TODO: no more pair button +/* - (void)PairButton:(UIButton *)sender { NSLog(@"Pair Button Pressed!"); @@ -34,7 +39,7 @@ static StreamConfiguration* streamConfig; _selectedHost = [[Computer alloc] initWithIp:self.hostTextField.text]; NSLog(@"Using custom host: %@", self.hostTextField.text); } - + if (![self validatePcSelected]) { NSLog(@"No valid PC selected"); return; @@ -54,6 +59,7 @@ static StreamConfiguration* streamConfig; [_opQueue addOperation:pMan]; } +*/ - (void)showPIN:(NSString *)PIN { dispatch_sync(dispatch_get_main_queue(), ^{ @@ -86,9 +92,12 @@ static StreamConfiguration* streamConfig; [self presentViewController:alert animated:YES completion:nil]; } +//TODO: No more stream button +/* - (void)StreamButton:(UIButton *)sender { NSLog(@"Stream Button Pressed!"); + if ([self.hostTextField.text length] > 0) { _selectedHost = [[Computer alloc] initWithIp:self.hostTextField.text]; NSLog(@"Using custom host: %@", self.hostTextField.text); @@ -139,18 +148,9 @@ static StreamConfiguration* streamConfig; NSLog(@"StreamConfig: %@, %d, %dx%dx%d at %d Mbps", streamConfig.host, streamConfig.hostAddr, streamConfig.width, streamConfig.height, streamConfig.frameRate, streamConfig.bitRate); [self performSegueWithIdentifier:@"createStreamFrame" sender:self]; } +*/ -- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component -{ - if (pickerView == self.StreamConfigs) { - return [self.streamConfigVals objectAtIndex:row]; - } else if (pickerView == self.HostPicker) { - return ((Computer*)([self.hostPickerVals objectAtIndex:row])).displayName; - } else { - return nil; - } -} - +/* - (void)setSelectedHost:(NSInteger)selectedIndex { _selectedHost = (Computer*)([self.hostPickerVals objectAtIndex:selectedIndex]); @@ -159,58 +159,71 @@ static StreamConfiguration* streamConfig; _selectedHost = NULL; } } +*/ -- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component -{ - if (pickerView == self.HostPicker) { - [self setSelectedHost:[self.HostPicker selectedRowInComponent:0]]; - } - - //TODO: figure out how to save this info!! -} - -// returns the number of 'columns' to display. -- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView -{ - return 1; -} - -// returns the # of rows in each component.. -- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component -{ - if (pickerView == self.StreamConfigs) { - return self.streamConfigVals.count; - } else if (pickerView == self.HostPicker) { - return self.hostPickerVals.count; - } else { - return 0; - } -} - (void)viewDidLoad { [super viewDidLoad]; - self.streamConfigVals = [[NSArray alloc] initWithObjects:@"1280x720 (30Hz)", @"1280x720 (60Hz)", @"1920x1080 (30Hz)", @"1920x1080 (60Hz)",nil]; - [self.StreamConfigs selectRow:1 inComponent:0 animated:NO]; + NSArray* streamConfigVals = [[NSArray alloc] initWithObjects:@"1280x720 (30Hz)", @"1280x720 (60Hz)", @"1920x1080 (30Hz)", @"1920x1080 (60Hz)",nil]; _opQueue = [[NSOperationQueue alloc] init]; // Initialize the host picker list - [self updateHosts:[[NSArray alloc] init]]; + //[self updateHosts:[[NSArray alloc] init]]; + + Computer* test = [[Computer alloc] initWithIp:@"CEMENT-TRUCK"]; + + + UIScrollView* hostScrollView = [[UIScrollView alloc] init]; + hostScrollView.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height / 2); + [hostScrollView setShowsHorizontalScrollIndicator:NO]; + UIComputerView* compView; + for (int i = 0; i < 5; i++) { + compView = [[UIComputerView alloc] initWithComputer:test]; + [hostScrollView addSubview:compView]; + [compView sizeToFit]; + compView.center = CGPointMake((compView.frame.size.width + 20) * i + compView.frame.size.width, hostScrollView.frame.size.height / 2); + + } + + [hostScrollView setContentSize:CGSizeMake(compView.frame.size.width * 5 + compView.frame.size.width, hostScrollView.frame.size.height)]; + + + UIScrollView* appScrollView = [[UIScrollView alloc] init]; + appScrollView.frame = CGRectMake(0, hostScrollView.frame.size.height, self.view.frame.size.width, self.view.frame.size.height / 2); + [appScrollView setShowsHorizontalScrollIndicator:NO]; + + + App* testApp = [[App alloc] init]; + testApp.displayName = @"Left 4 Dead 2"; + UIAppView* appView; + for (int i = 0; i < 5; i++) { + appView = [[UIAppView alloc] initWithApp:testApp]; + [appScrollView addSubview:appView]; + [appView sizeToFit]; + appView.center = CGPointMake((appView.frame.size.width + 20) * i + compView.frame.size.width, appScrollView.frame.size.height / 2); + } + + [appScrollView setContentSize:CGSizeMake(appView.frame.size.width * 5 + appView.frame.size.width, appScrollView.frame.size.height)]; + + [self.view addSubview:hostScrollView]; + [self.view addSubview:appScrollView]; + } - (void)viewDidAppear:(BOOL)animated { - [super viewDidAppear:animated]; - _mDNSManager = [[MDNSManager alloc] initWithCallback:self]; - [_mDNSManager searchForHosts]; + [super viewDidDisappear:animated]; + //_mDNSManager = [[MDNSManager alloc] initWithCallback:self]; + // [_mDNSManager searchForHosts]; } - (void)viewDidDisappear:(BOOL)animated { - [super viewDidDisappear:animated]; - [_mDNSManager stopSearching]; + [super viewDidDisappear:animated]; + // [_mDNSManager stopSearching]; } - (void)updateHosts:(NSArray *)hosts { @@ -219,11 +232,6 @@ static StreamConfiguration* streamConfig; if ([hostPickerValues count] == 0) { [hostPickerValues addObject:[[Computer alloc] initPlaceholder]]; } - - self.hostPickerVals = hostPickerValues; - [self.HostPicker reloadAllComponents]; - - [self setSelectedHost:[self.HostPicker selectedRowInComponent:0]]; } - (BOOL)validatePcSelected { @@ -257,22 +265,4 @@ static StreamConfiguration* streamConfig; - (BOOL)shouldAutorotate { return YES; } - -- (NSUInteger)supportedInterfaceOrientations { - NSString *deviceType = [UIDevice currentDevice].model; - if ([deviceType containsString:@"iPhone"] || [deviceType containsString:@"iPod"]) { - return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown; - } else { - return UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight; - } -} - -- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { - NSString *deviceType = [UIDevice currentDevice].model; - if ([deviceType containsString:@"iPhone"] || [deviceType containsString:@"iPod"]) { - return UIInterfaceOrientationPortrait; - } else { - return UIInterfaceOrientationLandscapeRight; - } -} @end diff --git a/Limelight/ViewControllers/StreamFrameViewController.m b/Limelight/ViewControllers/StreamFrameViewController.m index 588bee9e..e05aec06 100644 --- a/Limelight/ViewControllers/StreamFrameViewController.m +++ b/Limelight/ViewControllers/StreamFrameViewController.m @@ -118,13 +118,4 @@ - (BOOL)shouldAutorotate { return YES; } - -- (NSUInteger)supportedInterfaceOrientations { - return UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight; -} - -- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { - return UIInterfaceOrientationLandscapeRight; -} - @end diff --git a/MainFrame-iPad.storyboard b/MainFrame-iPad.storyboard deleted file mode 100644 index 9eb04319..00000000 --- a/MainFrame-iPad.storyboard +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/MainFrame-iPhone.storyboard b/MainFrame-iPhone.storyboard deleted file mode 100644 index 4aecfbb1..00000000 --- a/MainFrame-iPhone.storyboard +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/iPad.storyboard b/iPad.storyboard new file mode 100644 index 00000000..eb77d969 --- /dev/null +++ b/iPad.storyboard @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iPhone.storyboard b/iPhone.storyboard new file mode 100644 index 00000000..098b0cc6 --- /dev/null +++ b/iPhone.storyboard @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +