author | tron |
Sat, 05 Feb 2005 18:05:42 +0000 | |
changeset 1301 | bf64ba5b6774 |
parent 532 | d894d437be85 |
child 1892 | 8717d92b32b1 |
permissions | -rw-r--r-- |
531 | 1 |
#ifdef __BEOS__ |
2 |
||
3 |
#include "stdafx.h" |
|
4 |
#include "ttd.h" |
|
5 |
#include "hal.h" |
|
6 |
||
7 |
// BeOS System Includes |
|
8 |
#include <MidiSynthFile.h> |
|
9 |
||
10 |
BMidiSynthFile midiSynthFile; |
|
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 |
}; |
|
54 |
||
55 |
#endif // __BEOS__ |