Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does element picker work? #46

Open
AnClark opened this issue Jan 19, 2023 · 3 comments
Open

How does element picker work? #46

AnClark opened this issue Jan 19, 2023 · 3 comments

Comments

@AnClark
Copy link
Contributor

AnClark commented Jan 19, 2023

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

@rncbc
Copy link
Owner

rncbc commented Jan 19, 2023

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

@AnClark
Copy link
Contributor Author

AnClark commented Jan 20, 2023

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
Copy link
Contributor Author

AnClark commented Jan 20, 2023

Seems that this line relates to that feature:

drumkv1::setCurrentElementEx(mesg->data.key);

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.

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

No branches or pull requests

2 participants