PDA

View Full Version : WDL v2010.08.16 (now available via Git!)


Tale
08-17-2010, 04:26 AM
Latest snapshot (http://www.cockos.com/wdl/): WDL v2010.08.16

Now available via Git! The zipped distributions may go away someday?
EEL2: optional eel1 compat (allows you to build AVS using EEL2 and support old presets)
LICE: FillTriangle/Polygon/Bezier coordinates are now cleanly inclusive
LineParse: when parsing small lines, no heap use (requires an extra 2k of stack space per parser)
PtrList: do not pass NULLs to deletion functions
Scrollbar: improved zoom button sizing
sc_bounce: fixed a session ID handling bug
SWELL: no WM_CTLCOLOR* on text fields
SWELL: rendering glitch fix when destroying small subviews
SWELL: font and combo box sizes are more consistent
SWELL: emulate WM_NC/HTCAPTION on OSX for double-click in titlebar
SWELL: API for setting relative raise amounts for owned windows
Virtwnd: VirtualStaticText: added GetCharFromCoord()
Virtwnd: fixed scaled blit clipping on right/bottom, various other clip problems
Virtwnd: bgcache handles differing images automatically

I have just downloaded the Git repository, but because I am a complete Git dummy, I don't really know what to do now. For now I'll just copy the WDL source files to my project directory, re-apply my mods/patches, and see if I can get it to compile.

RRokkenAudio
08-17-2010, 04:53 AM
Yeah, doing the same, the only thing i can remember modding was some text color or something lol, all controls are separate, but let's see lol..

~RR.

schwa
08-17-2010, 05:03 AM
The thing to do would be to install git. :) msysgit is popular on windows (personally I would recommend the full 1.7.0.2 install, not the netinstall), and tortoisegit is convenient and usable (though not as robust as tortoisesvn, and also tortoisegit sort of encourages an svn-like workflow which doesn't necessarily make the best use of git).

git clone the repository to get a working copy. Then make yourself a personal branch for your own changes. Apply and locally commit your changes. If you want remote backup, you can set yourself up a remote repository for your personal branch.

Whenever WDL changes, you can selectively merge new code from Cockos (or anyone else) into your personal branch. When iplug goes into a read/write public repository, the maintainers can push changes from their personal branches to the master.

If you don't want to learn git, just clone the repository to get a working copy and start using it, you don't need to do anything else.

Xenakios
08-17-2010, 05:21 AM
Apply and locally commit your changes. If you want remote backup, you can set yourself up a remote repository for your personal branch.


This would be possible to do on the Cockos server? I did some (fairly trivial though) additions to the WDL resampler code and I was wondering if it's possible to have those changes somehow stored on the Cockos Git system. Obviously not on the WDL main branch, but something like a "remote repository of my personal branch"? :)

schwa
08-17-2010, 07:08 AM
This would be possible to do on the Cockos server? I did some (fairly trivial though) additions to the WDL resampler code and I was wondering if it's possible to have those changes somehow stored on the Cockos Git system. Obviously not on the WDL main branch, but something like a "remote repository of my personal branch"? :)

The Cockos server will very likely remain read-only, but a nice thing about git is that one person's master can be another person's branch. You can clone the read-only WDL git repository to a server, make a branch, and have that be your own personal master version. If the Cockos WDL code changes, you can choose to pull in or ignore whichever changes you want.

Xenakios
08-17-2010, 07:12 AM
The Cockos server will very likely remain read-only, but a nice thing about git is that one person's master can be another person's branch. You can clone the read-only WDL git repository to a server, make a branch, and have that be your own personal master version. If the Cockos WDL code changes, you can choose to pull in or ignore whichever changes you want.

Ok, thanks, I will try to figure out how to do that if I find some suitable server space somewhere.

Xenakios
08-17-2010, 08:51 AM
The change I added to resample.h :

#define WDL_RESAMPLER_EXPORT_TO_DLL
#ifdef WDL_RESAMPLER_EXPORT_TO_DLL
#define WDL_RESAMPLER_DLLEXPORT_THING __declspec (dllexport)
#else
#define WDL_RESAMPLER_DLLEXPORT_THING
#endif

class WDL_RESAMPLER_DLLEXPORT_THING WDL_Resampler


So nothing special and fairly obvious, but I think that change needs to be publicly available since the resampler code is LGPL and I've put some binaries using that into circulation?

Tale
08-17-2010, 12:01 PM
Ok, so I can now clone the WDL Git repository, add a branch, and locally commit some changes. However, I am having trouble figuring out how to integrate all this in my current project. I always store the WDL source files in a subdirectory called "wdl" in my main project directory, so I have this directory structure:

MyProject
MyProject\wdl
MyProject\wdl\IPlug
etc. etc.

However, when I clone the WDL Git repository, I end up with the following directory structure:

WDL
WDL\.git
WDL\WDL

Suppose I would want to use Git to manage WDL as well as my own project, then how should I set this up? Naturally I would prefer to keep my current directory structure unchanged (with WDL in the MyProject\wdl directory), although I guess could change this if absolutely necessary.

schwa
08-17-2010, 12:39 PM
[edit] Some pointless advice here ... sorry, we're learning Git too!

Better advice coming soon.

Jeffos
08-17-2010, 01:47 PM
.. and now msysgit! Damn, will come a day I'll learn more things with Cockos/hobby coding than in my day job!

LineParse: when parsing small lines, no heap use (requires an extra 2k of stack space per parser)

this interests me: perf. improvment? or possible issue ?

Tale
08-17-2010, 02:44 PM
I am sure there is a way to have a git branch (YourCode) with a subdirectory that points to a different git branch (WDL)
I found "git submodule add <srcurl> <localpath>", and that seems to do what you describe (and which could be very useful). However, this (naturally) still stores WDL in <localpath>\WDL.

but the simplest thing would be to make YourCode and WDL siblings, and add ".." in front of all the relative references in your own code base.
Let me see if I understand you correctly. This would result in the following directory structure, right?

WDL
.git
MyProject
MyProject\.git
SomeOtherProject
SomeOtherProject\.git

This doesn't look right to me... Why is WDL's .git dir on the same level as WDL, and not inside the WDL dir (i.e. in WDL\.git)? If it were, I think I could even keep using my current directory structure, and put WDL in MyProject\wdl (with its .git dir in MyProject\wdl\.git).

Justin
08-17-2010, 03:05 PM
What I would recommend is this (not using submodules, but merging WDL into your repository). Part 1, for this example, creates a new repos (you can skip it if you have an existing repos):


mkdir turds
cd turds
git init .
echo > hi.cpp
git add hi.cpp
git commit -a -m "foo"
git checkout master


Part 2, add WDL as a remote:
echo [remote \"cockoswdl\"] >> .git/config
echo url = http://www-dev.cockos.com/wdl/WDL.git >> .git/config


Then, finally, to get WDL, or whenever you want to update to the latest WDL, use:


git pull cockoswdl



This has the advantage of not being dependent on our repository -- if we go away, our WDL history is safely within your repository.

Tale
08-17-2010, 04:05 PM
What I would recommend is this (not using submodules, but merging WDL into your repository).
...
This has the advantage of not being dependent on our repository -- if we go away, our WDL history is safely within your repository.
Thanks! I just tried this, and it works flawlessly. :cool: WDL now resides in MyProject\WDL (or in Justin's case in turds\WDL :D), just like before. (Well, almost just like before, because the directory name is in uppercase now, but that's OK.)

Justin
08-17-2010, 09:03 PM
When iplug goes into a read/write public repository, the maintainers can push changes from their personal branches to the master.


Actually, how we should handle this is to encourage other developers to publish their repositories, and we can pull changes we like into the Cockos WDL repository. Alternatively, developers can send us patches against our public WDL repository.

Justin
08-17-2010, 09:07 PM
.. and now msysgit! Damn, will come a day I'll learn more things with Cockos/hobby coding than in my day job!

this interests me: perf. improvment? or possible issue ?

Yeah, better performance, less calls to malloc/free when parsing, which can add up.

Justin
08-17-2010, 10:04 PM
The change I added to resample.h :

#define WDL_RESAMPLER_EXPORT_TO_DLL
#ifdef WDL_RESAMPLER_EXPORT_TO_DLL
#define WDL_RESAMPLER_DLLEXPORT_THING __declspec (dllexport)
#else
#define WDL_RESAMPLER_DLLEXPORT_THING
#endif

class WDL_RESAMPLER_DLLEXPORT_THING WDL_Resampler


So nothing special and fairly obvious, but I think that change needs to be publicly available since the resampler code is LGPL and I've put some binaries using that into circulation?

Does that mean you have a .dll file that just includes that resampling code (with the declspec(dllexport)), and your program loads that .dll for using the resampler?

Xenakios
08-18-2010, 02:40 AM
Does that mean you have a .dll file that just includes that resampling code (with the declspec(dllexport)), and your program loads that .dll for using the resampler?

Yes, that's right.

Justin
08-18-2010, 05:33 PM
Yes, that's right.

And on the loading side, you do __declspec(dllimport) for the class definition?

Have you thought about doing:


__declspec(dllexport) class Resampler : public WDL_Resampler { };

Xenakios
08-18-2010, 05:45 PM
And on the loading side, you do __declspec(dllimport) for the class definition?

Have you thought about doing:


__declspec(dllexport) class Resampler : public WDL_Resampler { };


Hmm no...It all has just worked magically somehow, by linking to the dll import .lib file and including the resample.h header in my code.

Dunno if it is working entirely as supposed though but it does look like it. If I don't have the dll containing the wdl resampler class in the same folder as my application .exe, the application refuses to start. So I don't think the resampler code is for example somehow linked to my executable in some other way.

edit : actually heheh...The application code is using a different resample.h file without the __declspec(dllexport) thing. That's probably wrong.

RRokkenAudio
08-18-2010, 06:28 PM
BTW, what would it take to change the license on that bugger? ;)

~RR.

Xenakios
08-18-2010, 06:33 PM
BTW, what would it take to change the license on that bugger? ;)

