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

Go Back   Cockos Incorporated Forums > Other Software Discussion > WDL users forum

Reply
 
Thread Tools Display Modes
Old 02-03-2010, 03:25 AM   #161
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

what exactly did you set them to? I'd like to work out exactly what the problem is
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 02-04-2010, 06:22 PM   #162
Astralp
Human being with feelings
 
Join Date: Dec 2009
Posts: 73
Default

I'm away at the moment, I'll have a look when I get back but from memory I think it was just hgso for both. It is a bit annoying because the plugs are categorized by this in some hosts.
Astralp is offline   Reply With Quote
Old 07-24-2010, 05:55 PM   #163
cerberus
Human being with feelings
 
Join Date: Nov 2009
Location: memory
Posts: 633
Default

i'm trying to change the font style, size and specify an r,g,b or hex color...

my result is not successful so far:


here is the relevant code :

Code:
 ////attatch text control
	//IText lFont2(28, &COLOR_YELLOW, "Arial");
	//ITextControl *pTextControl=new ITextControl(this, &IRECT(10, 100, 10 + 128, 100 + 32), &lFont2,"55");
	
	IText lFont2(28, &COLOR_YELLOW, "Arial", IText::kStyleItalic);
	
	ITextControl *pTextControl=new ITextControl(this, &IRECT(10, 100, 10 + 128, 100 + 32), &lFont2,"55");
	
	pGraphics->AttachControl(pTextControl);
	
   //  Convert result to string and assign to restoString variable
	double dbResult = 50.0; //fixed test number..
	
	char restoString[5];
	sprintf(restoString, "%f", dbResult);
	
	char *updCaption = restoString;
	pTextControl->SetTextFromPlug(updCaption);	
	
	
	
	
	AttachGraphics(pGraphics);
cerberus is offline   Reply With Quote
Old 07-25-2010, 08:54 AM   #164
cerberus
Human being with feelings
 
Join Date: Nov 2009
Location: memory
Posts: 633
Default

would it be possible to work around this using LICEtext? i see : "class LICE_IFont"
etc. which appears to have a different set of formatting options than the IText library.
cerberus is offline   Reply With Quote
Old 07-26-2010, 07:31 AM   #165
cerberus
Human being with feelings
 
Join Date: Nov 2009
Location: memory
Posts: 633
Default



is this meant to work, the text field is not accessible to copy from, that
issue is discussed here http://forum.cockos.com/showthread.p...759#post551759

is there a different method to control IText fonts and font styles for osx?

i can't read that tiny font easily... can anyone?
cerberus is offline   Reply With Quote
Old 07-26-2010, 07:52 AM   #166
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,646
Default

I'm not sure what exactly you are trying to accomplish, but I use pGraphics->DrawIText() in customized controls to display text in my ComboV plug (screenshot). I do this by implementing my own Draw() method, e.g.:

Code:
char mText[100];

...

bool MyControl::Draw(IGraphics* pGraphics)
	sprintf(mText, "%0.2f", mValue);
	return pGraphics->DrawIText(&IText(17, &IColor(255, 160, 160, 160), NULL, IText::kStyleNormal, IText::kAlignFar), mText, &IRECT(400, 300, 500, 330));
Note that the current Windows implementation allows only one font and size per plug-in instance(?), I am unsure if this also goes for Mac. I believe there is a mod floating around here somewhere that overcomes this limitation.

Another thing is that I don't understand Mac font sizes, as they seem to come out smaller than on Windows. A Mac font size of 17 is about the same size as a font size of 15 on Windows.
Tale is offline   Reply With Quote
Old 07-26-2010, 10:57 PM   #167
bvesco
Human being with feelings
 
bvesco's Avatar
 
Join Date: Jun 2007
Posts: 125
Default

The mod is located here:

http://www.plugindeveloper.com/02/im...font-rendering

