Changeset - r2175:ec917b18c03f
[Not reviewed]
master
0 3 2
orudge - 19 years ago 2005-07-23 16:08:05
orudge@openttd.org
(svn r2689) - Split OS/2 music driver into os2_m.c, update project file
5 files changed with 401 insertions and 246 deletions:
0 comments (0 inline, 0 general)
music/os2_m.c
Show inline comments
 
new file 100644
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "music/os2_m.h"
 

	
 
#define INCL_DOS
 
#define INCL_OS2MM
 
#define INCL_WIN
 

	
 
#include <stdarg.h>
 
#include <os2.h>
 
#include <os2me.h>
 

	
 
/**********************
 
 * OS/2 MIDI PLAYER
 
 **********************/
 

	
 
/* Interesting how similar the MCI API in OS/2 is to the Win32 MCI API,
 
 * eh? Anyone would think they both came from the same place originally! ;)
 
 */
 

	
 
static long CDECL MidiSendCommand(const char *cmd, ...)
 
{
 
	va_list va;
 
	char buf[512];
 
	va_start(va, cmd);
 
	vsprintf(buf, cmd, va);
 
	va_end(va);
 
	return mciSendString(buf, NULL, 0, NULL, 0);
 
}
 

	
 
static void OS2MidiPlaySong(const char *filename)
 
{
 
	MidiSendCommand("close all");
 

	
 
	if (MidiSendCommand("open %s type sequencer alias song", filename) != 0)
 
		return;
 

	
 
	MidiSendCommand("play song from 0");
 
}
 

	
 
static void OS2MidiStopSong(void)
 
{
 
	MidiSendCommand("close all");
 
}
 

	
 
static void OS2MidiSetVolume(byte vol)
 
{
 
	MidiSendCommand("set song audio volume %d", ((vol/127)*100));
 
}
 

	
 
static bool OS2MidiIsSongPlaying(void)
 
{
 
	char buf[16];
 
	mciSendString("status song mode", buf, sizeof(buf), NULL, 0);
 
	return strcmp(buf, "playing") == 0 || strcmp(buf, "seeking") == 0;
 
}
 

	
 
static const char *OS2MidiStart(const char * const *parm)
 
{
 
	return 0;
 
}
 

	
 
static void OS2MidiStop(void)
 
{
 
	MidiSendCommand("close all");
 
}
 

	
 
const HalMusicDriver _os2_music_driver = {
 
	OS2MidiStart,
 
	OS2MidiStop,
 
	OS2MidiPlaySong,
 
	OS2MidiStopSong,
 
	OS2MidiIsSongPlaying,
 
	OS2MidiSetVolume,
 
};
 

	
music/os2_m.h
Show inline comments
 
new file 100644
 
#ifndef MUSIC_OS2_H
 
#define MUSIC_OS2_H
 

	
 
#include "hal.h"
 

	
 
extern const HalMusicDriver _os2_music_driver;
 

	
 
#endif
openttd.tgt
Show inline comments
 
@@ -191,13 +191,13 @@ 0
 
-1
 
1
 
1
 
0
 
51
 
WPickList
 
107
 
114
 
52
 
MItem
 
3
 
*.c
 
53
 
WString
 
@@ -786,14 +786,14 @@ 0
 
52
 
1
 
1
 
0
 
189
 
MItem
 
12
 
dummy_land.c
 
8
 
driver.c
 
190
 
WString
 
4
 
COBJ
 
191
 
WVList
 
@@ -804,14 +804,14 @@ 0
 
52
 
1
 
1
 
0
 
193
 
MItem
 
9
 
economy.c
 
12
 
dummy_land.c
 
194
 
WString
 
4
 
COBJ
 
195
 
WVList
 
@@ -822,14 +822,14 @@ 0
 
52
 
1
 
1
 
0
 
197
 
MItem
 
8
 
engine.c
 
9
 
