forked from aburch/simutrans
-
Notifications
You must be signed in to change notification settings - Fork 1
/
simsound.h
95 lines (70 loc) · 1.71 KB
/
simsound.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
* Beschreibung der Schnittstelle zum Soundsystem.
* von Hj. Malthaner, 1998, 2000
* This file is part of the Simutrans project under the artistic license.
* (see license.txt)
*/
#ifndef simsound_h
#define simsound_h
#include "simtypes.h"
// when muted, sound is not played (and also volume is not touched)
void sound_set_mute(bool on);
bool sound_get_mute();
/**
* setzt Lautstärke für alle effekte
* @author Hj. Malthaner
*/
void sound_set_global_volume(int volume);
/**
* ermittelt Lautstärke für alle effekte
* @author Hj. Malthaner
*/
int sound_get_global_volume();
/**
* Play a sound.
*
* @param idx Index of the sound
* @param volume Volume of the sound, 0 = silence, 255 = max
*/
void sound_play(uint16 idx, uint8 volume = 255);
// shuffle enable/disable for midis
bool sound_get_shuffle_midi();
void sound_set_shuffle_midi( bool shuffle );
/**
* setzt Lautstärke für MIDI playback
* @param volume volume in range 0..255
* @author Hj. Malthaner
*/
void sound_set_midi_volume(int volume);
/**
* ermittelt Lautstärke für MIDI playback
* @return volume in range 0..255
* @author Hj. Malthaner
*/
int sound_get_midi_volume();
/**
* gets midi title
* @author Hj. Malthaner
*/
const char *sound_get_midi_title(int index);
/**
* gets curent midi number
* @author Hj. Malthaner
*/
int get_current_midi();
// when muted, midi is not used
void midi_set_mute(bool on);
bool midi_get_mute();
/* OWEN: MIDI routines */
extern int midi_init(const char *path);
extern void midi_play(const int no);
extern void check_midi();
/**
* shuts down midi playing
* @author Owen Rudge
*/
extern void close_midi();
extern void midi_next_track();
extern void midi_last_track();
extern void midi_stop();
#endif