Plugin

Struct Plugin 

Source
pub struct Plugin { /* private fields */ }
Expand description

Can be used to instantiave LV2 plugins.

Implementations§

Source§

impl Plugin

Source

pub fn verify(&self) -> bool

Returns true if the plugin is valid. If the world was created with World::load_all, then this is not necessary. Only valid plugins will have been loaded.

Source

pub fn uri(&self) -> Node

The uri of the plugin.

§Panics

Panics if the uri could not be obtained.

Examples found in repository?
examples/lv2ls.rs (line 13)
3fn main() {
4    let world = World::new();
5    world.load_all();
6
7    let show_names = false;
8
9    let print = |plugin: Plugin| {
10        if show_names {
11            String::from(plugin.name().as_str().unwrap())
12        } else {
13            String::from(plugin.uri().as_uri().unwrap())
14        }
15    };
16
17    let plugins = world
18        .plugins()
19        .iter()
20        .filter(Plugin::verify)
21        .map(print)
22        .collect::<Vec<_>>();
23
24    debug_assert_eq!(world.plugins().count(), plugins.len());
25
26    for uri in plugins {
27        println!("{}", uri);
28    }
29}
More examples
Hide additional examples
examples/lv2info.rs (line 102)
101fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
102    println!("{}\n", p.uri().as_uri().unwrap());
103    println!("\tName:              {}", p.name().as_str().unwrap());
104    println!(
105        "\tClass:             {}",
106        p.class().label().as_str().unwrap()
107    );
108
109    if let Some(val) = p.author_name() {
110        println!("\tAuthor:            {}", val.as_str().unwrap());
111    }
112
113    if let Some(val) = p.author_email() {
114        println!("\tAuthor Email:      {}", val.as_str().unwrap());
115    }
116
117    if let Some(val) = p.author_homepage() {
118        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
119    }
120
121    if let Some(latency_port) = p.latency_port_index() {
122        println!(
123            "\tHas latency:       yes, reported by port {}",
124            latency_port
125        );
126    } else {
127        println!("\tHas latency:       no");
128    }
129
130    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
131    println!(
132        "\tBinary:            {}",
133        p.library_uri().map_or("<none>".to_string(), |node| node
134            .as_uri()
135            .unwrap()
136            .to_string())
137    );
138
139    if let Some(uis) = p.uis() {
140        println!("\tUIs:");
141
142        for ui in uis {
143            println!("\t\t{}", ui.uri().as_uri().unwrap());
144
145            for tyep in ui.classes() {
146                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
147            }
148
149            println!(
150                "\t\t\tBinary: {}",
151                ui.binary_uri().unwrap().as_uri().unwrap()
152            );
153            println!(
154                "\t\t\tBundle: {}",
155                ui.bundle_uri().unwrap().as_uri().unwrap()
156            );
157        }
158    }
159
160    print!("\tData URIs:         ");
161
162    for (i, uri) in p.data_uris().iter().enumerate() {
163        if i != 0 {
164            print!("\n\t                   ");
165        }
166
167        print!("{}", uri.as_uri().unwrap());
168    }
169
170    println!();
171
172    let features = p.required_features();
173    print!("\tRequired Features: ");
174
175    for (i, feature) in features.iter().enumerate() {
176        if i != 0 {
177            print!("\n\t                   ");
178        }
179        print!("{}", feature.as_uri().unwrap());
180    }
181    println!();
182
183    let features = p.optional_features();
184    print!("\tOptional Features: ");
185
186    for (i, feature) in features.iter().enumerate() {
187        if i != 0 {
188            print!("\n\t                   ");
189        }
190        print!("{}", feature.as_uri().unwrap());
191    }
192    println!();
193
194    if let Some(data) = p.extension_data() {
195        print!("\tExtension Data:    ");
196
197        for (i, d) in data.iter().enumerate() {
198            if i != 0 {
199                print!("\n\t                   ");
200            }
201            print!("{}", d.as_uri().unwrap());
202        }
203        println!();
204    }
205
206    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
207        if presets.count() != 0 {
208            println!("\tPresets: ");
209
210            for preset in presets {
211                world.load_resource(&preset).unwrap();
212
213                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
214                if titles.count() > 0 {
215                    if let Some(title) = titles.iter().next() {
216                        println!("\t         {}", title.as_str().unwrap());
217                    } else {
218                        println!("\t         <{}>", preset.as_uri().unwrap());
219                    }
220                } else {
221                    println!("\t         <{}>", preset.as_uri().unwrap());
222                }
223            }
224        }
225    }
226
227    let num_ports = p.ports_count();
228    let port_ranges = p.port_ranges_float();
229    assert_eq!(num_ports, port_ranges.len());
230    for (i, pr) in port_ranges.iter().enumerate() {
231        print_port(p, i, pr, nodes);
232    }
233}
Source

pub fn bundle_uri(&self) -> Node

The uri of the plugin’s bundle.

§Panics

Panics if the bundle uri could not be obtained.

Examples found in repository?
examples/lv2info.rs (line 130)
101fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
102    println!("{}\n", p.uri().as_uri().unwrap());
103    println!("\tName:              {}", p.name().as_str().unwrap());
104    println!(
105        "\tClass:             {}",
106        p.class().label().as_str().unwrap()
107    );
108
109    if let Some(val) = p.author_name() {
110        println!("\tAuthor:            {}", val.as_str().unwrap());
111    }
112
113    if let Some(val) = p.author_email() {
114        println!("\tAuthor Email:      {}", val.as_str().unwrap());
115    }
116
117    if let Some(val) = p.author_homepage() {
118        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
119    }
120
121    if let Some(latency_port) = p.latency_port_index() {
122        println!(
123            "\tHas latency:       yes, reported by port {}",
124            latency_port
125        );
126    } else {
127        println!("\tHas latency:       no");
128    }
129
130    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
131    println!(
132        "\tBinary:            {}",
133        p.library_uri().map_or("<none>".to_string(), |node| node
134            .as_uri()
135            .unwrap()
136            .to_string())
137    );
138
139    if let Some(uis) = p.uis() {
140        println!("\tUIs:");
141
142        for ui in uis {
143            println!("\t\t{}", ui.uri().as_uri().unwrap());
144
145            for tyep in ui.classes() {
146                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
147            }
148
149            println!(
150                "\t\t\tBinary: {}",
151                ui.binary_uri().unwrap().as_uri().unwrap()
152            );
153            println!(
154                "\t\t\tBundle: {}",
155                ui.bundle_uri().unwrap().as_uri().unwrap()
156            );
157        }
158    }
159
160    print!("\tData URIs:         ");
161
162    for (i, uri) in p.data_uris().iter().enumerate() {
163        if i != 0 {
164            print!("\n\t                   ");
165        }
166
167        print!("{}", uri.as_uri().unwrap());
168    }
169
170    println!();
171
172    let features = p.required_features();
173    print!("\tRequired Features: ");
174
175    for (i, feature) in features.iter().enumerate() {
176        if i != 0 {
177            print!("\n\t                   ");
178        }
179        print!("{}", feature.as_uri().unwrap());
180    }
181    println!();
182
183    let features = p.optional_features();
184    print!("\tOptional Features: ");
185
186    for (i, feature) in features.iter().enumerate() {
187        if i != 0 {
188            print!("\n\t                   ");
189        }
190        print!("{}", feature.as_uri().unwrap());
191    }
192    println!();
193
194    if let Some(data) = p.extension_data() {
195        print!("\tExtension Data:    ");
196
197        for (i, d) in data.iter().enumerate() {
198            if i != 0 {
199                print!("\n\t                   ");
200            }
201            print!("{}", d.as_uri().unwrap());
202        }
203        println!();
204    }
205
206    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
207        if presets.count() != 0 {
208            println!("\tPresets: ");
209
210            for preset in presets {
211                world.load_resource(&preset).unwrap();
212
213                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
214                if titles.count() > 0 {
215                    if let Some(title) = titles.iter().next() {
216                        println!("\t         {}", title.as_str().unwrap());
217                    } else {
218                        println!("\t         <{}>", preset.as_uri().unwrap());
219                    }
220                } else {
221                    println!("\t         <{}>", preset.as_uri().unwrap());
222                }
223            }
224        }
225    }
226
227    let num_ports = p.ports_count();
228    let port_ranges = p.port_ranges_float();
229    assert_eq!(num_ports, port_ranges.len());
230    for (i, pr) in port_ranges.iter().enumerate() {
231        print_port(p, i, pr, nodes);
232    }
233}
Source

pub fn data_uris(&self) -> Nodes

The uri for the data.

