File: sfx.h

package info (click to toggle)
epiphany 0.7.0+0-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 7,532 kB
  • sloc: cpp: 6,404; ansic: 141; makefile: 78; sh: 7
file content (95 lines) | stat: -rw-r--r-- 2,051 bytes parent folder | download | duplicates (6)
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
/***************************************************************************
                          sfx.h  -  description
                             -------------------
    begin                : Fri Aug 16 2002
    copyright            : (C) 2002 by Giuseppe D'Aqui'
    email                : kumber@tiscalinet.it
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License, Version 2, as published by  *
 *   the Free Software Foundation.                                   *
 *                                                                         *
 ***************************************************************************/

#include "dephine.h"

#include <vector>


#ifndef SFX_H
#define SFX_H

class Sample;

enum Sample_Type{	SFX_BOULDER_FALL,
									SFX_EMERALD_EAT,
									SFX_SAPPHIRE_EAT,
									SFX_GAME_GAMEOVER,
									SFX_DOOR_PASS,
									SFX_EMERALD_FALL,
									SFX_SAPPHIRE_FALL,
									SFX_GRASS_EAT,
									SFX_KEY_EAT,
									SFX_PLAYER_MOVE,
									SFX_MONSTER_MOVE,
									SFX_WOOD_SMASH,
									SFX_GAME_TIMEALARM,
									SFX_EXPLOSION
								};

class Sample_Manager
{
private:
	std::vector<Sample*> m_samples;
	
	Sample* get_sample(Sample_Type sfx);
	
		void load_samples();
		
	enum{
			m_channels_monsters,
			m_channels_boulders,
			m_channels_gems,
			m_channels_explosions,
			m_channels_timealarm
	};
	
	
public:
	
	
	void init();
	
	void deinit();
	
	void play(Sample_Type type);
	
	Uint32 get_max_volume();
	
	Uint32 get_volume();
	
	void set_volume(Uint32 value);

	
	// begin Singleton stuff

private:

    static Sample_Manager* _instance;

protected:

	Sample_Manager(){};

public:

    static Sample_Manager* instance();

// end Singleton stuff
	
};

#endif //SFX_H