mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2025-07-23 20:53:49 +00:00
82 lines
2.2 KiB
Objective-C
82 lines
2.2 KiB
Objective-C
//
|
|
// MainFrameViewController.m
|
|
// Limelight-iOS
|
|
//
|
|
// Created by Diego Waxemberg on 1/17/14.
|
|
// Copyright (c) 2014 Diego Waxemberg. All rights reserved.
|
|
//
|
|
|
|
#import "MainFrameViewController.h"
|
|
#import "VideoDepacketizer.h"
|
|
|
|
@interface MainFrameViewController ()
|
|
|
|
@end
|
|
|
|
@implementation MainFrameViewController
|
|
static NSString* hostAddr;
|
|
|
|
+ (const char*)getHostAddr
|
|
{
|
|
return [hostAddr UTF8String];
|
|
}
|
|
|
|
- (void)PairButton:(UIButton *)sender
|
|
{
|
|
NSLog(@"Pair Button Pressed!");
|
|
}
|
|
|
|
- (void)StreamButton:(UIButton *)sender
|
|
{
|
|
NSLog(@"Stream Button Pressed!");
|
|
//67339056
|
|
hostAddr = self.HostField.text;
|
|
NSString* host = [NSString stringWithFormat:@"http://%@:47989/launch?uniqueid=0&appid=67339056", self.HostField.text];
|
|
NSLog(@"host: %@", host);
|
|
|
|
[self performSegueWithIdentifier:@"createStreamFrame" sender:self];
|
|
|
|
NSURL* url = [[NSURL alloc] initWithString:host];
|
|
NSMutableURLRequest* request = [[NSMutableURLRequest alloc] initWithURL:url];
|
|
[request setHTTPMethod:@"GET"];
|
|
NSURLResponse* response = nil;
|
|
NSData *response1 = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:NULL];
|
|
NSLog(@"url response: %@", response1);
|
|
}
|
|
|
|
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
|
|
{
|
|
return [self.streamConfigVals objectAtIndex:row];
|
|
}
|
|
|
|
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
|
|
{
|
|
//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
|
|
{
|
|
return 4;
|
|
}
|
|
|
|
- (void)viewDidLoad
|
|
{
|
|
[super viewDidLoad];
|
|
// Do any additional setup after loading the view.
|
|
self.streamConfigVals = [[NSArray alloc] initWithObjects:@"1280x720 (30Hz)",@"1280x720 (60Hz)",@"1920x1080 (30Hz)",@"1920x1080 (60Hz)",nil];
|
|
}
|
|
|
|
- (void)didReceiveMemoryWarning
|
|
{
|
|
[super didReceiveMemoryWarning];
|
|
// Dispose of any resources that can be recreated.
|
|
}
|
|
@end
|