-
Notifications
You must be signed in to change notification settings - Fork 0
/
AudioFacade_8hpp_source.html
142 lines (140 loc) · 16.7 KB
/
AudioFacade_8hpp_source.html
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SPC-H Platformer Engine: includes/platformer-engine/Facade/AudioFacade.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">SPC-H Platformer Engine
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_09e761304027c904456130627fd4dcf5.html">includes</a></li><li class="navelem"><a class="el" href="dir_1587a151464512ea3626aba36cd93a86.html">platformer-engine</a></li><li class="navelem"><a class="el" href="dir_4ad73661ceecee2f59b8c0b0178f9787.html">Facade</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">AudioFacade.hpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="AudioFacade_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="preprocessor">#ifndef PLATFORMER_ENGINE_AUDIOFACADE_HPP</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="preprocessor">#define PLATFORMER_ENGINE_AUDIOFACADE_HPP</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>  </div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="preprocessor">#include <map></span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="preprocessor">#include <functional></span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="preprocessor">#include <memory></span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="preprocessor">#include "SDL_mixer.h"</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>  </div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="keyword">namespace </span><a class="code" href="namespaceplatformer__engine.html">platformer_engine</a> {</div>
<div class="line"><a name="l00010"></a><span class="lineno"><a class="line" href="classplatformer__engine_1_1AudioFacade.html"> 10</a></span>  <span class="keyword">class </span><a class="code" href="classplatformer__engine_1_1AudioFacade.html">AudioFacade</a> {</div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>  <a class="code" href="classplatformer__engine_1_1AudioFacade.html#a2d459e7f7b396b3f09033a7d2a954222">~AudioFacade</a>();</div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>  </div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>  <span class="keywordtype">void</span> <a class="code" href="classplatformer__engine_1_1AudioFacade.html#afc185da453435ef77f6af55557198012">Quit</a>();</div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>  </div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>  <span class="keywordtype">void</span> <a class="code" href="classplatformer__engine_1_1AudioFacade.html#ad03d28c1e9a2a24b77da512f4a95d346">SetVolume</a>(<span class="keywordtype">int</span> volume);</div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>  </div>
<div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="classplatformer__engine_1_1AudioFacade.html#a04776310871083a19dddb6ca635a3259"> 25</a></span>  <span class="keywordtype">int</span> <a class="code" href="classplatformer__engine_1_1AudioFacade.html#a04776310871083a19dddb6ca635a3259">getVolume</a>() {</div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  <span class="keywordflow">return</span> _volume;</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  }</div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  </div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  <span class="keywordtype">void</span> <a class="code" href="classplatformer__engine_1_1AudioFacade.html#af352956cd7a76c40da16e1dbed71a67e">SetVolumeMusic</a>(<span class="keywordtype">int</span> volume);</div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  </div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  <span class="keywordtype">void</span> <a class="code" href="classplatformer__engine_1_1AudioFacade.html#ae1bbda7a45281b2c45606732934ff8e3">LoadMusic</a>(<span class="keyword">const</span> std::string &musicName, <span class="keyword">const</span> std::string &fileName);</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  </div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <span class="keywordtype">void</span> <a class="code" href="classplatformer__engine_1_1AudioFacade.html#aaac0b5c67de59ff60647e8e70642fab4">LoadSound</a>(<span class="keyword">const</span> std::string &soundName, <span class="keyword">const</span> std::string &fileName);</div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  </div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <span class="keywordtype">void</span> <a class="code" href="classplatformer__engine_1_1AudioFacade.html#ad584fc147c4372ca289b028c28283e72">PlayMusic</a>(<span class="keyword">const</span> std::string &musicName, <span class="keywordtype">bool</span> loopMusic);</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  </div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <span class="keywordtype">void</span> <a class="code" href="classplatformer__engine_1_1AudioFacade.html#a9ae66a1d3afee47b3f5df70d561a5382">PlaySound</a>(<span class="keyword">const</span> std::string &soundName);</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  </div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <span class="keywordtype">void</span> <a class="code" href="classplatformer__engine_1_1AudioFacade.html#a1d0d4d9c2eea15d446d50ff95e0a61e2">TogglePlay</a>();</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  </div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <span class="keywordtype">void</span> <a class="code" href="classplatformer__engine_1_1AudioFacade.html#a360e5c61264a414e43d6bc4db7d0181b">StopMusic</a>();</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  </div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <a class="code" href="classplatformer__engine_1_1AudioFacade.html#a45257ed5e1b550548f5e62d82bf3a54f">AudioFacade</a>();</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  </div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  <span class="keyword">private</span>:</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  </div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  std::map<std::string, std::unique_ptr<Mix_Music, std::function<void(</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  Mix_Music *)>>> _music;</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  std::map<std::string, std::unique_ptr<Mix_Chunk, std::function<void(</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  Mix_Chunk *)>>> _sounds;</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  <span class="keywordtype">int</span> _volume = MIX_MAX_VOLUME;</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  };</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  </div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  </div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span> }</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  </div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span> <span class="preprocessor">#endif </span><span class="comment">//PLATFORMER_ENGINE_AUDIOFACADE_HPP</span></div>
<div class="ttc" id="aclassplatformer__engine_1_1AudioFacade_html"><div class="ttname"><a href="classplatformer__engine_1_1AudioFacade.html">platformer_engine::AudioFacade</a></div><div class="ttdef"><b>Definition:</b> AudioFacade.hpp:10</div></div>
<div class="ttc" id="aclassplatformer__engine_1_1AudioFacade_html_a04776310871083a19dddb6ca635a3259"><div class="ttname"><a href="classplatformer__engine_1_1AudioFacade.html#a04776310871083a19dddb6ca635a3259">platformer_engine::AudioFacade::getVolume</a></div><div class="ttdeci">int getVolume()</div><div class="ttdef"><b>Definition:</b> AudioFacade.hpp:25</div></div>
<div class="ttc" id="aclassplatformer__engine_1_1AudioFacade_html_a1d0d4d9c2eea15d446d50ff95e0a61e2"><div class="ttname"><a href="classplatformer__engine_1_1AudioFacade.html#a1d0d4d9c2eea15d446d50ff95e0a61e2">platformer_engine::AudioFacade::TogglePlay</a></div><div class="ttdeci">void TogglePlay()</div><div class="ttdoc">Toggle the play state of the music.</div><div class="ttdef"><b>Definition:</b> AudioFacade.cpp:85</div></div>
<div class="ttc" id="aclassplatformer__engine_1_1AudioFacade_html_a2d459e7f7b396b3f09033a7d2a954222"><div class="ttname"><a href="classplatformer__engine_1_1AudioFacade.html#a2d459e7f7b396b3f09033a7d2a954222">platformer_engine::AudioFacade::~AudioFacade</a></div><div class="ttdeci">~AudioFacade()</div><div class="ttdef"><b>Definition:</b> AudioFacade.cpp:22</div></div>
<div class="ttc" id="aclassplatformer__engine_1_1AudioFacade_html_a360e5c61264a414e43d6bc4db7d0181b"><div class="ttname"><a href="classplatformer__engine_1_1AudioFacade.html#a360e5c61264a414e43d6bc4db7d0181b">platformer_engine::AudioFacade::StopMusic</a></div><div class="ttdeci">void StopMusic()</div><div class="ttdoc">Stop the music.</div><div class="ttdef"><b>Definition:</b> AudioFacade.cpp:93</div></div>
<div class="ttc" id="aclassplatformer__engine_1_1AudioFacade_html_a45257ed5e1b550548f5e62d82bf3a54f"><div class="ttname"><a href="classplatformer__engine_1_1AudioFacade.html#a45257ed5e1b550548f5e62d82bf3a54f">platformer_engine::AudioFacade::AudioFacade</a></div><div class="ttdeci">AudioFacade()</div><div class="ttdef"><b>Definition:</b> AudioFacade.cpp:13</div></div>
<div class="ttc" id="aclassplatformer__engine_1_1AudioFacade_html_a9ae66a1d3afee47b3f5df70d561a5382"><div class="ttname"><a href="classplatformer__engine_1_1AudioFacade.html#a9ae66a1d3afee47b3f5df70d561a5382">platformer_engine::AudioFacade::PlaySound</a></div><div class="ttdeci">void PlaySound(const std::string &soundName)</div><div class="ttdoc">Play a sound file.</div><div class="ttdef"><b>Definition:</b> AudioFacade.cpp:76</div></div>
<div class="ttc" id="aclassplatformer__engine_1_1AudioFacade_html_aaac0b5c67de59ff60647e8e70642fab4"><div class="ttname"><a href="classplatformer__engine_1_1AudioFacade.html#aaac0b5c67de59ff60647e8e70642fab4">platformer_engine::AudioFacade::LoadSound</a></div><div class="ttdeci">void LoadSound(const std::string &soundName, const std::string &fileName)</div><div class="ttdoc">Load a sound file.</div><div class="ttdef"><b>Definition:</b> AudioFacade.cpp:50</div></div>
<div class="ttc" id="aclassplatformer__engine_1_1AudioFacade_html_ad03d28c1e9a2a24b77da512f4a95d346"><div class="ttname"><a href="classplatformer__engine_1_1AudioFacade.html#ad03d28c1e9a2a24b77da512f4a95d346">platformer_engine::AudioFacade::SetVolume</a></div><div class="ttdeci">void SetVolume(int volume)</div><div class="ttdoc">Set the volume of the audio system (use this before playing music)</div><div class="ttdef"><b>Definition:</b> AudioFacade.cpp:30</div></div>
<div class="ttc" id="aclassplatformer__engine_1_1AudioFacade_html_ad584fc147c4372ca289b028c28283e72"><div class="ttname"><a href="classplatformer__engine_1_1AudioFacade.html#ad584fc147c4372ca289b028c28283e72">platformer_engine::AudioFacade::PlayMusic</a></div><div class="ttdeci">void PlayMusic(const std::string &musicName, bool loopMusic)</div><div class="ttdoc">Play a music file.</div><div class="ttdef"><b>Definition:</b> AudioFacade.cpp:62</div></div>
<div class="ttc" id="aclassplatformer__engine_1_1AudioFacade_html_ae1bbda7a45281b2c45606732934ff8e3"><div class="ttname"><a href="classplatformer__engine_1_1AudioFacade.html#ae1bbda7a45281b2c45606732934ff8e3">platformer_engine::AudioFacade::LoadMusic</a></div><div class="ttdeci">void LoadMusic(const std::string &musicName, const std::string &fileName)</div><div class="ttdoc">Load a music file.</div><div class="ttdef"><b>Definition:</b> AudioFacade.cpp:38</div></div>
<div class="ttc" id="aclassplatformer__engine_1_1AudioFacade_html_af352956cd7a76c40da16e1dbed71a67e"><div class="ttname"><a href="classplatformer__engine_1_1AudioFacade.html#af352956cd7a76c40da16e1dbed71a67e">platformer_engine::AudioFacade::SetVolumeMusic</a></div><div class="ttdeci">void SetVolumeMusic(int volume)</div><div class="ttdoc">Set the volume of the music (that is already playing)</div><div class="ttdef"><b>Definition:</b> AudioFacade.cpp:34</div></div>
<div class="ttc" id="aclassplatformer__engine_1_1AudioFacade_html_afc185da453435ef77f6af55557198012"><div class="ttname"><a href="classplatformer__engine_1_1AudioFacade.html#afc185da453435ef77f6af55557198012">platformer_engine::AudioFacade::Quit</a></div><div class="ttdeci">void Quit()</div><div class="ttdoc">Quit the audio system.</div><div class="ttdef"><b>Definition:</b> AudioFacade.cpp:26</div></div>
<div class="ttc" id="anamespaceplatformer__engine_html"><div class="ttname"><a href="namespaceplatformer__engine.html">platformer_engine</a></div><div class="ttdef"><b>Definition:</b> CollisionBehaviour.cpp:7</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>