aboutsummaryrefslogtreecommitdiffstats
path: root/doc/api-ref/html/libsoundmanager_8hpp_source.html
blob: 58073d626e402e47e424e7a16cc9eb5595f448ef (plain)
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://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.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Sound Manager: SoundManagerBinding/include/libsoundmanager/libsoundmanager.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="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</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">Sound Manager
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('libsoundmanager_8hpp_source.html','');});
</script>
<div id="doc-content">
<!-- 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 class="header">
  <div class="headertitle">
<div class="title">libsoundmanager.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="libsoundmanager_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>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Copyright (c) 2017 TOYOTA MOTOR CORPORATION</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * You may obtain a copy of the License at</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> *      http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#ifndef LIBSOUNDMANAGER_H</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#define LIBSOUNDMANAGER_H</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#include &lt;audiomanagertypes.h&gt;</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#include &lt;map&gt;</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#include &lt;json-c/json.h&gt;</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#include &lt;systemd/sd-event.h&gt;</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;{</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#include &lt;afb/afb-binding.h&gt;</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#include &lt;afb/afb-wsj1.h&gt;</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#include &lt;afb/afb-ws-client.h&gt;</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;}</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="keyword">using namespace </span><a class="code" href="namespaceam.html">am</a>;</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="libsoundmanager_8hpp.html#a1f6a1c6cdbe66b174179ef6395f2981f">   34</a></span>&#160;<span class="keyword">const</span> std::vector&lt;std::string&gt; <a class="code" href="libsoundmanager_8hpp.html#a1f6a1c6cdbe66b174179ef6395f2981f">api_list</a>{</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    std::string(<span class="stringliteral">&quot;connect&quot;</span>),</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;    std::string(<span class="stringliteral">&quot;disconnect&quot;</span>),</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    std::string(<span class="stringliteral">&quot;setVolume&quot;</span>),</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    std::string(<span class="stringliteral">&quot;volumeStep&quot;</span>),</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    std::string(<span class="stringliteral">&quot;setSinkMuteState&quot;</span>),</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    std::string(<span class="stringliteral">&quot;getListMainConnections&quot;</span>),</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    std::string(<span class="stringliteral">&quot;ackConnect&quot;</span>),</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    std::string(<span class="stringliteral">&quot;ackDisconnect&quot;</span>),</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    std::string(<span class="stringliteral">&quot;ackSetSourceState&quot;</span>),    </div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    std::string(<span class="stringliteral">&quot;registerSource&quot;</span>),</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;    std::string(<span class="stringliteral">&quot;deregisterSource&quot;</span>),</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;    std::string(<span class="stringliteral">&quot;subscribe&quot;</span>),</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    std::string(<span class="stringliteral">&quot;unsubscribe&quot;</span>)</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;};</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;</div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="libsoundmanager_8hpp.html#a63497e6f3147871c0c6b1b251565e7f0">   50</a></span>&#160;<span class="keyword">const</span> std::vector&lt;std::string&gt; <a class="code" href="libsoundmanager_8hpp.html#a63497e6f3147871c0c6b1b251565e7f0">event_list</a>{</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    std::string(<span class="stringliteral">&quot;newMainConnection&quot;</span>),</div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;    std::string(<span class="stringliteral">&quot;volumeChanged&quot;</span>),</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    std::string(<span class="stringliteral">&quot;removedMainConnection&quot;</span>),</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;    std::string(<span class="stringliteral">&quot;sinkMuteStateChanged&quot;</span>),</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    std::string(<span class="stringliteral">&quot;mainConnectionStateChanged&quot;</span>),</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    std::string(<span class="stringliteral">&quot;setRoutingReady&quot;</span>),</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    std::string(<span class="stringliteral">&quot;setRoutingRundown&quot;</span>),</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    std::string(<span class="stringliteral">&quot;asyncConnect&quot;</span>),</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    std::string(<span class="stringliteral">&quot;ackSetSourceState&quot;</span>)</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;};</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div><div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="class_lib_soundmanager.html">   62</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_lib_soundmanager.html">LibSoundmanager</a></div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;{</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;    <a class="code" href="class_lib_soundmanager.html">LibSoundmanager</a>() = <span class="keyword">delete</span>;</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    <a class="code" href="class_lib_soundmanager.html">LibSoundmanager</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> port, <span class="keyword">const</span> std::string&amp; token);</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <span class="comment">//LibSoundmanager(const std::string&amp; uri);  </span></div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    ~<a class="code" href="class_lib_soundmanager.html">LibSoundmanager</a>();</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    </div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    <span class="comment">/* Method */</span></div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    <span class="keywordtype">void</span> register_callback(</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;        <span class="keywordtype">void</span> (*event_cb)(<span class="keyword">const</span> std::string&amp; <a class="code" href="structevent.html">event</a>, <span class="keyword">struct</span> json_object* event_contents), </div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;        <span class="keywordtype">void</span> (*reply_cb)(<span class="keyword">struct</span> json_object* reply_contents)</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;        );</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    <span class="keywordtype">int</span> run_eventloop();</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    <span class="keywordtype">int</span> call(<span class="keyword">const</span> std::string&amp; verb, <span class="keyword">struct</span> json_object* arg);</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    <span class="keywordtype">int</span> call_sync(<span class="keyword">const</span> std::string&amp; verb, <span class="keyword">struct</span> json_object* arg, <span class="keyword">struct</span> json_object* ret);</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="keywordtype">int</span> subscribe(<span class="keyword">const</span> std::string&amp; event_name);</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    <span class="keywordtype">int</span> unsubscribe(<span class="keyword">const</span> std::string&amp; event_name);</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    <span class="comment">/*const struct afb_wsj1* get_websocket_handler();</span></div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;<span class="comment">    const struct sd_event* get_sd_event();*/</span></div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    <span class="keywordtype">int</span> initialize_websocket();</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    void (*onEvent)(<span class="keyword">const</span> std::string&amp; event, <span class="keyword">struct </span>json_object* event_contents);</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    void (*onReply)(<span class="keyword">struct </span>json_object* reply);</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    <span class="keyword">struct </span>afb_wsj1* sp_websock;</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    <span class="keyword">struct </span>afb_wsj1_itf minterface;</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    sd_event* mploop;</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    std::string muri;</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    <span class="keywordtype">int</span> mport = 12345;</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    std::string mtoken = <span class="stringliteral">&quot;123456&quot;</span>;</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    am_Error_e connect(<span class="keyword">const</span> am_sourceID_t sourceID, <span class="keyword">const</span> am_sinkID_t sinkID, am::am_mainConnectionID_t&amp; mainConnectionID);</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    am_Error_e disconnect(<span class="keyword">const</span> am_mainConnectionID_t mainConnectionID);</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    <span class="comment">/* Don&#39;t use/ Internal only */</span></div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    <span class="keywordtype">void</span> on_hangup(<span class="keywordtype">void</span> *closure, <span class="keyword">struct</span> afb_wsj1 *wsj);</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    <span class="keywordtype">void</span> on_call(<span class="keywordtype">void</span> *closure, <span class="keyword">const</span> <span class="keywordtype">char</span> *api, <span class="keyword">const</span> <span class="keywordtype">char</span> *verb, <span class="keyword">struct</span> afb_wsj1_msg *msg);</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    <span class="keywordtype">void</span> on_event(<span class="keywordtype">void</span> *closure, <span class="keyword">const</span> <span class="keywordtype">char</span> *event, <span class="keyword">struct</span> afb_wsj1_msg *msg);</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    <span class="keywordtype">void</span> on_reply(<span class="keywordtype">void</span> *closure, <span class="keyword">struct</span> afb_wsj1_msg *msg);</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;};</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* LIBSOUNDMANAGER_H */</span><span class="preprocessor"></span></div><div class="ttc" id="namespaceam_html"><div class="ttname"><a href="namespaceam.html">am</a></div></div>
<div class="ttc" id="libsoundmanager_8hpp_html_a1f6a1c6cdbe66b174179ef6395f2981f"><div class="ttname"><a href="libsoundmanager_8hpp.html#a1f6a1c6cdbe66b174179ef6395f2981f">api_list</a></div><div class="ttdeci">const std::vector&lt; std::string &gt; api_list</div><div class="ttdef"><b>Definition:</b> <a href="libsoundmanager_8hpp_source.html#l00034">libsoundmanager.hpp:34</a></div></div>
<div class="ttc" id="libsoundmanager_8hpp_html_a63497e6f3147871c0c6b1b251565e7f0"><div class="ttname"><a href="libsoundmanager_8hpp.html#a63497e6f3147871c0c6b1b251565e7f0">event_list</a></div><div class="ttdeci">const std::vector&lt; std::string &gt; event_list</div><div class="ttdef"><b>Definition:</b> <a href="libsoundmanager_8hpp_source.html#l00050">libsoundmanager.hpp:50</a></div></div>
<div class="ttc" id="structevent_html"><div class="ttname"><a href="structevent.html">event</a></div><div class="ttdef"><b>Definition:</b> <a href="soundmanager_8c_source.html#l00049">soundmanager.c:49</a></div></div>
<div class="ttc" id="class_lib_soundmanager_html"><div class="ttname"><a href="class_lib_soundmanager.html">LibSoundmanager</a></div><div class="ttdef"><b>Definition:</b> <a href="libsoundmanager_8hpp_source.html#l00062">libsoundmanager.hpp:62</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_b967abc00200c877344b4504e6cbcf3f.html">SoundManagerBinding</a></li><li class="navelem"><a class="el" href="dir_c2dc0533631c44dc5d574e7be055c656.html">include</a></li><li class="navelem"><a class="el" href="dir_4ed4f07a8451d34bdd1d92ed62b81ed4.html">libsoundmanager</a></li><li class="navelem"><a class="el" href="libsoundmanager_8hpp.html">libsoundmanager.hpp</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>