summaryrefslogtreecommitdiff
path: root/NET/worlds/console/GammaPhoneMonitor.java
blob: 6381b23e361040d4a8d313f019d52aa2910ab438 (plain) (blame)
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
218
219
220
221
222
/*     */ package NET.worlds.console;
/*     */ 
/*     */ import NET.worlds.scape.WavSoundPlayer;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class GammaPhoneMonitor
/*     */   extends Thread
/*     */ {
/*     */   public static final int GA_FAILEDCONNECT = 100;
/*     */   public static final int GPE_WHATEVER = 0;
/*     */   public static final int GPE_OUT_OF_MEM = 1;
/*     */   public static final int GPE_WEIRD = 2;
/*     */   public static final int GPE_SOCKET = 3;
/*     */   public static final int GPE_COMM = 4;
/*     */   public static final int GPE_HOST = 5;
/*     */   public static final int GPE_FILE = 6;
/*     */   public static final int GPE_CRYPTO = 7;
/*     */   public static final int GPE_MULTICAST = 8;
/*     */   public static final int GPE_RECORD = 9;
/*     */   public static final int GPE_WAVE_INPUT = 10;
/*     */   public static final int GPE_PLAY = 11;
/*     */   public static final int GPE_WAVE_OUTPUT = 12;
/*     */   public static final int GPE_PORT = 13;
/*     */   public static final int GPE_SOCKETS_VERSION = 14;
/*     */   public static final int GPE_HALF_DUPLEX = 15;
/*     */   public static final int GPE_USAGE = 16;
/*     */   public static final int GPE_IS_HALF_DUPLEX = 17;
/*     */   public static final int GPE_IS_FULL_DUPLEX = 18;
/*     */   public static final int GPE_LWL = 19;
/*     */   public static final int GPE_TIMEOUT = 20;
/*     */   public static final int GPE_WAVE_IN_USE = 21;
/*     */   public static final int GPE_CONNECTION_LOST = 22;
/*     */   public static final int GPE_SUCCESS = 900;
/*     */   public static final int GPE_STARTUP = 901;
/*     */   public static final int GPE_SHUTDOWN = 902;
/*  82 */   private VoiceChat _vc = null;
/*     */   
/*     */   public GammaPhoneMonitor(VoiceChat v) {
/*  85 */     this._vc = v;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public void run()
/*     */   {
/*  95 */     int m = 0;
/*     */     
/*  97 */     Window w = Window.getMainWindow();
/*     */     
/*     */ 
/*     */ 
/*     */     try
/*     */     {
/*     */       for (;;)
/*     */       {
/* 105 */         if ((m = Window.getVoiceChatWParam()) != 0) {
/* 106 */           processMessage(Window.getVoiceChatWParam(), 
/* 107 */             Window.getVoiceChatLParam());
/* 108 */           Window.resetVoiceChatMsg();
/*     */         }
/* 110 */         Thread.sleep(1000L);
/*     */       }
/*     */     } catch (InterruptedException e) {
/* 113 */       stop();
/*     */     }
/*     */   }
/*     */   
/*     */ 
/*     */   private void processMessage(int wParam, int lParam)
/*     */   {
/* 120 */     switch (wParam) {
/*     */     case 0: 
/* 122 */       this._vc.inform(wParam, "whatever ");
/* 123 */       break;
/*     */     case 1: 
/* 125 */       this._vc.inform(wParam, "out of memory ");
/* 126 */       break;
/*     */     case 2: 
/* 128 */       this._vc.inform(wParam, "! ");
/* 129 */       break;
/*     */     case 3: 
/* 131 */       this._vc.inform(wParam, 
/* 132 */         "An error occurred while setting up the socket for Voice Chat.");
/* 133 */       break;
/*     */     case 4: 
/* 135 */       this._vc.inform(wParam, "communications ");
/* 136 */       break;
/*     */     case 5: 
/* 138 */       this._vc.inform(wParam, "can't find host ");
/* 139 */       break;
/*     */     case 6: 
/* 141 */       this._vc.inform(wParam, "can't open/read/write file ");
/* 142 */       break;
/*     */     case 7: 
/* 144 */       this._vc.inform(wParam, "we don't even use this! ");
/* 145 */       break;
/*     */     case 8: 
/* 147 */       this._vc.inform(wParam, "we don't even use this! ");
/* 148 */       break;
/*     */     case 9: 
/* 150 */       this._vc.inform(wParam, "can't record at 8000 or 11200 samp/sec");
/* 151 */       break;
/*     */     case 10: 
/* 153 */       this._vc.inform(wParam, "error opening wave input device ");
/* 154 */       break;
/*     */     case 11: 
/* 156 */       this._vc.inform(wParam, "sound card can't play at 8000 or 11200");
/* 157 */       break;
/*     */     case 12: 
/* 159 */       this._vc.inform(wParam, "error opening wave output device ");
/* 160 */       break;
/*     */     case 13: 
/* 162 */       this._vc.inform(wParam, "invalid port number specified ");
/* 163 */       break;
/*     */     case 14: 
/* 165 */       this._vc.inform(wParam, "incompatible (old) sockets library ");
/* 166 */       break;
/*     */     case 15: 
/* 168 */       this._vc.inform(wParam, "sound drivers can't support full duplex");
/* 169 */       break;
/*     */     case 16: 
/* 171 */       this._vc.inform(wParam, "command line syntax error ");
/* 172 */       break;
/*     */     case 17: 
/* 174 */       this._vc.inform(wParam, "response to isFullDuplex command ");
/* 175 */       break;
/*     */     case 18: 
/* 177 */       this._vc.inform(wParam, "response to isFullDuplex command ");
/* 178 */       break;
/*     */     case 19: 
/* 180 */       this._vc.inform(wParam, " -Look Who's Listening- error, weird! ");
/* 181 */       break;
/*     */     case 20: 
/* 183 */       this._vc.inform(wParam, "Never heard back. ");
/* 184 */       break;
/*     */     
/*     */     case 21: 
/* 187 */       this._vc.inform(wParam, "VoiceChat failed because a  wav device is in use.");
/*     */       
/* 189 */       break;
/*     */     
/*     */     case 22: 
/* 192 */       this._vc.inform(wParam, "VoiceChat has lost its connection.");
/* 193 */       break;
/*     */     
/*     */     case 900: 
/* 196 */       this._vc.inform(wParam, "It worked o.k. ");
/* 197 */       break;
/*     */     
/*     */     case 901: 
/* 200 */       this._vc.registerProcess(lParam);
/* 201 */       break;
/*     */     
/*     */     case 902: 
/* 204 */       WavSoundPlayer.resumeSystem();
/*     */       
/* 206 */       break;
/*     */     
/*     */     case 100: 
/* 209 */       Console.println(Console.message("Voice-failed"));
/* 210 */       break;
/*     */     
/*     */     default: 
/* 213 */       Console.println(Console.message("Unrec-message") + wParam);
/*     */     }
/*     */   }
/*     */ }


/* Location:              C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\GammaPhoneMonitor.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */