summaryrefslogtreecommitdiffstats
path: root/examples/hosts/test_host.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/hosts/test_host.c')
-rw-r--r--examples/hosts/test_host.c69
1 files changed, 5 insertions, 64 deletions
diff --git a/examples/hosts/test_host.c b/examples/hosts/test_host.c
index 16efa11..97df831 100644
--- a/examples/hosts/test_host.c
+++ b/examples/hosts/test_host.c
@@ -61,7 +61,7 @@ create_audio_output()
void
create_port(SLV2Plugin* plugin,
SLV2Instance* instance,
- unsigned long port_index)
+ uint32_t port_index)
{
enum SLV2PortClass class = slv2_port_get_class(plugin, port_index);
@@ -102,14 +102,14 @@ main()
const SLV2Plugin* p = slv2_list_get_plugin_by_uri(plugins, plugin_uri);
if (p) {
/* Get the plugin's name */
- unsigned char* name = slv2_plugin_get_name(p);
+ char* name = slv2_plugin_get_name(p);
printf("Name:\t%s\n", name);
free(name);
- unsigned long num_ports = slv2_plugin_get_num_ports(p);
+ uint32_t num_ports = slv2_plugin_get_num_ports(p);
//printf("Number of ports: %ld\n", num_ports);
- for (unsigned long i=0; i < num_ports; ++i) {
+ for (uint32_t i=0; i < num_ports; ++i) {
enum SLV2PortClass class = slv2_port_get_class(p, i);
switch (class) {
@@ -134,7 +134,7 @@ main()
}
SLV2Property prop;
- for (unsigned long i=0; i < num_ports; ++i) {
+ for (uint32_t i=0; i < num_ports; ++i) {
const char* property = "a";
prop = slv2_port_get_property(p, i, property);
if (prop)
@@ -167,65 +167,6 @@ main()
slv2_list_free(plugins);
-#if 0
- /* Display all plugins found in path */
- if (plugins)
- printf("Plugins found: %ld\n", slv2_list_get_size(plugins));
- else
- printf("No plugins found in %s\n", path);
-
- for (unsigned long i=0; 1; ++i) {
- const SLV2Plugin* p =
- slv2_list_get_plugin_by_index(plugins, i);
-
- if (!p)
- break;
- else
- printf("\t%s\n", slv2_plugin_get_uri(p));
- }
-#endif
-
-#if 0
- const uchar* bundle_url = (const uchar*)"file:/home/dave/code/ladspa2/ladspa2_sdk/examples/plugins/Amp-swh.ladspa2/";
- LV2Bundle* b = slv2_bundle_load(bundle_url);
-
- if (b != NULL) {
- printf("Loaded bundle %s\n", slv2_bundle_get_url(b));
-
- for (unsigned long i=0; i < slv2_bundle_get_num_plugins(b); ++i) {
- const SLV2Plugin* p = slv2_bundle_get_plugin_by_index(b, i);
- //printf("Plugin: %s\n", p->plugin_uri);
- //printf("Lib: %s\n", p->lib_url);
- //printf("Data: %s\n", p->data_url);
-
- printf("\n");
- const uchar* property = (uchar*)"doap:name";
- printf("%s\t%s\n", slv2_plugin_get_uri(p), property);
- struct SLV2Property* result = slv2_plugin_get_property(p, property);
-
- if (result) {
- for (int i=0; i < result->num_values; ++i)
- printf("\t%s\n", result->values[i]);
- } else {
- printf("No results.\n");
- }
- printf("\n");
-
- /* Instantiate plugin */
- SLV2PluginInstance* instance = slv2_plugin_instantiate(
- p, 48000, NULL);
- if (instance != NULL) {
- printf("Successfully instantiated %s\n", slv2_plugin_get_uri(p));
- slv2_plugin_instance_free(instance);
- }
-
- }
-
- } else {
- printf("Failed to load bundle %s\n", bundle_url);
- }
-#endif
-
return 0;
}