Struct lilv::plugin::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)
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
fn main() {
    let world = World::new();
    world.load_all();

    let show_names = false;

    let print = |plugin: Plugin| {
        if show_names {
            String::from(plugin.name().as_str().unwrap())
        } else {
            String::from(plugin.uri().as_uri().unwrap())
        }
    };

    let plugins = world
        .plugins()
        .iter()
        .filter(Plugin::verify)
        .map(print)
        .collect::<Vec<_>>();

    debug_assert_eq!(world.plugins().count(), plugins.len());

    for uri in plugins {
        println!("{}", uri);
    }
}
More examples
Hide additional examples
examples/lv2info.rs (line 102)
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
    println!("{}\n", p.uri().as_uri().unwrap());
    println!("\tName:              {}", p.name().as_str().unwrap());
    println!(
        "\tClass:             {}",
        p.class().label().as_str().unwrap()
    );

    if let Some(val) = p.author_name() {
        println!("\tAuthor:            {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_email() {
        println!("\tAuthor Email:      {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_homepage() {
        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
    }

    if let Some(latency_port) = p.latency_port_index() {
        println!(
            "\tHas latency:       yes, reported by port {}",
            latency_port
        );
    } else {
        println!("\tHas latency:       no");
    }

    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
    println!(
        "\tBinary:            {}",
        p.library_uri().map_or("<none>".to_string(), |node| node
            .as_uri()
            .unwrap()
            .to_string())
    );

    if let Some(uis) = p.uis() {
        println!("\tUIs:");

        for ui in uis {
            println!("\t\t{}", ui.uri().as_uri().unwrap());

            for tyep in ui.classes() {
                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
            }

            println!(
                "\t\t\tBinary: {}",
                ui.binary_uri().unwrap().as_uri().unwrap()
            );
            println!(
                "\t\t\tBundle: {}",
                ui.bundle_uri().unwrap().as_uri().unwrap()
            );
        }
    }

    print!("\tData URIs:         ");

    for (i, uri) in p.data_uris().iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }

        print!("{}", uri.as_uri().unwrap());
    }

    println!();

    let features = p.required_features();
    print!("\tRequired Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    let features = p.optional_features();
    print!("\tOptional Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    if let Some(data) = p.extension_data() {
        print!("\tExtension Data:    ");

        for (i, d) in data.iter().enumerate() {
            if i != 0 {
                print!("\n\t                   ");
            }
            print!("{}", d.as_uri().unwrap());
        }
        println!();
    }

    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
        if presets.count() != 0 {
            println!("\tPresets: ");

            for preset in presets {
                world.load_resource(&preset).unwrap();

                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
                if titles.count() > 0 {
                    if let Some(title) = titles.iter().next() {
                        println!("\t         {}", title.as_str().unwrap());
                    } else {
                        println!("\t         <{}>", preset.as_uri().unwrap());
                    }
                } else {
                    println!("\t         <{}>", preset.as_uri().unwrap());
                }
            }
        }
    }

    let num_ports = p.ports_count();
    let port_ranges = p.port_ranges_float();
    assert_eq!(num_ports, port_ranges.len());
    for (i, pr) in port_ranges.iter().enumerate() {
        print_port(p, i, pr, nodes);
    }
}
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)
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
    println!("{}\n", p.uri().as_uri().unwrap());
    println!("\tName:              {}", p.name().as_str().unwrap());
    println!(
        "\tClass:             {}",
        p.class().label().as_str().unwrap()
    );

    if let Some(val) = p.author_name() {
        println!("\tAuthor:            {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_email() {
        println!("\tAuthor Email:      {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_homepage() {
        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
    }

    if let Some(latency_port) = p.latency_port_index() {
        println!(
            "\tHas latency:       yes, reported by port {}",
            latency_port
        );
    } else {
        println!("\tHas latency:       no");
    }

    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
    println!(
        "\tBinary:            {}",
        p.library_uri().map_or("<none>".to_string(), |node| node
            .as_uri()
            .unwrap()
            .to_string())
    );

    if let Some(uis) = p.uis() {
        println!("\tUIs:");

        for ui in uis {
            println!("\t\t{}", ui.uri().as_uri().unwrap());

            for tyep in ui.classes() {
                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
            }

            println!(
                "\t\t\tBinary: {}",
                ui.binary_uri().unwrap().as_uri().unwrap()
            );
            println!(
                "\t\t\tBundle: {}",
                ui.bundle_uri().unwrap().as_uri().unwrap()
            );
        }
    }

    print!("\tData URIs:         ");

    for (i, uri) in p.data_uris().iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }

        print!("{}", uri.as_uri().unwrap());
    }

    println!();

    let features = p.required_features();
    print!("\tRequired Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    let features = p.optional_features();
    print!("\tOptional Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    if let Some(data) = p.extension_data() {
        print!("\tExtension Data:    ");

        for (i, d) in data.iter().enumerate() {
            if i != 0 {
                print!("\n\t                   ");
            }
            print!("{}", d.as_uri().unwrap());
        }
        println!();
    }

    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
        if presets.count() != 0 {
            println!("\tPresets: ");

            for preset in presets {
                world.load_resource(&preset).unwrap();

                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
                if titles.count() > 0 {
                    if let Some(title) = titles.iter().next() {
                        println!("\t         {}", title.as_str().unwrap());
                    } else {
                        println!("\t         <{}>", preset.as_uri().unwrap());
                    }
                } else {
                    println!("\t         <{}>", preset.as_uri().unwrap());
                }
            }
        }
    }

    let num_ports = p.ports_count();
    let port_ranges = p.port_ranges_float();
    assert_eq!(num_ports, port_ranges.len());
    for (i, pr) in port_ranges.iter().enumerate() {
        print_port(p, i, pr, nodes);
    }
}
source

pub fn data_uris(&self) -> Nodes

The uri for the data.