Examples found in repository?
examples/lv2info.rs (line 162)
101fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
102    println!("{}\n", p.uri().as_uri().unwrap());
103    println!("\tName:              {}", p.name().as_str().unwrap());
104    println!(
105        "\tClass:             {}",
106        p.class().label().as_str().unwrap()
107    );
108
109    if let Some(val) = p.author_name() {
110        println!("\tAuthor:            {}", val.as_str().unwrap());
111    }
112
113    if let Some(val) = p.author_email() {
114        println!("\tAuthor Email:      {}", val.as_str().unwrap());
115    }
116
117    if let Some(val) = p.author_homepage() {
118        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
119    }
120
121    if let Some(latency_port) = p.latency_port_index() {
122        println!(
123            "\tHas latency:       yes, reported by port {}",
124            latency_port
125        );
126    } else {
127        println!("\tHas latency:       no");
128    }
129
130    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
131    println!(
132        "\tBinary:            {}",
133        p.library_uri().map_or("<none>".to_string(), |node| node
134            .as_uri()
135            .unwrap()
136            .to_string())
137    );
138
139    if let Some(uis) = p.uis() {
140        println!("\tUIs:");
141
142        for ui in uis {
143            println!("\t\t{}", ui.uri().as_uri().unwrap());
144
145            for tyep in ui.classes() {
146                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
147            }
148
149            println!(
150                "\t\t\tBinary: {}",
151                ui.binary_uri().unwrap().as_uri().unwrap()
152            );
153            println!(
154                "\t\t\tBundle: {}",
155                ui.bundle_uri().unwrap().as_uri().unwrap()
156            );
157        }
158    }
159
160    print!("\tData URIs:         ");
161
162    for (i, uri) in p.data_uris().iter().enumerate() {
163        if i != 0 {
164            print!("\n\t                   ");
165        }
166
167        print!("{}", uri.as_uri().unwrap());
168    }
169
170    println!();
171
172    let features = p.required_features();
173    print!("\tRequired Features: ");
174
175    for (i, feature) in features.iter().enumerate() {
176        if i != 0 {
177            print!("\n\t                   ");
178        }
179        print!("{}", feature.as_uri().unwrap());
180    }
181    println!();
182
183    let features = p.optional_features();
184    print!("\tOptional Features: ");
185
186    for (i, feature) in features.iter().enumerate() {
187        if i != 0 {
188            print!("\n\t                   ");
189        }
190        print!("{}", feature.as_uri().unwrap());
191    }
192    println!();
193
194    if let Some(data) = p.extension_data() {
195        print!("\tExtension Data:    ");
196
197        for (i, d) in data.iter().enumerate() {
198            if i != 0 {
199                print!("\n\t                   ");
200            }
201            print!("{}", d.as_uri().unwrap());
202        }
203        println!();
204    }
205
206    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
207        if presets.count() != 0 {
208            println!("\tPresets: ");
209
210            for preset in presets {
211                world.load_resource(&preset).unwrap();
212
213                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
214                if titles.count() > 0 {
215                    if let Some(title) = titles.iter().next() {
216                        println!("\t         {}", title.as_str().unwrap());
217                    } else {
218                        println!("\t         <{}>", preset.as_uri().unwrap());
219                    }
220                } else {
221                    println!("\t         <{}>", preset.as_uri().unwrap());
222                }
223            }
224        }
225    }
226
227    let num_ports = p.ports_count();
228    let port_ranges = p.port_ranges_float();
229    assert_eq!(num_ports, port_ranges.len());
230    for (i, pr) in port_ranges.iter().enumerate() {
231        print_port(p, i, pr, nodes);
232    }
233}
Source

pub fn library_uri(&self) -> Option<Node>

The uri for the library.

Examples found in repository?
examples/lv2info.rs (line 133)
101fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
102    println!("{}\n", p.uri().as_uri().unwrap());
103    println!("\tName:              {}", p.name().as_str().unwrap());
104    println!(
105        "\tClass:             {}",
106        p.class().label().as_str().unwrap()
107    );
108
109    if let Some(val) = p.author_name() {
110        println!("\tAuthor:            {}", val.as_str().unwrap());
111    }
112
113    if let Some(val) = p.author_email() {
114        println!("\tAuthor Email:      {}", val.as_str().unwrap());
115    }
116
117    if let Some(val) = p.author_homepage() {
118        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
119    }
120
121    if let Some(latency_port) = p.latency_port_index() {
122        println!(
123            "\tHas latency:       yes, reported by port {}",
124            latency_port
125        );
126    } else {
127        println!("\tHas latency:       no");
128    }
129
130    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
131    println!(
132        "\tBinary:            {}",
133        p.library_uri().map_or("<none>".to_string(), |node| node
134            .as_uri()
135            .unwrap()
136            .to_string())
137    );
138
139    if let Some(uis) = p.uis() {
140        println!("\tUIs:");
141
142        for ui in uis {
143            println!("\t\t{}", ui.uri().as_uri().unwrap());
144
145            for tyep in ui.classes() {
146                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
147            }
148
149            println!(
150                "\t\t\tBinary: {}",
151                ui.binary_uri().unwrap().as_uri().unwrap()
152            );
153            println!(
154                "\t\t\tBundle: {}",
155                ui.bundle_uri().unwrap().as_uri().unwrap()
156            );
157        }
158    }
159
160    print!("\tData URIs:         ");
161
162    for (i, uri) in p.data_uris().iter().enumerate() {
163        if i != 0 {
164            print!("\n\t                   ");
165        }
166
167        print!("{}", uri.as_uri().unwrap());
168    }
169
170    println!();
171
172    let features = p.required_features();
173    print!("\tRequired Features: ");
174
175    for (i, feature) in features.iter().enumerate() {
176        if i != 0 {
177            print!("\n\t                   ");
178        }
179        print!("{}", feature.as_uri().unwrap());
180    }
181    println!();
182
183    let features = p.optional_features();
184    print!("\tOptional Features: ");
185
186    for (i, feature) in features.iter().enumerate() {
187        if i != 0 {
188            print!("\n\t                   ");
189        }
190        print!("{}", feature.as_uri().unwrap());
191    }
192    println!();
193
194    if let Some(data) = p.extension_data() {
195        print!("\tExtension Data:    ");
196
197        for (i, d) in data.iter().enumerate() {
198            if i != 0 {
199                print!("\n\t                   ");
200            }
201            print!("{}", d.as_uri().unwrap());
202        }
203        println!();
204    }
205
206    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
207        if presets.count() != 0 {
208            println!("\tPresets: ");
209
210            for preset in presets {
211                world.load_resource(&preset).unwrap();
212
213                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
214                if titles.count() > 0 {
215                    if let Some(title) = titles.iter().next() {
216                        println!("\t         {}", title.as_str().unwrap());
217                    } else {
218                        println!("\t         <{}>", preset.as_uri().unwrap());
219                    }
220                } else {
221                    println!("\t         <{}>", preset.as_uri().unwrap());
222                }
223            }
224        }
225    }
226
227    let num_ports = p.ports_count();
228    let port_ranges = p.port_ranges_float();
229    assert_eq!(num_ports, port_ranges.len());
230    for (i, pr) in port_ranges.iter().enumerate() {
231        print_port(p, i, pr, nodes);
232    }
233}
Source

pub fn name(&self) -> Node

The (human readable) name of the plugin.

§Panics

May panic if verify() returns false.

Examples found in repository?
examples/lv2ls.rs (line 11)
3fn main() {
4    let world = World::new();
5    world.load_all();
6
7    let show_names = false;
8
9    let print = |plugin: Plugin| {
10        if show_names {
11            String::from(plugin.name().as_str().unwrap())
12        } else {
13            String::from(plugin.uri().as_uri().unwrap())
14        }
15    };
16
17    let plugins = world
18        .plugins()
19        .iter()
20        .filter(Plugin::verify)
21        .map(print)
22        .collect::<Vec<_>>();
23
24    debug_assert_eq!(world.plugins().count(), plugins.len());
25
26    for uri in plugins {
27        println!("{}", uri);
28    }
29}
More examples
Hide additional examples
examples/lv2info.rs (line 103)
101fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
102    println!("{}\n", p.uri().as_uri().unwrap());
103    println!("\tName:              {}", p.name().as_str().unwrap());
104    println!(
105        "\tClass:             {}",
106        p.class().label().as_str().unwrap()
107    );
108
109    if let Some(val) = p.author_name() {
110        println!("\tAuthor:            {}", val.as_str().unwrap());
111    }
112
113    if let Some(val) = p.author_email() {
114        println!("\tAuthor Email:      {}", val.as_str().unwrap());
115    }
116
117    if let Some(val) = p.author_homepage() {
118        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
119    }
120
121    if let Some(latency_port) = p.latency_port_index() {
122        println!(
123            "\tHas latency:       yes, reported by port {}",
124            latency_port
125        );
126    } else {
127        println!("\tHas latency:       no");
128    }
129
130    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
131    println!(
132        "\tBinary:            {}",
133        p.library_uri().map_or("<none>".to_string(), |node| node
134            .as_uri()
135            .unwrap()
136            .to_string())
137    );
138
139    if let Some(uis) = p.uis() {
140        println!("\tUIs:");
141
142        for ui in uis {
143            println!("\t\t{}", ui.uri().as_uri().unwrap());
144
145            for tyep in ui.classes() {
146                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
147            }
148
149            println!(
150                "\t\t\tBinary: {}",
151                ui.binary_uri().unwrap().as_uri().unwrap()
152            );
153            println!(
154                "\t\t\tBundle: {}",
155                ui.bundle_uri().unwrap().as_uri().unwrap()
156            );
157        }
158    }
159
160    print!("\tData URIs:         ");
161
162    for (i, uri) in p.data_uris().iter().enumerate() {
163        if i != 0 {
164            print!("\n\t                   ");
165        }
166
167        print!("{}", uri.as_uri().unwrap());
168    }
169
170    println!();
171
172    let features = p.required_features();
173    print!("\tRequired Features: ");
174
175    for (i, feature) in features.iter().enumerate() {
176        if i != 0 {
177            print!("\n\t                   ");
178        }
179        print!("{}", feature.as_uri().unwrap());
180    }
181    println!();
182
183    let features = p.optional_features();
184    print!("\tOptional Features: ");
185
186    for (i, feature) in features.iter().enumerate() {
187        if i != 0 {
188            print!("\n\t                   ");
189        }
190        print!("{}", feature.as_uri().unwrap());
191    }
192    println!();
193
194    if let Some(data) = p.extension_data() {
195        print!("\tExtension Data:    ");
196
197        for (i, d) in data.iter().enumerate() {
198            if i != 0 {
199                print!("\n\t                   ");
200            }
201            print!("{}", d.as_uri().unwrap());
202        }
203        println!();
204    }
205
206    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
207        if presets.count() != 0 {
208            println!("\tPresets: ");
209
210            for preset in presets {
211                world.load_resource(&preset).unwrap();
212
213                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
214                if titles.count() > 0 {
215                    if let Some(title) = titles.iter().next() {
216                        println!("\t         {}", title.as_str().unwrap());
217                    } else {
218                        println!("\t         <{}>", preset.as_uri().unwrap());
219                    }
220                } else {
221                    println!("\t         <{}>", preset.as_uri().unwrap());
222                }
223            }
224        }
225    }
226
227    let num_ports = p.ports_count();
228    let port_ranges = p.port_ranges_float();
229    assert_eq!(num_ports, port_ranges.len());
230    for (i, pr) in port_ranges.iter().enumerate() {
231        print_port(p, i, pr, nodes);
232    }
233}
Source

pub fn class(&self) -> Class

The class of the plugin.

§Panics

Panics if the pluginc class could not be found.

Examples found in repository?
examples/lv2info.rs (line 106)
101fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
102    println!("{}\n", p.uri().as_uri().unwrap());
103    println!("\tName:              {}", p.name().as_str().unwrap());
104    println!(
105        "\tClass:             {}",
106        p.class().label().as_str().unwrap()
107    );
108
109    if let Some(val) = p.author_name() {
110        println!("\tAuthor:            {}", val.as_str().unwrap());
111    }
112
113    if let Some(val) = p.author_email() {
114        println!("\tAuthor Email:      {}", val.as_str().unwrap());
115    }
116
117    if let Some(val) = p.author_homepage() {
118        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
119    }
120
121    if let Some(latency_port) = p.latency_port_index() {
122        println!(
123            "\tHas latency:       yes, reported by port {}",
124            latency_port
125        );
126    } else {
127        println!("\tHas latency:       no");
128    }
129
130    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
131    println!(
132        "\tBinary:            {}",
133        p.library_uri().map_or("<none>".to_string(), |node| node
134            .as_uri()
135            .unwrap()
136            .to_string())
137    );
138
139    if let Some(uis) = p.uis() {
140        println!("\tUIs:");
141
142        for ui in uis {
143            println!("\t\t{}", ui.uri().as_uri().unwrap());
144
145            for tyep in ui.classes() {
146                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
147            }
148
149            println!(
150                "\t\t\tBinary: {}",
151                ui.binary_uri().unwrap().as_uri().unwrap()
152            );
153            println!(
154                "\t\t\tBundle: {}",
155                ui.bundle_uri().unwrap().as_uri().unwrap()
156            );
157        }
158    }
159
160    print!("\tData URIs:         ");
161
162    for (i, uri) in p.data_uris().iter().enumerate() {
163        if i != 0 {
164            print!("\n\t                   ");
165        }
166
167        print!("{}", uri.as_uri().unwrap());
168    }
169
170    println!();
171
172    let features = p.required_features();
173    print!("\tRequired Features: ");
174
175    for (i, feature) in features.iter().enumerate() {
176        if i != 0 {
177            print!("\n\t                   ");
178        }
179        print!("{}", feature.as_uri().unwrap());
180    }
181    println!();
182
183    let features = p.optional_features();
184    print!("\tOptional Features: ");
185
186    for (i, feature) in features.iter().enumerate() {
187        if i != 0 {
188            print!("\n\t                   ");
189        }
190        print!("{}", feature.as_uri().unwrap());
191    }
192    println!();
193
194    if let Some(data) = p.extension_data() {
195        print!("\tExtension Data:    ");
196
197        for (i, d) in data.iter().enumerate() {
198            if i != 0 {
199                print!("\n\t                   ");
200            }
201            print!("{}", d.as_uri().unwrap());
202        }
203        println!();
204    }
205
206    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
207        if presets.count() != 0 {
208            println!("\tPresets: ");
209
210            for preset in presets {
211                world.load_resource(&preset).unwrap();
212
213                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
214                if titles.count() > 0 {
215                    if let Some(title) = titles.iter().next() {
216                        println!("\t         {}", title.as_str().unwrap());
217                    } else {
218                        println!("\t         <{}>", preset.as_uri().unwrap());
219                    }
220                } else {
221                    println!("\t         <{}>", preset.as_uri().unwrap());
222                }
223            }
224        }
225    }
226
227    let num_ports = p.ports_count();
228    let port_ranges = p.port_ranges_float();
229    assert_eq!(num_ports, port_ranges.len());
230    for (i, pr) in port_ranges.iter().enumerate() {
231        print_port(p, i, pr, nodes);
232    }
233}
Source

pub fn value(&self, predicate: &Node) -> Nodes

The value of the predicate. Nodes may be empty if the plugin does not have one.

Source

pub fn has_feature(&self, feature_uri: &Node) -> bool

true if the plugin supports the feature.

Source

pub fn supported_features(&self) -> Nodes

The set of features that are supported.

Source

pub fn required_features(&self) -> Nodes

The set of features that are required to instantiate the plugin.

Examples found in repository?
examples/lv2info.rs (line 172)
101fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
102    println!("{}\n", p.uri().as_uri().unwrap());
103    println!("\tName:              {}", p.name().as_str().unwrap());
104    println!(
105        "\tClass:             {}",
106        p.class().label().as_str().unwrap()
107    );
108
109    if let Some(val) = p.author_name() {
110        println!("\tAuthor:            {}", val.as_str().unwrap());
111    }
112
113    if let Some(val) = p.author_email() {
114        println!("\tAuthor Email:      {}", val.as_str().unwrap());
115    }
116
117    if let Some(val) = p.author_homepage() {
118        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
119    }
120
121    if let Some(latency_port) = p.latency_port_index() {
122        println!(
123            "\tHas latency:       yes, reported by port {}",
124            latency_port
125        );
126    } else {
127        println!("\tHas latency:       no");
128    }
129
130    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
131    println!(
132        "\tBinary:            {}",
133        p.library_uri().map_or("<none>".to_string(), |node| node
134            .as_uri()
135            .unwrap()
136            .to_string())
137    );
138
139    if let Some(uis) = p.uis() {
140        println!("\tUIs:");
141
142        for ui in uis {
143            println!("\t\t{}", ui.uri().as_uri().unwrap());
144
145            for tyep in ui.classes() {
146                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
147            }
148
149            println!(
150                "\t\t\tBinary: {}",
151                ui.binary_uri().unwrap().as_uri().unwrap()
152            );
153            println!(
154                "\t\t\tBundle: {}",
155                ui.bundle_uri().unwrap().as_uri().unwrap()
156            );
157        }
158    }
159
160    print!("\tData URIs:         ");
161
162    for (i, uri) in p.data_uris().iter().enumerate() {
163        if i != 0 {
164            print!("\n\t                   ");
165        }
166
167        print!("{}", uri.as_uri().unwrap());
168    }
169
170    println!();
171
172    let features = p.required_features();
173    print!("\tRequired Features: ");
174
175    for (i, feature) in features.iter().enumerate() {
176        if i != 0 {
177            print!("\n\t                   ");
178        }
179        print!("{}", feature.as_uri().unwrap());
180    }
181    println!();
182
183    let features = p.optional_features();
184    print!("\tOptional Features: ");
185
186    for (i, feature) in features.iter().enumerate() {
187        if i != 0 {
188            print!("\n\t                   ");
189        }
190        print!("{}", feature.as_uri().unwrap());
191    }
192    println!();
193
194    if let Some(data) = p.extension_data() {
195        print!("\tExtension Data:    ");
196
197        for (i, d) in data.iter().enumerate() {
198            if i != 0 {
199                print!("\n\t                   ");
200            }
201            print!("{}", d.as_uri().unwrap());
202        }
203        println!();
204    }
205
206    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
207        if presets.count() != 0 {
208            println!("\tPresets: ");
209
210            for preset in presets {
211                world.load_resource(&preset).unwrap();
212
213                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
214                if titles.count() > 0 {
215                    if let Some(title) = titles.iter().next() {
216                        println!("\t         {}", title.as_str().unwrap());
217                    } else {
218                        println!("\t         <{}>", preset.as_uri().unwrap());
219                    }
220                } else {
221                    println!("\t         <{}>", preset.as_uri().unwrap());
222                }
223            }
224        }
225    }
226
227    let num_ports = p.ports_count();
228    let port_ranges = p.port_ranges_float();
229    assert_eq!(num_ports, port_ranges.len());
230    for (i, pr) in port_ranges.iter().enumerate() {
231        print_port(p, i, pr, nodes);
232    }
233}
Source

