COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :

Go Back   Cockos Incorporated Forums > Cockos and Friends Software Discussion > WDL users forum

Reply
 
Thread Tools Display Modes
Old 06-29-2008, 11:51 PM   #81
angixstudios
Human being with feelings
 
Join Date: Jun 2008
Posts: 10
Default

This framework is fantastic!
I'd be happy to make a donation for this great release.
Email me if there is a way to do so.
angixstudios is offline   Reply With Quote
Old 07-12-2008, 05:38 AM   #82
angixstudios
Human being with feelings
 
Join Date: Jun 2008
Posts: 10
Default text controls

Am I correct in saying that the text controls are not implemented yet?

They do not display at all. Followed the code and DrawIText is declared but not defined.

If I'm wrong could someone let me know what I may be doing wrong?
angixstudios is offline   Reply With Quote
Old 07-12-2008, 05:45 AM   #83
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,100
Default

Quote:
Originally Posted by angixstudios View Post
Am I correct in saying that the text controls are not implemented yet?

They do not display at all. Followed the code and DrawIText is declared but not defined.

If I'm wrong could someone let me know what I may be doing wrong?
They are implemented ... should be separate implementations in IGraphicsWindows and IGraphicsMac. If a control doesnt display the problem is often either that the rect is poorly defined or offscreen, or that the control wasn't set dirty after updating the text.
schwa is offline   Reply With Quote
Old 07-12-2008, 08:17 PM   #84
angixstudios
Human being with feelings
 
Join Date: Jun 2008
Posts: 10
Default

Sorry to paste code, but I'm not sure how else to ask for help.
Any assistance would be very appreciated.

bitmap = pGraphics->LoadIBitmap(BIGKNOB1_ID, BIGKNOB1_FN, kKnob_N);
pGraphics->AttachControl(new IKnobMultiControl(this, kDepth_X, kDepth_Y, kDepth, &bitmap, kVertical));

IRECT kDepthCap_Rect(57,148,92,161);
IColor white(255,255,255,255);
IText kDepthCapText(12, &white, "Arial");

ICaptionControl *cap = new ICaptionControl(this, &kDepthCap_Rect, kDepth, &kDepthCapText,true);
cap->SetDirty();

pGraphics->AttachControl(cap);

IRECT is definately within bounds.

If I right-click on the Caption Text I see the correct text in the popup but nothing appears normally.
angixstudios is offline   Reply With Quote
Old 07-12-2008, 08:38 PM   #85
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,100
Default

Ah! ICaptionControl is artifact code, I will delete it. Please try ITextControl (its parent).
schwa is offline   Reply With Quote
Old 07-12-2008, 08:54 PM   #86
angixstudios
Human being with feelings
 
Join Date: Jun 2008
Posts: 10
Default

ITextControl doesn't display anything either. CODE BELOW.
Am I doing something wrong?

ITextControl doesn't link to a control as well. I was hoping captionControl was a textbox that displayed the value of a knob below the knob.

IRECT kDepthCap_Rect(57,148,92,161);
IColor white(255,255,255,255);
IText kDepthCapText(12, &white, "Arial");

ITextControl *cap = new ITextControl(this, &kDepthCap_Rect, &kDepthCapText,"hello");

cap->SetDirty();

pGraphics->AttachControl(cap);
angixstudios is offline   Reply With Quote
Old 07-12-2008, 09:17 PM   #87
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,100
Default

Fuck me, a bug. Thanks/sorry.

I updated IPlug at http://downloads.stillwellaudio.com/...misc/IPlug.zip, and there's a test plugin with text captions (I restored ICaptionControl) at http://downloads.stillwellaudio.com/...sc/VSTTest.zip.
schwa is offline   Reply With Quote
Old 07-12-2008, 10:08 PM   #88
angixstudios
Human being with feelings
 
Join Date: Jun 2008
Posts: 10
Default

AWESOME! Thanks Mate!
angixstudios is offline   Reply With Quote
Old 07-13-2008, 12:13 AM   #89
angixstudios
Human being with feelings
 
Join Date: Jun 2008
Posts: 10
Default

Another question.
After editing a captionText, the corresponding(connected) control(knob) does not change. I have tried to edit the code placing SetDirties and Redraws for the control but does not work.