Of special note on Windows fonts below a certain size for certain font faces get replaced with a default font face. So you might get your Times New Roman at 15 pts but it becomes Arial when you get down to about 8 or so.
__________________
Audio tutorials and articles: http://www.benvesco.com/tonemonster/
My VST plugins: http://www.vescofx.com/
bvesco is offline   Reply With Quote
Old 07-27-2010, 12:43 AM   #168
cc_
Human being with feelings
 
Join Date: Mar 2009
Posts: 256
Default

Quote:
Originally Posted by Tale View Post
Another thing is that I don't understand Mac font sizes, as they seem to come out smaller than on Windows. A Mac font size of 17 is about the same size as a font size of 15 on Windows.
I don't understand them either! But I messed about a bit to try and get them to come out the same - it's in my mods. It's not easy getting the positioning the same either. I didn't check many font sizes though...

The changes are to IDrawText in IGraphicsMac.mm
cc_ is offline   Reply With Quote
Old 07-27-2010, 01:18 AM   #169
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,646
Default

Quote:
Originally Posted by cc_ View Post
I don't understand them either! But I messed about a bit to try and get them to come out the same - it's in my mods. It's not easy getting the positioning the same either. I didn't check many font sizes though...

The changes are to IDrawText in IGraphicsMac.mm
Thanks, I'll check them out.
Tale is offline   Reply With Quote
Old 07-27-2010, 02:31 AM   #170
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

