drumkv1 icon indicating copy to clipboard operation
drumkv1 copied to clipboard

How does element picker work?

Open AnClark opened this issue 2 years ago • 3 comments

Hi, Rui!

I'm porting DrumkV1 to DPF, DISTRHO Plugin Framework. And I encountered a problem:

In official LV2 version, when I pick an element from the element list (the listbox on the left of sample view), sample view and other controllers changes corresponding to the element's params.

But in my implementation, things are not what I wish. No matter how I touch the element list, UI won't change.

So I wonder how does the element list work. Does it relate to features of LV2?

My repo: https://github.com/anclark/drumkv1/tree/dpf-implementation

AnClark avatar Jan 19 '23 10:01 AnClark

it relies on lv2 instance-access, something I guess it's banned on the DPF , last time i've checked, eons ago

rncbc avatar Jan 19 '23 17:01 rncbc

Actually, in DPF, I can use instance-access with DPF_PLUGIN_WANTS_DIRECT_ACCESS activated:

https://github.com/AnClark/drumkv1/blob/5b92448ecd184641bc23eefacb8ca804251eb54b/src/DistrhoPluginInfo.h#L42


In your official LV2 implementation (drumkv1_lv2.cpp or drumkv1_lv2ui.cpp), I wonder where the plugin updates the element params.

AnClark avatar Jan 20 '23 00:01 AnClark

Seems that this line relates to that feature:

https://github.com/rncbc/drumkv1/blob/86e159cc2dd470601dd4261f4013067f6558555e/src/drumkv1_lv2.cpp#L823

In my implementation, I directly call it in drumkv1_dpf::selectSample(int) in drumkv1_dpf.cpp, like this:

void drumkv1_dpf::selectSample (int key)
{
	fprintf(stderr, ">> Trigger selectSample, key = %d\n", key);
	drumkv1::setCurrentElementEx(key);
}

However, it still does not work as what I wish.

AnClark avatar Jan 20 '23 00:01 AnClark