economy.c
 
198
 
WString
 
4
 
COBJ
 
199
 
WVList
 
@@ -840,14 +840,14 @@ 0
 
52
 
1
 
1
 
0
 
201
 
MItem
 
12
 
engine_gui.c
 
8
 
engine.c
 
202
 
WString
 
4
 
COBJ
 
203
 
WVList
 
@@ -858,14 +858,14 @@ 0
 
52
 
1
 
1
 
0
 
205
 
MItem
 
8
 
fileio.c
 
12
 
engine_gui.c
 
206
 
WString
 
4
 
COBJ
 
207
 
WVList
 
@@ -876,14 +876,14 @@ 0
 
52
 
1
 
1
 
0
 
209
 
MItem
 
5
 
gfx.c
 
8
 
fileio.c
 
210
 
WString
 
4
 
COBJ
 
211
 
WVList
 
@@ -894,14 +894,14 @@ 0
 
52
 
1
 
1
 
0
 
213
 
MItem
 
11
 
graph_gui.c
 
5
 
gfx.c
 
214
 
WString
 
4
 
COBJ
 
215
 
WVList
 
@@ -912,14 +912,14 @@ 0
 
52
 
1
 
1
 
0
 
217
 
MItem
 
14
 
industry_cmd.c
 
11
 
graph_gui.c
 
218
 
WString
 
4
 
COBJ
 
219
 
WVList
 
@@ -931,13 +931,13 @@ 52
 
1
 
1
 
0
 
221
 
MItem
 
14
 
industry_gui.c
 
industry_cmd.c
 
222
 
WString
 
4
 
COBJ
 
223
 
WVList
 
@@ -948,14 +948,14 @@ 0
 
52
 
1
 
1
 
0
 
225
 
MItem
 
11
 
intro_gui.c
 
14
 
industry_gui.c
 
226
 
WString
 
4
 
COBJ
 
227
 
WVList
 
@@ -967,13 +967,13 @@ 52
 
1
 
1
 
0
 
229
 
MItem
 
11
 
landscape.c
 
intro_gui.c
 
230
 
WString
 
4
 
COBJ
 
231
 
WVList
 
@@ -984,14 +984,14 @@ 0
 
52
 
1
 
1
 
0
 
233
 
MItem
 
10
 
main_gui.c
 
11
 
landscape.c
 
234
 
WString
 
4
 
COBJ
 
235
 
WVList
 
@@ -1002,14 +1002,14 @@ 0
 
52
 
1
 
1
 
0
 
237
 
MItem
 
5
 
map.c
 
10
 
main_gui.c
 
238
 
WString
 
4
 
COBJ
 
239
 
WVList
 
@@ -1021,13 +1021,13 @@ 52
 
1
 
1
 
0
 
241
 
MItem
 
5
 
md5.c
 
map.c
 
242
 
WString
 
4
 
COBJ
 
243
 
WVList
 
@@ -1038,14 +1038,14 @@ 0
 
52
 
1
 
1
 
0
 
245
 
MItem
 
9
 
minilzo.c
 
5
 
md5.c
 
246
 
WString
 
4
 
COBJ
 
247
 
WVList
 
@@ -1056,14 +1056,14 @@ 0
 
52
 
1
 
1
 
0
 
249
 
MItem
 
6
 
misc.c
 
9
 
minilzo.c
 
250
 
WString
 
4
 
COBJ
 
251
 
WVList
 
@@ -1074,14 +1074,14 @@ 0
 
52
 
1
 
1
 
0
 
253
 
MItem
 
10
 
misc_cmd.c
 
6
 
misc.c
 
254
 
WString
 
4
 
COBJ
 
255
 
WVList
 
@@ -1093,13 +1093,13 @@ 52
 
1
 
1
 
0
 
257
 
MItem
 
10
 
misc_gui.c
 
misc_cmd.c
 
258
 
WString
 
4
 
