|
01-13-2009, 11:52 PM
|
#121
|
Human being with feelings
Join Date: Nov 2008
Location: Darmstadt, Germany
Posts: 673
|
Creating new fonts all the time will cause a memory leak. The solution would probably be to store the font with the IText it belongs to (and delete the font when the IText is destroyed), BUT there is a slight problem: currently the IText is copied for every widget using text, so we'd still have a copy of the font for every caption etc.
|
|
|
01-13-2009, 11:54 PM
|
#122
|
Human being with feelings
Join Date: Nov 2008
Location: Darmstadt, Germany
Posts: 673
|
Quote:
Originally Posted by bvesco
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
|
try the following:
Code:
int wt = (pText->mStyle == IText::kStyleBold) ? FW_BOLD : 0;
|
|
|
01-14-2009, 01:23 AM
|
#123
|
Human being with feelings
Join Date: Jun 2007
Posts: 125
|
Yeah, that's what the code started as. I deliberately screwbarred the code I posted to show that it wasn't bolding even if you told it to bold no matter what. As it turns out it is a font size issue. GDI/LICE doesn't seem to be able to provide bold fonts below a certain size. Again, this is a case where I've been used to using VSTGUI for so long that I take certain things for granted, like the ability to get a bold font when I want it.
Storing the font on the IText for every text element is still preferrable to only being able to use a single font size/style on the entire plugin. I might be leaning that way since it is still better than not doing it, and better than leaking a logical font handle on every draw.
|
|
|
01-14-2009, 04:13 AM
|
#124
|
Human being with feelings
Join Date: Nov 2008
Location: Darmstadt, Germany
Posts: 673
|
No, the code started out as:
Code:
int wt = (pText->mStyle == IText::kStyleBold ? FW_BOLD : 0);
my suggestion was:
Code:
int wt = (pText->mStyle == IText::kStyleBold) ? FW_BOLD : 0;
small but important difference ;-)
|
|
|
01-14-2009, 10:18 AM
|
#125
|
Human being with feelings
Join Date: Jun 2007
Posts: 125
|
Small difference yes, important? No. At least not on my compiler (visual studio). Looking at those two statements I fully expect them to be 100% equivalent. Try this test:
Code:
int testTernary1()
{
int FW_BOLD = 700;
enum { kStyleNormal, kStyleBold };
int mStyle = kStyleBold;
int wt = (mStyle == kStyleBold ? FW_BOLD : 0);
return wt;
}
int testTernary2()
{
int FW_BOLD = 700;
enum { kStyleNormal, kStyleBold };
int mStyle = kStyleBold;
int wt = (mStyle == kStyleBold) ? FW_BOLD : 0;
return wt;
}
Only difference between those two functions is the form of the ternary operator or rather the placement of parentheses. As expected, both statements evaluate to the exact same value.
Can you tell me if I'm missing something in your suggestion?
|
|
|
01-14-2009, 10:26 AM
|
#126
|
Human being with feelings
Join Date: Nov 2008
Location: Darmstadt, Germany
Posts: 673
|
Sorry, faulty memory. I was sure == had a lower precedence than ?: but apparently it hasn't, so never mind.
|
|
|
01-18-2009, 03:39 AM
|
#127
|
Human being with feelings
Join Date: Jun 2007
Posts: 125
|
Quote:
Originally Posted by stixsmith
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();
}
}
|
Almost did the trick for me but in the end it still had a few shortcomings. I ended up doing:
Code:
void PlugExample::OnParamChange(int paramIdx)
{
...
RedrawParamControls();
...
}
So far this seems to have solved all the main problems with various controls not updating and it seems a lot more "intended" than the other suggestion.
|
|
|
01-18-2009, 05:51 PM
|
#128
|
Human being with feelings
Join Date: Jun 2007
Posts: 125
|
Highlight user edit text by default
I wanted my user edit boxes to have text highlighted by default (which is not how it behaves "out of the box"). I primarily wanted this to work with my ICaptionControl objects but this solution makes it work for any "PromptUserInput" style text edit boxes.
Code:
void IGraphicsWin::PromptUserInput(IControl* pControl, IParam* pParam)
{
...
if (! n)
{
SetFocus(mParamEditWnd);
SendMessage(mParamEditWnd, EM_SETSEL, 0, -1);
}
}
There appears to be a font handle leak in this function. I think this and the other font problems could be solved by associating a font handle pointer with each IControl object where they cache their own handle to be deleted with themselves. Not sure where to hang this extra font handle for edit boxes, maybe on the IGraphicsWin object itself since there can only ever be one at a time.
Before I tackle that though, there is still a problem with this code and the "PromptUserInput" edit box. When you activate the edit box (with text highlighted by default) and hit enter (without typing in the box) you will get a min value as return input. The text edit box itself contains the highlighted text of the current setting, but entering that still is treated as an empty entry until you make some form of input to the edit box. This could be in the form of even just a mouse click in the edit area. Anyone have any idea about this behavior?
|
|
|
01-19-2009, 01:13 AM
|
#129
|
Human being with feelings
Join Date: Jun 2007
Posts: 125
|
Too long
This thread is getting too long.
I would love some code review and opinions on how I "fixed" the font rendering in IPlug. I started a new thread for this:
http://forum.cockos.com/showthread.php?p=275230
This allows us to render as many fonts in as many styles, sizes and weights as we'd like. All without leaking font handles like a sieve. Please continue any font discussions of this nature in the other thread.
|
|
|
11-02-2009, 06:38 AM
|
#130
|
Mortal
Join Date: Dec 2008
Location: France
Posts: 1,969
|
IURLControl not working + latest IPlug version ?
Is IURLControl working ? I've tried to attach this control... nothing appears (Win).
Also, given some posts of this thread, I'm not sure where's the latest IPlug version: is it the one embedded in WDL (the one I use) or the zip attached in the 1st post of this thread ?
For example: it's said that ICaptionControl should work, an example has been attached but it leads to "URL not found" and ICaptionControl does not work here (Win).
Thanks for any help!
|
|
|
11-02-2009, 08:04 AM
|
#131
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
|
Quote:
Originally Posted by Jeffos
Is IURLControl working ? I've tried to attach this control... nothing appears (Win).
|
I hadn't found that control yet, so thanks for pointing it out to me.
Yes, it works here (Win32). I've just added this one line to a plug I'm working on:
Code:
pGraphics->AttachControl(new IURLControl(this, &IRECT(33, 267, 49, 283), "http://www.martinic.com/combov/"));
Now I can click in the 16x16 ractangle starting at (33, 267) of my plug's GUI to open my my website. Cool!
Quote:
Originally Posted by Jeffos
Also, given some posts of this thread, I'm not sure where's the latest IPlug version: is it the one embedded in WDL (the one I use) or the zip attached in the 1st post of this thread ?
For example: it's said that ICaptionControl should work, an example has been attached but it leads to "URL not found" and ICaptionControl does not work here (Win).
|
I assume the version on the WDL download page is the latest version, especially because it was updated only a couple of weeks ago (10 October).
|
|
|
11-02-2009, 08:19 AM
|
#132
|
Mortal
Join Date: Dec 2008
Location: France
Posts: 1,969
|
Thanks A LOT, Tale! With your code example, I've found my -big noob- error, I was using new IRECT(x,y,width,height) !! Same goes for ICaptionControl, both work fine now...
About the latest IPlug version: yep, quite sure, that's why I use this one.. May be an edit of the initial post could clarify this ([edit] done, thanks schwa!).
Thanks again, Tale.
Last edited by Jeffos; 11-02-2009 at 09:24 AM.
|
|
|
11-07-2009, 02:37 PM
|
#133
|
Human being with feelings
Join Date: Aug 2008
Posts: 1,144
|
is there a complete easy to install working demo (vc express /vc6) project ?
also a one post with full detailed instructions for newbies, is strongly needed.
|
|
|
11-08-2009, 02:30 PM
|
#134
|
Human being with feelings
Join Date: Aug 2008
Posts: 1,144
|
i downloaded VST SDK and extracted the affect/x.h files
also downloaded WDL package
but a full working VC6/VC express demo project is still strongly needed.
|
|
|
11-08-2009, 03:54 PM
|
#135
|
Human being with feelings
Join Date: Jun 2007
Location: Tromsø, Norway
Posts: 223
|
I really like this framework for doing vst but how do I proceed if I would like Mac compatibility? Do I need to compile it on a Mac?
|
|
|
11-08-2009, 04:31 PM
|
#136
|
Mortal
Join Date: Dec 2008
Location: France
Posts: 1,969
|
@whatsup
not sure I understand but there's a "full working VC6/VC express demo project" delivered : ..\wdl\IPlug\Example\IPlugExample.vcproj
@onqel
i guess yes, using: ..\YourIPlug\YourPlug.xcodeproj\project.pbxproj but i never did so, _cc would better reply..
|
|
|
11-08-2009, 04:43 PM
|
#137
|
Human being with feelings
Join Date: Aug 2008
Posts: 1,144
|
thank you, now found it.
|
|
|
11-09-2009, 01:03 PM
|
#138
|
Human being with feelings
Join Date: Jun 2009
Location: Buffalo, NY
Posts: 777
|
Yeah, I must say, I'm really having FUN with this framework!!!
~Rob.
|
|
|
12-15-2009, 08:22 PM
|
#139
|
Human being with feelings
Join Date: Jun 2006
Posts: 4
|
Hi there,
I'm having trouble getting the example to compile on windows. I'm getting the following linking errors:
1>MSVCRT.lib(MSVCR80.dll) : error LNK2005: _malloc already defined in LIBCMT.lib(malloc.obj)
1>MSVCRT.lib(MSVCR80.dll) : error LNK2005: _free already defined in LIBCMT.lib(free.obj)
1>MSVCRT.lib(MSVCR80.dll) : error LNK2005: _fclose already defined in LIBCMT.lib(fclose.obj)
1>MSVCRT.lib(MSVCR80.dll) : error LNK2005: _fopen already defined in LIBCMT.lib(fopen.obj)
1>MSVCRT.lib(MSVCR80.dll) : error LNK2005: _realloc already defined in LIBCMT.lib(realloc.obj)
1>MSVCRT.lib(MSVCR80.dll) : error LNK2005: _sprintf already defined in LIBCMT.lib(sprintf.obj)
1>MSVCRT.lib(MSVCR80.dll) : error LNK2005: _abort already defined in LIBCMT.lib(abort.obj)
1>MSVCRT.lib(MSVCR80.dll) : error LNK2005: _sscanf already defined in LIBCMT.lib(sscanf.obj)
1>MSVCRT.lib(MSVCR80.dll) : error LNK2005: _getenv already defined in LIBCMT.lib(getenv.obj)
1>MSVCRT.lib(MSVCR80.dll) : error LNK2005: _fprintf already defined in LIBCMT.lib(fprintf.obj)
1>MSVCRT.lib(MSVCR80.dll) : error LNK2005: ___iob_func already defined in LIBCMT.lib(_file.obj)
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info:: operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
1>MSVCRT.lib(MSVCR80.dll) : error LNK2005: __stricmp already defined in LIBCMT.lib(stricmp.obj)
1> Creating library Release/test.lib and object Release/test.exp
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>Release/IPlugExample.dll : fatal error LNK1169: one or more multiply defined symbols found
Can anyone help me out?
Thanks in advance,
Matt
|
|
|
12-15-2009, 08:59 PM
|
#140
|
Human being with feelings
Join Date: Jun 2007
Posts: 125
|
|
|
|
12-15-2009, 09:33 PM
|
#141
|
Human being with feelings
Join Date: Mar 2008
Location: Sydney, Australia
Posts: 3,955
|
Quote:
Originally Posted by RRokkenAudio
Yeah, I must say, I'm really having FUN with this framework!!!
|
me too... busy porting my JS effects to C++, plus extra bits...
fwiw - floaty as a C++ plugin runs about 4-5x faster.
|
|
|
12-15-2009, 09:43 PM
|
#142
|
Human being with feelings
Join Date: Aug 2008
Location: Buffalo NY
Posts: 1,091
|
See, i know NOTHING about DSP so i have to try to learn that too. And you know, theres nothing that I can find that says:
To make a signal louder multiply or add or etc...
There is no tutorial!!
Like, I want to add rms to a compressor i'm modding, Man, taking forever to find a code snippet that I understand etc....
Iplug is amazing so far!
~Rob.
|
|
|
12-15-2009, 10:06 PM
|
#143
|
Human being with feelings
Join Date: Aug 2008
Location: Buffalo NY
Posts: 1,091
|
One thing though, that would be nice is some sample code on LICE. Like, how to draw a display like reaEQ has etc. Don't even know where to start with lice.
~Rob.
|
|
|
12-16-2009, 01:10 AM
|
#145
|
Mortal
Join Date: Dec 2008
Location: France
Posts: 1,969
|
a floaty VST, cool dub3000 (we use it often here..) !
excatly the same here, I started to port all my JSs since I met IPlug.. but JS remains super-cool for fast tuning (mostly with midi when the guitarist says "now I want my gt-6 to make some coffee" during a rehearsal!).
rob, in order to use lice primitives you have to subclass your own control and override the draw() method. an very cool lice project example can be found on the WDL download page (jetpack, bottom of the page: mainly bitmap usage tho, few primitives) and we can at least see some justin's code ;-)
|
|
|
12-16-2009, 01:31 AM
|
#146
|
Human being with feelings
Join Date: Aug 2008
Location: Buffalo NY
Posts: 1,091
|
yeah, been waiting to see some justin code "warning, need gas" lol
BTW: If you guys get that brute force ir going thats in there, let me know
~Rob.
Last edited by junioreq; 12-16-2009 at 01:41 AM.
|
|
|
12-16-2009, 04:59 AM
|
#147
|
Human being with feelings
Join Date: Jun 2006
Posts: 4
|
Quote:
Originally Posted by bvesco
|
Thanks for that - my google-fu is clearly weak. That also look like a great site so thanks again.
Cheers,
Matt
|
|
|
01-20-2010, 07:12 PM
|
#148
|
Human being with feelings
Join Date: Dec 2009
Posts: 73
|
Could someone please upload an xcode project for building lice, I have been attempting to compile it all day without success. Failing that if someone can upload a compiled lice, that would at least allow me to struggle on. I'm new to OSX and xcode but would love to get this working. An xcode project for IPlug would be nice too, although I am not using the lib on my windows setup.
Sorry for the double post, I have made a thread on the forum for this issue yesterday, but I figured I might have more success with users subscribed to this thread!
many thanks
Andy
|
|
|
01-20-2010, 08:31 PM
|
#149
|
Human being with feelings
Join Date: Dec 2009
Posts: 73
|
Ok, worked it out finally... I'll post my experience on my original thread
|
|
|
01-21-2010, 10:57 AM
|
#150
|
Human being with feelings
Join Date: Dec 2009
Posts: 73
|
Well, it compiled but doesn't work as VST or AU unfortunately. Garageband crashes on detecting the AU plug and says:
"GarageBand unexpectedly quit while trying to use the Audio Unit “IPlug Example” by “Schwa”.
This plug-in may require an update."
Reaper does actually load the AU plug, but it crackles when using the sliders. Reaper crashes when scanning the VST version.
I am assuming that I am either doing something wrong or there is a problem with the compiler settings, I will try and describe what I have tried and hope that somebody will offer some help, I'm completely stumped.
First I am on OS X 10.5.8 using the latest version of X-code for 10.5 which is 3.1.4.
After extracting wdl, I then extract the image zip, make the change to line 82 of AEffect which stops the deprecated errors.
Next I open the example xcode project, scroll down to Linked frameworks, double click on IPlug.xcodeproj which then opens in a new window. I then build this and it compiles, but produces 198 warnings which are mostly:
'warning: taking address of temporary'
other errors are:
'warning: "MIN" redefined'
'warning: "MAX" redefined'
/VST/wdl/IPlug/IGraphicsMac.mm:165: warning: instance variable 'mGraphics' is @protected; this will be a hard error in the future
/VST/wdl/IPlug/IPlugAU.cpp:769: warning: enumeral mismatch in conditional expression: '<anonymous enum>' vs '<anonymous enum>'
/VST/wdl/IPlug/IGraphicsCarbon.cpp:8: warning: 'GetRegionBounds' is deprecated (declared at /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h:7119)
plus a whole other bunch of deprecated graphics like the above
/VST/wdl/IPlug/../lice/lice_text.cpp:1287: warning: comparison is always false due to limited range of data type
Those are the main errors alongside a few unused variables.
For the settings, I presume that 386 should be selected, I have tried both 10.4 and 10.5 which doesn't make any difference.
So, after that I compile the main project using the same setting I used for the IPlug compile. This builds successfully too, but has the following errors:
Checking Dependencies
Warning: The Compile Sources build phase contains this target's exported symbols file 'IPlugExample.exp'.
warning: no rule to process file '$(PROJECT_DIR)/IPlugExample.exp' of type sourcecode.exports for architecture i386
Warning: The Compile Sources build phase contains this target's exported symbols file 'IPlugExample.exp'.
warning: no rule to process file '$(PROJECT_DIR)/IPlugExample.exp' of type sourcecode.exports for architecture i386
Plus a few more:
/VST/wdl/IPlug/Example/../IControl.h:102: warning: taking address of temporary
and MIN/MAX redefined.
Regardless of build type debug/release the plugins don't work.
I've run out of ideas, I'm hoping someone can see something obvious here and I can get on with some coding! Not sure what else to try, and after loving IPlug in windows so far, the main attraction being the single code base idea, I'm starting to feel despondent that it won't work... Any suggestions appreciated! I'm wondering whether I should install an earlier Xcode.
thanks
Andy
Last edited by Astralp; 01-21-2010 at 11:06 AM.
Reason: Added log files
|
|
|
01-21-2010, 11:03 AM
|
#151
|
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,747
|
I don't think the xcode version would make a difference. Do you have the latest WDL from here http://www.cockos.com/wdl/ ?
Frustrating I know, but you could try running the plugin under the xcode debugger, to see where it crashes on the initial scan.
|
|
|
01-21-2010, 11:11 AM
|
#152
|
Human being with feelings
Join Date: Dec 2009
Posts: 73
|
Thanks for answering schwa. Yes I have the latest wdl from that page.
I just added the complete logs as attachments, do you get these same warnings when you compile?
I will investigate the debugger, though again it is an unknown realm...
thanks again, I'd love to get this working, it is such a fantastic framework..
|
|
|
01-21-2010, 12:27 PM
|
#153
|
Human being with feelings
Join Date: Dec 2009
Posts: 73
|
Been trying to use the debugger, I presume that the way to do it is you attach to a process such as garageband, but when i try it says no executable in path. I've never debugged a plug before, only an exe a long time ago. I usually do my debugging with log files, I guess I'll try that.
I've also just made an AU project from the templates in xcode and that worked flawlessly, so I don't think there is anything wrong with my xcode setup at least...
|
|
|
01-22-2010, 10:46 AM
|
#154
|
Human being with feelings
Join Date: Dec 2009
Posts: 73
|
Well I'm still plodding along with this, seems like the only problem with AU is in garageband which crashes on starting up detecting the example plug. Works in other hosts I've tried. Can anyone else confirm this with the example plug or is it just me? My garageband is up to date from the iLife 09.
I'm getting tantalizingly close to having one of my projects compile, but now have discovered that the text structure appears to be missing in the library. If I put this in the example project:
IText textStyle(16, &list_text_colour, "Arial", IText::EStyle::kStyleNormal,IText::EAlign::kAlignN ear);
It complains that there is no class/namespace etc...
I can't understand why as other structs seem to be ok from the Istructures.h
Is text supported on OSX?
|
|
|
01-22-2010, 11:13 AM
|
#155
|
Human being with feelings
Join Date: Dec 2009
Posts: 73
|
Oh, forgot the color:
IColor list_text_colour(10,240,240,240);
which goes above the IText, this is accepted which is baffling as the structs are defined in the same place.. the headache continues. Does anyone actually use IPlug to produce AU's regularly?
|
|
|
01-22-2010, 02:41 PM
|
#156
|
Human being with feelings
Join Date: Dec 2009
Posts: 73
|
Oh well, I give up, aside from the text issue I am also getting crashes in all AU hosts now when loading my custom plugin. I don't know whether I am missing something, but I feel that there are problems with the OS X support that I just don't have the ability to understand. I will continue to use IPlug for windows probably, but I am going to work on native AU plugs for the MAC, trying to get this working has zapped an enormous amount of energy. It's a real shame as the single base idea is truly brilliant... The AU examples with xcode compile and work flawlessly, so I'm going to direct my energy there.
Andy
|
|
|
02-01-2010, 05:18 AM
|
#157
|
Human being with feelings
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
|
did you change the various IDs in the resource.h? I have had a lot of problems, with aus crashing logic (although they passed the auval) when i did this (although i tried to stick to the advice in the comments). Eventually i seem to have it working
|
|
|
02-01-2010, 05:25 AM
|
#158
|
Human being with feelings
Join Date: Dec 2009
Posts: 73
|
Hi Oli
Can you clarify what you mean by change the ids? I have VST working flawlessly now on Mac, but haven't tried again with AU. This is promising that you have them working though, at least I know someone has for certain now
nice to see you on here btw!
take care
Andy
|
|
|
02-01-2010, 10:47 AM
|
#159
|
Human being with feelings
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
|
I just tried it and i get the
"Logic Pro unexpectedly quit while trying... This plug-in may require an update."
when i set PLUG_MFR and PLUG_MFR_ID in resource.h to the same four char string. If they are different it works.
oli
|
|
|
02-02-2010, 10:23 AM
|
#160
|
Human being with feelings
Join Date: Dec 2009
Posts: 73
|
Hi oli
Thanks so much, your advice has AU working for me although strangely it was the opposite of what you said, when I made the above 2 the same it worked for me.
The only problem I have now is that the controls with no parameters associated aren't working, but I am over the moon to get a loadable AU plug. Thanks so much!
Andy
|
|
|
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 06:35 AM.
|