COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 08-13-2010, 04:01 PM   #41
RRokkenAudio
Human being with feelings
 
RRokkenAudio's Avatar
 
Join Date: Jun 2009
Location: Buffalo, NY
Posts: 777
Default

Heh, don't even bother with XT lol...

~RR.
RRokkenAudio is offline   Reply With Quote
Old 08-14-2010, 04:22 AM   #42
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 2,975
Default

Quote:
Originally Posted by cc_ View Post
I've tried it on OSX10.5.8 with Cubase 4.5, Reaper 3, GarageBand and Live 7 both AU and VST and it now looks OK to me. If anyone else wants to give it a go, I compiled my modded IPlugExample and put it here (both VST and AU): text_edit_test.zip.
I have tried your text edit test in various hosts on OS X 10.6.4, and here are the results:

REAPER (v3.66; OSX Intel)

Everything works. I did find two nitpicks:
  • [AU/VST] Hoover the mouse over the small +/- buttons for the pan knob, scroll up using the mouse wheel, and the small button will appear to be pressed. You can fix this by adding an empty OnMouseWheel() method to your control.
  • [AU/VST] A control that is being editing using the keyboard also still reacts to the mouse wheel, but this doesn't update the value in the input box. On Window the value is updated, but I found this too much of a hassle on Cocoa. So I have chosen to temporarily disable the mouse wheel for the control that is being edited.

Ableton Live Intro (v8.1.4)

Again everything works, but there are a few additional nitpicks:
  • [AU] When the plug's window isn't the active window, the input box doesn't automatically receive focus. You can fix this by calling the makeKeyAndOrderFront method for the plug's window.
  • [VST] The input boxes seem a bit too high for only one line (they have room for almost two lines).
  • [VST] The Carbon combo box doesn't seem to react like Cocoa or Windows combo boxes, but I guess that is just the way Carbon's combo boxes work, right?

Ugly VSTi Interface X (beta v0.4)

Again everything works, but there is this one additional nitpick:
  • [VST] When you use the mouse wheel while the input box is active, the whole window seems to flicker.

GarageBand (v5.1)

Everything works (no additional nitpicks ).


Quote:
Originally Posted by cc_ View Post
So instead I used the code to fix the problems in mine, I didn't see any crashes, but there were problems with focus that oli mentioned above and also things not redrawing right.
Could you please return me the favour, and test ComboV (v1.0.3 beta2, download from here) on your Mac? If it isn't redrawing correctly I would really like to know.

Quote:
Originally Posted by cc_ View Post
BTW I noticed that neither the oli nor tale version had my fixes for the mouse right button in them. Have you guys tried your code with a two button mouse? Does it work right clicking to open the edit box? When I tried it I don't think it did, but I have a macmini with a logitec mouse plugged in so maybe that's different from the apple ones?
It simply didn't occur to me to add right-click support. Cmd-click works, so that was good enough for me. But adding right-click is a good idea, I will look into that.
__________________
Martinic Kee Bass - Scanner Vibrato - Elka Panther - Tale's JSFX Pack
Tale is offline   Reply With Quote
Old 08-16-2010, 12:41 AM   #43
cc_
Human being with feelings
 
Join Date: Mar 2009
Posts: 256
Default

Thanks for checking it out and the detailed comments. I'll try to fix those.

I tried ComboV, only nits I had were in Cubase and Live7. I couldn't find a way of dismissing the edit box with the mouse (clicking outside didn't work) you have to press enter or esc. Also, if you type more than will fit in the edit box it doesn't scroll, the letters just get squished together until there's just one big black blob! I've never seen anything do that before! Probably not a problem in your application though.

And yeah, right click doesn't work in either Carbon or Cocoa. The problem is that OSX doesn't treat it as a modifier, it's a different event.
cc_ is offline   Reply With Quote
Old 08-16-2010, 01:33 AM   #44
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 2,975
Default

Thanks for testing.

Quote:
Originally Posted by cc_ View Post
I tried ComboV, only nits I had were in Cubase and Live7. I couldn't find a way of dismissing the edit box with the mouse (clicking outside didn't work) you have to press enter or esc.
Yeah, that is the way it works at the moment. I think will look into that though, because clicking outside the edit box to close it would make my Carbon implementation more consistent with Cocoa.

Quote:
Originally Posted by cc_ View Post
Also, if you type more than will fit in the edit box it doesn't scroll, the letters just get squished together until there's just one big black blob! I've never seen anything do that before! Probably not a problem in your application though.
I haven't seen that myself, but I will look into that as well.

