LV2 Gtk help needed

Programming applications for making music on Linux.

Moderators: MattKingUSA, khz

Post Reply
rooftopduvet
Posts: 2
Joined: Sun Feb 27, 2011 10:23 am
Location: Southampton, UK

LV2 Gtk help needed

Post by rooftopduvet »

Hey guys,

First post here - so a big salute to the team ;-)

I'm trying hard to get into LV2 development. I've got the plugins by themselves working fine, but my next mission - making a gui for it - is causing me a lot of hassle. I'd really appreciate some help if anyone is willing to listen.

I've done the following steps, using the lv2_ui.h header...

1) Created a struct type with pointers to gtk widgets, floats for the ports, and slots to store write_function and the controller pointers.
2) Created a descriptor linking all the required functions.
3) Written the lv2ui_descriptor function
4) Written an instantiate function which: mallocs an instance of the ui struct; creates the widgets which are part of this struct; records the pointers of write_function and controller into the struct; returns the pointer to this struct.

I've also written the gui so that signals from the sliders are caught and use the write_function to update control port data.

Everything I've done seems very logical. I compile it and it loads fine, but as soon as I request the gui from a host, it crashes with a 'segmentation fault'.

However, if I choose to return NULL to the instantiate function, the gui pops up fine - BUT again crashes with the same error if I move any of the sliders which trigger the write_function.

Does anyone have any idea what it might be trying to access to give me this fault?
Or is this likely to be a newbie error in my code.

Thanks for reading :-)
Matthew
User avatar
autostatic
Established Member
Posts: 1994
Joined: Wed Dec 09, 2009 5:26 pm
Location: Beverwijk, The Netherlands
Has thanked: 32 times
Been thanked: 104 times
Contact:

Re: LV2 Gtk help needed

Post by autostatic »

Hello Matthew, there are not so many developers around here. You could try your luck on the Linux Audio Developers mailinglist: http://linuxaudio.org/mailarchive/lad/
Or on IRC: #lad at FreeNode.

Best,

Jeremy
rooftopduvet
Posts: 2
Joined: Sun Feb 27, 2011 10:23 am
Location: Southampton, UK

Re: LV2 Gtk help needed

Post by rooftopduvet »

Ahh ok, I did think that the developers area seemed a little quiet.

Thanks very much for the heads up :-)

All the best
Matt
User avatar
autostatic
Established Member
Posts: 1994
Joined: Wed Dec 09, 2009 5:26 pm
Location: Beverwijk, The Netherlands
Has thanked: 32 times
Been thanked: 104 times
Contact:

Re: LV2 Gtk help needed

Post by autostatic »

Hello Matt,

NP. What are you working on actually?

Best,

Jeremy
User avatar
eikakot
Established Member
Posts: 103
Joined: Fri Jan 29, 2010 2:24 pm
Location: Vilnius, Lithuania
Has thanked: 7 times
Been thanked: 3 times
Contact:

Re: LV2 Gtk help needed

Post by eikakot »

Hey, rooftopduvet! Nice to see another one willing to make LV2 plugins :) Is there a source code somewhere to look at?
Post Reply