File: latency_1914.xml

package info (click to toggle)
swh-plugins 0.4.17-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, stretch
  • size: 3,264 kB
  • ctags: 1,066
  • sloc: ansic: 23,551; xml: 12,633; perl: 1,114; sh: 964; makefile: 221
file content (55 lines) | stat: -rw-r--r-- 1,551 bytes parent folder | download | duplicates (12)
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
<?xml version="1.0"?>
<!DOCTYPE ladspa SYSTEM "ladspa-swh.dtd">
<?xml-stylesheet href="ladspa.css" type="text/css"?>

<ladspa>
  <global>
    <meta name="maker" value="Steve Harris &lt;steve@plugin.org.uk&gt;"/>
    <meta name="copyright" value="GPL"/>
    <meta name="properties" value="HARD_RT_CAPABLE"/>
    <code>
      #include "ladspa-util.h"
    </code>
  </global>

  <plugin label="artificialLatency" id="1914" class="UtilityPlugin">
    <name>Artificial latency</name>
    <p>Reports its  delay value as systemic latency. Does nothing else, *this is not a delay*.</p>
    <p>Can be used to correct for latency between channels.</p>

    <callback event="instantiate"><![CDATA[
      fs = s_rate;
    ]]></callback>

    <callback event="run"><![CDATA[
      unsigned long pos;
      const int delay_fr = f_round(delay * 0.001 * fs);

      if (input != output) {
        for (pos = 0; pos < sample_count; pos++) {
          buffer_write(output[pos], input[pos]);
        }
      }
      *(plugin_data->latency) = (float)delay_fr;
    ]]></callback>

    <port label="delay" dir="input" type="control" hint="default_low">
      <name>Delay (ms)</name>
      <range min="0" max="10000"/>
    </port>

    <port label="input" dir="input" type="audio">
      <name>Input</name>
    </port>

    <port label="output" dir="output" type="audio">
      <name>Output</name>
    </port>

    <port label="latency" dir="output" type="control">
      <name>latency</name>
    </port>

    <instance-data label="fs" type="float" />
  </plugin>
</ladspa>