File: lv2_dump_ports.cpp

package info (click to toggle)
amsynth 1.13.4-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 18,228 kB
  • sloc: cpp: 9,546; ansic: 1,490; makefile: 345; python: 69; sh: 40
file content (24 lines) | stat: -rw-r--r-- 711 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

#include "../Preset.cc"
#include "../Parameter.cc"

#include <cstdio>

int main ()
{
	Preset preset;
	for (size_t i=0; i<preset.ParameterCount(); i++) {
		Parameter &p = preset.getParameter(i);
		printf("        a lv2:InputPort ;\n");
		printf("        a lv2:ControlPort ;\n");
		printf("        lv2:index %d ;\n", i + 3);
		printf("        lv2:symbol \"%s\" ;\n", p.getName().c_str());
		printf("        lv2:name \"%s\" ;\n", p.getName().c_str());
		printf("        lv2:portProperty epp:hasStrictBounds ;\n");
		printf("        lv2:default %f ;\n", p.getValue());
		printf("        lv2:minimum %f ;\n", p.getMin());
		printf("        lv2:maximum %f ;\n", p.getMax());
		printf("    ] , [\n");
	}
	return 0;
}