|
10-23-2009, 11:13 PM
|
#1
|
Mortal
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
|
Rotary Switch control class
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?
|
|
|
10-24-2009, 12:30 AM
|
#2
|
Human being with feelings
Join Date: Mar 2009
Posts: 256
|
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.
|
|
|
10-24-2009, 01:08 AM
|
#3
|
Mortal
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
|
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
|
|
|
10-24-2009, 01:13 AM
|
#4
|
Human being with feelings
Join Date: Mar 2009
Posts: 256
|
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.
|
|
|
10-24-2009, 01:18 AM
|
#5
|
Mortal
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
|
Thanks I will try, Im still WAY noob on the coding stuff so we shall see what happens!
|
|
|
10-24-2009, 01:21 AM
|
#6
|
Mortal
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
|
Do you know of any examples that use Iknob control? I have no idea how to implement this
|
|
|
10-24-2009, 01:54 AM
|
#7
|
Human being with feelings
Join Date: Mar 2009
Posts: 256
|
Had coffee now. Actually you will want the IKnobMultiControl, that is the one that takes a multi-frame bitmap.
Code:
pControl = new IKnobMultiControl(pPlug, x, y, index, pBitmap);
The index is the index of a parameter that should be an integer.
|
|
|
10-25-2009, 08:36 PM
|
#8
|
Mortal
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
|
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 ?
|
|
|
10-26-2009, 12:37 AM
|
#9
|
Human being with feelings
Join Date: Mar 2009
Posts: 256
|
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:
Code:
IControl *pK = new IKnobMultiControl(this, kHPFSwitch_X, kHPFSwitch_Y, kHPFSw, &bitmap);
pK->SetGearing(2.0);
pGraphics->AttachControl(pK);
hope that helps!
|
|
|
10-26-2009, 03:42 AM
|
#10
|
Mortal
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
|
thanks a ton!!!!
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
|
|
|
10-27-2009, 12:53 PM
|
#11
|
Human being with feelings
Join Date: Mar 2009
Posts: 256
|
That certainly is a nice looking panel!
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 04:14 AM.
|