2014-10-20 21:13:13 -04:00
|
|
|
//
|
|
|
|
|
// ControllerSupport.h
|
2015-05-12 21:48:30 -04:00
|
|
|
// Moonlight
|
2014-10-20 21:13:13 -04:00
|
|
|
//
|
|
|
|
|
// Created by Cameron Gutman on 10/20/14.
|
2015-05-12 21:48:30 -04:00
|
|
|
// 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"
|
2019-02-11 18:21:04 -08:00
|
|
|
#import "Controller.h"
|
2014-10-20 21:13:13 -04:00
|
|
|
|
2015-01-09 16:13:44 -05:00
|
|
|
@class OnScreenControls;
|
|
|
|
|
|
2019-10-22 00:32:56 -04:00
|
|
|
@protocol GamepadPresenceDelegate <NSObject>
|
|
|
|
|
|
|
|
|
|
- (void) gamepadPresenceChanged;
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
2014-10-20 21:13:13 -04:00
|
|
|
@interface ControllerSupport : NSObject
|
|
|
|
|
|
2019-10-22 00:32:56 -04:00
|
|
|
-(id) initWithConfig:(StreamConfiguration*)streamConfig presenceDelegate:(id<GamepadPresenceDelegate>)delegate;
|
2018-03-27 08:50:40 +02:00
|
|
|
|
2015-01-09 16:13:44 -05:00
|
|
|
-(void) initAutoOnScreenControlMode:(OnScreenControls*)osc;
|
2014-10-20 21:13:13 -04:00
|
|
|
-(void) cleanup;
|
2018-03-27 08:50:40 +02:00
|
|
|
-(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;
|
2015-01-09 16:13:44 -05:00
|
|
|
|
2019-11-06 20:57:53 -08:00
|
|
|
-(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-01-09 16:13:44 -05:00
|
|
|
|
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-01-09 16:13:44 -05:00
|
|
|
|
2015-02-02 02:42:38 -05:00
|
|
|
-(void) updateFinished:(Controller*)controller;
|
2015-01-09 16:13:44 -05:00
|
|
|
|
2019-02-11 19:22:18 -08:00
|
|
|
-(void) rumble:(unsigned short)controllerNumber lowFreqMotor:(unsigned short)lowFreqMotor highFreqMotor:(unsigned short)highFreqMotor;
|
|
|
|
|
|
2018-06-02 13:52:58 -07:00
|
|
|
+(int) getConnectedGamepadMask:(StreamConfiguration*)streamConfig;
|
2018-01-20 14:37:33 -08:00
|
|
|
|
2019-10-22 00:32:56 -04:00
|
|
|
-(NSUInteger) getConnectedGamepadCount;
|
|
|
|
|
|
2014-10-20 21:13:13 -04:00
|
|
|
@property (nonatomic, strong) id connectObserver;
|
|
|
|
|
@property (nonatomic, strong) id disconnectObserver;
|
|
|
|
|
|
|
|
|
|
@end
|