View Full Version : Rotary Switch control class
pipelineaudio
10-23-2009, 11:13 PM
I was thinking I could mod class ISwitchControl a bit to allow dragging up and down, but I dont understand what IMouseMod* pMod does.
Has anyone made a class for this or what would be a good way to try and mod this?
I haven't had my coffee yet... but I think you should just be able to use a IKnobControl. Just attach it to a parameter that only has 2 states and a bitmap with only 2 bitmaps.
pipelineaudio
10-24-2009, 01:08 AM
But some of these have 23 states
These will be discrete values which is why I didnt just do a regular knob, this pic might help explain
http://stash.reaper.fm/oldsb/232183/10992315323convoqshadow.png
Ah, I see.
I think it will still work though, just use an integer parameter with the range set to give you 23 states, and a bitmap to match.
pipelineaudio
10-24-2009, 01:18 AM
Thanks I will try, Im still WAY noob on the coding stuff so we shall see what happens!
pipelineaudio
10-24-2009, 01:21 AM
Do you know of any examples that use Iknob control? I have no idea how to implement this
Had coffee now. Actually you will want the IKnobMultiControl, that is the one that takes a multi-frame bitmap.
pControl = new IKnobMultiControl(pPlug, x, y, index, pBitmap);
The index is the index of a parameter that should be an integer.
pipelineaudio
10-25-2009, 08:36 PM
ok this seems to work in my main.cpp
// Attach a rotating knob associated with the Pan parameter.
IBitmap bitmap = pGraphics->LoadIBitmap(TOGGLE_ID, TOGGLE_FN, kSwitch_HPFpngs);
pGraphics->AttachControl(new IKnobMultiControl(this, kHPFSwitch_X, kHPFSwitch_Y, kHPFSw, &bitmap));
gearing = 1/2;
// See IControl.h for other control types,
I do need to change the gearing though (icontrol.h line 263 on)
How do I change to like twice the gear speed or half the gear speed in my main.cpp ?
There is a function in IKnobControl to set the gearing, to use it you will have to change your code so you assign the knob control to a variable, something like:
IControl *pK = new IKnobMultiControl(this, kHPFSwitch_X, kHPFSwitch_Y, kHPFSw, &bitmap);
pK->SetGearing(2.0);
pGraphics->AttachControl(pK);
hope that helps!
pipelineaudio
10-26-2009, 03:42 AM
thanks a ton!!!!
http://stash.reaper.fm/oldsb/232965/10992515341fxtrack1.png
that's not a mockup its a real screencap!
Of course it doesn't do jack diddly to the audio yet but all the knobs ar ein place and working perfect :)
That certainly is a nice looking panel!
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.