COBJ
 
259
 
WVList
 
@@ -1110,14 +1110,14 @@ 0
 
52
 
1
 
1
 
0
 
261
 
MItem
 
7
 
mixer.c
 
10
 
misc_gui.c
 
262
 
WString
 
4
 
COBJ
 
263
 
WVList
 
@@ -1128,14 +1128,14 @@ 0
 
52
 
1
 
1
 
0
 
265
 
MItem
 
11
 
music_gui.c
 
7
 
mixer.c
 
266
 
WString
 
4
 
COBJ
 
267
 
WVList
 
@@ -1146,14 +1146,14 @@ 0
 
52
 
1
 
1
 
0
 
269
 
MItem
 
9
 
namegen.c
 
14
 
music\null_m.c
 
270
 
WString
 
4
 
COBJ
 
271
 
WVList
 
@@ -1164,14 +1164,14 @@ 0
 
52
 
1
 
1
 
0
 
273
 
MItem
 
9
 
network.c
 
13
 
music\os2_m.c
 
274
 
WString
 
4
 
COBJ
 
275
 
WVList
 
@@ -1182,14 +1182,14 @@ 0
 
52
 
1
 
1
 
0
 
277
 
MItem
 
16
 
network_client.c
 
11
 
music_gui.c
 
278
 
WString
 
4
 
COBJ
 
279
 
WVList
 
@@ -1200,14 +1200,14 @@ 0
 
52
 
1
 
1
 
0
 
281
 
MItem
 
14
 
network_data.c
 
9
 
namegen.c
 
282
 
WString
 
4
 
COBJ
 
283
 
WVList
 
@@ -1218,14 +1218,14 @@ 0
 
52
 
1
 
1
 
0
 
285
 
MItem
 
18
 
network_gamelist.c
 
9
 
network.c
 
286
 
WString
 
4
 
COBJ
 
287
 
WVList
 
@@ -1236,14 +1236,14 @@ 0
 
52
 
1
 
1
 
0
 
289
 
MItem
 
13
 
network_gui.c
 
16
 
network_client.c
 
290
 
WString
 
4
 
COBJ
 
291
 
WVList
 
@@ -1254,14 +1254,14 @@ 0
 
52
 
1
 
1
 
0
 
293
 
MItem
 
16
 
network_server.c
 
14
 
network_data.c
 
294
 
WString
 
4
 
COBJ
 
295
 
WVList
 
@@ -1272,14 +1272,14 @@ 0
 
52
 
1
 
1
 
0
 
297
 
MItem
 
13
 
network_udp.c
 
18
 
network_gamelist.c
 
298
 
WString
 
4
 
COBJ
 
299
 
WVList
 
@@ -1290,14 +1290,14 @@ 0
 
52
 
1
 
1
 
0
 
301
 
MItem
 
8
 
newgrf.c
 
13
 
network_gui.c
 
302
 
WString
 
4
 
COBJ
 
303
 
WVList
 
@@ -1308,14 +1308,14 @@ 0
 
52
 
1
 
1
 
0
 
305
 
MItem
 
10
 
news_gui.c
 
16
 
network_server.c
 
306
 
WString
 
4
 
COBJ
 
307
 
WVList
 
@@ -1326,14 +1326,14 @@ 0
 
52
 
1
 
1
 
0
 
309
 
MItem
 
5
 
npf.c
 
13
 
network_udp.c
 
310
 
WString
 
4
 
COBJ
 
311
 
WVList
 
@@ -1344,14 +1344,14 @@ 0
 
52
 
1
 
1
 
0
 
313
 
MItem
 
11
 
oldloader.c
 
8
 
newgrf.c
 
314
 
WString
 
4
 
COBJ
 
315
 
WVList
 
@@ -1362,14 +1362,14 @@ 0
 
52
 
1
 
1
 
0
 
317
 
MItem
 
9
 
openttd.c
 
