File: audio.h

package info (click to toggle)
enemylines7 0.6-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,636 kB
  • sloc: cpp: 21,756; makefile: 24
file content (54 lines) | stat: -rw-r--r-- 856 bytes parent folder | download | duplicates (5)
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
#ifndef __el__audio_h
#define __el__audio_h

#include <iostream>
#include "release.h"

namespace PRJID {


typedef enum E_AudioSample {
	AS_NONE,
	AS_TITLE,
	AS_FAILED,
	AS_EXPLOSION_BUILDING,
	AS_EXPLOSION_PLANE,
	AS_LASER,
	AS_JETPACK,
	AS_PROBLEM,
	AS_LAST
};

typedef enum E_AudioChannel {
	AC_NEXT=-1,
	AC_TITLE,
	AC_PROBLEM,
	AC_LASER,
	AC_EXPLOSION,
	AC_EXPLOSION2,
	AC_EXPLOSION3,
	AC_EXPLOSION4,
	AC_EXPLOSION5,
	AC_LAST
};

class Audio{
public:
	static bool init();
	static bool load(std::string dir);

	static void off();
	static void on();
	static void toggle();
	static void tick();

	static void play(E_AudioSample s,E_AudioChannel chan=AC_NEXT,int repeat=0);

	static void schedule_play(unsigned int delay,E_AudioSample s,E_AudioChannel chan=AC_NEXT,int repeat=0);
};

std::ostream& operator<<(std::ostream&s, Audio);

} //namespace

#endif