PDA

View Full Version : Weird grayout problems


RRokkenAudio
02-11-2010, 08:16 AM
I have 8 knobs setup like this:

IBitmap bitmap = pGraphics->LoadIBitmap(KNOB_ID, KNOB_FN, 101);


pGraphics->AttachControl(new IKnobMultiControl(this, 40,55,kdethp, &bitmap));
pGraphics->AttachControl(new IKnobMultiControl(this, 112,55,kdetlp, &bitmap));
pGraphics->AttachControl(new IKnobMultiControl(this, 192,55,kthresh, &bitmap));
pGraphics->AttachControl(new IKnobMultiControl(this, 272,55, kratio, &bitmap));
pGraphics->AttachControl(new IKnobMultiControl(this, 192,119, kattack, &bitmap));
pGraphics->AttachControl(new IKnobMultiControl(this, 272,119, krelease, &bitmap));
pGraphics->AttachControl(new IKnobMultiControl(this, 353,119, kmakeup, &bitmap));

Now, if i add ONE MORE knob, my grayout control that i'm using in another area starts graying out the wrong control, which is a pushbutton and has absolutely nothing to do with those knobs above.

Its like, if I put in over 7 knobs, my grayout control for the switch, starts graying out the wrong thing. Makes absolutely no sense at all. Heres the grayout:



if(blah){
GetGUI()->GrayOutControl(listenidx,false);
}
else{ //no rms

//blah
GetGUI()->GrayOutControl(listenidx,false);
}


So, i add more than 8 knobs at the top, and my push button grayout code starts graying out the wrong push buttons. they are in no way, shape or form linked in any way. Is there a max amount of knobs you can add?

BTW: If i add 8 knobs, it grays out my one compressor in switch, if i add 9 knobs, it grays out ITSELF lol
~Rob.

Tale
02-12-2010, 03:46 AM
My guess would be that you're calling GetGUI()->GrayOutControl(listenidx, false) with the wrong index number in listenidx.

RRokkenAudio
02-12-2010, 05:39 AM
hmmm index number?

I just put:

listenidx = pGraphics->AttachControl(new ISwitchControl(this, 90,118,klisten, &bitmap));

Seeing as though I don't know what an index number is, that may be the problem ;)

~Rob.

Tale
02-12-2010, 07:56 AM
I believe GrayOutControl() expects a parameter index number, not a control index number. I think if you patch your code as follows it should probably work:

GetGUI()->GrayOutControl(GetGUI()->GetControl(listenidx)->ParamIdx(), true);

Or you could simply do:

GetGUI()->GrayOutControl(klisten, true);

RRokkenAudio
02-12-2010, 10:12 PM
That worked, thank you. I was using the meterupdate as an example, guess that works differently.

:)

~Rob.