10
 
news_gui.c
 
318
 
WString
 
4
 
COBJ
 
319
 
WVList
 
@@ -1380,14 +1380,14 @@ 0
 
52
 
1
 
1
 
0
 
321
 
MItem
 
11
 
order_cmd.c
 
5
 
npf.c
 
322
 
WString
 
4
 
COBJ
 
323
 
WVList
 
@@ -1399,13 +1399,13 @@ 52
 
1
 
1
 
0
 
325
 
MItem
 
11
 
order_gui.c
 
oldloader.c
 
326
 
WString
 
4
 
COBJ
 
327
 
WVList
 
@@ -1416,14 +1416,14 @@ 0
 
52
 
1
 
1
 
0
 
329
 
MItem
 
5
 
os2.c
 
9
 
openttd.c
 
330
 
WString
 
4
 
COBJ
 
331
 
WVList
 
@@ -1434,14 +1434,14 @@ 0
 
52
 
1
 
1
 
0
 
333
 
MItem
 
10
 
pathfind.c
 
11
 
order_cmd.c
 
334
 
WString
 
4
 
COBJ
 
335
 
WVList
 
@@ -1452,14 +1452,14 @@ 0
 
52
 
1
 
1
 
0
 
337
 
MItem
 
5
 
pbs.c
 
11
 
order_gui.c
 
338
 
WString
 
4
 
COBJ
 
339
 
WVList
 
@@ -1470,14 +1470,14 @@ 0
 
52
 
1
 
1
 
0
 
341
 
MItem
 
12
 
player_gui.c
 
5
 
os2.c
 
342
 
WString
 
4
 
COBJ
 
343
 
WVList
 
@@ -1488,14 +1488,14 @@ 0
 
52
 
1
 
1
 
0
 
345
 
MItem
 
9
 
players.c
 
10
 
pathfind.c
 
346
 
WString
 
4
 
COBJ
 
347
 
WVList
 
@@ -1506,14 +1506,14 @@ 0
 
52
 
1
 
1
 
0
 
349
 
MItem
 
6
 
pool.c
 
5
 
pbs.c
 
350
 
WString
 
4
 
COBJ
 
351
 
WVList
 
@@ -1524,14 +1524,14 @@ 0
 
52
 
1
 
1
 
0
 
353
 
MItem
 
7
 
queue.c
 
12
 
player_gui.c
 
354
 
WString
 
4
 
COBJ
 
355
 
WVList
 
@@ -1542,14 +1542,14 @@ 0
 
52
 
1
 
1
 
0
 
357
 
MItem
 
6
 
rail.c
 
9
 
players.c
 
358
 
WString
 
4
 
COBJ
 
359
 
WVList
 
@@ -1560,14 +1560,14 @@ 0
 
52
 
1
 
1
 
0
 
361
 
MItem
 
10
 
rail_cmd.c
 
6
 
pool.c
 
362
 
WString
 
4
 
COBJ
 
363
 
WVList
 
@@ -1578,14 +1578,14 @@ 0
 
52
 
1
 
1
 
0
 
365
 
MItem
 
10
 
rail_gui.c
 
7
 
queue.c
 
366
 
WString
 
4
 
COBJ
 
367
 
WVList
 
@@ -1596,95 +1596,95 @@ 0
 
52
 
1
 
1
 
0
 
369
 
MItem
 
5
 
rev.c
 
6
 
rail.c
 
370
 
WString
 
4
 
COBJ
 
371
 
WVList
 
0
 
372
 
WVList
 
0
 
52
 
1
 
1
 
0
 
373
 
ActionStates
 
MItem
 
10
 
rail_cmd.c
 
374
 
WString
 
5
 
&Make
 
4
 
COBJ
 
375
 
WVList
 
0
 
376
 
WVList
 
0
 
52
 
1
 
1
 
0
 
376
 
377
 
MItem
 
10
 
