author | tron |
Sat, 23 Jul 2005 15:34:05 +0000 | |
changeset 2173 | d828f2e748fe |
parent 2171 | 60334c9ca477 |
child 2186 | db48cf29b983 |
permissions | -rw-r--r-- |
531 | 1 |
#include "stdafx.h" |
1892
8717d92b32b1
(svn r2398) - CodeChange: forgot to update unix and os2 specific files as well.
Darkvater
parents:
1301
diff
changeset
|
2 |
#include "openttd.h" |
2171
60334c9ca477
(svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents:
1892
diff
changeset
|
3 |
#include "music/bemidi.h" |
531 | 4 |
|
5 |
// BeOS System Includes |
|
6 |
#include <MidiSynthFile.h> |
|
7 |
||
2173 | 8 |
static BMidiSynthFile midiSynthFile; |
531 | 9 |
|
1301
bf64ba5b6774
(svn r1805) Teach the driver layer a few things about const correctness
tron
parents:
532
diff
changeset
|
10 |
static const char *bemidi_start(const char * const *parm) |
531 | 11 |
{ |
12 |
return NULL; |
|
13 |
} |
|
14 |
||
15 |
static void bemidi_stop(void) |
|
16 |
{ |
|
17 |
midiSynthFile.UnloadFile(); |
|
18 |
} |
|
19 |
||
20 |
static void bemidi_play_song(const char *filename) |
|
21 |
{ |
|
22 |
bemidi_stop(); |
|
23 |
entry_ref midiRef; |
|
24 |
get_ref_for_path(filename, &midiRef); |
|
25 |
midiSynthFile.LoadFile(&midiRef); |
|
26 |
midiSynthFile.Start(); |
|
27 |
} |
|
28 |
||
29 |
static void bemidi_stop_song(void) |
|
30 |
{ |
|
31 |
midiSynthFile.UnloadFile(); |
|
32 |
} |
|
33 |
||
34 |
static bool bemidi_is_playing(void) |
|
35 |
{ |
|
36 |
return !midiSynthFile.IsFinished(); |
|
37 |
} |
|
38 |
||
39 |
static void bemidi_set_volume(byte vol) |
|
40 |
{ |
|
41 |
fprintf(stderr, "BeMidi: Set volume not implemented\n"); |
|
42 |
} |
|
43 |
||
44 |
const HalMusicDriver _bemidi_music_driver = { |
|
45 |
bemidi_start, |
|
46 |
bemidi_stop, |
|
47 |
bemidi_play_song, |
|
48 |
bemidi_stop_song, |
|
49 |
bemidi_is_playing, |
|
50 |
bemidi_set_volume, |
|
51 |
}; |