Examples found in repository?
examples/lv2info.rs (line 162)
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
    println!("{}\n", p.uri().as_uri().unwrap());
    println!("\tName:              {}", p.name().as_str().unwrap());
    println!(
        "\tClass:             {}",
        p.class().label().as_str().unwrap()
    );

    if let Some(val) = p.author_name() {
        println!("\tAuthor:            {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_email() {
        println!("\tAuthor Email:      {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_homepage() {
        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
    }

    if let Some(latency_port) = p.latency_port_index() {
        println!(
            "\tHas latency:       yes, reported by port {}",
            latency_port
        );
    } else {
        println!("\tHas latency:       no");
    }

    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
    println!(
        "\tBinary:            {}",
        p.library_uri().map_or("<none>".to_string(), |node| node
            .as_uri()
            .unwrap()
            .to_string())
    );

    if let Some(uis) = p.uis() {
        println!("\tUIs:");

        for ui in uis {
            println!("\t\t{}", ui.uri().as_uri().unwrap());

            for tyep in ui.classes() {
                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
            }

            println!(
                "\t\t\tBinary: {}",
                ui.binary_uri().unwrap().as_uri().unwrap()
            );
            println!(
                "\t\t\tBundle: {}",
                ui.bundle_uri().unwrap().as_uri().unwrap()
            );
        }
    }

    print!("\tData URIs:         ");

    for (i, uri) in p.data_uris().iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }

        print!("{}", uri.as_uri().unwrap());
    }

    println!();

    let features = p.required_features();
    print!("\tRequired Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    let features = p.optional_features();
    print!("\tOptional Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    if let Some(data) = p.extension_data() {
        print!("\tExtension Data:    ");

        for (i, d) in data.iter().enumerate() {
            if i != 0 {
                print!("\n\t                   ");
            }
            print!("{}", d.as_uri().unwrap());
        }
        println!();
    }

    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
        if presets.count() != 0 {
            println!("\tPresets: ");

            for preset in presets {
                world.load_resource(&preset).unwrap();

                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
                if titles.count() > 0 {
                    if let Some(title) = titles.iter().next() {
                        println!("\t         {}", title.as_str().unwrap());
                    } else {
                        println!("\t         <{}>", preset.as_uri().unwrap());
                    }
                } else {
                    println!("\t         <{}>", preset.as_uri().unwrap());
                }
            }
        }
    }

    let num_ports = p.ports_count();
    let port_ranges = p.port_ranges_float();
    assert_eq!(num_ports, port_ranges.len());
    for (i, pr) in port_ranges.iter().enumerate() {
        print_port(p, i, pr, nodes);
    }
}
source

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

The uri for the library.

Examples found in repository?
examples/lv2info.rs (line 133)
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
    println!("{}\n", p.uri().as_uri().unwrap());
    println!("\tName:              {}", p.name().as_str().unwrap());
    println!(
        "\tClass:             {}",
        p.class().label().as_str().unwrap()
    );

    if let Some(val) = p.author_name() {
        println!("\tAuthor:            {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_email() {
        println!("\tAuthor Email:      {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_homepage() {
        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
    }

    if let Some(latency_port) = p.latency_port_index() {
        println!(
            "\tHas latency:       yes, reported by port {}",
            latency_port
        );
    } else {
        println!("\tHas latency:       no");
    }

    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
    println!(
        "\tBinary:            {}",
        p.library_uri().map_or("<none>".to_string(), |node| node
            .as_uri()
            .unwrap()
            .to_string())
    );

    if let Some(uis) = p.uis() {
        println!("\tUIs:");

        for ui in uis {
            println!("\t\t{}", ui.uri().as_uri().unwrap());

            for tyep in ui.classes() {
                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
            }

            println!(
                "\t\t\tBinary: {}",
                ui.binary_uri().unwrap().as_uri().unwrap()
            );
            println!(
                "\t\t\tBundle: {}",
                ui.bundle_uri().unwrap().as_uri().unwrap()
            );
        }
    }

    print!("\tData URIs:         ");

    for (i, uri) in p.data_uris().iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }

        print!("{}", uri.as_uri().unwrap());
    }

    println!();

    let features = p.required_features();
    print!("\tRequired Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    let features = p.optional_features();
    print!("\tOptional Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    if let Some(data) = p.extension_data() {
        print!("\tExtension Data:    ");

        for (i, d) in data.iter().enumerate() {
            if i != 0 {
                print!("\n\t                   ");
            }
            print!("{}", d.as_uri().unwrap());
        }
        println!();
    }

    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
        if presets.count() != 0 {
            println!("\tPresets: ");

            for preset in presets {
                world.load_resource(&preset).unwrap();

                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
                if titles.count() > 0 {
                    if let Some(title) = titles.iter().next() {
                        println!("\t         {}", title.as_str().unwrap());
                    } else {
                        println!("\t         <{}>", preset.as_uri().unwrap());
                    }
                } else {
                    println!("\t         <{}>", preset.as_uri().unwrap());
                }
            }
        }
    }

    let num_ports = p.ports_count();
    let port_ranges = p.port_ranges_float();
    assert_eq!(num_ports, port_ranges.len());
    for (i, pr) in port_ranges.iter().enumerate() {
        print_port(p, i, pr, nodes);
    }
}
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)
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
fn main() {
    let world = World::new();
    world.load_all();

    let show_names = false;

    let print = |plugin: Plugin| {
        if show_names {
            String::from(plugin.name().as_str().unwrap())
        } else {
            String::from(plugin.uri().as_uri().unwrap())
        }
    };

    let plugins = world
        .plugins()
        .iter()
        .filter(Plugin::verify)
        .map(print)
        .collect::<Vec<_>>();

    debug_assert_eq!(world.plugins().count(), plugins.len());

    for uri in plugins {
        println!("{}", uri);
    }
}
More examples
Hide additional examples
examples/lv2info.rs (line 103)
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
    println!("{}\n", p.uri().as_uri().unwrap());
    println!("\tName:              {}", p.name().as_str().unwrap());
    println!(
        "\tClass:             {}",
        p.class().label().as_str().unwrap()
    );

    if let Some(val) = p.author_name() {
        println!("\tAuthor:            {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_email() {
        println!("\tAuthor Email:      {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_homepage() {
        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
    }

    if let Some(latency_port) = p.latency_port_index() {
        println!(
            "\tHas latency:       yes, reported by port {}",
            latency_port
        );
    } else {
        println!("\tHas latency:       no");
    }

    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
    println!(
        "\tBinary:            {}",
        p.library_uri().map_or("<none>".to_string(), |node| node
            .as_uri()
            .unwrap()
            .to_string())
    );

    if let Some(uis) = p.uis() {
        println!("\tUIs:");

        for ui in uis {
            println!("\t\t{}", ui.uri().as_uri().unwrap());

            for tyep in ui.classes() {
                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
            }

            println!(
                "\t\t\tBinary: {}",
                ui.binary_uri().unwrap().as_uri().unwrap()
            );
            println!(
                "\t\t\tBundle: {}",
                ui.bundle_uri().unwrap().as_uri().unwrap()
            );
        }
    }

    print!("\tData URIs:         ");

    for (i, uri) in p.data_uris().iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }

        print!("{}", uri.as_uri().unwrap());
    }

    println!();

    let features = p.required_features();
    print!("\tRequired Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    let features = p.optional_features();
    print!("\tOptional Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    if let Some(data) = p.extension_data() {
        print!("\tExtension Data:    ");

        for (i, d) in data.iter().enumerate() {
            if i != 0 {
                print!("\n\t                   ");
            }
            print!("{}", d.as_uri().unwrap());
        }
        println!();
    }

    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
        if presets.count() != 0 {
            println!("\tPresets: ");

            for preset in presets {
                world.load_resource(&preset).unwrap();

                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
                if titles.count() > 0 {
                    if let Some(title) = titles.iter().next() {
                        println!("\t         {}", title.as_str().unwrap());
                    } else {
                        println!("\t         <{}>", preset.as_uri().unwrap());
                    }
                } else {
                    println!("\t         <{}>", preset.as_uri().unwrap());
                }
            }
        }
    }

    let num_ports = p.ports_count();
    let port_ranges = p.port_ranges_float();
    assert_eq!(num_ports, port_ranges.len());
    for (i, pr) in port_ranges.iter().enumerate() {
        print_port(p, i, pr, nodes);
    }
}
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)
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
    println!("{}\n", p.uri().as_uri().unwrap());
    println!("\tName:              {}", p.name().as_str().unwrap());
    println!(
        "\tClass:             {}",
        p.class().label().as_str().unwrap()
    );

    if let Some(val) = p.author_name() {
        println!("\tAuthor:            {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_email() {
        println!("\tAuthor Email:      {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_homepage() {
        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
    }

    if let Some(latency_port) = p.latency_port_index() {
        println!(
            "\tHas latency:       yes, reported by port {}",
            latency_port
        );
    } else {
        println!("\tHas latency:       no");
    }

    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
    println!(
        "\tBinary:            {}",
        p.library_uri().map_or("<none>".to_string(), |node| node
            .as_uri()
            .unwrap()
            .to_string())
    );

    if let Some(uis) = p.uis() {
        println!("\tUIs:");

        for ui in uis {
            println!("\t\t{}", ui.uri().as_uri().unwrap());

            for tyep in ui.classes() {
                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
            }

            println!(
                "\t\t\tBinary: {}",
                ui.binary_uri().unwrap().as_uri().unwrap()
            );
            println!(
                "\t\t\tBundle: {}",
                ui.bundle_uri().unwrap().as_uri().unwrap()
            );
        }
    }

    print!("\tData URIs:         ");

    for (i, uri) in p.data_uris().iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }

        print!("{}", uri.as_uri().unwrap());
    }

    println!();

    let features = p.required_features();
    print!("\tRequired Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    let features = p.optional_features();
    print!("\tOptional Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    if let Some(data) = p.extension_data() {
        print!("\tExtension Data:    ");

        for (i, d) in data.iter().enumerate() {
            if i != 0 {
                print!("\n\t                   ");
            }
            print!("{}", d.as_uri().unwrap());
        }
        println!();
    }

    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
        if presets.count() != 0 {
            println!("\tPresets: ");

            for preset in presets {
                world.load_resource(&preset).unwrap();

                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
                if titles.count() > 0 {
                    if let Some(title) = titles.iter().next() {
                        println!("\t         {}", title.as_str().unwrap());
                    } else {
                        println!("\t         <{}>", preset.as_uri().unwrap());
                    }
                } else {
                    println!("\t         <{}>", preset.as_uri().unwrap());
                }
            }
        }
    }

    let num_ports = p.ports_count();
    let port_ranges = p.port_ranges_float();
    assert_eq!(num_ports, port_ranges.len());
    for (i, pr) in port_ranges.iter().enumerate() {
        print_port(p, i, pr, nodes);
    }
}
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)
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
    println!("{}\n", p.uri().as_uri().unwrap());
    println!("\tName:              {}", p.name().as_str().unwrap());
    println!(
        "\tClass:             {}",
        p.class().label().as_str().unwrap()
    );

    if let Some(val) = p.author_name() {
        println!("\tAuthor:            {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_email() {
        println!("\tAuthor Email:      {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_homepage() {
        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
    }

    if let Some(latency_port) = p.latency_port_index() {
        println!(
            "\tHas latency:       yes, reported by port {}",
            latency_port
        );
    } else {
        println!("\tHas latency:       no");
    }

    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
    println!(
        "\tBinary:            {}",
        p.library_uri().map_or("<none>".to_string(), |node| node
            .as_uri()
            .unwrap()
            .to_string())
    );

    if let Some(uis) = p.uis() {
        println!("\tUIs:");

        for ui in uis {
            println!("\t\t{}", ui.uri().as_uri().unwrap());

            for tyep in ui.classes() {
                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
            }

            println!(
                "\t\t\tBinary: {}",
                ui.binary_uri().unwrap().as_uri().unwrap()
            );
            println!(
                "\t\t\tBundle: {}",
                ui.bundle_uri().unwrap().as_uri().unwrap()
            );
        }
    }

    print!("\tData URIs:         ");

    for (i, uri) in p.data_uris().iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }

        print!("{}", uri.as_uri().unwrap());
    }

    println!();

    let features = p.required_features();
    print!("\tRequired Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    let features = p.optional_features();
    print!("\tOptional Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    if let Some(data) = p.extension_data() {
        print!("\tExtension Data:    ");

        for (i, d) in data.iter().enumerate() {
            if i != 0 {
                print!("\n\t                   ");
            }
            print!("{}", d.as_uri().unwrap());
        }
        println!();
    }

    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
        if presets.count() != 0 {
            println!("\tPresets: ");

            for preset in presets {
                world.load_resource(&preset).unwrap();

                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
                if titles.count() > 0 {
                    if let Some(title) = titles.iter().next() {
                        println!("\t         {}", title.as_str().unwrap());
                    } else {
                        println!("\t         <{}>", preset.as_uri().unwrap());
                    }
                } else {
                    println!("\t         <{}>", preset.as_uri().unwrap());
                }
            }
        }
    }

    let num_ports = p.ports_count();
    let port_ranges = p.port_ranges_float();
    assert_eq!(num_ports, port_ranges.len());
    for (i, pr) in port_ranges.iter().enumerate() {
        print_port(p, i, pr, nodes);
    }
}
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)
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
    println!("{}\n", p.uri().as_uri().unwrap());
    println!("\tName:              {}", p.name().as_str().unwrap());
    println!(
        "\tClass:             {}",
        p.class().label().as_str().unwrap()
    );

    if let Some(val) = p.author_name() {
        println!("\tAuthor:            {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_email() {
        println!("\tAuthor Email:      {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_homepage() {
        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
    }

    if let Some(latency_port) = p.latency_port_index() {
        println!(
            "\tHas latency:       yes, reported by port {}",
            latency_port
        );
    } else {
        println!("\tHas latency:       no");
    }

    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
    println!(
        "\tBinary:            {}",
        p.library_uri().map_or("<none>".to_string(), |node| node
            .as_uri()
            .unwrap()
            .to_string())
    );

    if let Some(uis) = p.uis() {
        println!("\tUIs:");

        for ui in uis {
            println!("\t\t{}", ui.uri().as_uri().unwrap());

            for tyep in ui.classes() {
                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
            }

            println!(
                "\t\t\tBinary: {}",
                ui.binary_uri().unwrap().as_uri().unwrap()
            );
            println!(
                "\t\t\tBundle: {}",
                ui.bundle_uri().unwrap().as_uri().unwrap()
            );
        }
    }

    print!("\tData URIs:         ");

    for (i, uri) in p.data_uris().iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }

        print!("{}", uri.as_uri().unwrap());
    }

    println!();

    let features = p.required_features();
    print!("\tRequired Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    let features = p.optional_features();
    print!("\tOptional Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    if let Some(data) = p.extension_data() {
        print!("\tExtension Data:    ");

        for (i, d) in data.iter().enumerate() {
            if i != 0 {
                print!("\n\t                   ");
            }
            print!("{}", d.as_uri().unwrap());
        }
        println!();
    }

    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
        if presets.count() != 0 {
            println!("\tPresets: ");

            for preset in presets {
                world.load_resource(&preset).unwrap();

                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
                if titles.count() > 0 {
                    if let Some(title) = titles.iter().next() {
                        println!("\t         {}", title.as_str().unwrap());
                    } else {
                        println!("\t         <{}>", preset.as_uri().unwrap());
                    }
                } else {
                    println!("\t         <{}>", preset.as_uri().unwrap());
                }
            }
        }
    }

    let num_ports = p.ports_count();
    let port_ranges = p.port_ranges_float();
    assert_eq!(num_ports, port_ranges.len());
    for (i, pr) in port_ranges.iter().enumerate() {
        print_port(p, i, pr, nodes);
    }
}
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)
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
    println!("{}\n", p.uri().as_uri().unwrap());
    println!("\tName:              {}", p.name().as_str().unwrap());
    println!(
        "\tClass:             {}",
        p.class().label().as_str().unwrap()
    );

    if let Some(val) = p.author_name() {
        println!("\tAuthor:            {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_email() {
        println!("\tAuthor Email:      {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_homepage() {
        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
    }

    if let Some(latency_port) = p.latency_port_index() {
        println!(
            "\tHas latency:       yes, reported by port {}",
            latency_port
        );
    } else {
        println!("\tHas latency:       no");
    }

    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
    println!(
        "\tBinary:            {}",
        p.library_uri().map_or("<none>".to_string(), |node| node
            .as_uri()
            .unwrap()
            .to_string())
    );

    if let Some(uis) = p.uis() {
        println!("\tUIs:");

        for ui in uis {
            println!("\t\t{}", ui.uri().as_uri().unwrap());

            for tyep in ui.classes() {
                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
            }

            println!(
                "\t\t\tBinary: {}",
                ui.binary_uri().unwrap().as_uri().unwrap()
            );
            println!(
                "\t\t\tBundle: {}",
                ui.bundle_uri().unwrap().as_uri().unwrap()
            );
        }
    }

    print!("\tData URIs:         ");

    for (i, uri) in p.data_uris().iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }

        print!("{}", uri.as_uri().unwrap());
    }

    println!();

    let features = p.required_features();
    print!("\tRequired Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    let features = p.optional_features();
    print!("\tOptional Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    if let Some(data) = p.extension_data() {
        print!("\tExtension Data:    ");

        for (i, d) in data.iter().enumerate() {
            if i != 0 {
                print!("\n\t                   ");
            }
            print!("{}", d.as_uri().unwrap());
        }
        println!();
    }

    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
        if presets.count() != 0 {
            println!("\tPresets: ");

            for preset in presets {
                world.load_resource(&preset).unwrap();

                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
                if titles.count() > 0 {
                    if let Some(title) = titles.iter().next() {
                        println!("\t         {}", title.as_str().unwrap());
                    } else {
                        println!("\t         <{}>", preset.as_uri().unwrap());
                    }
                } else {
                    println!("\t         <{}>", preset.as_uri().unwrap());
                }
            }
        }
    }

    let num_ports = p.ports_count();
    let port_ranges = p.port_ranges_float();
    assert_eq!(num_ports, port_ranges.len());
    for (i, pr) in port_ranges.iter().enumerate() {
        print_port(p, i, pr, nodes);
    }
}
source