road_cmd.c
 
377
 
rail_gui.c
 
378
 
WString
 
4
 
COBJ
 
378
 
379
 
WVList
 
0
 
379
 
380
 
WVList
 
0
 
52
 
1
 
1
 
0
 
380
 
381
 
MItem
 
10
 
road_gui.c
 
381
 
5
 
rev.c
 
382
 
WString
 
4
 
COBJ
 
382
 
WVList
 
0
 
383
 
WVList
 
0
 
52
 
1
 
384
 
WVList
 
1
 
0
 
384
 
MItem
 
13
 
roadveh_cmd.c
 
385
 
ActionStates
 
386
 
WString
 
4
 
COBJ
 
386
 
WVList
 
0
 
5
 
&Make
 
387
 
WVList
 
0
 
52
 
1
 
1
 
0
 
388
 
MItem
 
13
 
roadveh_gui.c
 
10
 
road_cmd.c
 
389
 
WString
 
4
 
COBJ
 
390
 
WVList
 
@@ -1696,13 +1696,13 @@ 52
 
1
 
1
 
0
 
392
 
MItem
 
10
 
saveload.c
 
road_gui.c
 
393
 
WString
 
4
 
COBJ
 
394
 
WVList
 
@@ -1713,14 +1713,14 @@ 0
 
52
 
1
 
1
 
0
 
396
 
MItem
 
12
 
screenshot.c
 
13
 
roadveh_cmd.c
 
397
 
WString
 
4
 
COBJ
 
398
 
WVList
 
@@ -1731,14 +1731,14 @@ 0
 
52
 
1
 
1
 
0
 
400
 
MItem
 
5
 
sdl.c
 
13
 
roadveh_gui.c
 
401
 
WString
 
4
 
COBJ
 
402
 
WVList
 
@@ -1750,13 +1750,13 @@ 52
 
1
 
1
 
0
 
404
 
MItem
 
10
 
settings.c
 
saveload.c
 
405
 
WString
 
4
 
COBJ
 
406
 
WVList
 
@@ -1767,14 +1767,14 @@ 0
 
52
 
1
 
1
 
0
 
408
 
MItem
 
14
 
settings_gui.c
 
12
 
screenshot.c
 
409
 
WString
 
4
 
COBJ
 
410
 
WVList
 
@@ -1785,14 +1785,14 @@ 0
 
52
 
1
 
1
 
0
 
412
 
MItem
 
10
 
ship_cmd.c
 
5
 
sdl.c
 
413
 
WString
 
4
 
COBJ
 
414
 
WVList
 
@@ -1804,13 +1804,13 @@ 52
 
1
 
1
 
0
 
416
 
MItem
 
10
 
ship_gui.c
 
settings.c
 
417
 
WString
 
4
 
COBJ
 
418
 
WVList
 
@@ -1821,14 +1821,14 @@ 0
 
52
 
1
 
1
 
0
 
420
 
MItem
 
7
 
signs.c
 
14
 
settings_gui.c
 
421
 
WString
 
4
 
COBJ
 
422
 
WVList
 
@@ -1839,14 +1839,14 @@ 0
 
52
 
1
 
1
 
0
 
424
 
MItem
 
14
 
smallmap_gui.c
 
10
 
ship_cmd.c
 
425
 
WString
 
4
 
COBJ
 
426
 
WVList
 
@@ -1857,14 +1857,14 @@ 0
 
52
 
1
 
1
 
0
 
428
 
MItem
 
7
 
sound.c
 
10
 
ship_gui.c
 
429
 
WString
 
4
 
COBJ
 
430
 
WVList
 
@@ -1875,14 +1875,14 @@ 0
 
52
 
1
 
1
 
0
 
432
 
MItem
 
8
 
sprite.c
 
7
 
signs.c
 
433
 
WString
 
4
 
COBJ
 
434
 
WVList
 