Quote:
Originally Posted by cc_ View Post
And yeah, right click doesn't work in either Carbon or Cocoa. The problem is that OSX doesn't treat it as a modifier, it's a different event.
This is on my to-do list.
__________________
Martinic Kee Bass - Scanner Vibrato - Elka Panther - Tale's JSFX Pack
Tale is offline   Reply With Quote
Old 08-21-2010, 06:29 AM   #45
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 2,975
Default

Quote:
Originally Posted by Tale View Post
Yeah, that is the way it works at the moment. I think will look into that though, because clicking outside the edit box to close it would make my Carbon implementation more consistent with Cocoa.
Done. And I have also added left-click to commit behaviour to the Windows version.

Quote:
Originally Posted by Tale View Post
I haven't seen that myself, but I will look into that as well.
The "squishing" was caused by the single line flag. I have therefore removed it, although the text still won't scroll, but instead it now wraps to the next line. This does look better though.

Quote:
Originally Posted by Tale View Post
This is on my to-do list.
Done.

I have bundled all my modifications and bugfixes in a Git repository, and I have made a list of them on my WDL mini website.

Mini website: http://www.taletn.com/wdl/
Git repository: http://www.taletn.com/WDL.git
__________________
Martinic Kee Bass - Scanner Vibrato - Elka Panther - Tale's JSFX Pack
Tale is offline   Reply With Quote
Old 08-22-2010, 11:14 AM   #46
cerberus
Human being with feelings
 
Join Date: Nov 2009
Location: memory
Posts: 634
Default

i'm trying tale's wdl, i've found that i want to disable the right-click function for certain controls, or make right-click behave like a regular click; e.g.
Code:
// a contact switch that hides itself when clicked

class IContactControlHideOnClick : public ISwitchControl
{
public:
	
	IContactControlHideOnClick(IPlugBase* pPlug, int x, int y, int paramIdx, IBitmap* pBitmap)
	:	ISwitchControl(pPlug, x, y, paramIdx, pBitmap) {
		// the standard double click sets-to-default behaviour doesn't make sense for
		//  IContactControl and leads to fast single clicks getting lost, so turn it off.
		mDblAsSingleClick=false;
	}
	~IContactControlHideOnClick() {}
	
	void OnMouseUp(int x, int y, IMouseMod* pMod);
	void OnMouseWheel(int x, int y, IMouseMod* pMod, int d) {}   // added (xen) disables mousewheel
	void OnMouseDown(int x, int y, IMouseMod* pMod);
	
};


void IContactControlHideOnClick::OnMouseDown(int x, int y, IMouseMod* pMod)
{
	if (pMod->R) {    // on right click, do nothing.
		
	}
	
	
		mPlug->GetGUI()->HideControl(29,true);   //hides itself  (kIndex number, true)
	//	mPlug->GetGUI()->HideControl(27,false);
	
} // rr

void IContactControlHideOnClick::OnMouseUp(int x, int y, IMouseMod* pMod)
{
	mValue = 0.0;
	SetDirty();
}
and
Code:
 ///////////////////////////////
// A switch that reverts to 0.0 when released. Mousewheel is disabled.
// xen
class NoWheelIContactControl : public ISwitchControl
{
public:
	
	NoWheelIContactControl(IPlugBase* pPlug, int x, int y, int paramIdx, IBitmap* pBitmap)
	:	ISwitchControl(pPlug, x, y, paramIdx, pBitmap) {
		// the standard double click sets-to-default behaviour doesn't make sense for
		//  IContactControl and leads to fast single clicks getting lost, so turn it off.
		mDblAsSingleClick=false;
	}
	~NoWheelIContactControl() {}
	
	void OnMouseUp(int x, int y, IMouseMod* pMod);
	void OnMouseWheel(int x, int y, IMouseMod* pMod, int d) {}   // added (xen) disables mousewheel
	void OnMouseDown(int x, int y, IMouseMod* pMod);
	
};

void NoWheelIContactControl::OnMouseDown(int x, int y, IMouseMod* pMod)

{
	// PromptUserInput();
	mDisablePrompt = true;    // disable right click
	mValue = 1.0;
	SetDirty();		
}

void NoWheelIContactControl::OnMouseUp(int x, int y, IMouseMod* pMod)


{ 
	mValue = 0.0;
	SetDirty();	
}
however, there are some controls for which direct text entry is not appropriate, but i can't figure out how to disable the right click function. e.g.
Code:
 // Bitmap shows when value = 0, then toggles its target area to the whole bitmap