pub fn ports_count(&self) -> usize

Returns the number of ports for the plugin.

Examples found in repository?
examples/lv2info.rs (line 227)
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
    println!("{}\n", p.uri().as_uri().unwrap());
    println!("\tName:              {}", p.name().as_str().unwrap());
    println!(
        "\tClass:             {}",
        p.class().label().as_str().unwrap()
    );

    if let Some(val) = p.author_name() {
        println!("\tAuthor:            {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_email() {
        println!("\tAuthor Email:      {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_homepage() {
        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
    }

    if let Some(latency_port) = p.latency_port_index() {
        println!(
            "\tHas latency:       yes, reported by port {}",
            latency_port
        );
    } else {
        println!("\tHas latency:       no");
    }

    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
    println!(
        "\tBinary:            {}",
        p.library_uri().map_or("<none>".to_string(), |node| node
            .as_uri()
            .unwrap()
            .to_string())
    );

    if let Some(uis) = p.uis() {
        println!("\tUIs:");

        for ui in uis {
            println!("\t\t{}", ui.uri().as_uri().unwrap());

            for tyep in ui.classes() {
                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
            }

            println!(
                "\t\t\tBinary: {}",
                ui.binary_uri().unwrap().as_uri().unwrap()
            );
            println!(
                "\t\t\tBundle: {}",
                ui.bundle_uri().unwrap().as_uri().unwrap()
            );
        }
    }

    print!("\tData URIs:         ");

    for (i, uri) in p.data_uris().iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }

        print!("{}", uri.as_uri().unwrap());
    }

    println!();

    let features = p.required_features();
    print!("\tRequired Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    let features = p.optional_features();
    print!("\tOptional Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    if let Some(data) = p.extension_data() {
        print!("\tExtension Data:    ");

        for (i, d) in data.iter().enumerate() {
            if i != 0 {
                print!("\n\t                   ");
            }
            print!("{}", d.as_uri().unwrap());
        }
        println!();
    }

    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
        if presets.count() != 0 {
            println!("\tPresets: ");

            for preset in presets {
                world.load_resource(&preset).unwrap();

                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
                if titles.count() > 0 {
                    if let Some(title) = titles.iter().next() {
                        println!("\t         {}", title.as_str().unwrap());
                    } else {
                        println!("\t         <{}>", preset.as_uri().unwrap());
                    }
                } else {
                    println!("\t         <{}>", preset.as_uri().unwrap());
                }
            }
        }
    }

    let num_ports = p.ports_count();
    let port_ranges = p.port_ranges_float();
    assert_eq!(num_ports, port_ranges.len());
    for (i, pr) in port_ranges.iter().enumerate() {
        print_port(p, i, pr, nodes);
    }
}
source

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

