File: debug_1184.xml

package info (click to toggle)
swh-plugins 0.4.17-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, 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 (65 lines) | stat: -rw-r--r-- 1,690 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
56
57
58
59
60
61
62
63
64
65
<?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 "stdio.h"
		</code>
	</global>

	<plugin label="debug" id="1184" class="UtilityPlugin">
		<name>Debug Plugin</name>
		<p>Prints some stats about the input stream to stdout. Not intended for general use.</p>

		<callback event="instantiate">
			printf("sample rate %ld\n", s_rate);
		</callback>

		<callback event="run">
			static LADSPA_Data max, min, maxl, minl;
			unsigned long pos;

			if (reset) {
				max = 0;
				min = 0;
				maxl = 0;
				minl = 1;
			}

			for (pos = 0; pos &lt; sample_count; pos++) {
				if (allvals) {
					printf("%f\n", input[pos]);
				}
				max = fabs(input[pos]) &gt; max?fabs(input[pos]):max;
				min = fabs(input[pos]) &lt; min?fabs(input[pos]):min;
				maxl = input[pos] &gt; maxl?input[pos]:maxl;
				minl = input[pos] &lt; minl?input[pos]:minl;
				buffer_write(output[pos], input[pos]);
			}
			printf("amplitude (%f, %f)\t", min, max);
			printf("level (%f, %f)\n", minl, maxl);
		</callback>

		<port label="allvals" dir="input" type="control">
			<name>Diplay all values?</name>
			<range min="0" max="1"/>
		</port>

		<port label="reset" dir="input" type="control">
			<name>Reset counters?</name>
			<range min="0" max="1"/>
		</port>

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

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