pub fn optional_features(&self) -> Nodes

The set of features that are optional to instantiate the plugin.

Examples found in repository?
examples/lv2info.rs (line 183)
101fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
102    println!("{}\n", p.uri().as_uri().unwrap());
103    println!("\tName:              {}", p.name().as_str().unwrap());
104    println!(
105        "\tClass:             {}",
106        p.class().label().as_str().unwrap()
107    );
108
109    if let Some(val) = p.author_name() {
110        println!("\tAuthor:            {}", val.as_str().unwrap());
111    }
112
113    if let Some(val) = p.author_email() {
114        println!("\tAuthor Email:      {}", val.as_str().unwrap());
115    }
116
117    if let Some(val) = p.author_homepage() {
118        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
119    }
120
121    if let Some(latency_port) = p.latency_port_index() {
122        println!(
123            "\tHas latency:       yes, reported by port {}",
124            latency_port
125        );
126    } else {
127        println!("\tHas latency:       no");
128    }
129
130    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
131    println!(
132        "\tBinary:            {}",
133        p.library_uri().map_or("<none>".to_string(), |node| node
134            .as_uri()
135            .unwrap()
136            .to_string())
137    );
138
139    if let Some(uis) = p.uis() {
140        println!("\tUIs:");
141
142        for ui in uis {
143            println!("\t\t{}", ui.uri().as_uri().unwrap());
144
145            for tyep in ui.classes() {
146                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
147            }
148
149            println!(
150                "\t\t\tBinary: {}",
151                ui.binary_uri().unwrap().as_uri().unwrap()
152            );
153            println!(
154                "\t\t\tBundle: {}",
155                ui.bundle_uri().unwrap().as_uri().unwrap()
156            );
157        }
158    }
159
160    print!("\tData URIs:         ");
161
162    for (i, uri) in p.data_uris().iter().enumerate() {
163        if i != 0 {
164            print!("\n\t                   ");
165        }
166
167        print!("{}", uri.as_uri().unwrap());
168    }
169
170    println!();
171
172    let features = p.required_features();
173    print!("\tRequired Features: ");
174
175    for (i, feature) in features.iter().enumerate() {
176        if i != 0 {
177            print!("\n\t                   ");
178        }
179        print!("{}", feature.as_uri().unwrap());
180    }
181    println!();
182
183    let features = p.optional_features();
184    print!("\tOptional Features: ");
185
186    for (i, feature) in features.iter().enumerate() {
187        if i != 0 {
188            print!("\n\t                   ");
189        }
190        print!("{}", feature.as_uri().unwrap());
191    }
192    println!();
193
194    if let Some(data) = p.extension_data() {
195        print!("\tExtension Data:    ");
196
197        for (i, d) in data.iter().enumerate() {
198            if i != 0 {
199                print!("\n\t                   ");
200            }
201            print!("{}", d.as_uri().unwrap());
202        }
203        println!();
204    }
205
206    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
207        if presets.count() != 0 {
208            println!("\tPresets: ");
209
210            for preset in presets {
211                world.load_resource(&preset).unwrap();
212
213                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
214                if titles.count() > 0 {
215                    if let Some(title) = titles.iter().next() {
216                        println!("\t         {}", title.as_str().unwrap());
217                    } else {
218                        println!("\t         <{}>", preset.as_uri().unwrap());
219                    }
220                } else {
221                    println!("\t         <{}>", preset.as_uri().unwrap());
222                }
223            }
224        }
225    }
226
227    let num_ports = p.ports_count();
228    let port_ranges = p.port_ranges_float();
229    assert_eq!(num_ports, port_ranges.len());
230    for (i, pr) in port_ranges.iter().enumerate() {
231        print_port(p, i, pr, nodes);
232    }
233}
Source

pub fn has_extension_data(&self, uri: &Node) -> bool

Returns true if the plugin has extension data for uri.

Source

pub fn extension_data(&self) -> Option<Nodes>

Get a sequence of all extension data provided by a plugin.

Examples found in repository?
examples/lv2info.rs (line 194)
101fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
102    println!("{}\n", p.uri().as_uri().unwrap());
103    println!("\tName:              {}", p.name().as_str().unwrap());
104    println!(
105        "\tClass:             {}",
106        p.class().label().as_str().unwrap()
107    );
108
109    if let Some(val) = p.author_name() {
110        println!("\tAuthor:            {}", val.as_str().unwrap());
111    }
112
113    if let Some(val) = p.author_email() {
114        println!("\tAuthor Email:      {}", val.as_str().unwrap());
115    }
116
117    if let Some(val) = p.author_homepage() {
118        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
119    }
120
121    if let Some(latency_port) = p.latency_port_index() {
122        println!(
123            "\tHas latency:       yes, reported by port {}",
124            latency_port
125        );
126    } else {
127        println!("\tHas latency:       no");
128    }
129
130    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
131    println!(
132        "\tBinary:            {}",
133        p.library_uri().map_or("<none>".to_string(), |node| node
134            .as_uri()
135            .unwrap()
136            .to_string())
137    );
138
139    if let Some(uis) = p.uis() {
140        println!("\tUIs:");
141
142        for ui in uis {
143            println!("\t\t{}", ui.uri().as_uri().unwrap());
144
145            for tyep in ui.classes() {
146                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
147            }
148
149            println!(
150                "\t\t\tBinary: {}",
151                ui.binary_uri().unwrap().as_uri().unwrap()
152            );
153            println!(
154                "\t\t\tBundle: {}",
155                ui.bundle_uri().unwrap().as_uri().unwrap()
156            );
157        }
158    }
159
160    print!("\tData URIs:         ");
161
162    for (i, uri) in p.data_uris().iter().enumerate() {
163        if i != 0 {
164            print!("\n\t                   ");
165        }
166
167        print!("{}", uri.as_uri().unwrap());
168    }
169
170    println!();
171
172    let features = p.required_features();
173    print!("\tRequired Features: ");
174
175    for (i, feature) in features.iter().enumerate() {
176        if i != 0 {
177            print!("\n\t                   ");
178        }
179        print!("{}", feature.as_uri().unwrap());
180    }
181    println!();
182
183    let features = p.optional_features();
184    print!("\tOptional Features: ");
185
186    for (i, feature) in features.iter().enumerate() {
187        if i != 0 {
188            print!("\n\t                   ");
189        }
190        print!("{}", feature.as_uri().unwrap());
191    }
192    println!();
193
194    if let Some(data) = p.extension_data() {
195        print!("\tExtension Data:    ");
196
197        for (i, d) in data.iter().enumerate() {
198            if i != 0 {
199                print!("\n\t                   ");
200            }
201            print!("{}", d.as_uri().unwrap());
202        }
203        println!();
204    }
205
206    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
207        if presets.count() != 0 {
208            println!("\tPresets: ");
209
210            for preset in presets {
211                world.load_resource(&preset).unwrap();
212
213                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
214                if titles.count() > 0 {
215                    if let Some(title) = titles.iter().next() {
216                        println!("\t         {}", title.as_str().unwrap());
217                    } else {
218                        println!("\t         <{}>", preset.as_uri().unwrap());
219                    }
220                } else {
221                    println!("\t         <{}>", preset.as_uri().unwrap());
222                }
223            }
224        }
225    }
226
227    let num_ports = p.ports_count();
228    let port_ranges = p.port_ranges_float();
229    assert_eq!(num_ports, port_ranges.len());
230    for (i, pr) in port_ranges.iter().enumerate() {
231        print_port(p, i, pr, nodes);
232    }
233}
Source