Return the ranges for all ports.

Examples found in repository?
examples/lv2info.rs (line 228)
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
    println!("{}\n", p.uri().as_uri().unwrap());
    println!("\tName:              {}", p.name().as_str().unwrap());
    println!(
        "\tClass:             {}",
        p.class().label().as_str().unwrap()
    );

    if let Some(val) = p.author_name() {
        println!("\tAuthor:            {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_email() {
        println!("\tAuthor Email:      {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_homepage() {
        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
    }

    if let Some(latency_port) = p.latency_port_index() {
        println!(
            "\tHas latency:       yes, reported by port {}",
            latency_port
        );
    } else {
        println!("\tHas latency:       no");
    }

    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
    println!(
        "\tBinary:            {}",
        p.library_uri().map_or("<none>".to_string(), |node| node
            .as_uri()
            .unwrap()
            .to_string())
    );

    if let Some(uis) = p.uis() {
        println!("\tUIs:");

        for ui in uis {
            println!("\t\t{}", ui.uri().as_uri().unwrap());

            for tyep in ui.classes() {
                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
            }

            println!(
                "\t\t\tBinary: {}",
                ui.binary_uri().unwrap().as_uri().unwrap()
            );
            println!(
                "\t\t\tBundle: {}",
                ui.bundle_uri().unwrap().as_uri().unwrap()
            );
        }
    }

    print!("\tData URIs:         ");

    for (i, uri) in p.data_uris().iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }

        print!("{}", uri.as_uri().unwrap());
    }

    println!();

    let features = p.required_features();
    print!("\tRequired Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    let features = p.optional_features();
    print!("\tOptional Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    if let Some(data) = p.extension_data() {
        print!("\tExtension Data:    ");

        for (i, d) in data.iter().enumerate() {
            if i != 0 {
                print!("\n\t                   ");
            }
            print!("{}", d.as_uri().unwrap());
        }
        println!();
    }

    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
        if presets.count() != 0 {
            println!("\tPresets: ");

            for preset in presets {
                world.load_resource(&preset).unwrap();

                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
                if titles.count() > 0 {
                    if let Some(title) = titles.iter().next() {
                        println!("\t         {}", title.as_str().unwrap());
                    } else {
                        println!("\t         <{}>", preset.as_uri().unwrap());
                    }
                } else {
                    println!("\t         <{}>", preset.as_uri().unwrap());
                }
            }
        }
    }

    let num_ports = p.ports_count();
    let port_ranges = p.port_ranges_float();
    assert_eq!(num_ports, port_ranges.len());
    for (i, pr) in port_ranges.iter().enumerate() {
        print_port(p, i, pr, nodes);
    }
}
source