I have been working on a couple of solutions to the font problem–the first one involves making a bitmap (in gimp or photo shop etc) which holds each character of the font at the desired size (mono space fonts only). The second solution involves linking to the freetype library (but I didn't get that far yet). The second solution should be a lot more flexible.
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 07-27-2010, 07:27 AM   #171
cc_
Human being with feelings
 
Join Date: Mar 2009
Posts: 256
Default

Did you consider the text facilities in lice? I seem to remember schwa saying something about this. I have been meaning to look at it, but haven't had time. lice_textnew.cpp looks interesting, I guess combined with the swell to make the HFONT stuff work on OSX.

Then again I noticed that swell-gdi-lice.cpp has this line in it:

Code:
#define FONTSCALE 0.9
so maybe the results are not going to be pixel identical
cc_ is offline   Reply With Quote
Old 07-27-2010, 08:41 AM   #172
cerberus
Human being with feelings
 
Join Date: Nov 2009
Location: memory
Posts: 633
Default

Quote:
Originally Posted by bvesco View Post
The mod is located here:

http://www.plugindeveloper.com/02/im...font-rendering

Of special note on Windows fonts below a certain size for certain font faces get replaced with a default font face. So you might get your Times New Roman at 15 pts but it becomes Arial when you get down to about 8 or so.
that method seems to be for windows only. i assume tale's code will work in osx?
cerberus is offline   Reply With Quote
Old 07-27-2010, 10:24 AM   #173
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,646
Default

Quote:
Originally Posted by cerberus View Post
that method seems to be for windows only. i assume tale's code will work in osx?
Yes, my code will work in both Windows and OS X.
Tale is offline   Reply With Quote
Old 07-27-2010, 03:16 PM   #174
Jeffos
Mortal
 
Jeffos's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 1,969
Default

I've drawn some text using LICE_IFont (well LICE_CachedFont) in IPlug, -theorically- this should also work on OSX (?). However, I did some mods in IPlug: I moved DrawIText() in IGraphicsLice (+ related clean-up in inherited classes) + see below + I defined a new attribute mFontIdx in IText (updated contructors too).
Well, quick/brutal job (be cool about "MAX_NB_FONTS").. could be of course be improved. You also need SWELL's LOGFONT + "../lice/lice_text.h" + "../ptrlist.h"

HTH! I'd like to know how/if it works on OSX!

Added in IGraphicsLice.h:
Code:
  bool IGraphicsLice::DrawIText(IText* pText, char* str, IRECT* pR);
  WDL_PtrList<LICE_CachedFont> m_fonts;
Added/moded IGraphicsLice.cpp:
Code:
IGraphicsLice::IGraphicsLice(IPlugBase* pPlug, int w, int h, int refreshFPS)
:	IGraphics(pPlug, w, h, refreshFPS), mDrawBitmap(0), mTmpBitmap(0)
{
	for (int i=0; i < MAX_NB_FONTS; i++) 
		m_fonts.Add(new LICE_CachedFont);
}

IGraphicsLice::~IGraphicsLice() 
{
	DELETE_NULL(mDrawBitmap);
	DELETE_NULL(mTmpBitmap);
	m_fonts.Empty(true);
}

bool IGraphicsLice::DrawIText(IText* pText, char* str, IRECT* pR)
{
	if (!str || str == '\0') {
		return true;
	}
	if (pText->mFontIdx >= MAX_NB_FONTS)
		return false;
	RECT R = { pR->L, pR->T, pR->R, pR->B };
	if (!m_fonts.Get(pText->mFontIdx)->GetHFont())
	{
		LOGFONT lf = {
		  pText->mSize,0,0,0,FW_NORMAL,FALSE,FALSE,FALSE,DEFAULT_CHARSET,
			OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH,
			(CHAR)pText->mFont
		};
		m_fonts.Get(pText->mFontIdx)->SetFromHFont(CreateFontIndirect(&lf),LICE_FONT_FLAG_OWNS_HFONT);                 
		m_fonts.Get(pText->mFontIdx)->SetBkMode(TRANSPARENT);
		m_fonts.Get(pText->mFontIdx)->SetTextColor(
			LICE_RGBA(pText->mColor.R,pText->mColor.G,pText->mColor.B,pText->mColor.A));
	}
	m_fonts.Get(pText->mFontIdx)->DrawText(mDrawBitmap, str, -1, &R, DT_LEFT | DT_VCENTER);
	return true;
}
[edit] I forgot! the idea is of course to support multiple fonts in a same plug

Last edited by Jeffos; 07-27-2010 at 03:35 PM. Reason: multiple fonts
Jeffos is offline   Reply With Quote
Old 07-28-2010, 01:37 AM   #175
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,646
Default

I can't even get it work on Windows. I get an error from the linker saying it can't resolve LICE_CachedFont.

BTW, I know you have just copied it from the original, but this can't be right:

Code:
	if (!str || str == '\0') {
		return true;
	}
Surely this was meant (right?):

Code:
	if (!str || *str == '\0') {
		return true;
	}
Tale is offline   Reply With Quote
Old 07-28-2010, 03:03 AM   #176
Jeffos
Mortal
 
Jeffos's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 1,969
Default

Thanks for giving it a try, Tale!

For your linking issue, I can't check that from where I am but, as said above, I'd say you need something like this in IGraphicsLice.h:
Code:
#define MAX_NB_FONTS 8
#include "../lice/lice_text.h"
#include "../ptrlist.h"
For the *str == '\0', LOL, of course! But please, keep the credits to schwa (copy/paste from IGraphicsWin indeed)

Disclaimer: although I'm deeply into WDL/LICE now, I really am an OSX noob! Carbon, coca-cola and stuff are still chineese to me. Fortunately, I'll borow a MAC for a couple of weeks soon.. Also, this should be considered as a POC, I did that following schwa's remark about bvesco's mod.. to see..

Last edited by Jeffos; 07-28-2010 at 04:23 AM. Reason: english + POV -> POC
Jeffos is offline   Reply With Quote
Old 07-28-2010, 07:35 AM   #177
Jeffos
Mortal
 
Jeffos's Avatar
 
Join Date: Dec 2008
Location: France
Posts: 1,969
Default

Just posted in another thread (I quote it here as this thread is IPlug's entry point):
Quote:
Originally Posted by schwa View Post
Similarly, the text display features are limited on Windows and extremely limited on Mac. LICE's text display features are pretty good now (they didn't exist when iplug was written), so the "right" thing to do is to implement text drawing in iplug using LICE_CachedFont. This isn't a quick job, though.
I understand this as LICE_CachedFont is indeed the way to go, but what I posted above is insufficient/incorrect for OSX (I just know it's ok on Win).
Jeffos is offline   Reply With Quote
Old 02-23-2011, 08:07 AM   #178
Adam Fulara
Human being with feelings
 
Adam Fulara's Avatar
 
Join Date: Jan 2011
Posts: 48
Default

Is that library working with Gnu C++ compiler too?

Edit: nevermind, I downloaded free Visual C++ Express and it's working fine. Looks great!
__________________
http://adam.fulara.com/software
Guitar and Midi stuff

Last edited by Adam Fulara; 02-24-2011 at 04:23 PM.
Adam Fulara is offline   Reply With Quote
Old 02-27-2011, 06:35 AM   #179
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

Quote:
Is that library working with Gnu C++ compiler too?
if you're still interested i have some codeblocks/mingw projects in my git repository. it seems ok so far, except for finding resources. The binary obviously includes them but i still get an error that they can't be found

oli
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 03-23-2011, 11:47 AM   #180
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

Jeffos - i got your mod working on OSX.

it's here if anyone wants to try https://github.com/olilarkin/wdl-ce/tree/igraphicsmod

work in progress (see screenshot)! Hopefully can get the fonts to look really similar. Actually some of those fonts are probably not installed on my windows vm, so didn't show up properly
Attached Images
File Type: jpg Screen shot 2011-03-23 at 18.37.48.jpg (64.1 KB, 541 views)
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 03-23-2011, 11:49 AM   #181
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

i also merged IGraphicsLice into IGraphics as shwa was suggesting on another thread. seems to be working ok so far.
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Old 05-15-2011, 12:02 AM   #182
gluon
Human being with feelings
 
Join Date: May 2011
Posts: 5
Default

hello experts,
just wanted to figure out if IPlug C++ is still developped and used.
I checked that the first post was from 2007 so I just ask the question.

I'm looking for a framework to begin to design VST for designthemedia.com
synthmaker seems nice, but I'm afraid to be a bit limitated because it seems we cannot tweak the code under the hood.

any infos would be appreciated
gluon is offline   Reply With Quote
Old 05-15-2011, 12:59 AM   #183
bvesco
Human being with feelings
 
bvesco's Avatar
 
Join Date: Jun 2007
Posts: 125
Default

IPlug is alive and kicking. There is the official version here and the community edition maintained at https://github.com/audio-plugins/wdl-ce
__________________
Audio tutorials and articles: http://www.benvesco.com/tonemonster/
My VST plugins: http://www.vescofx.com/
bvesco is offline   Reply With Quote
Old 05-15-2011, 01:21 AM   #184
gluon
Human being with feelings
 
Join Date: May 2011
Posts: 5
Default

ok bvesco, thanks for your precious feedback !

I'd need a little help to build my toolchain with eclipse etc.
Can I find it here?
gluon is offline   Reply With Quote
Old 09-07-2011, 10:27 AM   #185
izmirlig
Human being with feelings
 
Join Date: Sep 2011
Posts: 1
Default Interested as well

@schwa
with regards to IPLUG-- I am a statistician who does music as a very very serious hobby. When I got my fireware audio interface several years ago I decided to play around and learn the RIFF/WAV format. I wrote a small program to read and copy the format block to a second file and then 'speed up' the file by an integer factor, F, supplied by the user (2, 4, etc). Inside the program, the WAV file format block was analyzed for sample rate, bytes per sample etc. The final data block split the bytes per sample into F pieces and averaged them. It works! I am aware that there are plenty of simple ways to do this but it amused me to no end doing it myself in C.

Several years later, I dusted off this old program and decided to play around some more--maybe try filtering using Fourier transform--once again--nothing new or earth shattering here--I have plenty of plugins that probably can do that in my Cubase LE Elements 6. I'm just in it for fun.

What I was wondering is maybe I could use your IPLUG to turn my experiments in to VST plugins. I am not facile with object oriented programming in C++ but I have had experience with classes in Java and in R. So would the learning curve be too steep? In any case, I'll download IPLUG and take a look at the samples. I was interested in starting a dialogue with you. If this gets anywhere--I'll write back with a [shorter] update on my progress.
izmirlig 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 03:11 AM.


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