pub fn ports_count(&self) -> usize

Returns the number of ports for the plugin.

Examples found in repository?
examples/lv2info.rs (line 227)
101fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
102    println!("{}\n", p.uri().as_uri().unwrap());
103    println!("\tName:              {}", p.name().as_str().unwrap());
104    println!(
105        "\tClass:             {}",
106        p.class().label().as_str().unwrap()
107    );
108
109    if let Some(val) = p.author_name() {
110        println!("\tAuthor:            {}", val.as_str().unwrap());
111    }
112
113    if let Some(val) = p.author_email() {
114        println!("\tAuthor Email:      {}", val.as_str().unwrap());
115    }
116
117    if let Some(val) = p.author_homepage() {
118        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
119    }
120
121    if let Some(latency_port) = p.latency_port_index() {
122        println!(
123            "\tHas latency:       yes, reported by port {}",
124            latency_port
125        );
126    } else {
127        println!("\tHas latency:       no");
128    }
129
130    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
131    println!(
132        "\tBinary:            {}",
133        p.library_uri().map_or("<none>".to_string(), |node| node
134            .as_uri()
135            .unwrap()
136            .to_string())
137    );
138
139    if let Some(uis) = p.uis() {
140        println!("\tUIs:");
141
142        for ui in uis {
143            println!("\t\t{}", ui.uri().as_uri().unwrap());
144
145            for tyep in ui.classes() {
146                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
147            }
148
149            println!(
150                "\t\t\tBinary: {}",
151                ui.binary_uri().unwrap().as_uri().unwrap()
152            );
153            println!(
154                "\t\t\tBundle: {}",
155                ui.bundle_uri().unwrap().as_uri().unwrap()
156            );
157        }
158    }
159
160    print!("\tData URIs:         ");
161
162    for (i, uri) in p.data_uris().iter().enumerate() {
163        if i != 0 {
164            print!("\n\t                   ");
165        }
166
167        print!("{}", uri.as_uri().unwrap());
168    }
169
170    println!();
171
172    let features = p.required_features();
173    print!("\tRequired Features: ");
174
175    for (i, feature) in features.iter().enumerate() {
176        if i != 0 {
177            print!("\n\t                   ");
178        }
179        print!("{}", feature.as_uri().unwrap());
180    }
181    println!();
182
183    let features = p.optional_features();
184    print!("\tOptional Features: ");
185
186    for (i, feature) in features.iter().enumerate() {
187        if i != 0 {
188            print!("\n\t                   ");
189        }
190        print!("{}", feature.as_uri().unwrap());
191    }
192    println!();
193
194    if let Some(data) = p.extension_data() {
195        print!("\tExtension Data:    ");
196
197        for (i, d) in data.iter().enumerate() {
198            if i != 0 {
199                print!("\n\t                   ");
200            }
201            print!("{}", d.as_uri().unwrap());
202        }
203        println!();
204    }
205
206    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
207        if presets.count() != 0 {
208            println!("\tPresets: ");
209
210            for preset in presets {
211                world.load_resource(&preset).unwrap();
212
213                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
214                if titles.count() > 0 {
215                    if let Some(title) = titles.iter().next() {
216                        println!("\t         {}", title.as_str().unwrap());
217                    } else {
218                        println!("\t         <{}>", preset.as_uri().unwrap());
219                    }
220                } else {
221                    println!("\t         <{}>", preset.as_uri().unwrap());
222                }
223            }
224        }
225    }
226
227    let num_ports = p.ports_count();
228    let port_ranges = p.port_ranges_float();
229    assert_eq!(num_ports, port_ranges.len());
230    for (i, pr) in port_ranges.iter().enumerate() {
231        print_port(p, i, pr, nodes);
232    }
233}
Source

pub fn port_ranges_float(&self) -> Vec<FloatRanges>

Return the ranges for all ports.

Examples found in repository?
examples/lv2info.rs (line 228)
101fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
102    println!("{}\n", p.uri().as_uri().unwrap());
103    println!("\tName:              {}", p.name().as_str().unwrap());
104    println!(
105        "\tClass:             {}",
106        p.class().label().as_str().unwrap()
107    );
108
109    if let Some(val) = p.author_name() {
110        println!("\tAuthor:            {}", val.as_str().unwrap());
111    }
112
113    if let Some(val) = p.author_email() {
114        println!("\tAuthor Email:      {}", val.as_str().unwrap());
115    }
116
117    if let Some(val) = p.author_homepage() {
118        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
119    }
120
121    if let Some(latency_port) = p.latency_port_index() {
122        println!(
123            "\tHas latency:       yes, reported by port {}",
124            latency_port
125        );
126    } else {
127        println!("\tHas latency:       no");
128    }
129
130    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
131    println!(
132        "\tBinary:            {}",
133        p.library_uri().map_or("<none>".to_string(), |node| node
134            .as_uri()
135            .unwrap()
136            .to_string())
137    );
138
139    if let Some(uis) = p.uis() {
140        println!("\tUIs:");
141
142        for ui in uis {
143            println!("\t\t{}", ui.uri().as_uri().unwrap());
144
145            for tyep in ui.classes() {
146                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
147            }
148
149            println!(
150                "\t\t\tBinary: {}",
151                ui.binary_uri().unwrap().as_uri().unwrap()
152            );
153            println!(
154                "\t\t\tBundle: {}",
155                ui.bundle_uri().unwrap().as_uri().unwrap()
156            );
157        }
158    }
159
160    print!("\tData URIs:         ");
161
162    for (i, uri) in p.data_uris().iter().enumerate() {
163        if i != 0 {
164            print!("\n\t                   ");
165        }
166
167        print!("{}", uri.as_uri().unwrap());
168    }
169
170    println!();
171
172    let features = p.required_features();
173    print!("\tRequired Features: ");
174
175    for (i, feature) in features.iter().enumerate() {
176        if i != 0 {
177            print!("\n\t                   ");
178        }
179        print!("{}", feature.as_uri().unwrap());
180    }
181    println!();
182
183    let features = p.optional_features();
184    print!("\tOptional Features: ");
185
186    for (i, feature) in features.iter().enumerate() {
187        if i != 0 {
188            print!("\n\t                   ");
189        }
190        print!("{}", feature.as_uri().unwrap());
191    }
192    println!();
193
194    if let Some(data) = p.extension_data() {
195        print!("\tExtension Data:    ");
196
197        for (i, d) in data.iter().enumerate() {
198            if i != 0 {
199                print!("\n\t                   ");
200            }
201            print!("{}", d.as_uri().unwrap());
202        }
203        println!();
204    }
205
206    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
207        if presets.count() != 0 {
208            println!("\tPresets: ");
209
210            for preset in presets {
211                world.load_resource(&preset).unwrap();
212
213                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
214                if titles.count() > 0 {
215                    if let Some(title) = titles.iter().next() {
216                        println!("\t         {}", title.as_str().unwrap());
217                    } else {
218                        println!("\t         <{}>", preset.as_uri().unwrap());
219                    }
220                } else {
221                    println!("\t         <{}>", preset.as_uri().unwrap());
222                }
223            }
224        }
225    }
226
227    let num_ports = p.ports_count();
228    let port_ranges = p.port_ranges_float();
229    assert_eq!(num_ports, port_ranges.len());
230    for (i, pr) in port_ranges.iter().enumerate() {
231        print_port(p, i, pr, nodes);
232    }
233}
Source

pub fn num_ports_of_class<I, N>(&self, classes: I) -> usize
where I: IntoIterator<Item = N>, N: Borrow<Node>,

Returns the number of ports that match all the given classes.

Source

pub fn has_latency(&self) -> bool

Returns wether or not the latency port can be found.

Source

pub fn latency_port_index(&self) -> Option<usize>

Return the index of the plugin’s latency port or None if it does not exist.