@@ -1893,14 +1893,14 @@ 0
 
52
 
1
 
1
 
0
 
436
 
MItem
 
13
 
spritecache.c
 
14
 
smallmap_gui.c
 
437
 
WString
 
4
 
COBJ
 
438
 
WVList
 
@@ -1911,14 +1911,14 @@ 0
 
52
 
1
 
1
 
0
 
440
 
MItem
 
13
 
station_cmd.c
 
7
 
sound.c
 
441
 
WString
 
4
 
COBJ
 
442
 
WVList
 
@@ -1929,14 +1929,14 @@ 0
 
52
 
1
 
1
 
0
 
444
 
MItem
 
13
 
station_gui.c
 
14
 
sound\null_s.c
 
445
 
WString
 
4
 
COBJ
 
446
 
WVList
 
@@ -1947,14 +1947,14 @@ 0
 
52
 
1
 
1
 
0
 
448
 
MItem
 
8
 
StdAfx.c
 
13
 
sound\sdl_s.c
 
449
 
WString
 
4
 
COBJ
 
450
 
WVList
 
@@ -1966,13 +1966,13 @@ 52
 
1
 
1
 
0
 
452
 
MItem
 
8
 
string.c
 
sprite.c
 
453
 
WString
 
4
 
COBJ
 
454
 
WVList
 
@@ -1983,14 +1983,14 @@ 0
 
52
 
1
 
1
 
0
 
456
 
MItem
 
9
 
strings.c
 
13
 
spritecache.c
 
457
 
WString
 
4
 
COBJ
 
458
 
WVList
 
@@ -2002,13 +2002,13 @@ 52
 
1
 
1
 
0
 
460
 
MItem
 
13
 
subsidy_gui.c
 
station_cmd.c
 
461
 
WString
 
4
 
COBJ
 
462
 
WVList
 
@@ -2019,14 +2019,14 @@ 0
 
52
 
1
 
1
 
0
 
464
 
MItem
 
15
 
terraform_gui.c
 
13
 
station_gui.c
 
465
 
WString
 
4
 
COBJ
 
466
 
WVList
 
@@ -2037,14 +2037,14 @@ 0
 
52
 
1
 
1
 
0
 
468
 
MItem
 
9
 
texteff.c
 
8
 
StdAfx.c
 
469
 
WString
 
4
 
COBJ
 
470
 
WVList
 
@@ -2055,14 +2055,14 @@ 0
 
52
 
1
 
1
 
0
 
472
 
MItem
 
6
 
tile.c
 
8
 
string.c
 
473
 
WString
 
4
 
COBJ
 
474
 
WVList
 
@@ -2073,14 +2073,14 @@ 0
 
52
 
1
 
1
 
0
 
476
 
MItem
 
10
 
town_cmd.c
 
9
 
strings.c
 
477
 
WString
 
4
 
COBJ
 
478
 
WVList
 
@@ -2091,14 +2091,14 @@ 0
 
52
 
1
 
1
 
0
 
480
 
MItem
 
10
 
town_gui.c
 
13
 
subsidy_gui.c
 
481
 
WString
 
4
 
COBJ
 
482
 
WVList
 
@@ -2109,14 +2109,14 @@ 0
 
52
 
1
 
1
 
0
 
484
 
MItem
 
11
 
train_cmd.c
 
15
 
terraform_gui.c
 
485
 
WString
 
4
 
COBJ
 
486
 
WVList
 
@@ -2127,14 +2127,14 @@ 0
 
52
 
1
 
1
 
0
 
488
 
MItem
 
11
 
train_gui.c
 
9
 
texteff.c
 
489
 
WString
 
4
 
COBJ
 
490
 
WVList
 
@@ -2145,14 +2145,14 @@ 0
 
52
 
1
 
1
 
0
 
492
 
MItem
 
10
 
tree_cmd.c
 
6
 
tile.c
 
493
 
WString
 
4
 
