-
Notifications
You must be signed in to change notification settings - Fork 6
/
AppController.h
217 lines (174 loc) · 5.83 KB
/
AppController.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
/* AppController */
#import <Cocoa/Cocoa.h>
#import <ApplicationServices/ApplicationServices.h>
#import <QuartzComposer/QCView.h>
// #import <WiiRemote/Mii.h>
#import <OSCPort.h>
#import <OSCInPort.h>
#import <OSC-string-help.h>
#import <WiiRemote/WiiRemote.h>
#import <WiiRemote/WiiRemoteDiscovery.h>
#import "GraphView.h"
#import "GridView.h"
#import "PreferenceWindow.h"
#import "WidgetsEnableTransformer.h"
#import "WidgetsEnableTransformer2.h"
#import "KeyConfiguration_AppDelegate.h"
#define portno 5600
#define rcvportno 5601
@class PreferenceWindow;
@interface AppController : NSObject
{
IBOutlet KeyConfiguration_AppDelegate* appDelegate;
IBOutlet NSArrayController* mappingController;
NSArray* modes;
NSArray* configSortDescriptors;
NSString* oscRemoteAddress;
NSArray* oscPort;
IBOutlet NSProgressIndicator *discoverySpinner;
IBOutlet NSDrawer *logDrawer;
IBOutlet NSDrawer *epDrawer;
IBOutlet NSDrawer *bbDrawer;
IBOutlet GraphView *graphView;
IBOutlet GraphView *graphView2;
IBOutlet NSTextView *textView;
IBOutlet NSButton* led1;
IBOutlet NSButton* led2;
IBOutlet NSButton* led3;
IBOutlet NSButton* led4;
IBOutlet NSWindow* mainWindow;
IBOutlet PreferenceWindow* preferenceWindow;
IBOutlet NSWindow* enterNameWindow;
IBOutlet NSWindow* irWindow;
IBOutlet NSButton* upButton;
IBOutlet NSButton* downButton;
IBOutlet NSButton* leftButton;
IBOutlet NSButton* rightButton;
IBOutlet NSButton* aButton;
IBOutlet NSButton* bButton;
IBOutlet NSButton* minusButton;
IBOutlet NSButton* plusButton;
IBOutlet NSButton* homeButton;
IBOutlet NSButton* oneButton;
IBOutlet NSButton* twoButton;
IBOutlet NSPopUpButton* mouseMode;
IBOutlet NSView* nunchukView;
IBOutlet NSView* ccView;
IBOutlet NSView* batteryLevelView;
IBOutlet NSLevelIndicator* batteryLevel;
IBOutlet NSTextField* theRemoteAddress;
IBOutlet NSTextField* theRemotePort;
IBOutlet NSTextField* theRcvPort;
IBOutlet QCView* wiimoteQCView;
IBOutlet QCView* joystickQCView;
IBOutlet QCView* irQCView;
IBOutlet QCView* ccQCView;
IBOutlet QCView* bbQCView;
IBOutlet NSTextField* newNameField;
IBOutlet NSTextField* WiimoteX;
IBOutlet NSTextField* WiimoteY;
IBOutlet NSTextField* WiimoteZ;
IBOutlet NSTextField* NunchukX;
IBOutlet NSTextField* NunchukY;
IBOutlet NSTextField* NunchukZ;
IBOutlet NSTextField* joystickX;
IBOutlet NSTextField* joystickY;
IBOutlet NSTextField* ccLeftX;
IBOutlet NSTextField* ccLeftY;
IBOutlet NSTextField* ccRightX;
IBOutlet NSTextField* ccRightY;
IBOutlet NSTextField* ccAnalogL;
IBOutlet NSTextField* ccAnalogR;
IBOutlet NSTextField* irPoint1X;
IBOutlet NSTextField* irPoint1Y;
IBOutlet NSTextField* irPoint1Size;
IBOutlet NSTextField* irPoint2X;
IBOutlet NSTextField* irPoint2Y;
IBOutlet NSTextField* irPoint2Size;
IBOutlet NSTextField* irPoint3X;
IBOutlet NSTextField* irPoint3Y;
IBOutlet NSTextField* irPoint3Size;
IBOutlet NSTextField* irPoint4X;
IBOutlet NSTextField* irPoint4Y;
IBOutlet NSTextField* irPoint4Size;
IBOutlet NSTextField* bPressureTR;
IBOutlet NSTextField* bPressureBR;
IBOutlet NSTextField* bPressureTL;
IBOutlet NSTextField* bPressureBL;
//enable recording of data
IBOutlet NSButton* recordButton;
NSMutableString* recordData;
NSSavePanel* savePanel;
BOOL recordToFile;
NSFileHandle* recordHandle;
WiiRemoteDiscovery *discovery;
WiiRemote* wii;
OSCPort* port;
OSCInPort* portIn;
CGPoint point;
char* address;
unsigned short portNumber;
unsigned short RcvPortNumber;
//BOOL isPressedBButton, isPressedAButton, isPressedHomeButton, isPressedUpButton, isPressedDownButton, isPressedLeftButton, isPressedRightButton, isPressedOneButton, isPressedTwoButton, isPressedPlusButton, isPressedMinusButton;
BOOL isLeftButtonDown, isRightButtonDown;
int mouseEventMode;
int x1, x2, x3, y1, y2, y3, z1, z2, z3;
int x0, y0, z0;
unsigned short tmpAccX, tmpAccY, tmpAccZ;
WiiJoyStickCalibData nunchukJsCalib;
WiiAccCalibData wiiAccCalib, nunchukAccCalib;
/* Center of Gravity Widget */
IBOutlet GridView* cogGridView;
IBOutlet NSWindow* cogWindow;
IBOutlet NSButton* cogPlaybackButton;
IBOutlet NSButton* cogRecordButton;
IBOutlet NSTextField* cogRecordDelay;
IBOutlet NSButton* cogResetButton;
IBOutlet NSTextField* cogSampleSize;
IBOutlet NSButton* cogSampleSizeButton;
IBOutlet NSTextField* cogTextInfo;
IBOutlet NSTextField* cogRecordTime;
IBOutlet NSTextField* cogWeight;
BOOL cogRecording;
BOOL cogCalibration;
float cogAjustX;
float cogAjustY;
float cogRecordedTime;
float cogRawX;
float cogRawY;
float cogSamples;
float cogRawWeight;
NSTimer* cogRecordTimer;
}
- (void)setupInitialKeyMappings;
- (IBAction)doCalibration:(id)sender;
- (IBAction)setForceFeedbackEnabled:(id)sender;
- (IBAction)setIRSensorEnabled:(id)sender;
- (IBAction)setLEDEnabled:(id)sender;
- (IBAction)setMotionSensorsEnabled:(id)sender;
- (IBAction)setMouseModeEnabled:(id)sender;
- (IBAction)openKeyConfiguration:(id)sender;
- (IBAction)addConfiguration:(id)sender;
- (IBAction)deleteConfiguration:(id)sender;
- (IBAction)enterSaveName:(id)sender;
- (IBAction)cancelEnterSaveName:(id)sender;
- (IBAction)saveFile:(id)sender;
- (IBAction)doDiscovery:(id)sender;
/* Center of Gravity widget */
- (void) cogStartRecord;
- (void) cogStopRecord;
- (void) cogRecordTimerUpdate:(NSTimer*)timer;
- (void) cogRecordDelayTimerUpdate:(NSTimer *)timer;
- (IBAction)cogCalibrate:(id)sender;
- (IBAction)cogRecord:(id)sender;
- (IBAction)cogReset:(id)sender;
- (IBAction)cogEnableSampleSize:(id)sender;
- (void)sendKeyboardEvent:(CGKeyCode)keyCode keyDown:(BOOL)keyDown;
// - (void)gotMiiData: (Mii*)m at:(int)slot;
- (IBAction)showHideIRWindow:(id)sender;
- (void) sendModifierKeys:(id)map isPressed:(BOOL)isPressed;
- (NSManagedObject*)createNewConfigration:(NSString*)name;
#pragma mark -
#pragma mark WiiRemoteDiscovery delegates
- (void) willStartWiimoteConnections;
@end