COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 10-23-2009, 11:13 PM   #1
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default 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?
pipelineaudio is offline   Reply With Quote
Old 10-24-2009, 12:30 AM   #2
cc_
Human being with feelings
 
Join Date: Mar 2009
Posts: 256
Default

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.
cc_ is offline   Reply With Quote
Old 10-24-2009, 01:08 AM   #3
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

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

pipelineaudio is offline   Reply With Quote
Old 10-24-2009, 01:13 AM   #4
cc_
Human being with feelings
 
Join Date: Mar 2009
Posts: 256
Default

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.
cc_ is offline   Reply With Quote
Old 10-24-2009, 01:18 AM   #5
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

Thanks I will try, Im still WAY noob on the coding stuff so we shall see what happens!
pipelineaudio is offline   Reply With Quote
Old 10-24-2009, 01:21 AM   #6
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

Do you know of any examples that use Iknob control? I have no idea how to implement this
pipelineaudio is offline   Reply With Quote
Old 10-24-2009, 01:54 AM   #7
cc_
Human being with feelings
 
Join Date: Mar 2009
Posts: 256
Default

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.
cc_ is offline   Reply With Quote
Old 10-25-2009, 08:36 PM   #8
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

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 ?
pipelineaudio is offline   Reply With Quote
Old 10-26-2009, 12:37 AM   #9
cc_
Human being with feelings
 
Join Date: Mar 2009
Posts: 256
Default

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!
cc_ is offline   Reply With Quote
Old 10-26-2009, 03:42 AM   #10
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,047
Default

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
pipelineaudio is offline   Reply With Quote
Old 10-27-2009, 12:53 PM   #11
cc_
Human being with feelings
 
Join Date: Mar 2009
Posts: 256
Default

That certainly is a nice looking panel!
cc_ is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:14 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.