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