| 1 | |
| 2 | <refentry id="getcfg"> |
| 3 | <indexterm id="Indexgetcfg"><primary>getcfg</primary></indexterm> |
| 4 | <refentryinfo><title>Instrument Control:Sensing and Control</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>getcfg</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | |
| 10 | |
| 11 | <refnamediv> |
| 12 | <refname>getcfg</refname> |
| 13 | <refpurpose> |
| 14 | Return Csound settings. |
| 15 | </refpurpose> |
| 16 | </refnamediv> |
| 17 | |
| 18 | <refsect1> |
| 19 | <title>Description</title> |
| 20 | <para> |
| 21 | Return various configuration settings in Svalue as a string at init time. |
| 22 | </para> |
| 23 | </refsect1> |
| 24 | |
| 25 | <refsect1> |
| 26 | <title>Syntax</title> |
| 27 | <synopsis>Svalue <command>getcfg</command> iopt</synopsis> |
| 28 | </refsect1> |
| 29 | |
| 30 | <refsect1> |
| 31 | <title>Initialization</title> |
| 32 | |
| 33 | <para> |
| 34 | <emphasis>iopt</emphasis> |
| 35 | -- The parameter to be returned, can be one of: |
| 36 | <itemizedlist> |
| 37 | <listitem> |
| 38 | <para>1: the maximum length of string variables in |
| 39 | characters; this is at least the value of the -+max_str_len |
| 40 | command line option - 1. <note>In Csound6 there is no |
| 41 | maximum string length so the returned value is meaningless</note></para> |
| 42 | </listitem> |
| 43 | |
| 44 | <listitem> |
| 45 | <para>2: the input sound file name (-i), or empty if there is no input file</para> |
| 46 | </listitem> |
| 47 | |
| 48 | <listitem> |
| 49 | <para>3: the output sound file name (-o), or empty if there is no output file</para> |
| 50 | </listitem> |
| 51 | |
| 52 | <listitem> |
| 53 | <para>4: return "1" if real time audio input or output is being used, and "0" otherwise</para> |
| 54 | </listitem> |
| 55 | |
| 56 | <listitem> |
| 57 | <para>5: return "1" if running in beat mode (-t command line option), and "0" otherwise</para> |
| 58 | </listitem> |
| 59 | |
| 60 | <listitem> |
| 61 | <para>6: the host operating system name</para> |
| 62 | </listitem> |
| 63 | |
| 64 | <listitem> |
| 65 | <para>7: return "1" if a callback function for the chnrecv and chnsend opcodes has been set, and "0" otherwise (which means these opcodes do nothing)</para> |
| 66 | </listitem> |
| 67 | </itemizedlist> |
| 68 | |
| 69 | </para> |
| 70 | </refsect1> |
| 71 | |
| 72 | <refsect1> |
| 73 | <title>Examples</title> |
| 74 | <para> |
| 75 | Here is an example of the getcfg opcode. It uses the file <ulink url="examples/getcfg.csd"><citetitle>getcfg.csd</citetitle></ulink>. |
| 76 | |
| 77 | <example> |
| 78 | <title>Example of the getcfg opcode.</title> |
| 79 | |
| 80 | |
| 81 | |
| 82 | <para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para> |
| 83 | <xi:include href="examples-xml/getcfg.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 84 | </example> |
| 85 | |
| 86 | The output should include lines like these: |
| 87 | <screen> |
| 88 | ------------------------------ |
| 89 | Max string len : 255 |
| 90 | Input file name (-i) : adc |
| 91 | Output file name (-o) : dac |
| 92 | RTaudio (-odac) : 1 |
| 93 | Beat mode (-t)? : 0 |
| 94 | Host Op. Sys. : Linux |
| 95 | Callback ? : 0 |
| 96 | ------------------------------ |
| 97 | </screen> |
| 98 | </para> |
| 99 | </refsect1> |
| 100 | |
| 101 | <refsect1> |
| 102 | <title>See also</title> |
| 103 | <para><link linkend="ControlSensing"><citetitle>Sensing and Control: System</citetitle></link></para> |
| 104 | </refsect1> |
| 105 | |
| 106 | <refsect1> |
| 107 | <title>Credits</title> |
| 108 | <para> |
| 109 | <simplelist> |
| 110 | <member>Author: Istvan Varga</member> |
| 111 | <member>2006</member> |
| 112 | </simplelist> |
| 113 | </para> |
| 114 | <para>New in version 5.02</para> |
| 115 | </refsect1> |
| 116 | </refentry> |