author | belugas |
Tue, 17 Apr 2007 20:23:13 +0000 | |
changeset 6481 | 85ad87daf4b0 |
parent 6247 | 7d81e3a5d803 |
child 7170 | 923946ec324f |
permissions | -rw-r--r-- |
2186 | 1 |
/* $Id$ */ |
2 |
||
6481
85ad87daf4b0
(svn r9662) -Documentation: Doxygen corrections and @file omissions
belugas
parents:
6247
diff
changeset
|
3 |
/** @file bemidi.cpp */ |
85ad87daf4b0
(svn r9662) -Documentation: Doxygen corrections and @file omissions
belugas
parents:
6247
diff
changeset
|
4 |
|
2192
6a4c2d020975
(svn r2707) Missed the paths in the BeOS MIDI player, sorry for all the noise
tron
parents:
2186
diff
changeset
|
5 |
#include "../stdafx.h" |
6a4c2d020975
(svn r2707) Missed the paths in the BeOS MIDI player, sorry for all the noise
tron
parents:
2186
diff
changeset
|
6 |
#include "../openttd.h" |
6a4c2d020975
(svn r2707) Missed the paths in the BeOS MIDI player, sorry for all the noise
tron
parents:
2186
diff
changeset
|
7 |
#include "bemidi.h" |
531 | 8 |
|
9 |
// BeOS System Includes |
|
10 |
#include <MidiSynthFile.h> |
|
11 |
||
2173 | 12 |
static BMidiSynthFile midiSynthFile; |
531 | 13 |
|
1301
bf64ba5b6774
(svn r1805) Teach the driver layer a few things about const correctness
tron
parents:
532
diff
changeset
|
14 |
static const char *bemidi_start(const char * const *parm) |
531 | 15 |
{ |
16 |
return NULL; |
|
17 |
} |
|
18 |
||
6247 | 19 |
static void bemidi_stop() |
531 | 20 |
{ |
21 |
midiSynthFile.UnloadFile(); |
|
22 |
} |
|
23 |
||
24 |
static void bemidi_play_song(const char *filename) |
|
25 |
{ |
|
26 |
bemidi_stop(); |
|
27 |
entry_ref midiRef; |
|
28 |
get_ref_for_path(filename, &midiRef); |
|
29 |
midiSynthFile.LoadFile(&midiRef); |
|
30 |
midiSynthFile.Start(); |
|
31 |
} |
|
32 |
||
6247 | 33 |
static void bemidi_stop_song() |
531 | 34 |
{ |
35 |
midiSynthFile.UnloadFile(); |
|
36 |
} |
|
37 |
||
6247 | 38 |
static bool bemidi_is_playing() |
531 | 39 |
{ |
40 |
return !midiSynthFile.IsFinished(); |
|
41 |
} |
|
42 |
||
43 |
static void bemidi_set_volume(byte vol) |
|
44 |
{ |
|
45 |
fprintf(stderr, "BeMidi: Set volume not implemented\n"); |
|
46 |
} |
|
47 |
||
48 |
const HalMusicDriver _bemidi_music_driver = { |
|
49 |
bemidi_start, |
|
50 |
bemidi_stop, |
|
51 |
bemidi_play_song, |
|
52 |
bemidi_stop_song, |
|
53 |
bemidi_is_playing, |
|
54 |
bemidi_set_volume, |
|
55 |
}; |