author | tron |
Sun, 24 Jul 2005 14:12:37 +0000 | |
changeset 2186 | db48cf29b983 |
parent 2173 | d828f2e748fe |
child 2192 | 6a4c2d020975 |
permissions | -rw-r--r-- |
2186 | 1 |
/* $Id$ */ |
2 |
||
531 | 3 |
#include "stdafx.h" |
1892
8717d92b32b1
(svn r2398) - CodeChange: forgot to update unix and os2 specific files as well.
Darkvater
parents:
1301
diff
changeset
|
4 |
#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
|
5 |
#include "music/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 |
}; |