pub fn num_ports_of_class<I, N>(&self, classes: I) -> usizewhere 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)
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
    println!("{}\n", p.uri().as_uri().unwrap());
    println!("\tName:              {}", p.name().as_str().unwrap());
    println!(
        "\tClass:             {}",
        p.class().label().as_str().unwrap()
    );

    if let Some(val) = p.author_name() {
        println!("\tAuthor:            {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_email() {
        println!("\tAuthor Email:      {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_homepage() {
        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
    }

    if let Some(latency_port) = p.latency_port_index() {
        println!(
            "\tHas latency:       yes, reported by port {}",
            latency_port
        );
    } else {
        println!("\tHas latency:       no");
    }

    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
    println!(
        "\tBinary:            {}",
        p.library_uri().map_or("<none>".to_string(), |node| node
            .as_uri()
            .unwrap()
            .to_string())
    );

    if let Some(uis) = p.uis() {
        println!("\tUIs:");

        for ui in uis {
            println!("\t\t{}", ui.uri().as_uri().unwrap());

            for tyep in ui.classes() {
                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
            }

            println!(
                "\t\t\tBinary: {}",
                ui.binary_uri().unwrap().as_uri().unwrap()
            );
            println!(
                "\t\t\tBundle: {}",
                ui.bundle_uri().unwrap().as_uri().unwrap()
            );
        }
    }

    print!("\tData URIs:         ");

    for (i, uri) in p.data_uris().iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }

        print!("{}", uri.as_uri().unwrap());
    }

    println!();

    let features = p.required_features();
    print!("\tRequired Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    let features = p.optional_features();
    print!("\tOptional Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    if let Some(data) = p.extension_data() {
        print!("\tExtension Data:    ");

        for (i, d) in data.iter().enumerate() {
            if i != 0 {
                print!("\n\t                   ");
            }
            print!("{}", d.as_uri().unwrap());
        }
        println!();
    }

    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
        if presets.count() != 0 {
            println!("\tPresets: ");

            for preset in presets {
                world.load_resource(&preset).unwrap();

                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
                if titles.count() > 0 {
                    if let Some(title) = titles.iter().next() {
                        println!("\t         {}", title.as_str().unwrap());
                    } else {
                        println!("\t         <{}>", preset.as_uri().unwrap());
                    }
                } else {
                    println!("\t         <{}>", preset.as_uri().unwrap());
                }
            }
        }
    }

    let num_ports = p.ports_count();
    let port_ranges = p.port_ranges_float();
    assert_eq!(num_ports, port_ranges.len());
    for (i, pr) in port_ranges.iter().enumerate() {
        print_port(p, i, pr, nodes);
    }
}
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)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
fn print_port(p: &Plugin, index: usize, port_ranges: &FloatRanges, nodes: &Nodes) {
    let port = p.port_by_index(index);

    println!("\n\tPort {}:", index);

    if port.is_none() {
        println!("\t\tERROR: Illegal/nonexistent port");
        return;
    }

    let port = port.unwrap();

    print!("\t\tType:        ");

    for (i, value) in port.classes().iter().enumerate() {
        if i != 0 {
            print!("\n\t\t             ");
        }
        print!("{}", value.as_uri().unwrap());
    }

    if port.is_a(&nodes.event_class) {
        let supported = port.value(&nodes.supports_event_pred);
        if supported.count() > 0 {
            println!("\n\t\tSupported events:\n");
            for value in supported {
                println!("\t\t\t{}", value.as_uri().unwrap());
            }
        }
    }

    let points = port.scale_points();
    println!("\n\t\tScale Points:");
    for point in points {
        println!(
            "\t\t\t{} = \"{}\"",
            point.value().as_str().unwrap(),
            point.label().as_str().unwrap(),
        );
    }

    println!(
        "\n\t\tSymbol:      {}",
        port.symbol().unwrap().as_str().unwrap(),
    );

    println!(
        "\t\tName:        {}",
        port.name().unwrap().as_str().unwrap(),
    );

    let groups = port.value(&nodes.group_pred);
    if let Some(group) = groups.iter().next() {
        println!("\t\tGroup:       {}", group.as_str().unwrap(),);
    }

    let designations = port.value(&nodes.designation_pred);
    if let Some(designation) = designations.iter().next() {
        println!("\t\tDesignation: {}", designation.as_str().unwrap(),);
    }

    if port.is_a(&nodes.control_class) {
        let (min, max, def) = (port_ranges.min, port_ranges.max, port_ranges.default);

        if !min.is_nan() {
            println!("\t\tMinimum:     {}", min);
        }

        if !max.is_nan() {
            println!("\t\tMaximum:     {}", max);
        }

        if !def.is_nan() {
            println!("\t\tDefault:     {}", def);
        }

        let properties = port.properties();
        for (i, property) in properties.iter().enumerate() {
            if i != 0 {
                print!("\t\t             ");
            }
            println!("{}", property.as_uri().unwrap());
        }
        println!();
    }
}
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)
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
    println!("{}\n", p.uri().as_uri().unwrap());
    println!("\tName:              {}", p.name().as_str().unwrap());
    println!(
        "\tClass:             {}",
        p.class().label().as_str().unwrap()
    );

    if let Some(val) = p.author_name() {
        println!("\tAuthor:            {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_email() {
        println!("\tAuthor Email:      {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_homepage() {
        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
    }

    if let Some(latency_port) = p.latency_port_index() {
        println!(
            "\tHas latency:       yes, reported by port {}",
            latency_port
        );
    } else {
        println!("\tHas latency:       no");
    }

    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
    println!(
        "\tBinary:            {}",
        p.library_uri().map_or("<none>".to_string(), |node| node
            .as_uri()
            .unwrap()
            .to_string())
    );

    if let Some(uis) = p.uis() {
        println!("\tUIs:");

        for ui in uis {
            println!("\t\t{}", ui.uri().as_uri().unwrap());

            for tyep in ui.classes() {
                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
            }

            println!(
                "\t\t\tBinary: {}",
                ui.binary_uri().unwrap().as_uri().unwrap()
            );
            println!(
                "\t\t\tBundle: {}",
                ui.bundle_uri().unwrap().as_uri().unwrap()
            );
        }
    }

    print!("\tData URIs:         ");

    for (i, uri) in p.data_uris().iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }

        print!("{}", uri.as_uri().unwrap());
    }

    println!();

    let features = p.required_features();
    print!("\tRequired Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    let features = p.optional_features();
    print!("\tOptional Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    if let Some(data) = p.extension_data() {
        print!("\tExtension Data:    ");

        for (i, d) in data.iter().enumerate() {
            if i != 0 {
                print!("\n\t                   ");
            }
            print!("{}", d.as_uri().unwrap());
        }
        println!();
    }

    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
        if presets.count() != 0 {
            println!("\tPresets: ");

            for preset in presets {
                world.load_resource(&preset).unwrap();

                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
                if titles.count() > 0 {
                    if let Some(title) = titles.iter().next() {
                        println!("\t         {}", title.as_str().unwrap());
                    } else {
                        println!("\t         <{}>", preset.as_uri().unwrap());
                    }
                } else {
                    println!("\t         <{}>", preset.as_uri().unwrap());
                }
            }
        }
    }

    let num_ports = p.ports_count();
    let port_ranges = p.port_ranges_float();
    assert_eq!(num_ports, port_ranges.len());
    for (i, pr) in port_ranges.iter().enumerate() {
        print_port(p, i, pr, nodes);
    }
}
source

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