Examples found in repository?
examples/lv2info.rs (line 121)
101fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
102    println!("{}\n", p.uri().as_uri().unwrap());
103    println!("\tName:              {}", p.name().as_str().unwrap());
104    println!(
105        "\tClass:             {}",
106        p.class().label().as_str().unwrap()
107    );
108
109    if let Some(val) = p.author_name() {
110        println!("\tAuthor:            {}", val.as_str().unwrap());
111    }
112
113    if let Some(val) = p.author_email() {
114        println!("\tAuthor Email:      {}", val.as_str().unwrap());
115    }
116
117    if let Some(val) = p.author_homepage() {
118        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
119    }
120
121    if let Some(latency_port) = p.latency_port_index() {
122        println!(
123            "\tHas latency:       yes, reported by port {}",
124            latency_port
125        );
126    } else {
127        println!("\tHas latency:       no");
128    }
129
130    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
131    println!(
132        "\tBinary:            {}",
133        p.library_uri().map_or("<none>".to_string(), |node| node
134            .as_uri()
135            .unwrap()
136            .to_string())
137    );
138
139    if let Some(uis) = p.uis() {
140        println!("\tUIs:");
141
142        for ui in uis {
143            println!("\t\t{}", ui.uri().as_uri().unwrap());
144
145            for tyep in ui.classes() {
146                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
147            }
148
149            println!(
150                "\t\t\tBinary: {}",
151                ui.binary_uri().unwrap().as_uri().unwrap()
152            );
153            println!(
154                "\t\t\tBundle: {}",
155                ui.bundle_uri().unwrap().as_uri().unwrap()
156            );
157        }
158    }
159
160    print!("\tData URIs:         ");
161
162    for (i, uri) in p.data_uris().iter().enumerate() {
163        if i != 0 {
164            print!("\n\t                   ");
165        }
166
167        print!("{}", uri.as_uri().unwrap());
168    }
169
170    println!();
171
172    let features = p.required_features();
173    print!("\tRequired Features: ");
174
175    for (i, feature) in features.iter().enumerate() {
176        if i != 0 {
177            print!("\n\t                   ");
178        }
179        print!("{}", feature.as_uri().unwrap());
180    }
181    println!();
182
183    let features = p.optional_features();
184    print!("\tOptional Features: ");
185
186    for (i, feature) in features.iter().enumerate() {
187        if i != 0 {
188            print!("\n\t                   ");
189        }
190        print!("{}", feature.as_uri().unwrap());
191    }
192    println!();
193
194    if let Some(data) = p.extension_data() {
195        print!("\tExtension Data:    ");
196
197        for (i, d) in data.iter().enumerate() {
198            if i != 0 {
199                print!("\n\t                   ");
200            }
201            print!("{}", d.as_uri().unwrap());
202        }
203        println!();
204    }
205
206    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
207        if presets.count() != 0 {
208            println!("\tPresets: ");
209
210            for preset in presets {
211                world.load_resource(&preset).unwrap();
212
213                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
214                if titles.count() > 0 {
215                    if let Some(title) = titles.iter().next() {
216                        println!("\t         {}", title.as_str().unwrap());
217                    } else {
218                        println!("\t         <{}>", preset.as_uri().unwrap());
219                    }
220                } else {
221                    println!("\t         <{}>", preset.as_uri().unwrap());
222                }
223            }
224        }
225    }
226
227    let num_ports = p.ports_count();
228    let port_ranges = p.port_ranges_float();
229    assert_eq!(num_ports, port_ranges.len());
230    for (i, pr) in port_ranges.iter().enumerate() {
231        print_port(p, i, pr, nodes);
232    }
233}
Source

pub fn iter_ports(&self) -> impl Iterator<Item = Port>

Returns an iterator over all the ports.

Source

pub fn port_by_index(&self, index: usize) -> Option<Port>

Return the port by index or None if it does not exist.

Examples found in repository?
examples/lv2info.rs (line 14)
13fn print_port(p: &Plugin, index: usize, port_ranges: &FloatRanges, nodes: &Nodes) {
14    let port = p.port_by_index(index);
15
16    println!("\n\tPort {}:", index);
17
18    if port.is_none() {
19        println!("\t\tERROR: Illegal/nonexistent port");
20        return;
21    }
22
23    let port = port.unwrap();
24
25    print!("\t\tType:        ");
26
27    for (i, value) in port.classes().iter().enumerate() {
28        if i != 0 {
29            print!("\n\t\t             ");
30        }
31        print!("{}", value.as_uri().unwrap());
32    }
33
34    if port.is_a(&nodes.event_class) {
35        let supported = port.value(&nodes.supports_event_pred);
36        if supported.count() > 0 {
37            println!("\n\t\tSupported events:\n");
38            for value in supported {
39                println!("\t\t\t{}", value.as_uri().unwrap());
40            }
41        }
42    }
43
44    let points = port.scale_points();
45    println!("\n\t\tScale Points:");
46    for point in points {
47        println!(
48            "\t\t\t{} = \"{}\"",
49            point.value().as_str().unwrap(),
50            point.label().as_str().unwrap(),
51        );
52    }
53
54    println!(
55        "\n\t\tSymbol:      {}",
56        port.symbol().unwrap().as_str().unwrap(),
57    );
58
59    println!(
60        "\t\tName:        {}",
61        port.name().unwrap().as_str().unwrap(),
62    );
63
64    let groups = port.value(&nodes.group_pred);
65    if let Some(group) = groups.iter().next() {
66        println!("\t\tGroup:       {}", group.as_str().unwrap(),);
67    }
68
69    let designations = port.value(&nodes.designation_pred);
70    if let Some(designation) = designations.iter().next() {
71        println!("\t\tDesignation: {}", designation.as_str().unwrap(),);
72    }
73
74    if port.is_a(&nodes.control_class) {
75        let (min, max, def) = (port_ranges.min, port_ranges.max, port_ranges.default);
76
77        if !min.is_nan() {
78            println!("\t\tMinimum:     {}", min);
79        }
80
81        if !max.is_nan() {
82            println!("\t\tMaximum:     {}", max);
83        }
84
85        if !def.is_nan() {
86            println!("\t\tDefault:     {}", def);
87        }
88
89        let properties = port.properties();
90        for (i, property) in properties.iter().enumerate() {
91            if i != 0 {
92                print!("\t\t             ");
93            }
94            println!("{}", property.as_uri().unwrap());
95        }
96        println!();
97    }
98}
Source

pub fn port_by_symbol(&self, symbol: &Node) -> Option<Port>

Note: This function is slower than port_by_index, especially on plugins with a very large number of ports.

Source

pub fn port_by_designation( &self, port_class: Option<&Node>, designation: &Node, ) -> Option<Port>

Get a port on plugin by its lv2:designation.

The designation of a port describes the meaning, assignment, allocation or role of the port, e.g. “left channel” or “gain”. If found, the port with matching port_class and designation is be returned, otherwise None is returned. The port_class can be used to distinguish the input and output ports for a particular designation. If port_class is None, any port with the given designation will be returned.

Source

pub fn project(&self) -> Option<Node>

Get the project the plugin is a part of.

More information about the project can be read with World::find_nodes.

Source

pub fn author_name(&self) -> Option<Node>

Returns the author name if present.

Examples found in repository?
examples/lv2info.rs (line 109)
101fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
102    println!("{}\n", p.uri().as_uri().unwrap());
103    println!("\tName:              {}", p.name().as_str().unwrap());
104    println!(
105        "\tClass:             {}",
106        p.class().label().as_str().unwrap()
107    );
108
109    if let Some(val) = p.author_name() {
110        println!("\tAuthor:            {}", val.as_str().unwrap());
111    }
112
113    if let Some(val) = p.author_email() {
114        println!("\tAuthor Email:      {}", val.as_str().unwrap());
115    }
116
117    if let Some(val) = p.author_homepage() {
118        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
119    }
120
121    if let Some(latency_port) = p.latency_port_index() {
122        println!(
123            "\tHas latency:       yes, reported by port {}",
124            latency_port
125        );
126    } else {
127        println!("\tHas latency:       no");
128    }
129
130    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
131    println!(
132        "\tBinary:            {}",
133        p.library_uri().map_or("<none>".to_string(), |node| node
134            .as_uri()
135            .unwrap()
136            .to_string())
137    );
138
139    if let Some(uis) = p.uis() {
140        println!("\tUIs:");
141
142        for ui in uis {
143            println!("\t\t{}", ui.uri().as_uri().unwrap());
144
145            for tyep in ui.classes() {
146                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
147            }
148
149            println!(
150                "\t\t\tBinary: {}",
151                ui.binary_uri().unwrap().as_uri().unwrap()
152            );
153            println!(
154                "\t\t\tBundle: {}",
155                ui.bundle_uri().unwrap().as_uri().unwrap()
156            );
157        }
158    }
159
160    print!("\tData URIs:         ");
161
162    for (i, uri) in p.data_uris().iter().enumerate() {
163        if i != 0 {
164            print!("\n\t                   ");
165        }
166
167        print!("{}", uri.as_uri().unwrap());
168    }
169
170    println!();
171
172    let features = p.required_features();
173    print!("\tRequired Features: ");
174
175    for (i, feature) in features.iter().enumerate() {
176        if i != 0 {
177            print!("\n\t                   ");
178        }
179        print!("{}", feature.as_uri().unwrap());
180    }
181    println!();
182
183    let features = p.optional_features();
184    print!("\tOptional Features: ");
185
186    for (i, feature) in features.iter().enumerate() {
187        if i != 0 {
188            print!("\n\t                   ");
189        }
190        print!("{}", feature.as_uri().unwrap());
191    }
192    println!();
193
194    if let Some(data) = p.extension_data() {
195        print!("\tExtension Data:    ");
196
197        for (i, d) in data.iter().enumerate() {
198            if i != 0 {
199                print!("\n\t                   ");
200            }
201            print!("{}", d.as_uri().unwrap());
202        }
203        println!();
204    }
205
206    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
207        if presets.count() != 0 {
208            println!("\tPresets: ");
209
210            for preset in presets {
211                world.load_resource(&preset).unwrap();
212
213                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
214                if titles.count() > 0 {
215                    if let Some(title) = titles.iter().next() {
216                        println!("\t         {}", title.as_str().unwrap());
217                    } else {
218                        println!("\t         <{}>", preset.as_uri().unwrap());
219                    }
220                } else {
221                    println!("\t         <{}>", preset.as_uri().unwrap());
222                }
223            }
224        }
225    }
226
227    let num_ports = p.ports_count();
228    let port_ranges = p.port_ranges_float();
229    assert_eq!(num_ports, port_ranges.len());
230    for (i, pr) in port_ranges.iter().enumerate() {
231        print_port(p, i, pr, nodes);
232    }
233}
Source

