-
Notifications
You must be signed in to change notification settings - Fork 1
/
chain__shared_8h_source.html
92 lines (90 loc) · 16 KB
/
chain__shared_8h_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
<!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.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>librespeaker: /home/gitlab-runner/builds/dc7d1974/0/seeedstudio/librespeaker/include/chain_nodes/chain_shared.h 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">librespeaker
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<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');
/* @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_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_fef0bd79b8e46d4cecee255b221b8de5.html">chain_nodes</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">chain_shared.h</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> * Copyright (c) 2017 Seeed Technology Co., Ltd.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> * @author Jack Shao <[email protected]></span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> */</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</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="preprocessor">#ifndef __CHAIN_SHARED_H__</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="preprocessor">#define __CHAIN_SHARED_H__</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> </div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="preprocessor">#include <mutex></span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> </div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="keyword">namespace </span><a class="code" href="namespacerespeaker.html">respeaker</a></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> {</div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div><div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="namespacerespeaker.html#a5372a69a95f6fd5424740ce4157651d9"> 18</a></span> <span class="keyword">enum</span> <a class="code" href="namespacerespeaker.html#a5372a69a95f6fd5424740ce4157651d9">ChainState</a>{</div><div class="line"><a name="l00019"></a><span class="lineno"><a class="line" href="namespacerespeaker.html#a5372a69a95f6fd5424740ce4157651d9afaec5b9406e37e356a53401c0c986c93"> 19</a></span>  <a class="code" href="namespacerespeaker.html#a5372a69a95f6fd5424740ce4157651d9afaec5b9406e37e356a53401c0c986c93">WAIT_TRIGGER_QUIETLY</a>, </div><div class="line"><a name="l00020"></a><span class="lineno"><a class="line" href="namespacerespeaker.html#a5372a69a95f6fd5424740ce4157651d9a2b6c4289a3bda53039aa490735b7d9e6"> 20</a></span>  <a class="code" href="namespacerespeaker.html#a5372a69a95f6fd5424740ce4157651d9a2b6c4289a3bda53039aa490735b7d9e6">WAIT_TRIGGER_WITH_BGM</a>, </div><div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="namespacerespeaker.html#a5372a69a95f6fd5424740ce4157651d9a18ae168cad5ca69fdc8873791fcfb6cc"> 21</a></span>  <a class="code" href="namespacerespeaker.html#a5372a69a95f6fd5424740ce4157651d9a18ae168cad5ca69fdc8873791fcfb6cc">LISTEN_QUIETLY</a>, </div><div class="line"><a name="l00022"></a><span class="lineno"><a class="line" href="namespacerespeaker.html#a5372a69a95f6fd5424740ce4157651d9ad6b5ce32ae55984baa35cd408b395809"> 22</a></span>  <a class="code" href="namespacerespeaker.html#a5372a69a95f6fd5424740ce4157651d9ad6b5ce32ae55984baa35cd408b395809">LISTEN_WITH_BGM</a> </div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> };</div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div><div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="structrespeaker_1_1ChainSharedData.html"> 26</a></span> <span class="keyword">struct </span><a class="code" href="structrespeaker_1_1ChainSharedData.html">ChainSharedData</a></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>  <a class="code" href="structrespeaker_1_1ChainSharedData.html">ChainSharedData</a>() : <a class="code" href="structrespeaker_1_1ChainSharedData.html#a2d77550d24ce31eb645a67420bf1b279">exit_flag</a>(<span class="keyword">false</span>),</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  <a class="code" href="structrespeaker_1_1ChainSharedData.html#ab55958f68aa075bf383b50cf2b32c9f1">state</a>(<a class="code" href="namespacerespeaker.html#a5372a69a95f6fd5424740ce4157651d9afaec5b9406e37e356a53401c0c986c93">WAIT_TRIGGER_QUIETLY</a>),</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  <a class="code" href="structrespeaker_1_1ChainSharedData.html#ab5031cd2f768a8c160743adaf6489172">vad_node_present</a>(<span class="keyword">false</span>),</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  <a class="code" href="structrespeaker_1_1ChainSharedData.html#a9aab60b053d30679901268a4cd7d4cd8">vad</a>(<span class="keyword">false</span>),</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  <a class="code" href="structrespeaker_1_1ChainSharedData.html#a661966ab3869722b8b0d73e38d1253c1">vep_freeze</a>(<span class="keyword">false</span>){};</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  std::mutex mutex_exit_flag;</div><div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="structrespeaker_1_1ChainSharedData.html#a2d77550d24ce31eb645a67420bf1b279"> 34</a></span>  <span class="keywordtype">bool</span> <a class="code" href="structrespeaker_1_1ChainSharedData.html#a2d77550d24ce31eb645a67420bf1b279">exit_flag</a>; </div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> </div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  std::mutex mutex_state;</div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="structrespeaker_1_1ChainSharedData.html#ab55958f68aa075bf383b50cf2b32c9f1"> 37</a></span>  <a class="code" href="namespacerespeaker.html#a5372a69a95f6fd5424740ce4157651d9">ChainState</a> <a class="code" href="structrespeaker_1_1ChainSharedData.html#ab55958f68aa075bf383b50cf2b32c9f1">state</a>; </div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  std::mutex mutex_vad;</div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="structrespeaker_1_1ChainSharedData.html#ab5031cd2f768a8c160743adaf6489172"> 40</a></span>  <span class="keywordtype">bool</span> <a class="code" href="structrespeaker_1_1ChainSharedData.html#ab5031cd2f768a8c160743adaf6489172">vad_node_present</a>; </div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="structrespeaker_1_1ChainSharedData.html#a9aab60b053d30679901268a4cd7d4cd8"> 41</a></span>  <span class="keywordtype">bool</span> <a class="code" href="structrespeaker_1_1ChainSharedData.html#a9aab60b053d30679901268a4cd7d4cd8">vad</a>; </div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> </div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  std::mutex mutex_vep_freeze;</div><div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="structrespeaker_1_1ChainSharedData.html#a661966ab3869722b8b0d73e38d1253c1"> 44</a></span>  <span class="keywordtype">bool</span> <a class="code" href="structrespeaker_1_1ChainSharedData.html#a661966ab3869722b8b0d73e38d1253c1">vep_freeze</a>; </div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span> };</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> </div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> } <span class="comment">// namespace respeaker</span></div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="preprocessor">#endif // !__CHAIN_SHARED_H__</span></div><div class="ttc" id="namespacerespeaker_html_a5372a69a95f6fd5424740ce4157651d9afaec5b9406e37e356a53401c0c986c93"><div class="ttname"><a href="namespacerespeaker.html#a5372a69a95f6fd5424740ce4157651d9afaec5b9406e37e356a53401c0c986c93">respeaker::WAIT_TRIGGER_QUIETLY</a></div><div class="ttdoc">the device is waiting for trigger and its playback is paused or muted. </div><div class="ttdef"><b>Definition:</b> chain_shared.h:19</div></div>
<div class="ttc" id="structrespeaker_1_1ChainSharedData_html_a9aab60b053d30679901268a4cd7d4cd8"><div class="ttname"><a href="structrespeaker_1_1ChainSharedData.html#a9aab60b053d30679901268a4cd7d4cd8">respeaker::ChainSharedData::vad</a></div><div class="ttdeci">bool vad</div><div class="ttdoc">If the last processed block of the node who can do Vad contains valid voice. </div><div class="ttdef"><b>Definition:</b> chain_shared.h:41</div></div>
<div class="ttc" id="namespacerespeaker_html_a5372a69a95f6fd5424740ce4157651d9a18ae168cad5ca69fdc8873791fcfb6cc"><div class="ttname"><a href="namespacerespeaker.html#a5372a69a95f6fd5424740ce4157651d9a18ae168cad5ca69fdc8873791fcfb6cc">respeaker::LISTEN_QUIETLY</a></div><div class="ttdoc">the device is listening user&#39;s commands, its playback is paused or muted, the chain will skip some al...</div><div class="ttdef"><b>Definition:</b> chain_shared.h:21</div></div>
<div class="ttc" id="namespacerespeaker_html_a5372a69a95f6fd5424740ce4157651d9"><div class="ttname"><a href="namespacerespeaker.html#a5372a69a95f6fd5424740ce4157651d9">respeaker::ChainState</a></div><div class="ttdeci">ChainState</div><div class="ttdef"><b>Definition:</b> chain_shared.h:18</div></div>
<div class="ttc" id="structrespeaker_1_1ChainSharedData_html"><div class="ttname"><a href="structrespeaker_1_1ChainSharedData.html">respeaker::ChainSharedData</a></div><div class="ttdef"><b>Definition:</b> chain_shared.h:26</div></div>
<div class="ttc" id="structrespeaker_1_1ChainSharedData_html_a661966ab3869722b8b0d73e38d1253c1"><div class="ttname"><a href="structrespeaker_1_1ChainSharedData.html#a661966ab3869722b8b0d73e38d1253c1">respeaker::ChainSharedData::vep_freeze</a></div><div class="ttdeci">bool vep_freeze</div><div class="ttdoc">For the Vep lib. </div><div class="ttdef"><b>Definition:</b> chain_shared.h:44</div></div>
<div class="ttc" id="structrespeaker_1_1ChainSharedData_html_ab5031cd2f768a8c160743adaf6489172"><div class="ttname"><a href="structrespeaker_1_1ChainSharedData.html#ab5031cd2f768a8c160743adaf6489172">respeaker::ChainSharedData::vad_node_present</a></div><div class="ttdeci">bool vad_node_present</div><div class="ttdoc">If the Vad (voice available detection) node is present. </div><div class="ttdef"><b>Definition:</b> chain_shared.h:40</div></div>
<div class="ttc" id="structrespeaker_1_1ChainSharedData_html_a2d77550d24ce31eb645a67420bf1b279"><div class="ttname"><a href="structrespeaker_1_1ChainSharedData.html#a2d77550d24ce31eb645a67420bf1b279">respeaker::ChainSharedData::exit_flag</a></div><div class="ttdeci">bool exit_flag</div><div class="ttdoc">Exit flag for joining the thread. </div><div class="ttdef"><b>Definition:</b> chain_shared.h:34</div></div>
<div class="ttc" id="structrespeaker_1_1ChainSharedData_html_ab55958f68aa075bf383b50cf2b32c9f1"><div class="ttname"><a href="structrespeaker_1_1ChainSharedData.html#ab55958f68aa075bf383b50cf2b32c9f1">respeaker::ChainSharedData::state</a></div><div class="ttdeci">ChainState state</div><div class="ttdoc">The state machine of the chain. </div><div class="ttdef"><b>Definition:</b> chain_shared.h:37</div></div>
<div class="ttc" id="namespacerespeaker_html_a5372a69a95f6fd5424740ce4157651d9a2b6c4289a3bda53039aa490735b7d9e6"><div class="ttname"><a href="namespacerespeaker.html#a5372a69a95f6fd5424740ce4157651d9a2b6c4289a3bda53039aa490735b7d9e6">respeaker::WAIT_TRIGGER_WITH_BGM</a></div><div class="ttdoc">the device is waiting for trigger, its playback is playing sound </div><div class="ttdef"><b>Definition:</b> chain_shared.h:20</div></div>
<div class="ttc" id="namespacerespeaker_html_a5372a69a95f6fd5424740ce4157651d9ad6b5ce32ae55984baa35cd408b395809"><div class="ttname"><a href="namespacerespeaker.html#a5372a69a95f6fd5424740ce4157651d9ad6b5ce32ae55984baa35cd408b395809">respeaker::LISTEN_WITH_BGM</a></div><div class="ttdoc">the device is listening user&#39;s commands, its playback is playing sound </div><div class="ttdef"><b>Definition:</b> chain_shared.h:22</div></div>
<div class="ttc" id="namespacerespeaker_html"><div class="ttname"><a href="namespacerespeaker.html">respeaker</a></div><div class="ttdef"><b>Definition:</b> aloop_output_node.h:14</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.15
</small></address>
</body>
</html>