PDA

View Full Version : Link knob parameter to seperate PNG Strip ?


junioreq
12-17-2009, 11:32 AM
I want to incorporate some graphics like, lets say I have a knob and when I turn the knob I want a bar to raise up somewhere else on the screen. My thought is, I can make the bar animated in knobman and get the png strip and assign it to a knob control for example...

So, if I can link knob one to knob2(the bar png) - so, knob one controls knob 2's pngs, I can have a simple and easy way to do simple graphics..

Any thoughts on this, or another way I can do custom graphics?

EDIT: here is an example of what I would like to do :

http://www.delamancha.co.uk/sfilter.htm

Now i would just create a "knob" for each bar and load up the bar png strip for each... and link the gain knob to control the png.. sounds simple!! But i lack the understanding of how to link knob 1 to the graphics "knob".

~Rob.

bvesco
12-18-2009, 01:52 AM
You can also have just two images, one fully on and one fully off. I use this approach for my VU meters. You can find some nice sample code for doing this in the VSTGUI source where they have a meter control that does exactly this.

junioreq
12-18-2009, 08:54 AM
I tried just doubling the knob control code with the same variable, didn't work :(

Gotta be some way to have one knob control another..

~Rob.

cc_
12-19-2009, 02:07 AM
I've pointed you to this before, but this is how I would do it. Look at the text display portion of the example:
http://forum.cockos.com/showthread.php?t=45686

You can easily change the text display into a bitmap control.

RRokkenAudio
12-19-2009, 04:51 AM
ahhh ok CC did not even think about changing it from text to bitmap :)

Will give a try

~Rob.

RRokkenAudio
12-19-2009, 04:53 PM
lol, I didn't figure it out lol, gotta figure it out tonite, I hope.

~Rob.

cc_
12-22-2009, 02:34 AM
If you haven't figured it out yet... it's something like this:

- copy the PanReadOut class and rename it to something
- instead of making a new ITextControl in the constructor make a new IBitmapControl.
- the Update method will be simpler, something like this:


void Update() {
double value = mpSubject->GetValue();
mpBitmapControl->SetValueFromUserInput(value);
}


Then make instances of your new class for each bitmap display you want (just like the example does for PanReadOut).

The bitmap control will use a multiframe png just like a knob would.

RRokkenAudio
01-17-2010, 04:39 PM
I assume this is the important stuff:

void Update() {
double value = mpSubject->GetValue();
mpBitmapControl->SetValueFromUserInput(value);
}

Still haven't gotten this to work;