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 <steve@plugin.org.uk>"/>
<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 < sample_count; pos++) {
if (allvals) {
printf("%f\n", input[pos]);
}
max = fabs(input[pos]) > max?fabs(input[pos]):max;
min = fabs(input[pos]) < min?fabs(input[pos]):min;
maxl = input[pos] > maxl?input[pos]:maxl;
minl = input[pos] < 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>
|