COBJ
 
494
 
WVList
 
@@ -2163,14 +2163,14 @@ 0
 
52
 
1
 
1
 
0
 
496
 
MItem
 
18
 
tunnelbridge_cmd.c
 
10
 
town_cmd.c
 
497
 
WString
 
4
 
COBJ
 
498
 
WVList
 
@@ -2181,14 +2181,14 @@ 0
 
52
 
1
 
1
 
0
 
500
 
MItem
 
15
 
unmovable_cmd.c
 
10
 
town_gui.c
 
501
 
WString
 
4
 
COBJ
 
502
 
WVList
 
@@ -2199,14 +2199,14 @@ 0
 
52
 
1
 
1
 
0
 
504
 
MItem
 
9
 
vehicle.c
 
11
 
train_cmd.c
 
505
 
WString
 
4
 
COBJ
 
506
 
WVList
 
@@ -2217,14 +2217,14 @@ 0
 
52
 
1
 
1
 
0
 
508
 
MItem
 
13
 
vehicle_gui.c
 
11
 
train_gui.c
 
509
 
WString
 
4
 
COBJ
 
510
 
WVList
 
@@ -2236,13 +2236,13 @@ 52
 
1
 
1
 
0
 
512
 
MItem
 
10
 
viewport.c
 
tree_cmd.c
 
513
 
WString
 
4
 
COBJ
 
514
 
WVList
 
@@ -2253,14 +2253,14 @@ 0
 
52
 
1
 
1
 
0
 
516
 
MItem
 
11
 
water_cmd.c
 
18
 
tunnelbridge_cmd.c
 
517
 
WString
 
4
 
COBJ
 
518
 
WVList
 
@@ -2271,14 +2271,14 @@ 0
 
52
 
1
 
1
 
0
 
520
 
MItem
 
10
 
waypoint.c
 
15
 
unmovable_cmd.c
 
521
 
WString
 
4
 
COBJ
 
522
 
WVList
 
@@ -2289,14 +2289,14 @@ 0
 
52
 
1
 
1
 
0
 
524
 
MItem
 
8
 
widget.c
 
9
 
vehicle.c
 
525
 
WString
 
4
 
COBJ
 
526
 
WVList
 
@@ -2307,14 +2307,14 @@ 0
 
52
 
1
 
1
 
0
 
528
 
MItem
 
8
 
window.c
 
13
 
vehicle_gui.c
 
529
 
WString
 
4
 
COBJ
 
530
 
WVList
 
@@ -2323,6 +2323,132 @@ 531
 
WVList
 
0
 
52
 
1
 
1
 
0
 
532
 
MItem
 
14
 
video\null_v.c
 
533
 
WString
 
4
 
COBJ
 
534
 
WVList
 
0
 
535
 
WVList
 
0
 
52
 
1
 
1
 
0
 
536
 
MItem
 
13
 
video\sdl_v.c
 
537
 
WString
 
4
 
COBJ
 
538
 
WVList
 
0
 
539
 
WVList
 
0
 
52
 
1
 
1
 
0
 
540
 
MItem
 
10
 
viewport.c
 
541
 
WString
 
4
 
COBJ
 
542
 
WVList
 
0
 
543
 
WVList
 
0
 
52
 
1
 
1
 
0
 
544
 
MItem
 
11
 
water_cmd.c
 
545
 
WString
 
4
 
COBJ
 
546
 
WVList
 
0
 
547
 
WVList
 
0
 
52
 
1
 
1
 
0
 
548
 
MItem
 
10
 
waypoint.c
 
549
 
WString
 
4
 
COBJ
 
550
 
WVList
 
0
 
551
 
WVList
 
0
 
52
 
1
 
1
 
0
 
552
 
MItem
 
8
 
widget.c
 
553
 
WString
 
4
 
COBJ
 
554
 
WVList
 
0
 
555
 
WVList
 