// and waits for another click to hide itself.
class IBitmapOverlayControl : public ISwitchControl
{
public:

	IBitmapOverlayControl(IPlugBase* pPlug, int x, int y, int paramIdx, IBitmap* pBitmap, IRECT* pTargetArea)
	:	ISwitchControl(pPlug, x, y, paramIdx, pBitmap), mTargetArea(*pTargetArea) {}

	IBitmapOverlayControl(IPlugBase* pPlug, int x, int y, IBitmap* pBitmap, IRECT* pTargetArea)
	:	ISwitchControl(pPlug, x, y, -1, pBitmap), mTargetArea(*pTargetArea) {}

	~IBitmapOverlayControl() {}

	bool Draw(IGraphics* pGraphics);

private:
	IRECT mTargetArea;	// Keep this around to swap in & out.
};
help here would be appreciated, tia.
cerberus is offline   Reply With Quote
Old 08-22-2010, 12:53 PM   #47
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 2,975
Default

If you use a standard IPlug control, then you can disable the user input prompt by calling DisablePrompt(). However, this will not disable right-click altogether, especially not for custom controls. If you want to disable right-click for these, you will need to something like:

Code:
class IMyControl: public IInvisibleSwitchControl
{
public:
	IMyControl(IPlugBase* pPlug, IRECT* pR, int paramIdx):
	IInvisibleSwitchControl(pPlug, pR, paramIdx) { mDblAsSingleClick = true; }

	~IMyControl() {}

	void OnMouseDown(int x, int y, IMouseMod* pMod)
	{
		// Ignore right-clicks
		if (pMod->R) return;

		// To-do: Add left-click code
	}
};
__________________
Martinic Kee Bass - Scanner Vibrato - Elka Panther - Tale's JSFX Pack
Tale is offline   Reply With Quote
Old 08-22-2010, 03:12 PM   #48
cerberus
Human being with feelings
 
Join Date: Nov 2009
Location: memory
Posts: 634
Default

IBitmapOverlayControl has no OnMousDown method, it may defeat the purpose
to add one? in that case i'd still need to get the control to hide itself, which is
all this one is supposed to do...

for the meantime, made a custom version of IBitmapOverlayControl with right-click disabled :
Code:
//////////////////////////////////////////////////////////////////  

// Bitmap shows when value = 0, then toggles its target area to the whole bitmap
// and waits for another click to hide itself. Right click is disabled.
class IBitmapOverlayNoRightClick : public ISwitchControl
{
public:
	
	IBitmapOverlayNoRightClick(IPlugBase* pPlug, int x, int y, int paramIdx, IBitmap* pBitmap, IRECT* pTargetArea)
	:	ISwitchControl(pPlug, x, y, paramIdx, pBitmap), mTargetArea(*pTargetArea) {}
	
	IBitmapOverlayNoRightClick(IPlugBase* pPlug, int x, int y, IBitmap* pBitmap, IRECT* pTargetArea)
	:	ISwitchControl(pPlug, x, y, -1, pBitmap), mTargetArea(*pTargetArea) {}
	
	~IBitmapOverlayNoRightClick() {}
	
	bool Draw(IGraphics* pGraphics);
	
		
private:
	IRECT mTargetArea;	// Keep this around to swap in & out.
};

bool IBitmapOverlayNoRightClick::Draw(IGraphics* pGraphics)
{
	if (mValue < 0.5) {
		mTargetRECT = mTargetArea;
		return true;	// Don't draw anything.
	}
	else {
		mDisablePrompt = true;   //  disable right click (which would bring up a text box for this control)
		mTargetRECT = mRECT;
		return IBitmapControl::Draw(pGraphics);
	}
}
i'd rather have right-click act like left-click for this particular control,
but at least the user won't ever get the default text prompt, which
i think is an inappropriate behavior (for this control).
cerberus is offline   Reply With Quote
Old 08-22-2010, 08:37 PM   #49
cerberus
Human being with feelings
 
Join Date: Nov 2009
Location: memory
Posts: 634
Default

i have text entry working, yay!

enjoy a short movie: http://cerberusaudio.com/b/ScreenFlow31.mov

i'm wondering if one could adjust the size of the text boxes?
cerberus is offline   Reply With Quote
Old 08-23-2010, 02:37 AM   #50
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 2,975
Default

