@@ -84,6 +84,7 @@ typedef unsigned int uint;
84
84
#include <lv2/uri-map/uri-map.h>
85
85
#include <lv2/worker/worker.h>
86
86
#include "lv2/control-input-port-change-request.h"
87
+ #include "lv2/kxstudio-properties.h"
87
88
#include "lv2/lv2-hmi.h"
88
89
#include "lv2/mod-license.h"
89
90
@@ -147,8 +148,6 @@ typedef struct {
147
148
148
149
#define LILV_NS_MOD "http://moddevices.com/ns/mod#"
149
150
150
- #define KX_TIME__TicksPerBeat "http://kxstudio.sf.net/ns/lv2ext/props#TimePositionTicksPerBeat"
151
-
152
151
// custom jack flag used for cv
153
152
// needed because we prefer jack2 which doesn't have metadata yet
154
153
#define JackPortIsControlVoltage 0x100
@@ -413,6 +412,7 @@ typedef struct EFFECT_T {
413
412
int32_t control_index ; // control/event input
414
413
int32_t enabled_index ;
415
414
int32_t freewheel_index ;
415
+ int32_t reset_index ;
416
416
int32_t bpb_index ;
417
417
int32_t bpm_index ;
418
418
int32_t speed_index ;
@@ -504,6 +504,7 @@ typedef struct LILV_NODES_T {
504
504
LilvNode * preset ;
505
505
LilvNode * rawMIDIClockAccess ;
506
506
LilvNode * rdfs_range ;
507
+ LilvNode * reset ;
507
508
LilvNode * sample_rate ;
508
509
LilvNode * state_interface ;
509
510
LilvNode * state_load_default_state ;
@@ -4149,6 +4150,7 @@ int effects_init(void* client)
4149
4150
effect -> control_index = -1 ;
4150
4151
effect -> enabled_index = -1 ;
4151
4152
effect -> freewheel_index = -1 ;
4153
+ effect -> reset_index = -1 ;
4152
4154
effect -> bpb_index = -1 ;
4153
4155
effect -> bpm_index = -1 ;
4154
4156
effect -> speed_index = -1 ;
@@ -4255,6 +4257,7 @@ int effects_init(void* client)
4255
4257
g_lilv_nodes .preset = lilv_new_uri (g_lv2_data , LV2_PRESETS__Preset );
4256
4258
g_lilv_nodes .rawMIDIClockAccess = lilv_new_uri (g_lv2_data , LILV_NS_MOD "rawMIDIClockAccess" );
4257
4259
g_lilv_nodes .rdfs_range = lilv_new_uri (g_lv2_data , LILV_NS_RDFS "range" );
4260
+ g_lilv_nodes .reset = lilv_new_uri (g_lv2_data , LV2_KXSTUDIO_PROPERTIES__Reset );
4258
4261
g_lilv_nodes .sample_rate = lilv_new_uri (g_lv2_data , LV2_CORE__sampleRate );
4259
4262
g_lilv_nodes .state_interface = lilv_new_uri (g_lv2_data , LV2_STATE__interface );
4260
4263
g_lilv_nodes .state_load_default_state = lilv_new_uri (g_lv2_data , LV2_STATE__loadDefaultState );
@@ -4320,7 +4323,7 @@ int effects_init(void* client)
4320
4323
g_urids .time_beatUnit = urid_to_id (g_symap , LV2_TIME__beatUnit );
4321
4324
g_urids .time_beatsPerBar = urid_to_id (g_symap , LV2_TIME__beatsPerBar );
4322
4325
g_urids .time_beatsPerMinute = urid_to_id (g_symap , LV2_TIME__beatsPerMinute );
4323
- g_urids .time_ticksPerBeat = urid_to_id (g_symap , KX_TIME__TicksPerBeat );
4326
+ g_urids .time_ticksPerBeat = urid_to_id (g_symap , LV2_KXSTUDIO_PROPERTIES__TimePositionTicksPerBeat );
4324
4327
g_urids .time_frame = urid_to_id (g_symap , LV2_TIME__frame );
4325
4328
g_urids .time_speed = urid_to_id (g_symap , LV2_TIME__speed );
4326
4329
@@ -4601,6 +4604,7 @@ int effects_finish(int close_client)
4601
4604
lilv_node_free (g_lilv_nodes .preset );
4602
4605
lilv_node_free (g_lilv_nodes .rawMIDIClockAccess );
4603
4606
lilv_node_free (g_lilv_nodes .rdfs_range );
4607
+ lilv_node_free (g_lilv_nodes .reset );
4604
4608
lilv_node_free (g_lilv_nodes .sample_rate );
4605
4609
lilv_node_free (g_lilv_nodes .state_interface );
4606
4610
lilv_node_free (g_lilv_nodes .state_load_default_state );
@@ -5207,7 +5211,9 @@ int effects_add(const char *uri, int instance, int activate)
5207
5211
5208
5212
// special ports
5209
5213
{
5210
- const LilvPort * enabled_port = lilv_plugin_get_port_by_designation (plugin , g_lilv_nodes .input , g_lilv_nodes .enabled );
5214
+ const LilvPort * enabled_port = lilv_plugin_get_port_by_designation (plugin ,
5215
+ g_lilv_nodes .input ,
5216
+ g_lilv_nodes .enabled );
5211
5217
if (enabled_port )
5212
5218
{
5213
5219
effect -> enabled_index = lilv_port_get_index (plugin , enabled_port );
@@ -5218,7 +5224,9 @@ int effects_add(const char *uri, int instance, int activate)
5218
5224
effect -> enabled_index = -1 ;
5219
5225
}
5220
5226
5221
- const LilvPort * freewheel_port = lilv_plugin_get_port_by_designation (plugin , g_lilv_nodes .input , g_lilv_nodes .freeWheeling );
5227
+ const LilvPort * freewheel_port = lilv_plugin_get_port_by_designation (plugin ,
5228
+ g_lilv_nodes .input ,
5229
+ g_lilv_nodes .freeWheeling );
5222
5230
if (freewheel_port )
5223
5231
{
5224
5232
effect -> freewheel_index = lilv_port_get_index (plugin , freewheel_port );
@@ -5229,7 +5237,22 @@ int effects_add(const char *uri, int instance, int activate)
5229
5237
effect -> freewheel_index = -1 ;
5230
5238
}
5231
5239
5232
- const LilvPort * bpb_port = lilv_plugin_get_port_by_designation (plugin , g_lilv_nodes .input , g_lilv_nodes .timeBeatsPerBar );
5240
+ const LilvPort * reset_port = lilv_plugin_get_port_by_designation (plugin ,
5241
+ g_lilv_nodes .input ,
5242
+ g_lilv_nodes .reset );
5243
+ if (reset_port )
5244
+ {
5245
+ effect -> reset_index = lilv_port_get_index (plugin , reset_port );
5246
+ * (effect -> ports [effect -> reset_index ]-> buffer ) = 0.0f ;
5247
+ }
5248
+ else
5249
+ {
5250
+ effect -> reset_index = -1 ;
5251
+ }
5252
+
5253
+ const LilvPort * bpb_port = lilv_plugin_get_port_by_designation (plugin ,
5254
+ g_lilv_nodes .input ,
5255
+ g_lilv_nodes .timeBeatsPerBar );
5233
5256
if (bpb_port )
5234
5257
{
5235
5258
effect -> bpb_index = lilv_port_get_index (plugin , bpb_port );
@@ -5240,7 +5263,9 @@ int effects_add(const char *uri, int instance, int activate)
5240
5263
effect -> bpb_index = -1 ;
5241
5264
}
5242
5265
5243
- const LilvPort * bpm_port = lilv_plugin_get_port_by_designation (plugin , g_lilv_nodes .input , g_lilv_nodes .timeBeatsPerMinute );
5266
+ const LilvPort * bpm_port = lilv_plugin_get_port_by_designation (plugin ,
5267
+ g_lilv_nodes .input ,
5268
+ g_lilv_nodes .timeBeatsPerMinute );
5244
5269
if (bpm_port )
5245
5270
{
5246
5271
effect -> bpm_index = lilv_port_get_index (plugin , bpm_port );
@@ -5251,7 +5276,9 @@ int effects_add(const char *uri, int instance, int activate)
5251
5276
effect -> bpm_index = -1 ;
5252
5277
}
5253
5278
5254
- const LilvPort * speed_port = lilv_plugin_get_port_by_designation (plugin , g_lilv_nodes .input , g_lilv_nodes .timeSpeed );
5279
+ const LilvPort * speed_port = lilv_plugin_get_port_by_designation (plugin ,
5280
+ g_lilv_nodes .input ,
5281
+ g_lilv_nodes .timeSpeed );
5255
5282
if (speed_port )
5256
5283
{
5257
5284
effect -> speed_index = lilv_port_get_index (plugin , speed_port );
@@ -5597,6 +5624,10 @@ int effects_preset_load(int effect_id, const char *uri)
5597
5624
{
5598
5625
* (effect -> ports [effect -> freewheel_index ]-> buffer ) = 0.0f ;
5599
5626
}
5627
+ if (effect -> reset_index >= 0 )
5628
+ {
5629
+ * (effect -> ports [effect -> reset_index ]-> buffer ) = 0.0f ;
5630
+ }
5600
5631
if (effect -> bpb_index >= 0 )
5601
5632
{
5602
5633
* (effect -> ports [effect -> bpb_index ]-> buffer ) = g_transport_bpb ;
0 commit comments