Add some WIP touch input support

This commit is contained in:
Cameron Gutman 2014-10-20 02:38:01 -04:00
parent 70f3a91dfb
commit 02fbd5f1d2
5 changed files with 82 additions and 6 deletions

View File

@ -7,6 +7,7 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
984C441819F48D1D0061A500 /* StreamView.m in Sources */ = {isa = PBXBuildFile; fileRef = 984C441719F48D1D0061A500 /* StreamView.m */; };
98A03B4D19F352EB00861ACA /* liblimelight-common.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 98A03B4A19F3514B00861ACA /* liblimelight-common.a */; }; 98A03B4D19F352EB00861ACA /* liblimelight-common.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 98A03B4A19F3514B00861ACA /* liblimelight-common.a */; };
98A03B5019F3598400861ACA /* VideoDecoderRenderer.m in Sources */ = {isa = PBXBuildFile; fileRef = 98A03B4F19F3598400861ACA /* VideoDecoderRenderer.m */; }; 98A03B5019F3598400861ACA /* VideoDecoderRenderer.m in Sources */ = {isa = PBXBuildFile; fileRef = 98A03B4F19F3598400861ACA /* VideoDecoderRenderer.m */; };
98A03B5119F35AAC00861ACA /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FBCC0E9819EF9703009729EB /* libcrypto.a */; }; 98A03B5119F35AAC00861ACA /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FBCC0E9819EF9703009729EB /* libcrypto.a */; };
@ -76,6 +77,8 @@
/* End PBXContainerItemProxy section */ /* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
984C441619F48D1D0061A500 /* StreamView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StreamView.h; sourceTree = "<group>"; };
984C441719F48D1D0061A500 /* StreamView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StreamView.m; sourceTree = "<group>"; };
98A03B4519F3514B00861ACA /* limelight-common.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "limelight-common.xcodeproj"; path = "limelight-common-c/limelight-common.xcodeproj"; sourceTree = "<group>"; }; 98A03B4519F3514B00861ACA /* limelight-common.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "limelight-common.xcodeproj"; path = "limelight-common-c/limelight-common.xcodeproj"; sourceTree = "<group>"; };
98A03B4E19F3598400861ACA /* VideoDecoderRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VideoDecoderRenderer.h; path = Limelight/VideoDecoderRenderer.h; sourceTree = SOURCE_ROOT; }; 98A03B4E19F3598400861ACA /* VideoDecoderRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VideoDecoderRenderer.h; path = Limelight/VideoDecoderRenderer.h; sourceTree = SOURCE_ROOT; };
98A03B4F19F3598400861ACA /* VideoDecoderRenderer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VideoDecoderRenderer.m; path = Limelight/VideoDecoderRenderer.m; sourceTree = SOURCE_ROOT; }; 98A03B4F19F3598400861ACA /* VideoDecoderRenderer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VideoDecoderRenderer.m; path = Limelight/VideoDecoderRenderer.m; sourceTree = SOURCE_ROOT; };
@ -412,6 +415,8 @@
FBCC0E9C19F00659009729EB /* mkcert.c */, FBCC0E9C19F00659009729EB /* mkcert.c */,
FBC8622B19F0BEFB0087327B /* HttpManager.h */, FBC8622B19F0BEFB0087327B /* HttpManager.h */,
FBC8622C19F0BEFB0087327B /* HttpManager.m */, FBC8622C19F0BEFB0087327B /* HttpManager.m */,
984C441619F48D1D0061A500 /* StreamView.h */,
984C441719F48D1D0061A500 /* StreamView.m */,
); );
path = Limelight; path = Limelight;
sourceTree = "<group>"; sourceTree = "<group>";
@ -959,6 +964,7 @@
FB290D3A19B2C6E3004C83CF /* StreamFrameViewController.m in Sources */, FB290D3A19B2C6E3004C83CF /* StreamFrameViewController.m in Sources */,
FB290D0019B2C406004C83CF /* main.m in Sources */, FB290D0019B2C406004C83CF /* main.m in Sources */,
FB290D3919B2C6E3004C83CF /* MainFrameViewController.m in Sources */, FB290D3919B2C6E3004C83CF /* MainFrameViewController.m in Sources */,
984C441819F48D1D0061A500 /* StreamView.m in Sources */,
FB290D3719B2C6E3004C83CF /* Connection.m in Sources */, FB290D3719B2C6E3004C83CF /* Connection.m in Sources */,
FBCC0E9D19F00659009729EB /* mkcert.c in Sources */, FBCC0E9D19F00659009729EB /* mkcert.c in Sources */,
FB290D3819B2C6E3004C83CF /* ConnectionHandler.m in Sources */, FB290D3819B2C6E3004C83CF /* ConnectionHandler.m in Sources */,