Quote:
Originally Posted by cerberus View Post
IBitmapOverlayControl has no OnMousDown method, it may defeat the purpose to add one?
IBitmapOverlayControl probably inherits its OnMouseDown() from a control above it, ultimately from IControl.

Quote:
Originally Posted by cerberus View Post
i'd rather have right-click act like left-click for this particular control, but at least the user won't ever get the default text prompt, which i think is an inappropriate behavior (for this control).
I agree that user input isn't very useful on some controls. However, fixing this could break existing code. Besides, it is not that hard to customize your own controls, so they behave exactly as you want them to.

Quote:
Originally Posted by cerberus View Post
i have text entry working, yay!
Cool!

Quote:
Originally Posted by cerberus View Post
i'm wondering if one could adjust the size of the text boxes?
The text box sizes are hard-coded in IGraphicsWin.cpp, IGraphicsCocoa.mm and IGraphicsCarbon.cpp (look for #define PARAM_EDIT_W).
__________________
Martinic Kee Bass - Scanner Vibrato - Elka Panther - Tale's JSFX Pack
Tale is offline   Reply With Quote
Old 08-23-2010, 10:30 AM   #51
olilarkin
Human being with feelings
 
olilarkin's Avatar
 
Join Date: Apr 2009
Location: UK
Posts: 1,163
Default

wouldn't it be better if the text box / dropdown RECT was passed as an argument to promptUserInput(), so that the position is changeable? This is what i've done. Also, i think a popup contextual menu would be much neater than a combo box.

oli
__________________
VirtualCZ | pMix | Endless Series | iPlug2 | Linkedin | Facebook
Available for Audio Dev tuition via Skype (IPlug/JUCE/C++)
olilarkin is offline   Reply With Quote
Old 08-24-2010, 05:05 AM   #52
l0calh05t
Human being with feelings
 
l0calh05t's Avatar
 
Join Date: Nov 2008
Location: Darmstadt, Germany
Posts: 673
Default

Quote:
Originally Posted by olilarkin View Post
wouldn't it be better if the text box / dropdown RECT was passed as an argument to promptUserInput(), so that the position is changeable? This is what i've done. Also, i think a popup contextual menu would be much neater than a combo box.

oli
I like this suggestion as well (although i'd leave the height fixed)
http://www.plugindeveloper.com/03/wide-user-inpu
__________________
Raw data for raw nerves | 1.05946309...
My Blog | My free VST plugins | WDL-OL CMake fork
l0calh05t is offline   Reply With Quote
Old 08-24-2010, 07:14 AM   #53
cc_
Human being with feelings
 
Join Date: Mar 2009
Posts: 256
Default

Personally, I prefer the Combobox - this right click stuff is meant to be a way to give keyboard entry, and a combobox is better for keyboard entry - on osx at least, you can type in the field and it auto completes.
cc_ is offline   Reply With Quote
Old 08-24-2010, 07:21 AM   #54
l0calh05t
Human being with feelings
 
l0calh05t's Avatar
 
Join Date: Nov 2008
Location: Darmstadt, Germany
Posts: 673
Default

a combobox only really makes sense for enum values. or did you mean a spin box? I don't really like the right-click stuff either, esp for knobs. left-click editable captions are better imo
__________________
Raw data for raw nerves | 1.05946309...
My Blog | My free VST plugins | WDL-OL CMake fork
l0calh05t is offline   Reply With Quote
Old 08-24-2010, 07:45 AM   #55
cc_
Human being with feelings
 
Join Date: Mar 2009
Posts: 256
Default

Yes, comboboxs for enum values. I thought oli was talking about enum values.
cc_ is offline   Reply With Quote
Old 08-24-2010, 08:02 PM   #56
cerberus
Human being with feelings
 
Join Date: Nov 2009
Location: memory
Posts: 634
Default

i don't understand a problem i am having where kParams read back from the .rpp
will return with some apparently incorrect values in the lower bits.

on the left is a restored instance, loaded from a saved .rpp. but it was saved in the exact state we see in
the instance on the right, which is a new instance.

the white text and the text box both represent the same kParam, set the same. but
it comes back with some extra digits hanging off the bag end...


the instance on the right is how it should be; this is a new instance, but as we can observe,
on a restored instance it is making some apparent error...
Code:
myVariable  =  GetParam(kParam)->Value();
is giving me funky numbers that are doubles, but never exactly what they seemingly ought to be.
i assume it's reading from the binary chunk in the .rpp.. but i'm not advanced enough to
be able to figure out when and exactly where the error is coming from. but i'm posting it
here on the chance it is a bug related to osx (testing only vst in reaper atm...)
cerberus is offline   Reply With Quote
Old 08-26-2010, 01:19 PM   #57
cerberus
Human being with feelings
 
Join Date: Nov 2009
Location: memory
Posts: 634
Default

i've learned here that the bytechunk is declared as a float by iplug...
http://forum.cockos.com/showthread.p...es only floats

i'm not sure how to proceed...
could i use ByteChunk::Put() to the force serialization as doubles?
and if so, how would i go about that?

or would i need to modify the serialize method in iplug?
would using cc_'s modified containers.h file help?
cerberus is offline   Reply With Quote
Old 08-27-2010, 08:10 AM   #58
cc_
Human being with feelings
 
Join Date: Mar 2009
Posts: 256
Default

No, my modified containers would not help, that just makes sure projects can be swapped between PPC and Intel without breaking.

If you grab my latest WDL (see the sticky thread) and set:

Code:
 #define PLUG_DOES_STATE_CHUNKS 1
in your resource.h (or wherever you do that stuff), then you can be sure that it will save your parameters as doubles (in the state chunk).

But, I'm not sure that's the problem. I mean, the value you are trying to save is 0, right? Zero should be zero whether you store it as a float, a double an int or a char!
cc_ is offline   Reply With Quote
Old 08-27-2010, 12:06 PM   #59
cerberus
Human being with feelings
 
Join Date: Nov 2009
Location: memory
Posts: 634
Default

thanks cc_ right, i'm not sure i've identified my issue correctly... my workaround
for the problem just asked about was unacceptably weird; there's probably some other
error in my code, e.g. where i may have confused writing normalized kParam values
with a control's defined range, etc.
cerberus is offline   Reply With Quote
Old 09-22-2010, 08:56 AM   #60
cerberus
Human being with feelings
 
Join Date: Nov 2009
Location: memory
Posts: 634
Default

well... this is odd.. alpha channel for itext is working in osx, but not on pc?? some kind of turnabout? or a graphics card issue for me? ( we see the known font size discrepancy issue here too):

cerberus is offline   Reply With Quote
Old 09-22-2010, 09:56 AM   #61
cerberus
Human being with feelings
 
Join Date: Nov 2009
Location: memory
Posts: 634
Default

another user also gets the bright text... i compiled with the same wdl/iplug source files and headers. could this be a cockos bug?

would someone please verify if alpha channel for text is working properly on the pc platform?
cerberus is offline   Reply With Quote
Old 09-22-2010, 01:25 PM   #62
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 2,975
Default

The alpha channel does not work for text in Windows, because IPlug calls the Windows API functions SetTextColor() and DrawText(), and these do not support an alpha channel.
__________________
Martinic Kee Bass - Scanner Vibrato - Elka Panther - Tale's JSFX Pack
Tale is offline   Reply With Quote
Old 09-22-2010, 02:33 PM   #63
cerberus
Human being with feelings
 
Join Date: Nov 2009
Location: memory
Posts: 634
Default

oh ok. thanks tale!

perhaps we still could emulate alpha channel by using gray out? or even changing the amount of grayout on the fly?
cerberus is offline   Reply With Quote
Old 09-22-2010, 09:59 PM   #64
cerberus
Human being with feelings
 
Join Date: Nov 2009
Location: memory
Posts: 634
Default



so i never imagined that i could or would make software for pc...
i don't really know how to use a pc. so thanks to cockos,
and to those who have offered me tips thus far!
cerberus is offline   Reply With Quote
Old 10-12-2010, 11:33 AM   #65
cerberus
Human being with feelings
 
Join Date: Nov 2009
Location: memory
Posts: 634
Default

this is getting weird... i see 2 apparent bugs for text boxes in windows only. osx right click works perfectly here.

1. windows is broken in this case.. same code. i made a double-click method to open the text box which does still work in windows.
but the right-click method works only in osx.

http://cerberusaudio.com/b/Win_RightClick_Broken.mov

2. notice that osx text boxes open with the contained text field auto-selected, whereas
windows text boxes require one to re-select what appears to have been auto-selected.
(i think this is a bug, but i am told this is normal behavior for iplug on windows.)

anyone have any windows fixes for text boxes ?

what a strange case of turnabout this is, my text boxes in osx now work like a dream! (but, uh...)
cerberus is offline   Reply With Quote
Old 10-12-2010, 02:34 PM   #66
cerberus
Human being with feelings
 
Join Date: Nov 2009
Location: memory
Posts: 634
Default

1. is solved, i think...

it was ok to have PromptUserInput() in the OnMouseUp method in osx, but it seems
that in windows, PromptUserInput() can be called from the OnMouseDown function
or OnMouseDoubleClick functions, but not from OnMouseUp.
cerberus is offline   Reply With Quote
Old 03-14-2011, 09:54 AM   #67
olilarkin
Human being with feelings
 
olilarkin's Avatar
 
Join Date: Apr 2009
Location: UK
Posts: 1,163
Default

i noticed a slight problem with the IGraphicsMac/Win PromptUserInput() implementations i.e. in cockos/tales/ccs repos.

Code:
  
int n = pParam->GetNDisplayTexts();
if (n) { ...
if someone has done

Code:
GetParam(kGainL)->InitDouble("Gain L", 0.0, -96.0, 12.0, 0.1, "dB");
GetParam(kGainL)->SetDisplayText(-96., "Mute");
they can no longer set the parameter using a text entry, since there is 1 Display Text. Maybe better to do something like

Code:
 
int n = pParam->GetNDisplayTexts();

if (pParam->Type()  == IParam::kTypeDouble | pParam->Type()  == IParam::kTypeInt) // do text entry
else if (pParam->Type() == IParam::kTypeEnum && n) // do combobox
__________________
VirtualCZ | pMix | Endless Series | iPlug2 | Linkedin | Facebook
Available for Audio Dev tuition via Skype (IPlug/JUCE/C++)
olilarkin is offline   Reply With Quote
Old 03-14-2011, 11:23 AM   #68
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 2,975
Default

Yes I agree, that would be better. BTW, a boolean should also show a combo box:

Code:
int n = pParam->GetNDisplayTexts();
if (n && (pParam->Type() == kTypeEnum || pParam->Type() == kTypeBool)) { ...
__________________
Martinic Kee Bass - Scanner Vibrato - Elka Panther - Tale's JSFX Pack

Last edited by Tale; 03-26-2011 at 08:07 AM. Reason: Changed n && enum || bool to n && (enum || bool)
Tale is offline   Reply With Quote
Old 03-26-2011, 03:52 PM   #69
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 2,975
Default

I have updated my Git repository, now only boolean and enum parameters use a combo box when prompting for user input.
__________________
Martinic Kee Bass - Scanner Vibrato - Elka Panther - Tale's JSFX Pack
Tale is offline   Reply With Quote
Old 03-29-2011, 12:53 PM   #70
olilarkin
Human being with feelings
 
olilarkin's Avatar
 
Join Date: Apr 2009
Location: UK
Posts: 1,163
Default

i didn't try your code, but i took a look at the changes. I think you also need to test the parameter type in IGraphics::SetFromStringAfterPrompt() rather than just the number of display texts. I think the bug i mentioned above will still happen.
__________________
VirtualCZ | pMix | Endless Series | iPlug2 | Linkedin | Facebook
Available for Audio Dev tuition via Skype (IPlug/JUCE/C++)
olilarkin is offline   Reply With Quote
Old 03-29-2011, 02:06 PM   #71
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 2,975
Default

My updated code in SetFromStringAfterPrompt() checks if there are any display texts. If so, then it tries to map the user input string to one of the display texts using MapDisplayText(). If this succeeds, then the int that corresponds to the display text is used. If the user input string can't be mapped to a display text, then the input string is converted to a number using atof(). No bug here (at least, I think).

Code:
double v;
bool mapped = pParam->GetNDisplayTexts();
if (mapped)
{
	int vi;
	mapped = pParam->MapDisplayText(txt, &vi);
	if (mapped) v = (double)vi;
}
if (!mapped)
{
	v = atof(txt);
	if (pParam->DisplayIsNegated()) v = -v;
}
pControl->SetValueFromUserInput(pParam->GetNormalized(v));
__________________
Martinic Kee Bass - Scanner Vibrato - Elka Panther - Tale's JSFX Pack
Tale is offline   Reply With Quote
Old 03-29-2011, 02:09 PM   #72
olilarkin
Human being with feelings
 
olilarkin's Avatar
 
Join Date: Apr 2009
Location: UK
Posts: 1,163
Default

ah ok, missed that
__________________
VirtualCZ | pMix | Endless Series | iPlug2 | Linkedin | Facebook
Available for Audio Dev tuition via Skype (IPlug/JUCE/C++)
olilarkin 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 01:47 AM.


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