Returns the author email if present.

Examples found in repository?
examples/lv2info.rs (line 113)
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
    println!("{}\n", p.uri().as_uri().unwrap());
    println!("\tName:              {}", p.name().as_str().unwrap());
    println!(
        "\tClass:             {}",
        p.class().label().as_str().unwrap()
    );

    if let Some(val) = p.author_name() {
        println!("\tAuthor:            {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_email() {
        println!("\tAuthor Email:      {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_homepage() {
        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
    }

    if let Some(latency_port) = p.latency_port_index() {
        println!(
            "\tHas latency:       yes, reported by port {}",
            latency_port
        );
    } else {
        println!("\tHas latency:       no");
    }

    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
    println!(
        "\tBinary:            {}",
        p.library_uri().map_or("<none>".to_string(), |node| node
            .as_uri()
            .unwrap()
            .to_string())
    );

    if let Some(uis) = p.uis() {
        println!("\tUIs:");

        for ui in uis {
            println!("\t\t{}", ui.uri().as_uri().unwrap());

            for tyep in ui.classes() {
                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
            }

            println!(
                "\t\t\tBinary: {}",
                ui.binary_uri().unwrap().as_uri().unwrap()
            );
            println!(
                "\t\t\tBundle: {}",
                ui.bundle_uri().unwrap().as_uri().unwrap()
            );
        }
    }

    print!("\tData URIs:         ");

    for (i, uri) in p.data_uris().iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }

        print!("{}", uri.as_uri().unwrap());
    }

    println!();

    let features = p.required_features();
    print!("\tRequired Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    let features = p.optional_features();
    print!("\tOptional Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    if let Some(data) = p.extension_data() {
        print!("\tExtension Data:    ");

        for (i, d) in data.iter().enumerate() {
            if i != 0 {
                print!("\n\t                   ");
            }
            print!("{}", d.as_uri().unwrap());
        }
        println!();
    }

    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
        if presets.count() != 0 {
            println!("\tPresets: ");

            for preset in presets {
                world.load_resource(&preset).unwrap();

                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
                if titles.count() > 0 {
                    if let Some(title) = titles.iter().next() {
                        println!("\t         {}", title.as_str().unwrap());
                    } else {
                        println!("\t         <{}>", preset.as_uri().unwrap());
                    }
                } else {
                    println!("\t         <{}>", preset.as_uri().unwrap());
                }
            }
        }
    }

    let num_ports = p.ports_count();
    let port_ranges = p.port_ranges_float();
    assert_eq!(num_ports, port_ranges.len());
    for (i, pr) in port_ranges.iter().enumerate() {
        print_port(p, i, pr, nodes);
    }
}
source

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