pub fn author_email(&self) -> Option<Node>

Returns the author email if present.

Examples found in repository?
examples/lv2info.rs (line 113)
101fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
102    println!("{}\n", p.uri().as_uri().unwrap());
103    println!("\tName:              {}", p.name().as_str().unwrap());
104    println!(
105        "\tClass:             {}",
106        p.class().label().as_str().unwrap()
107    );
108
109    if let Some(val) = p.author_name() {
110        println!("\tAuthor:            {}", val.as_str().unwrap());
111    }
112
113    if let Some(val) = p.author_email() {
114        println!("\tAuthor Email:      {}", val.as_str().unwrap());
115    }
116
117    if let Some(val) = p.author_homepage() {
118        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
119    }
120
121    if let Some(latency_port) = p.latency_port_index() {
122        println!(
123            "\tHas latency:       yes, reported by port {}",
124            latency_port
125        );
126    } else {
127        println!("\tHas latency:       no");
128    }
129
130    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
131    println!(
132        "\tBinary:            {}",
133        p.library_uri().map_or("<none>".to_string(), |node| node
134            .as_uri()
135            .unwrap()
136            .to_string())
137    );
138
139    if let Some(uis) = p.uis() {
140        println!("\tUIs:");
141
142        for ui in uis {
143            println!("\t\t{}", ui.uri().as_uri().unwrap());
144
145            for tyep in ui.classes() {
146                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
147            }
148
149            println!(
150                "\t\t\tBinary: {}",
151                ui.binary_uri().unwrap().as_uri().unwrap()
152            );
153            println!(
154                "\t\t\tBundle: {}",
155                ui.bundle_uri().unwrap().as_uri().unwrap()
156            );
157        }
158    }
159
160    print!("\tData URIs:         ");
161
162    for (i, uri) in p.data_uris().iter().enumerate() {
163        if i != 0 {
164            print!("\n\t                   ");
165        }
166
167        print!("{}", uri.as_uri().unwrap());
168    }
169
170    println!();
171
172    let features = p.required_features();
173    print!("\tRequired Features: ");
174
175    for (i, feature) in features.iter().enumerate() {
176        if i != 0 {
177            print!("\n\t                   ");
178        }
179        print!("{}", feature.as_uri().unwrap());
180    }
181    println!();
182
183    let features = p.optional_features();
184    print!("\tOptional Features: ");
185
186    for (i, feature) in features.iter().enumerate() {
187        if i != 0 {
188            print!("\n\t                   ");
189        }
190        print!("{}", feature.as_uri().unwrap());
191    }
192    println!();
193
194    if let Some(data) = p.extension_data() {
195        print!("\tExtension Data:    ");
196
197        for (i, d) in data.iter().enumerate() {
198            if i != 0 {
199                print!("\n\t                   ");
200            }
201            print!("{}", d.as_uri().unwrap());
202        }
203        println!();
204    }
205
206    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
207        if presets.count() != 0 {
208            println!("\tPresets: ");
209
210            for preset in presets {
211                world.load_resource(&preset).unwrap();
212
213                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
214                if titles.count() > 0 {
215                    if let Some(title) = titles.iter().next() {
216                        println!("\t         {}", title.as_str().unwrap());
217                    } else {
218                        println!("\t         <{}>", preset.as_uri().unwrap());
219                    }
220                } else {
221                    println!("\t         <{}>", preset.as_uri().unwrap());
222                }
223            }
224        }
225    }
226
227    let num_ports = p.ports_count();
228    let port_ranges = p.port_ranges_float();
229    assert_eq!(num_ports, port_ranges.len());
230    for (i, pr) in port_ranges.iter().enumerate() {
231        print_port(p, i, pr, nodes);
232    }
233}
Source

pub fn author_homepage(&self) -> Option<Node>

Examples found in repository?
examples/lv2info.rs (line 117)
101fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
102    println!("{}\n", p.uri().as_uri().unwrap());
103    println!("\tName:              {}", p.name().as_str().unwrap());
104    println!(
105        "\tClass:             {}",
106        p.class().label().as_str().unwrap()
107    );
108
109    if let Some(val) = p.author_name() {
110        println!("\tAuthor:            {}", val.as_str().unwrap());
111    }
112
113    if let Some(val) = p.author_email() {
114        println!("\tAuthor Email:      {}", val.as_str().unwrap());
115    }
116
117    if let Some(val) = p.author_homepage() {
118        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
119    }
120
121    if let Some(latency_port) = p.latency_port_index() {
122        println!(
123            "\tHas latency:       yes, reported by port {}",
124            latency_port
125        );
126    } else {
127        println!("\tHas latency:       no");
128    }
129
130    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
131    println!(
132        "\tBinary:            {}",
133        p.library_uri().map_or("<none>".to_string(), |node| node
134            .as_uri()
135            .unwrap()
136            .to_string())
137    );
138
139    if let Some(uis) = p.uis() {
140        println!("\tUIs:");
141
142        for ui in uis {
143            println!("\t\t{}", ui.uri().as_uri().unwrap());
144
145            for tyep in ui.classes() {
146                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
147            }
148
149            println!(
150                "\t\t\tBinary: {}",
151                ui.binary_uri().unwrap().as_uri().unwrap()
152            );
153            println!(
154                "\t\t\tBundle: {}",
155                ui.bundle_uri().unwrap().as_uri().unwrap()
156            );
157        }
158    }
159
160    print!("\tData URIs:         ");
161
162    for (i, uri) in p.data_uris().iter().enumerate() {
163        if i != 0 {
164            print!("\n\t                   ");
165        }
166
167        print!("{}", uri.as_uri().unwrap());
168    }
169
170    println!();
171
172    let features = p.required_features();
173    print!("\tRequired Features: ");
174
175    for (i, feature) in features.iter().enumerate() {
176        if i != 0 {
177            print!("\n\t                   ");
178        }
179        print!("{}", feature.as_uri().unwrap());
180    }
181    println!();
182
183    let features = p.optional_features();
184    print!("\tOptional Features: ");
185
186    for (i, feature) in features.iter().enumerate() {
187        if i != 0 {
188            print!("\n\t                   ");
189        }
190        print!("{}", feature.as_uri().unwrap());
191    }
192    println!();
193
194    if let Some(data) = p.extension_data() {
195        print!("\tExtension Data:    ");
196
197        for (i, d) in data.iter().enumerate() {
198            if i != 0 {
199                print!("\n\t                   ");
200            }
201            print!("{}", d.as_uri().unwrap());
202        }
203        println!();
204    }
205
206    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
207        if presets.count() != 0 {
208            println!("\tPresets: ");
209
210            for preset in presets {
211                world.load_resource(&preset).unwrap();
212
213                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
214                if titles.count() > 0 {
215                    if let Some(title) = titles.iter().next() {
216                        println!("\t         {}", title.as_str().unwrap());
217                    } else {
218                        println!("\t         <{}>", preset.as_uri().unwrap());
219                    }
220                } else {
221                    println!("\t         <{}>", preset.as_uri().unwrap());
222                }
223            }
224        }
225    }
226
227    let num_ports = p.ports_count();
228    let port_ranges = p.port_ranges_float();
229    assert_eq!(num_ports, port_ranges.len());
230    for (i, pr) in port_ranges.iter().enumerate() {
231        print_port(p, i, pr, nodes);
232    }
233}
Source