My guess is the PromptUserInput in running on a seperate thread and redraws are executed before the input in entered.

I tried onKeyDown handlers on the captionText but no good.

Is there a way you can think of to get this to work??
angixstudios is offline   Reply With Quote
Old 09-19-2008, 02:59 AM   #90
Ernst Hot
Human being with feelings
 
Join Date: Sep 2008
Location: Århus, Denmark
Posts: 3
Default Gui refresh rate

First, let me say that this framework is just awesome... I had a basic filter vst up and running about an hour after downloading it, despite not having dealt with C++ in years. Great stuff

I have a question though; It seems there is some artificial limit on how often the gui updates? It seems a tad bit too slow for metering for instance. Is there a way to remedy this?

I've been looking through the Lice and IPlug source, but haven't found anything so far.
Ernst Hot is offline   Reply With Quote
Old 09-19-2008, 05:08 AM   #91
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,100
Default

Quote:
Originally Posted by Ernst Hot View Post
I have a question though; It seems there is some artificial limit on how often the gui updates? It seems a tad bit too slow for metering for instance. Is there a way to remedy this?
Hi, thanks!

The last argument to MakeGraphics() is the frame rate, which I think is set to 24 by default. If this looks slow to you, it may be because whatever you're drawing is overly CPU intensive and the redraws are not actually happening at 24 -- if everything is actually updating at 24 fps it should look fine.
schwa is offline   Reply With Quote
Old 10-15-2008, 01:52 AM   #92
snebenan
Human being with feelings
 
Join Date: Jan 2008
Location: Sweden
Posts: 97
Default

Hi,
Since I ran into the limitation of max 16 sliders in JS I'm looking towards other solutions for creating a good vst controller for my evolver and blofeld.

wdl looks like it could solve my graphics needs but I could not find anything about midi. am I just blind or is it solved in some other way?

//Peter
snebenan is offline   Reply With Quote
Old 11-17-2008, 08:31 PM   #93
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 6,465
Default

Quote:
Originally Posted by snebenan View Post
Hi,
Since I ran into the limitation of max 16 sliders in JS I'm looking towards other solutions for creating a good vst controller for my evolver and blofeld.

wdl looks like it could solve my graphics needs but I could not find anything about midi. am I just blind or is it solved in some other way?

