SBoard/src/main/java/jlilv/LilvPort.java

123 lines
3.5 KiB
Java

package jlilv;
import jlilv.c.CObject;
public class LilvPort extends CObject {
long pluginPointer;
/**
Get the RDF node of `port`.
Ports nodes may be may be URIs or blank nodes.
@return A shared node which must not be modified or freed.
*/
public native LilvNode getNode();
/**
Port analog of lilv_plugin_get_value().
*/
public native LilvCollection<LilvNode> getValue(LilvNode predicate);
/**
Get a single property value of a port.
This is equivalent to lilv_nodes_get_first(lilv_port_get_value(...)) but is
simpler to use in the common case of only caring about one value. The
caller is responsible for freeing the returned node.
*/
public native LilvNode get(LilvNode predicate);
/**
Return the LV2 port properties of a port.
*/
public native LilvCollection<LilvNode> getProperties();
/**
Return whether a port has a certain property.
*/
public native boolean hasProperty(LilvNode property);
/**
Return whether a port supports a certain event type.
More precisely, this returns true iff the port has an atom:supports or an
ev:supportsEvent property with `event_type` as the value.
*/
public native boolean supportsEvent(LilvNode event_type);
/**
Get the index of a port.
The index is only valid for the life of the plugin and may change between
versions. For a stable identifier, use the symbol.
*/
public native int getIndex();
/**
Get the symbol of a port.
The 'symbol' is a short string, a valid C identifier.
Returned value is owned by `port` and must not be freed.
*/
public native LilvNode getSymbol();
/**
Get the name of a port.
This is guaranteed to return the untranslated name (the doap:name in the
data file without a language tag). Returned value must be freed by
the caller.
*/
public native LilvNode getName();
/**
Get all the classes of a port.
This can be used to determine if a port is an input, output, audio,
control, midi, etc, etc, though it's simpler to use lilv_port_is_a().
The returned list does not include lv2:Port, which is implied.
Returned value is shared and must not be destroyed by caller.
*/
public native LilvCollection<LilvNode> getClasses();
/**
Determine if a port is of a given class (input, output, audio, etc).
For convenience/performance/extensibility reasons, hosts are expected to
create a LilvNode for each port class they "care about". Well-known type
URI strings like `LILV_URI_INPUT_PORT` are defined for convenience, but
this function is designed so that Lilv is usable with any port types
without requiring explicit support in Lilv.
*/
public native boolean isA(LilvNode port_class);
/**
Get the default, minimum, and maximum values of a port.
`def`, `min`, and `max` are outputs, pass pointers to uninitialized
LilvNode* variables. These will be set to point at new values (which must
be freed by the caller using lilv_node_free()), or NULL if the value does
not exist.
*/
public native PortValues getRange();
public class PortValues {
LilvNode def;
LilvNode min;
LilvNode max;
}
/**
Get the scale points (enumeration values) of a port.
This returns a collection of 'interesting' named values of a port, which for
example might be appropriate entries for a value selector in a UI.
Returned value may be NULL if `port` has no scale points, otherwise it
must be freed by caller with lilv_scale_points_free().
*/
public native LilvCollection<LilvScalePoint> getScalePoints();
}