-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCreatingSettings.html
More file actions
111 lines (109 loc) · 7.86 KB
/
CreatingSettings.html
File metadata and controls
111 lines (109 loc) · 7.86 KB
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
<!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>libfluidsynth: Creating and changing the settings</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>
<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" />
<link href="custom.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">libfluidsynth
 <span id="projectnumber">2.5.4</span>
</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>
</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">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('CreatingSettings.html',''); initResizable(); });
/* @license-end */
</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="PageDoc"><div class="header">
<div class="headertitle">
<div class="title">Creating and changing the settings </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>Before you can use the synthesizer, you have to create a settings object. The settings objects is used by many components of the FluidSynth library. It gives a unified API to set the parameters of the audio drivers, the midi drivers, the synthesizer, and so forth. A number of default settings are defined by the current implementation.</p>
<p>All settings have a name that follows the "dotted-name" notation. For example, <a class="el" href="settings_synth.html#settings_synth_polyphony">synth.polyphony</a> refers to the number of voices (polyphony) allocated by the synthesizer. The settings also have a type. There are currently three types: strings, numbers (double floats), and integers. You can change the values of a setting using the <a class="el" href="group__settings.html#ga58cbabbb8990c2934b3eeea925e01804" title="Set a string value for a named setting.">fluid_settings_setstr()</a>, <a class="el" href="group__settings.html#ga25fc9badbe6d2f036af206ca2de1680d" title="Set a numeric value for a named setting.">fluid_settings_setnum()</a>, and <a class="el" href="group__settings.html#gaec566c035617c2e12de85b82297ac90b" title="Set an integer value for a setting.">fluid_settings_setint()</a> functions. For example:</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include <fluidsynth.h></span></div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>** argv) </div>
<div class="line">{</div>
<div class="line"> <a class="code" href="group__Types.html#gaa363402d3c77333b0f070ba531d034ba">fluid_settings_t</a>* settings = <a class="code" href="group__settings.html#ga7623af35fb3d1abace21ef7d5b4f4781">new_fluid_settings</a>();</div>
<div class="line"> <a class="code" href="group__settings.html#gaec566c035617c2e12de85b82297ac90b">fluid_settings_setint</a>(settings, <span class="stringliteral">"synth.polyphony"</span>, 128);</div>
<div class="line"> <span class="comment">/* ... */</span></div>
<div class="line"> <a class="code" href="group__settings.html#gabd13a1e869bfaaaebfc58a72af5a66ac">delete_fluid_settings</a>(settings);</div>
<div class="line"> <span class="keywordflow">return</span> 0;</div>
<div class="line">}</div>
<div class="ttc" id="agroup__Types_html_gaa363402d3c77333b0f070ba531d034ba"><div class="ttname"><a href="group__Types.html#gaa363402d3c77333b0f070ba531d034ba">fluid_settings_t</a></div><div class="ttdeci">struct _fluid_hashtable_t fluid_settings_t</div><div class="ttdoc">Configuration settings instance.</div><div class="ttdef"><b>Definition:</b> types.h:37</div></div>
<div class="ttc" id="agroup__settings_html_ga7623af35fb3d1abace21ef7d5b4f4781"><div class="ttname"><a href="group__settings.html#ga7623af35fb3d1abace21ef7d5b4f4781">new_fluid_settings</a></div><div class="ttdeci">fluid_settings_t * new_fluid_settings(void)</div><div class="ttdoc">Create a new settings object.</div><div class="ttdef"><b>Definition:</b> fluid_settings.c:261</div></div>
<div class="ttc" id="agroup__settings_html_gabd13a1e869bfaaaebfc58a72af5a66ac"><div class="ttname"><a href="group__settings.html#gabd13a1e869bfaaaebfc58a72af5a66ac">delete_fluid_settings</a></div><div class="ttdeci">void delete_fluid_settings(fluid_settings_t *settings)</div><div class="ttdoc">Delete the provided settings object.</div><div class="ttdef"><b>Definition:</b> fluid_settings.c:285</div></div>
<div class="ttc" id="agroup__settings_html_gaec566c035617c2e12de85b82297ac90b"><div class="ttname"><a href="group__settings.html#gaec566c035617c2e12de85b82297ac90b">fluid_settings_setint</a></div><div class="ttdeci">int fluid_settings_setint(fluid_settings_t *settings, const char *name, int val)</div><div class="ttdoc">Set an integer value for a setting.</div><div class="ttdef"><b>Definition:</b> fluid_settings.c:1533</div></div>
</div><!-- fragment --><p>The API contains the functions to query the type, the current value, the default value, the range and the "hints" of a setting. The range is the minimum and maximum value of the setting. The hints gives additional information about a setting. For example, whether a string represents a filename. Or whether a number should be interpreted on a logarithmic scale. Check the settings.h API documentation for a description of all functions. </p>
</div></div><!-- contents -->
</div><!-- PageDoc -->
</div><!-- doc-content -->
</body>
</html>