0
 
52
 
1
 
1
 
0
 
556
 
MItem
 
8
 
window.c
 
557
 
WString
 
4
 
COBJ
 
558
 
WVList
 
0
 
559
 
WVList
 
0
 
52
 
1
 
1
 
0
os/os2/openttd.wpj
Show inline comments
 
@@ -41,13 +41,13 @@ 0
 
0
 
10
 
WFileName
 
17
 
..\..\openttd.tgt
 
0
 
18
 
22
 
11
 
VComponent
 
12
 
WRect
 
688
 
680
os2.c
Show inline comments
 
@@ -32,12 +32,21 @@
 
#include <i86.h>
 

	
 
#if defined(WITH_SDL)
 
#include <SDL.h>
 
#endif
 

	
 
#include "sound/null_s.h"
 
#include "sound/sdl_s.h"
 

	
 
#include "video/null_v.h"
 
#include "video/sdl_v.h"
 

	
 
#include "music/null_m.h"
 
#include "music/os2_m.h"
 

	
 
static inline int strcasecmp(const char* s1, const char* s2)
 
{
 
	return stricmp(s1, s2);
 
}
 

	
 
static char *_fios_path;
 
@@ -632,76 +641,12 @@ void OS2_SwitchToConsoleMode(void)
 
	DosGetInfoBlocks(&tib, &pib);
 

	
 
	// Change flag from PM to VIO
 
	pib->pib_ultype = 3;
 
}
 

	
 
/**********************
 
 * OS/2 MIDI PLAYER
 
 **********************/
 

	
 
/* Interesting how similar the MCI API in OS/2 is to the Win32 MCI API,
 
 * eh? Anyone would think they both came from the same place originally! ;)
 
 */
 

	
 
static long CDECL MidiSendCommand(const char *cmd, ...)
 
{
 
	va_list va;
 
	char buf[512];
 
	va_start(va, cmd);
 
	vsprintf(buf, cmd, va);
 
	va_end(va);
 
	return mciSendString(buf, NULL, 0, NULL, 0);
 
}
 

	
 
static void OS2MidiPlaySong(const char *filename)
 
{
 
	MidiSendCommand("close all");
 

	
 
	if (MidiSendCommand("open %s type sequencer alias song", filename) != 0)
 
		return;
 

	
 
	MidiSendCommand("play song from 0");
 
}
 

	
 
static void OS2MidiStopSong(void)
 
{
 
	MidiSendCommand("close all");
 
}
 

	
 
static void OS2MidiSetVolume(byte vol)
 
{
 
	MidiSendCommand("set song audio volume %d", ((vol/127)*100));
 
}
 

	
 
static bool OS2MidiIsSongPlaying(void)
 
{
 
	char buf[16];
 
	mciSendString("status song mode", buf, sizeof(buf), NULL, 0);
 
	return strcmp(buf, "playing") == 0 || strcmp(buf, "seeking") == 0;
 
}
 

	
 
static const char *OS2MidiStart(const char * const *parm)
 
{
 
	return 0;
 
}
 

	
 
static void OS2MidiStop(void)
 
{
 
	MidiSendCommand("close all");
 
}
 

	
 
const HalMusicDriver _os2_music_driver = {
 
	OS2MidiStart,
 
	OS2MidiStop,
 
	OS2MidiPlaySong,
 
	OS2MidiStopSong,
 
	OS2MidiIsSongPlaying,
 
	OS2MidiSetVolume,
 
};
 

	
 
/**
 
 * Insert a chunk of text from the clipboard onto the textbuffer. Get TEXT clipboard
 
 * and append this up to the maximum length (either absolute or screenlength). If maxlength
 
 * is zero, we don't care about the screenlength but only about the physical length of the string
 
 * @param tb @Textbuf type to be changed
 
 * @return Return true on successfull change of Textbuf, or false otherwise
0 comments (0 inline, 0 general)