pub fn is_replaced(&self) -> bool

true if the plugin has been replaced by another plugin.

The plugin will still be usable, but hosts should hide them from their user interfaces to prevent users fromusing deprecated plugins.

Source

pub fn related(&self, typ: Option<&Node>) -> Option<Nodes>

Get the resources related to plugin with lv2:appliesTo.

Some plugin-related resources are not linked directly to the plugin with rdfs:seeAlso and thus will not be automatically loaded along with the plugin data (usually for performance reasons). All such resources of the given type related to plugin can be accessed with this function.

If typ is None, all such resources will be returned, regardless of type.

To actually load the data for each returned resource, use World::load_resource().

Examples found in repository?
examples/lv2info.rs (line 206)
101fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
102    println!("{}\n", p.uri().as_uri().unwrap());
103    println!("\tName:              {}", p.name().as_str().unwrap());
104    println!(
105        "\tClass:             {}",
106        p.class().label().as_str().unwrap()
107    );
108
109    if let Some(val) = p.author_name() {
110        println!("\tAuthor:            {}", val.as_str().unwrap());
111    }
112
113    if let Some(val) = p.author_email() {
114        println!("\tAuthor Email:      {}", val.as_str().unwrap());
115    }
116
117    if let Some(val) = p.author_homepage() {
118        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
119    }
120
121    if let Some(latency_port) = p.latency_port_index() {
122        println!(
123            "\tHas latency:       yes, reported by port {}",
124            latency_port
125        );
126    } else {
127        println!("\tHas latency:       no");
128    }
129
130    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
131    println!(
132        "\tBinary:            {}",
133        p.library_uri().map_or("<none>".to_string(), |node| node
134            .as_uri()
135            .unwrap()
136            .to_string())
137    );
138
139    if let Some(uis) = p.uis() {
140        println!("\tUIs:");
141
142        for ui in uis {
143            println!("\t\t{}", ui.uri().as_uri().unwrap());
144
145            for tyep in ui.classes() {
146                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
147            }
148
149            println!(
150                "\t\t\tBinary: {}",
151                ui.binary_uri().unwrap().as_uri().unwrap()
152            );
153            println!(
154                "\t\t\tBundle: {}",
155                ui.bundle_uri().unwrap().as_uri().unwrap()
156            );
157        }
158    }
159
160    print!("\tData URIs:         ");
161
162    for (i, uri) in p.data_uris().iter().enumerate() {
163        if i != 0 {
164            print!("\n\t                   ");
165        }
166
167        print!("{}", uri.as_uri().unwrap());
168    }
169
170    println!();
171
172    let features = p.required_features();
173    print!("\tRequired Features: ");
174
175    for (i, feature) in features.iter().enumerate() {
176        if i != 0 {
177            print!("\n\t                   ");
178        }
179        print!("{}", feature.as_uri().unwrap());
180    }
181    println!();
182
183    let features = p.optional_features();
184    print!("\tOptional Features: ");
185
186    for (i, feature) in features.iter().enumerate() {
187        if i != 0 {
188            print!("\n\t                   ");
189        }
190        print!("{}", feature.as_uri().unwrap());
191    }
192    println!();
193
194    if let Some(data) = p.extension_data() {
195        print!("\tExtension Data:    ");
196
197        for (i, d) in data.iter().enumerate() {
198            if i != 0 {
199                print!("\n\t                   ");
200            }
201            print!("{}", d.as_uri().unwrap());
202        }
203        println!();
204    }
205
206    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
207        if presets.count() != 0 {
208            println!("\tPresets: ");
209
210            for preset in presets {
211                world.load_resource(&preset).unwrap();
212
213                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
214                if titles.count() > 0 {
215                    if let Some(title) = titles.iter().next() {
216                        println!("\t         {}", title.as_str().unwrap());
217                    } else {
218                        println!("\t         <{}>", preset.as_uri().unwrap());
219                    }
220                } else {
221                    println!("\t         <{}>", preset.as_uri().unwrap());
222                }
223            }
224        }
225    }
226
227    let num_ports = p.ports_count();
228    let port_ranges = p.port_ranges_float();
229    assert_eq!(num_ports, port_ranges.len());
230    for (i, pr) in port_ranges.iter().enumerate() {
231        print_port(p, i, pr, nodes);
232    }
233}
Source

pub fn uis(&self) -> Option<Uis>

Get all UIs for plugin.

Examples found in repository?
examples/lv2info.rs (line 139)
101fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
102    println!("{}\n", p.uri().as_uri().unwrap());
103    println!("\tName:              {}", p.name().as_str().unwrap());
104    println!(
105        "\tClass:             {}",
106        p.class().label().as_str().unwrap()
107    );
108
109    if let Some(val) = p.author_name() {
110        println!("\tAuthor:            {}", val.as_str().unwrap());
111    }
112
113    if let Some(val) = p.author_email() {
114        println!("\tAuthor Email:      {}", val.as_str().unwrap());
115    }
116
117    if let Some(val) = p.author_homepage() {
118        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
119    }
120
121    if let Some(latency_port) = p.latency_port_index() {
122        println!(
123            "\tHas latency:       yes, reported by port {}",
124            latency_port
125        );
126    } else {
127        println!("\tHas latency:       no");
128    }
129
130    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
131    println!(
132        "\tBinary:            {}",
133        p.library_uri().map_or("<none>".to_string(), |node| node
134            .as_uri()
135            .unwrap()
136            .to_string())
137    );
138
139    if let Some(uis) = p.uis() {
140        println!("\tUIs:");
141
142        for ui in uis {
143            println!("\t\t{}", ui.uri().as_uri().unwrap());
144
145            for tyep in ui.classes() {
146                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
147            }
148
149            println!(
150                "\t\t\tBinary: {}",
151                ui.binary_uri().unwrap().as_uri().unwrap()
152            );
153            println!(
154                "\t\t\tBundle: {}",
155                ui.bundle_uri().unwrap().as_uri().unwrap()
156            );
157        }
158    }
159
160    print!("\tData URIs:         ");
161
162    for (i, uri) in p.data_uris().iter().enumerate() {
163        if i != 0 {
164            print!("\n\t                   ");
165        }
166
167        print!("{}", uri.as_uri().unwrap());
168    }
169
170    println!();
171
172    let features = p.required_features();
173    print!("\tRequired Features: ");
174
175    for (i, feature) in features.iter().enumerate() {
176        if i != 0 {
177            print!("\n\t                   ");
178        }
179        print!("{}", feature.as_uri().unwrap());
180    }
181    println!();
182
183    let features = p.optional_features();
184    print!("\tOptional Features: ");
185
186    for (i, feature) in features.iter().enumerate() {
187        if i != 0 {
188            print!("\n\t                   ");
189        }
190        print!("{}", feature.as_uri().unwrap());
191    }
192    println!();
193
194    if let Some(data) = p.extension_data() {
195        print!("\tExtension Data:    ");
196
197        for (i, d) in data.iter().enumerate() {
198            if i != 0 {
199                print!("\n\t                   ");
200            }
201            print!("{}", d.as_uri().unwrap());
202        }
203        println!();
204    }
205
206    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
207        if presets.count() != 0 {
208            println!("\tPresets: ");
209
210            for preset in presets {
211                world.load_resource(&preset).unwrap();
212
213                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
214                if titles.count() > 0 {
215                    if let Some(title) = titles.iter().next() {
216                        println!("\t         {}", title.as_str().unwrap());
217                    } else {
218                        println!("\t         <{}>", preset.as_uri().unwrap());
219                    }
220                } else {
221                    println!("\t         <{}>", preset.as_uri().unwrap());
222                }
223            }
224        }
225    }
226
227    let num_ports = p.ports_count();
228    let port_ranges = p.port_ranges_float();
229    assert_eq!(num_ports, port_ranges.len());
230    for (i, pr) in port_ranges.iter().enumerate() {
231        print_port(p, i, pr, nodes);
232    }
233}
Source

pub unsafe fn instantiate<'a, FS>( &self, sample_rate: f64, features: FS, ) -> Option<Instance>
where FS: IntoIterator<Item = &'a LV2Feature>,

Instantiate a plugin.

§Safety

Instantiating a plugin calls the plugin’s code which itself may be unsafe.

Trait Implementations§

Source§

impl Clone for Plugin

Source§

fn clone(&self) -> Plugin

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Plugin

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Send for Plugin

Source§

impl Sync for Plugin

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.