-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdaudio.h
More file actions
59 lines (42 loc) · 1.23 KB
/
daudio.h
File metadata and controls
59 lines (42 loc) · 1.23 KB
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
//-----------------------------------------------------------------------------
// File: daudio.h
//
// DirectX audio controller class
//-----------------------------------------------------------------------------
#ifndef DAUDIO_H
#define DAUDIO_H
#include "dxcommon.h"
#include "types.h"
#include "util.h"
#include "maths.h"
//#define INITGUID
#include <dmusici.h>
class daudio_t {
public:
~daudio_t() { destroy(); }
result_t create();
void destroy();
hsegment_t get_segment(const char* name);
haudiopath_t create_path(const vec3_t& pos, const vec3_t& dir);
void free_path(haudiopath_t path);
void set_pos(haudiopath_t path, const vec3_t& pos);
void set_dir(haudiopath_t path, const vec3_t& dir);
void play_sound(hsound_t sound, haudiopath_t path, bool repeat = false);
void stop_sound(hsound_t sound, haudiopath_t path);
bool is_playing(hsound_t segment, haudiopath_t path);
bool is_playing(hsound_t segment);
static daudio_t& get_instance();
private:
struct audiopath_t;
struct sound_t;
daudio_t() :
sounds(0),
paths(0)
{}
sound_t* sounds;
audiopath_t* audiopaths;
com_ptr_t<IDirectMusicPerformance8> performance;
com_ptr_t<IDirectMusicLoader8> loader;
};
#define daudio (daudio_t::get_instance())
#endif