aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/control.c24
-rw-r--r--src/control.h24
-rw-r--r--src/jack.c6
-rw-r--r--src/jalv.c6
-rw-r--r--src/jalv_console.c2
-rw-r--r--src/jalv_gtk.c2
-rw-r--r--src/process_setup.c1
-rw-r--r--src/state.c10
8 files changed, 38 insertions, 37 deletions
diff --git a/src/control.c b/src/control.c
index b0392e3..41a2b70 100644
--- a/src/control.c
+++ b/src/control.c
@@ -32,13 +32,13 @@ scale_point_cmp(const ScalePoint* a, const ScalePoint* b)
}
ControlID*
-new_port_control(LilvWorld* const world,
- const LilvPlugin* const plugin,
- const LilvPort* const port,
- uint32_t port_index,
- const float sample_rate,
- const JalvNodes* const nodes,
- LV2_Atom_Forge* const forge)
+new_port_control(LilvWorld* const world,
+ const LilvPlugin* const plugin,
+ const LilvPort* const port,
+ uint32_t port_index,
+ const float sample_rate,
+ const JalvNodes* const nodes,
+ const LV2_Atom_Forge* const forge)
{
ControlID* id = (ControlID*)calloc(1, sizeof(ControlID));
@@ -121,11 +121,11 @@ has_range(LilvWorld* const world,
}
ControlID*
-new_property_control(LilvWorld* const world,
- const LilvNode* property,
- const JalvNodes* const nodes,
- LV2_URID_Map* const map,
- LV2_Atom_Forge* const forge)
+new_property_control(LilvWorld* const world,
+ const LilvNode* property,
+ const JalvNodes* const nodes,
+ LV2_URID_Map* const map,
+ const LV2_Atom_Forge* const forge)
{
ControlID* id = (ControlID*)calloc(1, sizeof(ControlID));
id->type = PROPERTY;
diff --git a/src/control.h b/src/control.h
index a5acf40..0109e60 100644
--- a/src/control.h
+++ b/src/control.h
@@ -64,21 +64,21 @@ typedef struct {
/// Create a new ID for a control port
ControlID*
-new_port_control(LilvWorld* world,
- const LilvPlugin* plugin,
- const LilvPort* port,
- uint32_t port_index,
- float sample_rate,
- const JalvNodes* nodes,
- LV2_Atom_Forge* forge);
+new_port_control(LilvWorld* world,
+ const LilvPlugin* plugin,
+ const LilvPort* port,
+ uint32_t port_index,
+ float sample_rate,
+ const JalvNodes* nodes,
+ const LV2_Atom_Forge* forge);
/// Create a new ID for a property-based parameter
ControlID*
-new_property_control(LilvWorld* world,
- const LilvNode* property,
- const JalvNodes* nodes,
- LV2_URID_Map* map,
- LV2_Atom_Forge* forge);
+new_property_control(LilvWorld* world,
+ const LilvNode* property,
+ const JalvNodes* nodes,
+ LV2_URID_Map* map,
+ const LV2_Atom_Forge* forge);
/// Free a control allocated with new_port_control() or new_property_control()
void
diff --git a/src/jack.c b/src/jack.c
index e08b861..6228dfb 100644
--- a/src/jack.c
+++ b/src/jack.c
@@ -102,8 +102,8 @@ static int
process_silent(JalvProcess* const proc, const jack_nframes_t nframes)
{
for (uint32_t p = 0U; p < proc->num_ports; ++p) {
- JalvProcessPort* const port = &proc->ports[p];
- jack_port_t* const jport = (jack_port_t*)proc->ports[p].sys_port;
+ const JalvProcessPort* const port = &proc->ports[p];
+ jack_port_t* const jport = (jack_port_t*)proc->ports[p].sys_port;
if (jport && port->flow == FLOW_OUTPUT) {
void* const buf = jack_port_get_buffer(jport, nframes);
if (port->type == TYPE_EVENT) {
@@ -264,7 +264,7 @@ latency_cb(const jack_latency_callback_mode_t mode, void* const data)
{
// Calculate latency assuming all ports depend on each other
- JalvBackend* const backend = (JalvBackend*)data;
+ const JalvBackend* const backend = (JalvBackend*)data;
const JalvProcess* const proc = backend->process;
const PortFlow flow =
((mode == JackCaptureLatency) ? FLOW_INPUT : FLOW_OUTPUT);
diff --git a/src/jalv.c b/src/jalv.c
index a596b86..20cac1f 100644
--- a/src/jalv.c
+++ b/src/jalv.c
@@ -364,7 +364,7 @@ void
jalv_ui_instantiate(Jalv* jalv, const char* native_ui_type, void* parent)
{
#if USE_SUIL
- LilvInstance* const instance = jalv->process.instance;
+ const LilvInstance* const instance = jalv->process.instance;
jalv->ui_host =
suil_host_new(jalv_send_to_plugin, jalv_ui_port_index, NULL, NULL);
@@ -638,8 +638,8 @@ jalv_init_features(Jalv* const jalv)
static void
jalv_init_ui_settings(Jalv* const jalv)
{
- JalvOptions* const opts = &jalv->opts;
- JalvSettings* const settings = &jalv->settings;
+ const JalvOptions* const opts = &jalv->opts;
+ JalvSettings* const settings = &jalv->settings;
if (!settings->ring_size) {
/* The UI ring is fed by plugin output ports (usually one), and the UI
diff --git a/src/jalv_console.c b/src/jalv_console.c
index fba3aa9..fe92cd7 100644
--- a/src/jalv_console.c
+++ b/src/jalv_console.c
@@ -257,7 +257,7 @@ jalv_process_command(Jalv* jalv, const char* cmd)
}
} else if (sscanf(cmd, "set %1023[a-zA-Z0-9_] %f", sym, &value) == 2 ||
sscanf(cmd, "%1023[a-zA-Z0-9_] = %f", sym, &value) == 2) {
- JalvPort* const port = jalv_port_by_symbol(jalv, sym);
+ const JalvPort* const port = jalv_port_by_symbol(jalv, sym);
if (port) {
jalv->process.controls_buf[port->index] = value;
print_control_port(jalv, port, value);
diff --git a/src/jalv_gtk.c b/src/jalv_gtk.c
index 5a1c393..16cff34 100644
--- a/src/jalv_gtk.c
+++ b/src/jalv_gtk.c
@@ -586,7 +586,7 @@ differ_enough(float a, float b)
static void
set_float_control(const ControlID* control, float value)
{
- LV2_Atom_Forge* const forge = &s_jalv->forge;
+ const LV2_Atom_Forge* const forge = &s_jalv->forge;
if (control->value_type == forge->Int) {
const int32_t ival = lrintf(value);
set_control(control, sizeof(ival), forge->Int, &ival);
diff --git a/src/process_setup.c b/src/process_setup.c
index 66078a9..169ddcd 100644
--- a/src/process_setup.c
+++ b/src/process_setup.c
@@ -180,6 +180,7 @@ jalv_process_port_init(JalvProcessPort* const port,
LilvNode* const name = lilv_port_get_name(lilv_plugin, lilv_port);
port->symbol = symbol ? jalv_strdup(lilv_node_as_string(symbol)) : NULL;
port->label = name ? jalv_strdup(lilv_node_as_string(name)) : NULL;
+ lilv_node_free(name);
// Set buffer size
LilvNode* const min_size =
diff --git a/src/state.c b/src/state.c
index d910150..472244e 100644
--- a/src/state.c
+++ b/src/state.c
@@ -42,8 +42,8 @@ get_port_value(const char* port_symbol,
uint32_t* size,
uint32_t* type)
{
- Jalv* const jalv = (Jalv*)user_data;
- JalvPort* const port = jalv_port_by_symbol(jalv, port_symbol);
+ Jalv* const jalv = (Jalv*)user_data;
+ const JalvPort* const port = jalv_port_by_symbol(jalv, port_symbol);
if (port && port->flow == FLOW_INPUT && port->type == TYPE_CONTROL) {
*size = sizeof(float);
*type = jalv->forge.Float;
@@ -130,9 +130,9 @@ set_port_value(const char* port_symbol,
uint32_t ZIX_UNUSED(size),
uint32_t type)
{
- Jalv* const jalv = (Jalv*)user_data;
- JalvProcess* const proc = &jalv->process;
- JalvPort* const port = jalv_port_by_symbol(jalv, port_symbol);
+ Jalv* const jalv = (Jalv*)user_data;
+ JalvProcess* const proc = &jalv->process;
+ const JalvPort* const port = jalv_port_by_symbol(jalv, port_symbol);
if (!port) {
jalv_log(JALV_LOG_ERR, "Preset port `%s' is missing\n", port_symbol);
return;