//Peter
Since you mention JS, I am assuming you want to make something that works integrated inside Reaper? Then the Reaper Extension plugins are probably what you want to look into...From them you can have access to the MIDI ports as well as the plugins loaded on Reaper's tracks.
__________________
For info on SWS Reaper extension plugin (including Xenakios' previous extension/actions) :
http://www.sws-extension.org/
https://github.com/Jeff0S/sws
--
Xenakios blog (about HourGlass and λ) :
http://xenakios.wordpress.com/
Xenakios is offline   Reply With Quote
Old 11-21-2008, 08:58 AM   #94
red
Human being with feelings
 
Join Date: Nov 2008
Posts: 3
Default Xcode build error: swell-gdi-int.h file not found

Hi there,

I'm trying to build IPlug in Xcode 3.
I have tons of compiler errors.

- IPlug_Prefix.pch is missing.
- some includes must be edited (../wdl/swell/*.h -> ../swell/*.h)
- Xcode build error: swell-gdi-int.h file not found, not included in the package
- IGraphicsMac.mm - GDP_CTX not declared

Can someone please point me the right direction, how to compile this great framework. I really want to give it a try.


Thanks for help and best regards.
./Klaus
red is offline   Reply With Quote
Old 11-30-2008, 04:27 AM   #95
debian
Human being with feelings
 
debian's Avatar
 
Join Date: Nov 2008
Posts: 31
Default swell-gdi-int.h

This seems to be nice.

I want to compile IPlug using xcode on a mac. but I'm seem to be missing the file swell/swell-gdi-int.h

EDIT:
found it in an older WDL,
I have some other errors now... I'll be back
__________________
ojoj...

Last edited by debian; 11-30-2008 at 04:51 AM.
debian is offline   Reply With Quote
Old 11-30-2008, 03:08 PM   #96
debian
Human being with feelings
 
debian's Avatar
 
Join Date: Nov 2008
Posts: 31
Default

How do I compile the Lice Library to get the file liblice.a on an intel macintosh?
__________________
ojoj...
debian is offline   Reply With Quote
Old 11-30-2008, 03:18 PM   #97
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,100
Default

Hi Debian,

To use my IPlug.xcodeproj, you'll need to build LICE (once only) as a separate static library (as its own project). Alternatively you could drag all the LICE source files that IPlug uses into the IPlug project and remove the dependency on liblice.
schwa is offline   Reply With Quote
Old 11-30-2008, 04:34 PM   #98
debian
Human being with feelings
 
debian's Avatar
 
Join Date: Nov 2008
Posts: 31
Default

Thanks for the assistanse.
I manage to compile the IPlug library,
but when trying to compile your IPlugExample.component I get a lot of (38) linker error.

I'll give it another try tomorrow...
__________________
ojoj...
debian is offline   Reply With Quote
Old 12-01-2008, 01:01 PM   #99
debian
Human being with feelings
 
debian's Avatar
 
Join Date: Nov 2008
Posts: 31
Default

hi schwa,
I can't get rid of these linkerror... do you mind have a look at the buld result in my attachment and se if you know of a solution?
Attached Files
File Type: txt buld.txt (17.2 KB, 523 views)
__________________
ojoj...
debian is offline   Reply With Quote
Old 12-28-2008, 05:27 AM   #100
l0calh05t
Human being with feelings
 
l0calh05t's Avatar
 
Join Date: Nov 2008
Location: Darmstadt, Germany
Posts: 664
Default

Quote:
Originally Posted by angixstudios View Post
Another question.
After editing a captionText, the corresponding(connected) control(knob) does not change. I have tried to edit the code placing SetDirties and Redraws for the control but does not work.

My guess is the PromptUserInput in running on a seperate thread and redraws are executed before the input in entered.

I tried onKeyDown handlers on the captionText but no good.

Is there a way you can think of to get this to work??
Did anyone manage to get this to work?
l0calh05t is offline   Reply With Quote
Old 12-28-2008, 08:37 AM   #101
l0calh05t
Human being with feelings
 
l0calh05t's Avatar
 
Join Date: Nov 2008
Location: Darmstadt, Germany
Posts: 664
Default

also, the img folder is missing in the IPlug example included with WDL
l0calh05t is offline   Reply With Quote
Old 12-29-2008, 06:15 AM   #102
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,100
Default

I just put the image folder for the iplug example in the WDL dist, thanks for letting us know it was left out. It's in the build that's linked in the first post of this thread.

Regarding the manual editing of controls -- the control does need a redraw call, but this should be handled already in IControl::SetValueFromUserInput. It does seem to wok properly here, are you on Win or OSX?
schwa is offline   Reply With Quote
Old 12-29-2008, 09:22 AM   #103
l0calh05t
Human being with feelings
 
l0calh05t's Avatar
 
Join Date: Nov 2008
Location: Darmstadt, Germany
Posts: 664
Default

Quote:
Originally Posted by schwa View Post
I just put the image folder for the iplug example in the WDL dist, thanks for letting us know it was left out. It's in the build that's linked in the first post of this thread.
Yeah, I found those as well.

Quote:
Regarding the manual editing of controls -- the control does need a redraw call, but this should be handled already in IControl::SetValueFromUserInput. It does seem to wok properly here, are you on Win or OSX?
Windows, but are we talking about the same thing? I don't mean the right-click edit field but having a normal control and a caption field associated to the same parameter, when one changes one via right-click the other isn't redrawn/updated.
l0calh05t is offline   Reply With Quote
Old 12-30-2008, 07:04 AM   #104
stixsmith
Human being with feelings
 
Join Date: Dec 2008
Location: UK
Posts: 7
Default building with X Code 10.5 Intel Mac

schwa

Firstly, congratulations on an excellent framework!

I've aleady built the libraries, and a fairly complex VST on Windows (Visual Studio 2008) and so far very impressed...

I'm attempting to "port" the Windows VST to VST/AU on Mac. I have to admit at this point that whilst an experienced developer, I'm an XCode noob! I'm running into the same issues as Debain in an earlier post, and tried your suggestion:

Quote:
Originally Posted by schwa View Post
To use my IPlug.xcodeproj, you'll need to build LICE (once only) as a separate static library (as its own project). Alternatively you could drag all the LICE source files that IPlug uses into the IPlug project and remove the dependency on liblice.
I removed liblice from the IPlug.xcodeproj, and added the entire contents of the lice folder (cpp and h files), and was able to successfully build IPlug that way (or at least it built without any errors - which might not be quite the same thing?!?!?!)

I am now getting linker errors just like Debian when I try to build your IPlugExample

Could you provide/post your LICE.xcodeproj? Then I can try building that, then your original IPlug, and then your original IPlugExample - to more closely match your setup?

Thanks in advance

stixsmith
stixsmith is offline   Reply With Quote
Old 12-30-2008, 07:25 AM   #105
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,100
Default

I'll post some xcodeproj files next time I'm at a Mac. One piece of possibly useful information is that the way to set up a library dependency in xcode is to simply drag the library's xcodeproj into the target's project (as opposed to the devstudio way of typing the .lib into the link settings window and then adding it as on the target dependency list).
schwa is offline   Reply With Quote
Old 12-30-2008, 08:18 AM   #106
stixsmith
Human being with feelings
 
Join Date: Dec 2008
Location: UK
Posts: 7
Default

Thanks very much

Those project files will be VERY useful in getting started, I'm sure (for me, and a lot of other noobs too!)

I managed to figure that out that you can drag and drop pretty much anything from one project to another in XCode - which is rather handy

Since I used your IPlugExample it already had the IPlug project in it - so I still suspect my attempt to build IPlug (or LICE) is the problem - once I have your three project files, then the answer will most likely be obvious!

Hope that at some point I'll be able to start contributing a little something back to the project...

Thanks again
stixsmith
stixsmith is offline   Reply With Quote
Old 01-05-2009, 03:40 AM   #107
bvesco
Human being with feelings
 
bvesco's Avatar
 
Join Date: Jun 2007
Posts: 125
Default

Using VC2k5.

Debug build of the example is working fine.

Release build is giving lots of linker errors on msvcrt.lib and LIBCMT.lib

Sound familiar to anyone?

More google-ing for this:
http://cboard.cprogramming.com/showthread.php?t=97754
showed:
Code:
Reusable Library            Switch    Library    Macro(s) Defined
----------------------------------------------------------------
Single Threaded             /ML       LIBC       (none)
Static MultiThread          /MT       LIBCMT     _MT
Dynamic Link (DLL)          /MD       MSVCRT     _MT and _DLL
Debug Single Threaded       /MLd      LIBCD      _DEBUG
Debug Static MultiThread    /MTd      LIBCMTD    _DEBUG and _MT
Debug Dynamic Link (DLL)    /MDd      MSVCRTD    _DEBUG, _MT, and _DLL
The IPlug, IPlug Example and plush2 projects are using /MT while lice and test use /MD. I changed lice and test to /MT and things compiled just fine. So the remaining question is if it is ok to have lice compiled with /MT instead of /MD.
__________________
Audio tutorials and articles: http://www.benvesco.com/tonemonster/
My VST plugins: http://www.vescofx.com/

Last edited by bvesco; 01-05-2009 at 04:05 AM. Reason: more accurate info
bvesco is offline   Reply With Quote
Old 01-05-2009, 06:47 AM   #108
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,100
Default

Sounds like you need to do a static lib release build of LICE on your system.
schwa is offline   Reply With Quote
Old 01-05-2009, 01:03 PM   #109
bvesco
Human being with feelings
 
bvesco's Avatar
 
Join Date: Jun 2007
Posts: 125
Default

Yes, that is what I thought. That's what the /MT flag does but it is set up to be /MD (dynamic). I just wanted to make sure that switching to static is ok.
__________________
Audio tutorials and articles: http://www.benvesco.com/tonemonster/
My VST plugins: http://www.vescofx.com/
bvesco is offline   Reply With Quote
Old 01-06-2009, 12:44 AM   #110
bvesco
Human being with feelings
 
bvesco's Avatar
 
Join Date: Jun 2007
Posts: 125
Default

Next mundane technical question:

The "Reaper Special" configuration seems to be copied from the "No SSE2" configuration. Like the latter, the Reaper config has NO_SSE2 defined and EnableEnhancedInstructionSet="0"

Is this also intentional, is there something about the reaper mode that makes SSE2 undesirable? It seems like a copy/paste casualty.
__________________
Audio tutorials and articles: http://www.benvesco.com/tonemonster/
My VST plugins: http://www.vescofx.com/
bvesco is offline   Reply With Quote
Old 01-07-2009, 02:19 AM   #111
bvesco
Human being with feelings
 
bvesco's Avatar
 
Join Date: Jun 2007
Posts: 125
Default

Next bit of feedback on IPlug.

The functions for setting sample rate and IO configuration from the host are not virtual in the base class and provide no callbacks. This means there is no direct way to respond to these events without directly modifying the base class to suit your own nefarious purposes.

Use case 1:
Implementing an IIR filter where the coefficients have to be recalculated when the sample rate changes. In the straight VST SDK my effect would override the virtual setSamplerate call, call to parent, then do some of its own triggering of events before returning.

In the world of IPlug it seems necessary to look for a samplerate change on each call to the process replacing functions and recalculate if your samplerate is different than last time. Or calculate the coefficients on every call to process. Neither of these seem desirable. Or was IPlug designed to force this calculation on every call to process? Have I missed something?
__________________
Audio tutorials and articles: http://www.benvesco.com/tonemonster/
My VST plugins: http://www.vescofx.com/
bvesco is offline   Reply With Quote
Old 01-07-2009, 05:39 AM   #112
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 9,100
Default

Both VST and AU will call the plugin's Reset() when the sample rate or buffer size changes. So the typical way to handle something like this would be something like this in Reset():

int sr = GetSampleRate();
if (sr != m_sr)
{
m_sr = sr;
// do recalculation
}
schwa is offline   Reply With Quote
Old 01-07-2009, 10:35 AM   #113
bvesco
Human being with feelings
 
bvesco's Avatar
 
Join Date: Jun 2007
Posts: 125
Default

Oh, very sweet then. So reset() is sort of like the "catch all" for needing to start/stop/open/close/change anything. Dig.
__________________
Audio tutorials and articles: http://www.benvesco.com/tonemonster/
My VST plugins: http://www.vescofx.com/
bvesco is offline   Reply With Quote
Old 01-08-2009, 12:16 AM   #114
bvesco
Human being with feelings
 
bvesco's Avatar
 
Join Date: Jun 2007
Posts: 125
Default ITextControl "under" transparent png

Bah, leftovers from doing too much of my own VST wrapper coding...
So if you use IRECT as (x, y, w, h) things will get fubar with ITextControl and ICaptionControl. It is of course supposed to be (x1, y1, x2, y2) which made everything work like normal. This note left here for anyone else who might stumble across this human error..

Now I have ICaptionControl element that is linked to a knob control via param. Turning the knob control does not update the ICaptionControl in realtime. Actually, it does update it in realtime but the control does not redraw so the caption remains showing the old value. Forcing a redraw (close/open gui or move off/on screen) will show the correct value.

This only happens with live updating of the knob (moving it with mouse). If I select saved presets then the knob and caption both are updated and rendered in realtime.

Updating the param via right-click, then type, does not update the knob though.

Additionally, setting the IText::kStyleBold in the IText passed to ITextControl does not result in bold text.

Still work to be done in this area?

P.S. The reset() thing worked out really slick. I am liking IPlug more every day.
__________________
Audio tutorials and articles: http://www.benvesco.com/tonemonster/
My VST plugins: http://www.vescofx.com/

Last edited by bvesco; 01-08-2009 at 11:39 PM.
bvesco is offline   Reply With Quote
Old 01-10-2009, 04:27 AM   #115
stixsmith
Human being with feelings
 
Join Date: Dec 2008
Location: UK
Posts: 7
Default

Seems newbies are running into many of the same "gotchas"
Congrats for posting them here so that others might avoid

This really is a great framework already - and building up a friendly community of users can only help it get even better... and save Schwa from having to answer so many "dumb" questions?

Congrats again to Schwa for releasing this.


Seems that once setting the font type/size the first time, you cannot change them? Digging a little deeper into the framework code this seems deliberate - perhaps there is a good reason for this? I have not yet had the need to investigate further - but just a mental note/heads up...


I had similar problems with controls/captions (when right clicking and keying values, controls/captions were not updating) which I fixed (bodged?) like this:

void PlugExample::OnParamChange(int paramIdx) {

...

if (GetGUI()) {
// force redraw of a control - any one - does not seem to matter which?
GetGUI()->GetControl(hdl[kSomeControl])->Redraw();

GetGUI()->SetAllControlsDirty();
}
}

Which works - though I am not entirely "happy" this is really the "solution"


An example plug that covers even more of the controls/functions in the framework would serve as good documentation (and a test of the framework)

e.g. I've not yet been able to get box/line drawing - or any similar "graphics" functions to work (on Windows platform) - can anyone post a snippet of example code? (to show correct usage?)


Still cannot get the IPlug or IPlugExample to build on Mac OSX/xCode - Schwa if you could post the most recent code and projects (liblice, IPlug, IPlugExample) that would be very very helpful. Much appreciated!

Cheers
stixsmith
stixsmith is offline   Reply With Quote
Old 01-11-2009, 02:51 PM   #116
bvesco
Human being with feelings
 
bvesco's Avatar
 
Join Date: Jun 2007
Posts: 125
Default

Quote:
Originally Posted by stixsmith View Post
Seems newbies are running into many of the same "gotchas"
Congrats for posting them here so that others might avoid

Seems that once setting the font type/size the first time, you cannot change them?

I'm not sure if this reply is targeted at my post or not, but seems related so I feel the need to clarify in case there's an answer for me in there. Are you suggesting that an IText can not have its mStyle property changed after construction? Perhaps my question was not clear enough...

Code:
IText textProps(FONT_SIZE_NORMAL, &COLOR_BLACK, "Arial", IText::kStyleBold);
pGraphics->AttachControl(new ITextControl(this, &tmpRect, &textProps, "bold me"));
The ITextControl in the example above is not bold text when displayed.

Furthermore I should expect this example to work (as a continuation of the previous snippet, though I'm not using it in this way):

Code:
textProps.mStyle = IText::kStyleNormal;
pGraphics->AttachControl(new ITextControl(this, &tmpRect, &textProps, "don't bold me"));
This text should display unbolded even though it uses the IText that was previously constructed as bold. I should expect this to work because the ITextControl invokes the default copy constructor of IText to make a shallow copy. It does not keep a pointer to the original pass by reference IText.

I'm not trying to do anything funny like attempting to get at the mText member of ITextControl and change it from normal to bold on the fly. I am telling an ITextControl to be bold from "day 1" of its render.

Thanks for the tip on forcing redraw of controls. I will try that soon. I agree that does not seem like the "real" solution, but if it gets it working then I'll live with it for a while.

I'll also echo the congrats on releasing this framework. I've tried JUCE and Infinity and neither one cut the mustard for me. I had started rolling my own which was in its infancy. I was just about to implement my own version of what is called IParam here when I stumbled upon WDL and the IPlug. I was also planning to move my own library toward being AU/VST abstracted but was only VST so far. IPlug had taken care of that layer already too. IPlug didn't just already do these things, but did them in a more feature complete way than I had even imagined I would do in my own version. So kudos on the IPlug framework. It has been a dream.
__________________
Audio tutorials and articles: http://www.benvesco.com/tonemonster/
My VST plugins: http://www.vescofx.com/
bvesco is offline   Reply With Quote
Old 01-12-2009, 12:19 PM   #117
stixsmith
Human being with feelings
 
Join Date: Dec 2008
Location: UK
Posts: 7
Default

Quote:
Originally Posted by bvesco View Post
I'm not sure if this reply is targeted at my post or not, but seems related so I feel the need to clarify in case there's an answer for me in there. Are you suggesting that an IText can not have its mStyle property changed after construction? Perhaps my question was not clear enough...
Yes, mostly targetted at your post Bvesco - but others too in earlier posts - I am a newcomer.

Having similar but slightly different problems with fonts...

You might expect the following two examples to produce the same output - try them - you will see that they do not!

Code:
Example 1:

	IText lFont1(14, &COLOR_WHITE, "Arial");
	pGraphics->AttachControl(new ITextControl(this, &IRECT(10, 200, 10 + 128, 200 + 32), &lFont1, "14 White Arial"));

	IText lFont2(28, &COLOR_BLUE, "Courier");
	pGraphics->AttachControl(new ITextControl(this, &IRECT(10, 400, 10 + 128, 400 + 32), &lFont2, "28 Blue Courier"));
and...

Code:
Example 2:

	IText lFont2(28, &COLOR_BLUE, "Courier");
	pGraphics->AttachControl(new ITextControl(this, &IRECT(10, 400, 10 + 128, 400 + 32), &lFont2, "28 Blue Courier"));

	IText lFont1(14, &COLOR_WHITE, "Arial");
	pGraphics->AttachControl(new ITextControl(this, &IRECT(10, 200, 10 + 128, 200 + 32), &lFont1, "14 White Arial"));
(i.e. I just reversed the order of creating the text and text controls)

You will see that once the typeface and size have been set once - for ANY IText in the Plug, they are effectively "locked in"
stixsmith is offline   Reply With Quote
Old 01-12-2009, 04:01 PM   #118
bvesco
Human being with feelings
 
bvesco's Avatar
 
Join Date: Jun 2007
Posts: 125
Default

Quote:
Originally Posted by stixsmith View Post
You will see that once the typeface and size have been set once - for ANY IText in the Plug, they are effectively "locked in"
1. If that is true, then it is a ridiculous limitation that I do not accept after having used several other libs that enforce no such restriction.

2. That's all well and good, but I'm not changing typeface and size on the fly. I'm just trying to put some bold text on the plug while there is no other text on it at all.

I guess I might be slapping VSTGUI on top of IPlug after all...
__________________
Audio tutorials and articles: http://www.benvesco.com/tonemonster/
My VST plugins: http://www.vescofx.com/
bvesco is offline   Reply With Quote
Old 01-13-2009, 02:41 AM   #119
stixsmith
Human being with feelings
 
Join Date: Dec 2008
Location: UK
Posts: 7
Default

Quote:
Originally Posted by bvesco View Post
I guess I might be slapping VSTGUI on top of IPlug after all...
No - please don't do it!!!

Just wanted to point out there is still some development required on the framework to have text functionality working as might be expected.

The more eyes we have looking at it (and the more hands tinkering with it) the quicker these little things can be identified and resolved...
stixsmith is offline   Reply With Quote
Old 01-13-2009, 11:29 PM   #120
bvesco
Human being with feelings
 
bvesco's Avatar
 
Join Date: Jun 2007
Posts: 125
Default Adventures in typeface...

I have been playing with this stuff and here's where we are at.

IGraphicsWin.cpp has the function body for

Code:
bool IGraphicsWin::DrawIText(IText* pText, char* str, IRECT* pR)
where around line 654 we see the conditional

Code:
    if (!mFontActive) {
        int h = pText->mSize;
        int esc = 10 * pText->mOrientation;
        int wt = (pText->mStyle == IText::kStyleBold ? FW_BOLD : 0);
        int it = (pText->mStyle == IText::kStyleItalic ? 1 : 0);
        HFONT font = CreateFont(h, 0, esc, esc, wt, it, 0, 0, 0, 0, 0, 0, 0, pText->mFont);
        SelectObject(pDC, font);  // leak?
        SetBkMode(pDC, TRANSPARENT);
        mFontActive = true;
        setColor = true;
    }
which is what restricts the size and weight from being set more than once (among other things). Perhaps this is done because the font is created every time the function is called. This is assuming CreateFont does not cache the font, I don't know much GDI so I am not sure of that one. For giggles I removed the (!mFontActive) check. I was now able to change font size any time I want, but not font weight. This puzzled me and led to playing around with line 657 until I ended up with

Code:
int wt = (pText->mStyle == IText::kStyleBold ? FW_EXTRABOLD: FW_EXTRABOLD);
which you would *think* means that all your text would always be extra bold no matter what you told it. Alas, such is not the case. I am unable to get any font weight other than the default. I'm going to dig into GDI and see if I can turn anything up. In the meantime, any other ideas? I'd really like to be able to bold some text
__________________
Audio tutorials and articles: http://www.benvesco.com/tonemonster/
My VST plugins: http://www.vescofx.com/
bvesco 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:52 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.