Skip to content

SwitchTrigger4 save/restore channel as LV2_State#12

Open
Janjhl wants to merge 7 commits intomasterfrom
SwitchTrigger4_SaveState
Open

SwitchTrigger4 save/restore channel as LV2_State#12
Janjhl wants to merge 7 commits intomasterfrom
SwitchTrigger4_SaveState

Conversation

@Janjhl
Copy link

@Janjhl Janjhl commented May 19, 2022

No description provided.

@Janjhl Janjhl requested a review from falkTX May 19, 2022 11:58
/**********************************************************************************************************************************************************/

#define PLUGIN_URI "http://moddevices.com/plugins/mod-devel/SwitchTrigger4"
#define CHANNEL_URI "http://moddevices.com/plugins/mod-devel/SwitchTrigger4#channel>"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is an extra > at the end, please remove it

@@ -1,16 +1,26 @@
#include <stdlib.h>
#include <stdlib.h>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line changed for no reason


/**********************************************************************************************************************************************************/

static LV2_State_Status channel_save(LV2_Handle handle, LV2_State_Store_Function store, LV2_State_Handle state_handle, uint32_t flags, const LV2_Feature* const* features);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in order to make things consistent, these 2 calls should go inside the class

plugin->URIDs.atom_Path = plugin->urid_map->map(plugin->urid_map->handle,LV2_ATOM__Path);
plugin->URIDs.switch_channel = plugin->urid_map->map(plugin->urid_map->handle,CHANNEL_URI);
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a break after handling urid map, as there is no need to check any more features afterwards


plug:channel
a lv2:Parameter ;
rdfs:label "channel" ;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should have a default, min and max value. same semantics as a regular control port

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that said, exposing such a parameter is a bad idea. we would need an atom input and output port to get things integrated in the host properly. which is kinda pointless in this plugin.
so best is to not have such parameter exposed at all, as it complicates things

""";

lv2:requiredFeature urid:map ;
lv2:optionalFeature state:loadDefaultState ;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to define the default state if you want to have this property.

];

patch:writable plug:channel ;
patch:state plug:channel ;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not a valid property

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants