moonlight-ios/Limelight/Input/ControllerSupport.h

53 lines
1.9 KiB
C
Raw Normal View History

2014-10-20 21:13:13 -04:00
//
// ControllerSupport.h
// Moonlight
2014-10-20 21:13:13 -04:00
//
// Created by Cameron Gutman on 10/20/14.
// Copyright (c) 2014 Moonlight Stream. All rights reserved.
2014-10-20 21:13:13 -04:00
//
2018-06-02 13:52:58 -07:00
#import "StreamConfiguration.h"
#import "Controller.h"
2014-10-20 21:13:13 -04:00
@class OnScreenControls;
@protocol ControllerSupportDelegate <NSObject>
- (void) gamepadPresenceChanged;
- (void) mousePresenceChanged;
- (void) streamExitRequested;
@end
2014-10-20 21:13:13 -04:00
@interface ControllerSupport : NSObject
-(id) initWithConfig:(StreamConfiguration*)streamConfig delegate:(id<ControllerSupportDelegate>)delegate;
-(void) connectionEstablished;
-(void) initAutoOnScreenControlMode:(OnScreenControls*)osc;
2014-10-20 21:13:13 -04:00
-(void) cleanup;
-(Controller*) getOscController;
2014-10-20 21:13:13 -04:00
2015-02-02 02:42:38 -05:00
-(void) updateLeftStick:(Controller*)controller x:(short)x y:(short)y;
-(void) updateRightStick:(Controller*)controller x:(short)x y:(short)y;
-(void) updateLeftTrigger:(Controller*)controller left:(unsigned char)left;
-(void) updateRightTrigger:(Controller*)controller right:(unsigned char)right;
-(void) updateTriggers:(Controller*)controller left:(unsigned char)left right:(unsigned char)right;
2015-02-02 02:42:38 -05:00
-(void) updateButtonFlags:(Controller*)controller flags:(int)flags;
-(void) setButtonFlag:(Controller*)controller flags:(int)flags;
-(void) clearButtonFlag:(Controller*)controller flags:(int)flags;
2015-02-02 02:42:38 -05:00
-(void) updateFinished:(Controller*)controller;
2019-02-11 19:22:18 -08:00
-(void) rumble:(unsigned short)controllerNumber lowFreqMotor:(unsigned short)lowFreqMotor highFreqMotor:(unsigned short)highFreqMotor;
-(void) rumbleTriggers:(uint16_t)controllerNumber leftTrigger:(uint16_t)leftTrigger rightTrigger:(uint16_t)rightTrigger;
-(void) setMotionEventState:(uint16_t)controllerNumber motionType:(uint8_t)motionType reportRateHz:(uint16_t)reportRateHz;
2023-09-27 08:52:26 -05:00
-(void) setControllerLed:(uint16_t)controllerNumber r:(uint8_t)r g:(uint8_t)g b:(uint8_t)b;
2019-02-11 19:22:18 -08:00
2018-06-02 13:52:58 -07:00
+(int) getConnectedGamepadMask:(StreamConfiguration*)streamConfig;
-(NSUInteger) getConnectedGamepadCount;
2014-10-20 21:13:13 -04:00
@end