rounded icon
This commit is contained in:
1 parent
527fb16428
commit
d26cef7ef4
27 files changed
+6794
-3617
No files matched your search
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
@@ -47,6 +47,7 @@ typedef NS_ENUM(NSInteger, SettingsMenuMode) {
|
||||
width:(NSInteger)width
|
||||
audioConfig:(NSInteger)audioConfig
|
||||
onscreenControls:(NSInteger)onscreenControls
|
||||
motionMode:(NSInteger)motionMode
|
||||
keyboardToggleFingers:(NSInteger)keyboardToggleFingers
|
||||
oscLayoutToolFingers:(NSInteger)oscLayoutToolFingers
|
||||
slideToSettingsScreenEdge:(NSInteger)slideToSettingsScreenEdge
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
width:(NSInteger)width
|
||||
audioConfig:(NSInteger)audioConfig
|
||||
onscreenControls:(NSInteger)onscreenControls
|
||||
motionMode:(NSInteger)motionMode
|
||||
keyboardToggleFingers:(NSInteger)keyboardToggleFingers
|
||||
oscLayoutToolFingers:(NSInteger)oscLayoutToolFingers
|
||||
slideToSettingsScreenEdge:(NSInteger)slideToSettingsScreenEdge
|
||||
@@ -99,6 +100,7 @@
|
||||
settingsToSave.width = [NSNumber numberWithInteger:width];
|
||||
settingsToSave.audioConfig = [NSNumber numberWithInteger:audioConfig];
|
||||
settingsToSave.onscreenControls = [NSNumber numberWithInteger:onscreenControls];
|
||||
settingsToSave.motionMode = [NSNumber numberWithInteger:motionMode];
|
||||
settingsToSave.keyboardToggleFingers = [NSNumber numberWithInteger:(uint16_t)keyboardToggleFingers];
|
||||
settingsToSave.oscLayoutToolFingers = [NSNumber numberWithInteger:(uint16_t)oscLayoutToolFingers];
|
||||
settingsToSave.slideToSettingsScreenEdge = [NSNumber numberWithInteger:(uint32_t)slideToSettingsScreenEdge];
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
@property (nonatomic, retain) NSNumber * width;
|
||||
@property (nonatomic, retain) NSNumber * audioConfig;
|
||||
@property (nonatomic, retain) NSNumber * onscreenControls;
|
||||
@property (nonatomic, retain) NSNumber * motionMode;
|
||||
@property (nonatomic, retain) NSNumber * keyboardToggleFingers;
|
||||
@property (nonatomic, retain) NSNumber * oscLayoutToolFingers;
|
||||
@property (nonatomic, retain) NSNumber * slideToSettingsScreenEdge;
|
||||
|
||||
@@ -89,6 +89,7 @@
|
||||
self.multiController = settings.multiController;
|
||||
self.swapABXYButtons = settings.swapABXYButtons;
|
||||
self.onscreenControls = settings.onscreenControls;
|
||||
self.motionMode = settings.motionMode;
|
||||
self.reverseMouseWheelDirection = settings.reverseMouseWheelDirection;
|
||||
self.asyncNativeTouchPriority = settings.asyncNativeTouchPriority;
|
||||
self.btMouseSupport = settings.btMouseSupport;
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 10 KiB |
Vendored
BIN
Binary file not shown.
@@ -10,6 +10,9 @@
|
||||
|
||||
@import GameController;
|
||||
@import CoreHaptics;
|
||||
#if !TARGET_OS_TV
|
||||
@import CoreMotion;
|
||||
#endif
|
||||
|
||||
@interface Controller : NSObject
|
||||
|
||||
@@ -43,6 +46,12 @@ typedef struct {
|
||||
@property (nonatomic) NSTimer* _Nullable gyroTimer;
|
||||
@property (nonatomic) GCRotationRate lastGyroSample;
|
||||
|
||||
#if !TARGET_OS_TV
|
||||
@property (nonatomic) CMMotionManager * _Nullable motionManager;
|
||||
@property (nonatomic) CMAcceleration lastDeviceAccelSample;
|
||||
@property (nonatomic) CMRotationRate lastDeviceGyroSample;
|
||||
#endif
|
||||
|
||||
@property (nonatomic) NSTimer* _Nullable batteryTimer;
|
||||
@property (nonatomic) GCDeviceBatteryState lastBatteryState;
|
||||
@property (nonatomic) float lastBatteryLevel;
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
#include "Limelight.h"
|
||||
|
||||
@import GameController;
|
||||
#if !TARGET_OS_TV
|
||||
@import CoreMotion;
|
||||
#endif
|
||||
@import AudioToolbox;
|
||||
|
||||
static const double MOUSE_SPEED_DIVISOR = 1.25;
|
||||
@@ -49,6 +52,7 @@ static const double MOUSE_SPEED_DIVISOR = 1.25;
|
||||
char _controllerNumbers;
|
||||
bool _multiController;
|
||||
bool _swapABXYButtons;
|
||||
int _motionMode;
|
||||
bool _captureMouse;
|
||||
}
|
||||
|
||||
@@ -90,18 +94,111 @@ static const double MOUSE_SPEED_DIVISOR = 1.25;
|
||||
|
||||
- (void) setMotionEventState:(uint16_t)controllerNumber motionType:(uint8_t)motionType reportRateHz:(uint16_t)reportRateHz
|
||||
{
|
||||
|
||||
if (@available(iOS 14.0, tvOS 14.0, *)) {
|
||||
Controller* controller = [_controllers objectForKey:[NSNumber numberWithInteger:controllerNumber]];
|
||||
if (controller == nil) {
|
||||
// No connected controller for this player
|
||||
return;
|
||||
}
|
||||
|
||||
if (controller.gamepad.motion == nil) {
|
||||
// No motion supported for this controller
|
||||
return;
|
||||
}
|
||||
|
||||
#if !TARGET_OS_TV //tvOS has no device motion
|
||||
NSInteger motionMode = _motionMode; //motionMode 0 = auto | 1 = always device | 2 = always controller
|
||||
if(motionMode !=2 && controllerNumber < 2){
|
||||
if(controller == nil || controller.gamepad.motion == nil || motionMode == 1){
|
||||
//Player has no controller *or* no motion for controller 1 *or* wants to override controller 1 motion with device motion
|
||||
//using device motion
|
||||
if (controller == nil) {
|
||||
// No connected controller for this player, use the _oscController instead
|
||||
controller = _oscController;
|
||||
}
|
||||
if(!controller.motionManager) {
|
||||
controller.motionManager = [[CMMotionManager alloc] init];
|
||||
}
|
||||
|
||||
switch (motionType) {
|
||||
case LI_MOTION_TYPE_ACCEL:
|
||||
[controller.accelTimer invalidate];
|
||||
controller.accelTimer = nil;
|
||||
|
||||
// Reset the last motion sample
|
||||
CMAcceleration emptyDeviceAccelSample = {};
|
||||
controller.lastDeviceAccelSample = emptyDeviceAccelSample;
|
||||
|
||||
{dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
controller.accelTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 / reportRateHz repeats:YES block:^(NSTimer *timer) {
|
||||
// Don't send duplicate samples
|
||||
CMAcceleration lastDeviceAccelSample = controller.lastDeviceAccelSample;
|
||||
CMAcceleration deviceAccelSample = controller.motionManager.deviceMotion.userAcceleration;
|
||||
//userAcceleration does not contain gravity, add gravity to x, y and z values:
|
||||
deviceAccelSample.x += controller.motionManager.deviceMotion.gravity.x;
|
||||
deviceAccelSample.y += controller.motionManager.deviceMotion.gravity.y;
|
||||
deviceAccelSample.z += controller.motionManager.deviceMotion.gravity.z;
|
||||
|
||||
if (memcmp(&deviceAccelSample, &lastDeviceAccelSample, sizeof(deviceAccelSample)) == 0) {
|
||||
return;
|
||||
}
|
||||
controller.lastDeviceAccelSample = deviceAccelSample;
|
||||
|
||||
// Convert g to m/s^2
|
||||
if(UIApplication.sharedApplication.windows.firstObject.windowScene.interfaceOrientation == 4){ //check for landscape left or landscape right
|
||||
LiSendControllerMotionEvent((uint8_t)controllerNumber,
|
||||
LI_MOTION_TYPE_ACCEL,
|
||||
deviceAccelSample.y * -9.80665f,
|
||||
deviceAccelSample.z * -9.80665f,
|
||||
deviceAccelSample.x * -9.80665f);
|
||||
}
|
||||
else{
|
||||
LiSendControllerMotionEvent((uint8_t)controllerNumber,
|
||||
LI_MOTION_TYPE_ACCEL,
|
||||
deviceAccelSample.y * +9.80665f,
|
||||
deviceAccelSample.z * -9.80665f,
|
||||
deviceAccelSample.x * +9.80665f);
|
||||
}
|
||||
}];
|
||||
});}
|
||||
break;
|
||||
case LI_MOTION_TYPE_GYRO:
|
||||
[controller.gyroTimer invalidate];
|
||||
controller.gyroTimer = nil;
|
||||
|
||||
// Reset the last motion sample
|
||||
CMRotationRate emptyDeviceGyroSample = {};
|
||||
controller.lastDeviceGyroSample = emptyDeviceGyroSample;
|
||||
|
||||
[controller.motionManager startDeviceMotionUpdates];
|
||||
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
controller.gyroTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 / reportRateHz repeats:YES block:^(NSTimer *timer) {
|
||||
|
||||
// Don't send duplicate samples
|
||||
CMRotationRate lastDeviceGyroSample = controller.lastDeviceGyroSample;
|
||||
CMRotationRate deviceGyroSample = controller.motionManager.deviceMotion.rotationRate;
|
||||
if (memcmp(&deviceGyroSample, &lastDeviceGyroSample, sizeof(deviceGyroSample)) == 0) {
|
||||
return;
|
||||
}
|
||||
controller.lastDeviceGyroSample = deviceGyroSample;
|
||||
|
||||
// Convert rad/s to deg/s
|
||||
if(UIApplication.sharedApplication.windows.firstObject.windowScene.interfaceOrientation == 4){//check for landscape left or landscape right
|
||||
LiSendControllerMotionEvent((uint8_t)controllerNumber,
|
||||
LI_MOTION_TYPE_GYRO,
|
||||
deviceGyroSample.y * 57.2957795f,
|
||||
deviceGyroSample.z * 57.2957795f,
|
||||
deviceGyroSample.x * 57.2957795f);
|
||||
}
|
||||
else{
|
||||
LiSendControllerMotionEvent((uint8_t)controllerNumber,
|
||||
LI_MOTION_TYPE_GYRO,
|
||||
deviceGyroSample.y * -57.2957795f,
|
||||
deviceGyroSample.z * 57.2957795f,
|
||||
deviceGyroSample.x * -57.2957795f);
|
||||
}
|
||||
|
||||
}];
|
||||
});
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (motionType) {
|
||||
case LI_MOTION_TYPE_ACCEL:
|
||||
[controller.accelTimer invalidate];
|
||||
@@ -1108,6 +1205,7 @@ static const double MOUSE_SPEED_DIVISOR = 1.25;
|
||||
_controllerNumbers = 0;
|
||||
_multiController = streamConfig.multiController;
|
||||
_swapABXYButtons = streamConfig.swapABXYButtons;
|
||||
_motionMode = streamConfig.motionMode;
|
||||
_delegate = delegate;
|
||||
|
||||
_oscController = [[Controller alloc] init];
|
||||
@@ -1283,6 +1381,11 @@ static const double MOUSE_SPEED_DIVISOR = 1.25;
|
||||
}
|
||||
[_controllers removeAllObjects];
|
||||
|
||||
#if !TARGET_OS_TV
|
||||
[self cleanupControllerMotion:_oscController];
|
||||
[_oscController.motionManager stopDeviceMotionUpdates];
|
||||
#endif
|
||||
|
||||
for (GCController* controller in [GCController controllers]) {
|
||||
if ([ControllerSupport isSupportedGamepad:controller]) {
|
||||
[self unregisterControllerCallbacks:controller];
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
#import "CustomTapGestureRecognizer.h"
|
||||
#import "Controller.h"
|
||||
#include "Limelight.h"
|
||||
#if !TARGET_OS_TV
|
||||
#import <CoreMotion/CoreMotion.h>
|
||||
#endif
|
||||
#import "OnScreenButtonState.h"
|
||||
#import "OSCProfilesManager.h"
|
||||
#import "DataManager.h"
|
||||
|
||||
@@ -58,6 +58,8 @@
|
||||
</array>
|
||||
<key>NSLocalNetworkUsageDescription</key>
|
||||
<string>Moonlight uses the local network to connect to your gaming PC for streaming.</string>
|
||||
<key>NSMotionUsageDescription</key>
|
||||
<string>Moonlight uses the device Gyro and Acceleration data to emulate motion controls when streaming.</string>
|
||||
<key>UIApplicationSceneManifest</key>
|
||||
<dict>
|
||||
<key>UIApplicationSupportsMultipleScenes</key>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="23788" systemVersion="24F74" minimumToolsVersion="Xcode 7.3" sourceLanguage="Objective-C" userDefinedModelVersionIdentifier="">
|
||||
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="23602" systemVersion="24C5089c" minimumToolsVersion="Xcode 7.3" sourceLanguage="Objective-C" userDefinedModelVersionIdentifier="">
|
||||
<entity name="App" representedClassName="App" syncable="YES" codeGenerationType="class">
|
||||
<attribute name="hdrSupported" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES" syncable="YES"/>
|
||||
<attribute name="hidden" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES" syncable="YES"/>
|
||||
@@ -21,17 +21,18 @@
|
||||
<relationship name="appList" optional="YES" toMany="YES" deletionRule="Cascade" destinationEntity="App" inverseName="host" inverseEntity="App" syncable="YES"/>
|
||||
</entity>
|
||||
<entity name="Settings" representedClassName="Settings" syncable="YES" codeGenerationType="class">
|
||||
<attribute name="asyncNativeTouchPriority" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="audioConfig" attributeType="Integer 32" defaultValueString="2" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="bitrate" attributeType="Integer 32" defaultValueString="10000" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="btMouseSupport" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES" syncable="YES"/>
|
||||
<attribute name="deviceGyroMode" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="enableHdr" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES" syncable="YES"/>
|
||||
<attribute name="enableYUV444" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES" syncable="YES"/>
|
||||
<attribute name="externalDisplayMode" optional="YES" attributeType="Integer 16" defaultValueString="1" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="externalDisplayMode" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="framerate" attributeType="Integer 32" defaultValueString="60" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="height" attributeType="Integer 32" defaultValueString="720" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="motionMode" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="keyboardToggleFingers" optional="YES" attributeType="Integer 16" defaultValueString="3" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="largerStickLR1" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES" syncable="YES"/>
|
||||
<attribute name="liftStreamViewForKeyboard" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES" syncable="YES"/>
|
||||
<attribute name="localMousePointerMode" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="mousePointerVelocityFactor" optional="YES" attributeType="Float" defaultValueString="1" usesScalarValueType="NO" syncable="YES"/>
|
||||
@@ -39,25 +40,23 @@
|
||||
<attribute name="onscreenControls" attributeType="Integer 32" defaultValueString="1" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="optimizeGames" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES" syncable="YES"/>
|
||||
<attribute name="oscLayoutToolFingers" optional="YES" attributeType="Integer 16" defaultValueString="4" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="oscTapExlusionAreaSize" optional="YES" attributeType="Float" defaultValueString="1.03" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="playAudioOnPC" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES" syncable="YES"/>
|
||||
<attribute name="pointerVelocityModeDivider" optional="YES" attributeType="Float" defaultValueString="0.5" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="preferredCodec" attributeType="Integer 32" defaultValueString="YES" usesScalarValueType="YES" syncable="YES"/>
|
||||
<attribute name="resolutionSelected" optional="YES" attributeType="Integer 16" defaultValueString="5" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="reverseMouseWheelDirection" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES" syncable="YES"/>
|
||||
<attribute name="settingsMenuMode" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="settingsMenuWidth" attributeType="Float" defaultValueString="370" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="showKeyboardToolbar" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES" syncable="YES"/>
|
||||
<attribute name="slideToSettingsDistance" optional="YES" attributeType="Float" defaultValueString="0.25" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="slideToSettingsDistance" optional="YES" attributeType="Float" defaultValueString="0.5" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="slideToSettingsScreenEdge" optional="YES" attributeType="Integer 32" defaultValueString="2" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="statsOverlayEnabled" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES" syncable="YES"/>
|
||||
<attribute name="statsOverlayLevel" optional="YES" attributeType="Integer 16" defaultValueString="1" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="swapABXYButtons" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES" syncable="YES"/>
|
||||
<attribute name="touchMode" optional="YES" attributeType="Integer 16" defaultValueString="1" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="touchMoveEventInterval" optional="YES" attributeType="Integer 16" defaultValueString="320" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="touchPointerVelocityFactor" optional="YES" attributeType="Float" defaultValueString="1" usesScalarValueType="NO" syncable="YES"/>
|
||||
<attribute name="uniqueId" attributeType="String" syncable="YES"/>
|
||||
<attribute name="unlockDisplayOrientation" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES" syncable="YES"/>
|
||||
<attribute name="useFramePacing" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES" syncable="YES"/>
|
||||
<attribute name="width" attributeType="Integer 32" defaultValueString="1280" usesScalarValueType="NO" syncable="YES"/>
|
||||
</entity>
|
||||
</model>
|
||||
</model>
|
||||
Vendored
BIN
Binary file not shown.
@@ -5,9 +5,6 @@
|
||||
// Created by Diego Waxemberg on 10/20/14.
|
||||
// Copyright (c) 2014 Moonlight Stream. All rights reserved.
|
||||
//
|
||||
// Modified by True砖家 since 2024.8.10
|
||||
// Copyright © 2024 True砖家 @ Bilibili. All rights reserved.
|
||||
//
|
||||
|
||||
@interface StreamConfiguration : NSObject
|
||||
|
||||
@@ -30,7 +27,8 @@
|
||||
@property BOOL optimizeGameSettings;
|
||||
@property BOOL playAudioOnPC;
|
||||
@property BOOL swapABXYButtons;
|
||||
@property BOOL asyncNativeTouchPriority;
|
||||
@property int motionMode;
|
||||
@property BOOL largerStickLR1;
|
||||
@property int audioConfiguration;
|
||||
@property int supportedVideoFormats;
|
||||
@property BOOL multiController;
|
||||
|
||||
@@ -9,5 +9,5 @@
|
||||
#import "StreamConfiguration.h"
|
||||
|
||||
@implementation StreamConfiguration
|
||||
@synthesize host, httpsPort, appID, width, height, frameRate, bitRate, riKeyId, riKey, gamepadMask, appName, optimizeGameSettings, playAudioOnPC, swapABXYButtons, audioConfiguration, supportedVideoFormats, multiController, serverCert, rtspSessionUrl, serverCodecModeSupport, enableYUV444;
|
||||
@synthesize host, httpsPort, appID, width, height, frameRate, bitRate, riKeyId, riKey, gamepadMask, appName, optimizeGameSettings, playAudioOnPC, swapABXYButtons, motionMode, audioConfiguration, supportedVideoFormats, multiController, serverCert, rtspSessionUrl, serverCodecModeSupport, enableYUV444;
|
||||
@end
|
||||
Vendored
BIN
Binary file not shown.
File diff suppressed because it is too large.
Load diff
+951
-873
File diff suppressed because it is too large.
Load diff
+1872
-1944
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user