13
Limelight/StreamView.h Normal file
View File

@ -0,0 +1,13 @@
//
// StreamView.h
// Limelight
//
// Created by Cameron Gutman on 10/19/14.
// Copyright (c) 2014 Limelight Stream. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface StreamView : UIView
@end

58
Limelight/StreamView.m Normal file
View File

@ -0,0 +1,58 @@
//
// StreamView.m
// Limelight
//
// Created by Cameron Gutman on 10/19/14.
// Copyright (c) 2014 Limelight Stream. All rights reserved.
//
#import "StreamView.h"
#include <Limelight.h>
@implementation StreamView {
CGPoint touchLocation;
BOOL touchMoved;
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [[event allTouches] anyObject];
touchLocation = [touch locationInView:self];
touchMoved = false;
NSLog(@"Touch down");
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [[event allTouches] anyObject];
CGPoint currentLocation = [touch locationInView:self];
NSLog(@"Touch move");
if (touchLocation.x != currentLocation.x &&
touchLocation.y != currentLocation.y)
{
LiSendMouseMoveEvent(touchLocation.x - currentLocation.x,
touchLocation.y - currentLocation.y);
touchMoved = true;
touchLocation = currentLocation;
}
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
NSLog(@"Touch up");
if (!touchMoved) {
LiSendMouseButtonEvent(BUTTON_ACTION_PRESS, BUTTON_LEFT);
usleep(50 * 1000);
LiSendMouseButtonEvent(BUTTON_ACTION_RELEASE, BUTTON_LEFT);
}
}
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event {
}
@end

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6245" systemVersion="14A386a" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="wb7-af-jn8"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6245" systemVersion="14A389" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="wb7-af-jn8">
<dependencies> <dependencies>
<deployment defaultVersion="1808" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/>
</dependencies> </dependencies>
<scenes> <scenes>
@ -73,7 +72,7 @@
<viewControllerLayoutGuide type="top" id="NG3-N1-D4k"/> <viewControllerLayoutGuide type="top" id="NG3-N1-D4k"/>
<viewControllerLayoutGuide type="bottom" id="3MH-n6-BSR"/> <viewControllerLayoutGuide type="bottom" id="3MH-n6-BSR"/>
</layoutGuides> </layoutGuides>
<view key="view" contentMode="scaleToFill" id="VPm-Ae-rc4" userLabel="RenderView"> <view key="view" contentMode="scaleToFill" id="VPm-Ae-rc4" userLabel="RenderView" customClass="StreamView">
<rect key="frame" x="0.0" y="0.0" width="1024" height="768"/> <rect key="frame" x="0.0" y="0.0" width="1024" height="768"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6245" systemVersion="14A386a" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="dgh-JZ-Q7z"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6245" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="dgh-JZ-Q7z">
<dependencies> <dependencies>
<deployment defaultVersion="1808" identifier="iOS"/> <deployment defaultVersion="2048" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6238"/>
</dependencies> </dependencies>
<scenes> <scenes>
@ -88,7 +88,7 @@
<viewControllerLayoutGuide type="top" id="DRq-YB-9Rh"/> <viewControllerLayoutGuide type="top" id="DRq-YB-9Rh"/>
<viewControllerLayoutGuide type="bottom" id="KH1-hM-RYW"/> <viewControllerLayoutGuide type="bottom" id="KH1-hM-RYW"/>
</layoutGuides> </layoutGuides>
<view key="view" contentMode="scaleToFill" id="eir-e9-IPE"> <view key="view" contentMode="scaleToFill" id="eir-e9-IPE" customClass="StreamView">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/> <rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>