Examples found in repository?
examples/lv2info.rs (line 117)
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
    println!("{}\n", p.uri().as_uri().unwrap());
    println!("\tName:              {}", p.name().as_str().unwrap());
    println!(
        "\tClass:             {}",
        p.class().label().as_str().unwrap()
    );

    if let Some(val) = p.author_name() {
        println!("\tAuthor:            {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_email() {
        println!("\tAuthor Email:      {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_homepage() {
        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
    }

    if let Some(latency_port) = p.latency_port_index() {
        println!(
            "\tHas latency:       yes, reported by port {}",
            latency_port
        );
    } else {
        println!("\tHas latency:       no");
    }

    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
    println!(
        "\tBinary:            {}",
        p.library_uri().map_or("<none>".to_string(), |node| node
            .as_uri()
            .unwrap()
            .to_string())
    );

    if let Some(uis) = p.uis() {
        println!("\tUIs:");

        for ui in uis {
            println!("\t\t{}", ui.uri().as_uri().unwrap());

            for tyep in ui.classes() {
                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
            }

            println!(
                "\t\t\tBinary: {}",
                ui.binary_uri().unwrap().as_uri().unwrap()
            );
            println!(
                "\t\t\tBundle: {}",
                ui.bundle_uri().unwrap().as_uri().unwrap()
            );
        }
    }

    print!("\tData URIs:         ");

    for (i, uri) in p.data_uris().iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }

        print!("{}", uri.as_uri().unwrap());
    }

    println!();

    let features = p.required_features();
    print!("\tRequired Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    let features = p.optional_features();
    print!("\tOptional Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    if let Some(data) = p.extension_data() {
        print!("\tExtension Data:    ");

        for (i, d) in data.iter().enumerate() {
            if i != 0 {
                print!("\n\t                   ");
            }
            print!("{}", d.as_uri().unwrap());
        }
        println!();
    }

    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
        if presets.count() != 0 {
            println!("\tPresets: ");

            for preset in presets {
                world.load_resource(&preset).unwrap();

                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
                if titles.count() > 0 {
                    if let Some(title) = titles.iter().next() {
                        println!("\t         {}", title.as_str().unwrap());
                    } else {
                        println!("\t         <{}>", preset.as_uri().unwrap());
                    }
                } else {
                    println!("\t         <{}>", preset.as_uri().unwrap());
                }
            }
        }
    }

    let num_ports = p.ports_count();
    let port_ranges = p.port_ranges_float();
    assert_eq!(num_ports, port_ranges.len());
    for (i, pr) in port_ranges.iter().enumerate() {
        print_port(p, i, pr, nodes);
    }
}
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)
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
    println!("{}\n", p.uri().as_uri().unwrap());
    println!("\tName:              {}", p.name().as_str().unwrap());
    println!(
        "\tClass:             {}",
        p.class().label().as_str().unwrap()
    );

    if let Some(val) = p.author_name() {
        println!("\tAuthor:            {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_email() {
        println!("\tAuthor Email:      {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_homepage() {
        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
    }

    if let Some(latency_port) = p.latency_port_index() {
        println!(
            "\tHas latency:       yes, reported by port {}",
            latency_port
        );
    } else {
        println!("\tHas latency:       no");
    }

    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
    println!(
        "\tBinary:            {}",
        p.library_uri().map_or("<none>".to_string(), |node| node
            .as_uri()
            .unwrap()
            .to_string())
    );

    if let Some(uis) = p.uis() {
        println!("\tUIs:");

        for ui in uis {
            println!("\t\t{}", ui.uri().as_uri().unwrap());

            for tyep in ui.classes() {
                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
            }

            println!(
                "\t\t\tBinary: {}",
                ui.binary_uri().unwrap().as_uri().unwrap()
            );
            println!(
                "\t\t\tBundle: {}",
                ui.bundle_uri().unwrap().as_uri().unwrap()
            );
        }
    }

    print!("\tData URIs:         ");

    for (i, uri) in p.data_uris().iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }

        print!("{}", uri.as_uri().unwrap());
    }

    println!();

    let features = p.required_features();
    print!("\tRequired Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    let features = p.optional_features();
    print!("\tOptional Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    if let Some(data) = p.extension_data() {
        print!("\tExtension Data:    ");

        for (i, d) in data.iter().enumerate() {
            if i != 0 {
                print!("\n\t                   ");
            }
            print!("{}", d.as_uri().unwrap());
        }
        println!();
    }

    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
        if presets.count() != 0 {
            println!("\tPresets: ");

            for preset in presets {
                world.load_resource(&preset).unwrap();

                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
                if titles.count() > 0 {
                    if let Some(title) = titles.iter().next() {
                        println!("\t         {}", title.as_str().unwrap());
                    } else {
                        println!("\t         <{}>", preset.as_uri().unwrap());
                    }
                } else {
                    println!("\t         <{}>", preset.as_uri().unwrap());
                }
            }
        }
    }

    let num_ports = p.ports_count();
    let port_ranges = p.port_ranges_float();
    assert_eq!(num_ports, port_ranges.len());
    for (i, pr) in port_ranges.iter().enumerate() {
        print_port(p, i, pr, nodes);
    }
}
source

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

Get all UIs for plugin.

Examples found in repository?
examples/lv2info.rs (line 139)
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
fn print_plugin(world: &World, p: &Plugin, nodes: &Nodes) {
    println!("{}\n", p.uri().as_uri().unwrap());
    println!("\tName:              {}", p.name().as_str().unwrap());
    println!(
        "\tClass:             {}",
        p.class().label().as_str().unwrap()
    );

    if let Some(val) = p.author_name() {
        println!("\tAuthor:            {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_email() {
        println!("\tAuthor Email:      {}", val.as_str().unwrap());
    }

    if let Some(val) = p.author_homepage() {
        println!("\tAuthor Homepage:   {}", val.as_uri().unwrap());
    }

    if let Some(latency_port) = p.latency_port_index() {
        println!(
            "\tHas latency:       yes, reported by port {}",
            latency_port
        );
    } else {
        println!("\tHas latency:       no");
    }

    println!("\tBundle:            {}", p.bundle_uri().as_uri().unwrap());
    println!(
        "\tBinary:            {}",
        p.library_uri().map_or("<none>".to_string(), |node| node
            .as_uri()
            .unwrap()
            .to_string())
    );

    if let Some(uis) = p.uis() {
        println!("\tUIs:");

        for ui in uis {
            println!("\t\t{}", ui.uri().as_uri().unwrap());

            for tyep in ui.classes() {
                println!("\t\t\tClass:  {}", tyep.as_uri().unwrap());
            }

            println!(
                "\t\t\tBinary: {}",
                ui.binary_uri().unwrap().as_uri().unwrap()
            );
            println!(
                "\t\t\tBundle: {}",
                ui.bundle_uri().unwrap().as_uri().unwrap()
            );
        }
    }

    print!("\tData URIs:         ");

    for (i, uri) in p.data_uris().iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }

        print!("{}", uri.as_uri().unwrap());
    }

    println!();

    let features = p.required_features();
    print!("\tRequired Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    let features = p.optional_features();
    print!("\tOptional Features: ");

    for (i, feature) in features.iter().enumerate() {
        if i != 0 {
            print!("\n\t                   ");
        }
        print!("{}", feature.as_uri().unwrap());
    }
    println!();

    if let Some(data) = p.extension_data() {
        print!("\tExtension Data:    ");

        for (i, d) in data.iter().enumerate() {
            if i != 0 {
                print!("\n\t                   ");
            }
            print!("{}", d.as_uri().unwrap());
        }
        println!();
    }

    if let Some(presets) = p.related(Some(&nodes.preset_class)) {
        if presets.count() != 0 {
            println!("\tPresets: ");

            for preset in presets {
                world.load_resource(&preset).unwrap();

                let titles = world.find_nodes(Some(&preset), &nodes.label_pred, None);
                if titles.count() > 0 {
                    if let Some(title) = titles.iter().next() {
                        println!("\t         {}", title.as_str().unwrap());
                    } else {
                        println!("\t         <{}>", preset.as_uri().unwrap());
                    }
                } else {
                    println!("\t         <{}>", preset.as_uri().unwrap());
                }
            }
        }
    }

    let num_ports = p.ports_count();
    let port_ranges = p.port_ranges_float();
    assert_eq!(num_ports, port_ranges.len());
    for (i, pr) in port_ranges.iter().enumerate() {
        print_port(p, i, pr, nodes);
    }
}
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 copy 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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.