-
Notifications
You must be signed in to change notification settings - Fork 0
/
AudioSource_8hpp_source.html
129 lines (127 loc) · 13.2 KB
/
AudioSource_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
<!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/spic-prj-api/AudioSource.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_de77370fa4c160312bb88f5d1919228b.html">spic-prj-api</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">AudioSource.hpp</div> </div>
</div><!--header-->
<div class="contents">
<a href="AudioSource_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 AUDIOSOURCE_H_</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="preprocessor">#define AUDIOSOURCE_H_</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 "<a class="code" href="Component_8hpp.html">Component.hpp</a>"</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="preprocessor">#include <string></span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="preprocessor">#include <boost/serialization/access.hpp></span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="preprocessor">#include <boost/serialization/export.hpp></span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="preprocessor">#include <boost/serialization/map.hpp></span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>  </div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="keyword">namespace </span><a class="code" href="namespacespic.html">spic</a> {</div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>  </div>
<div class="line"><a name="l00015"></a><span class="lineno"><a class="line" href="classspic_1_1AudioSource.html"> 15</a></span>  <span class="keyword">class </span><a class="code" href="classspic_1_1AudioSource.html">AudioSource</a> : <span class="keyword">public</span> <a class="code" href="classspic_1_1Component.html">Component</a> {</div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>  <span class="keyword">public</span>:</div>
<div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="classspic_1_1AudioSource.html#a1a9ab4992fd8e1446dc6eceeeec7d047"> 17</a></span>  <a class="code" href="classspic_1_1AudioSource.html#a1a9ab4992fd8e1446dc6eceeeec7d047">AudioSource</a>() {</div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>  _audioClips = std::map<std::string, int>();</div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>  }</div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>  </div>
<div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="classspic_1_1AudioSource.html#acdfccf9503e2c22800c13cf59ff97bad"> 21</a></span>  <a class="code" href="classspic_1_1AudioSource.html#acdfccf9503e2c22800c13cf59ff97bad">AudioSource</a>(std::map<std::string, int> audioClips) : _audioClips(std::move(audioClips)) {}</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>  </div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>  <span class="keyword">template</span><<span class="keyword">class</span> Archive></div>
<div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="classspic_1_1AudioSource.html#a000145d6d6114ebd84a00c2f99376982"> 24</a></span>  <span class="keywordtype">void</span> <a class="code" href="classspic_1_1AudioSource.html#a000145d6d6114ebd84a00c2f99376982">serialize</a>(Archive &ar, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> version) {</div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  ar & boost::serialization::base_object<Component, AudioSource>(*<span class="keyword">this</span>);</div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  boost::serialization::void_cast_register<AudioSource, Component>();</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  ar & _audioClips;</div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  }</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  </div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  <span class="keywordtype">void</span> <a class="code" href="classspic_1_1AudioSource.html#ac5223a45229c13b97bbfebc088b08e26">PlayMusic</a>(<span class="keyword">const</span> std::string &musicName, <span class="keywordtype">bool</span> looping);</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  </div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  <span class="keywordtype">void</span> <a class="code" href="classspic_1_1AudioSource.html#aedf97810d0ad13b5309d7260357c6b8c">PlaySound</a>(<span class="keyword">const</span> std::string &soundName);</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  </div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <span class="keywordtype">void</span> <a class="code" href="classspic_1_1AudioSource.html#a88f2d65890e4ce1de154dd3e90b4158f">Stop</a>();</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="classspic_1_1AudioSource.html#aef8c2dae3296103e8b4cb217875bfbe1">AddAudioClip</a>(<span class="keyword">const</span> std::string &musicName, <span class="keywordtype">int</span> volume);</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  </div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <span class="keyword">private</span>:</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  std::map<std::string, int> _audioClips;</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  };</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span> }</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  </div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span> <span class="preprocessor">#endif </span><span class="comment">// AUDIOSOURCE_H_</span></div>
<div class="ttc" id="aComponent_8hpp_html"><div class="ttname"><a href="Component_8hpp.html">Component.hpp</a></div></div>
<div class="ttc" id="aclassspic_1_1AudioSource_html"><div class="ttname"><a href="classspic_1_1AudioSource.html">spic::AudioSource</a></div><div class="ttdoc">Component which can play audio.</div><div class="ttdef"><b>Definition:</b> AudioSource.hpp:15</div></div>
<div class="ttc" id="aclassspic_1_1AudioSource_html_a000145d6d6114ebd84a00c2f99376982"><div class="ttname"><a href="classspic_1_1AudioSource.html#a000145d6d6114ebd84a00c2f99376982">spic::AudioSource::serialize</a></div><div class="ttdeci">void serialize(Archive &ar, unsigned int version)</div><div class="ttdef"><b>Definition:</b> AudioSource.hpp:24</div></div>
<div class="ttc" id="aclassspic_1_1AudioSource_html_a1a9ab4992fd8e1446dc6eceeeec7d047"><div class="ttname"><a href="classspic_1_1AudioSource.html#a1a9ab4992fd8e1446dc6eceeeec7d047">spic::AudioSource::AudioSource</a></div><div class="ttdeci">AudioSource()</div><div class="ttdef"><b>Definition:</b> AudioSource.hpp:17</div></div>
<div class="ttc" id="aclassspic_1_1AudioSource_html_a88f2d65890e4ce1de154dd3e90b4158f"><div class="ttname"><a href="classspic_1_1AudioSource.html#a88f2d65890e4ce1de154dd3e90b4158f">spic::AudioSource::Stop</a></div><div class="ttdeci">void Stop()</div><div class="ttdoc">Call this method to stop playing audio. @spicapi.</div><div class="ttdef"><b>Definition:</b> AudioSource.cpp:18</div></div>
<div class="ttc" id="aclassspic_1_1AudioSource_html_ac5223a45229c13b97bbfebc088b08e26"><div class="ttname"><a href="classspic_1_1AudioSource.html#ac5223a45229c13b97bbfebc088b08e26">spic::AudioSource::PlayMusic</a></div><div class="ttdeci">void PlayMusic(const std::string &musicName, bool looping)</div><div class="ttdoc">Call this method to start playing audio (make sure the audio file is loaded)</div><div class="ttdef"><b>Definition:</b> AudioSource.cpp:4</div></div>
<div class="ttc" id="aclassspic_1_1AudioSource_html_acdfccf9503e2c22800c13cf59ff97bad"><div class="ttname"><a href="classspic_1_1AudioSource.html#acdfccf9503e2c22800c13cf59ff97bad">spic::AudioSource::AudioSource</a></div><div class="ttdeci">AudioSource(std::map< std::string, int > audioClips)</div><div class="ttdef"><b>Definition:</b> AudioSource.hpp:21</div></div>
<div class="ttc" id="aclassspic_1_1AudioSource_html_aedf97810d0ad13b5309d7260357c6b8c"><div class="ttname"><a href="classspic_1_1AudioSource.html#aedf97810d0ad13b5309d7260357c6b8c">spic::AudioSource::PlaySound</a></div><div class="ttdeci">void PlaySound(const std::string &soundName)</div><div class="ttdoc">Play a sound.</div><div class="ttdef"><b>Definition:</b> AudioSource.cpp:11</div></div>
<div class="ttc" id="aclassspic_1_1AudioSource_html_aef8c2dae3296103e8b4cb217875bfbe1"><div class="ttname"><a href="classspic_1_1AudioSource.html#aef8c2dae3296103e8b4cb217875bfbe1">spic::AudioSource::AddAudioClip</a></div><div class="ttdeci">void AddAudioClip(const std::string &musicName, int volume)</div><div class="ttdoc">Add an audio clip that can be played by this component.</div><div class="ttdef"><b>Definition:</b> AudioSource.cpp:22</div></div>
<div class="ttc" id="aclassspic_1_1Component_html"><div class="ttname"><a href="classspic_1_1Component.html">spic::Component</a></div><div class="ttdoc">Base class for all components.</div><div class="ttdef"><b>Definition:</b> Component.hpp:23</div></div>
<div class="ttc" id="anamespacespic_html"><div class="ttname"><a href="namespacespic.html">spic</a></div><div class="ttdef"><b>Definition:</b> AudioNotFoundException.hpp: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>