~RR.

To clarify, Rob is probably referring to the difficulty of complying to the LGPL license by using other DLLs from code that itself is only within a DLL (VST plugins). While it's not impossible, it is an additional practical difficulty.

Justin
08-19-2010, 03:42 PM
BTW, what would it take to change the license on that bugger? ;)

~RR.

We can license it in non-GPL form to people who want to give us the moneys. ;)

Justin
08-19-2010, 03:43 PM
Hmm no...It all has just worked magically somehow, by linking to the dll import .lib file and including the resample.h header in my code.

Dunno if it is working entirely as supposed though but it does look like it. If I don't have the dll containing the wdl resampler class in the same folder as my application .exe, the application refuses to start. So I don't think the resampler code is for example somehow linked to my executable in some other way.

edit : actually heheh...The application code is using a different resample.h file without the __declspec(dllexport) thing. That's probably wrong.

Heh, which sounds like it isn't using the DLL version, which defeats the point of the LGPLedness.

RRokkenAudio
08-19-2010, 04:01 PM
maybe I'll just put an r_ before every variable/function.. lol then i can sell it hahahah.. j/k obviously lol.

~Rob.

Xenakios
08-19-2010, 05:13 PM
Heh, which sounds like it isn't using the DLL version, which defeats the point of the LGPLedness.

I don't have the resample.cpp file in my code project though...So where would it be taking the code at runtime if it is isn't compiled and linked to the exe? :) Well, anyway I'll figure the mess out somehow.

Tale
08-21-2010, 06:20 AM
Part 2, add WDL as a remote:
echo [remote \"cockoswdl\"] >> .git/config
echo url = http://www-dev.cockos.com/wdl/WDL.git >> .git/config

When I do this it works, but Git won't show me the remote branch (with "git branch -r"). I have no idea if this is important, but nevertheless I would think it probably better/safer to let Git add the remote to your config file by doing:

git remote add cockoswdl http://www-dev.cockos.com/wdl/WDL.git

Now "git branch -r" will report "cockoswdl/master" instead of nothing. The downside is that I need to do "git pull cockoswdl master", but I am sure you could tell Git to pull the master by default.