File: music_manager.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 (79 lines) | stat: -rw-r--r-- 1,725 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
/***************************************************************************
                          music_manager.h  -  description
                             -------------------
    begin                : Jun 13 2007
    copyright            : (C) 2007 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 <SDL/SDL_mixer.h>
#include <vector>


#ifndef MUSIC_MANAGER_H_
#define MUSIC_MANAGER_H_


enum Music_Type{
				MUS_MENU,
				MUS_CREDITS,
				MUS_GAME,
				MUS_READY
};


class Music_Manager{
private:
	std::vector<Mix_Music*> m_musics;
	
	Mix_Music* get_music(Music_Type music);
	
	void load_musics();
	
	bool music_enabled;
	
public:
	
	void init();
	
	void deinit();
	
	void play(Music_Type type);
	
	Uint32 get_max_volume();
	
	Uint32 get_volume();
	
	void set_volume(Uint32 value);
	
	void disable_music();
	
	void enable_music();
	
	// begin Singleton stuff

private:

    static Music_Manager* _instance;

protected:

	Music_Manager(){};

public:

    static Music_Manager* instance();

// end Singleton stuff

};
#endif /*MUSIC_MANAGER_H_*/