PDA

View Full Version : Delphi translation of Avisynth headers


Kaiousama
30th July 2004, 10:51
Are they already translated?
If not, is anyone interested in working on such a project?

It would be good to allow delphi developers to code their own avisynth filters ;)

pieter1976
30th July 2004, 19:25
I would love to have a delphi component for avisyth and I think that lots of other people would like to have one too.

LigH
15th November 2004, 12:51
I tried that myself last weekend, but gave up finally.

Reasons:

1) Not enough experience with C++ syntax - some forward declarations were a little confusing to me, "friendly" classes absolutely unknown, and constructor handling too ... implicit, probably.

2) Too little experience with interfaces.

3) In Delphi, it is (officially) not possible to create functions with a variable parameter count (like "func(params, ...)" in C++). For example, you won't be able to declare a function like WriteLn() / printf(); you only may use such functions from external DLLs, if you use the "varargs" modifier together with the "external" statement.

Bidoche
15th November 2004, 16:14
Varargs is a C legacy, C++ doesn't like that too much.

Where do it needs that ? I mean really need it.
I never use it in 3.0.

LigH
15th November 2004, 16:37
I'm not yet sure how far I need to declare it, at least I will have to declare one class interface (so that my code knows what's inside); an sprintf() function is part of one "Interface" class (I think, the Environment). And officially, Delphi allows declaring "varargs" functions only together with using "external" DLL imports. But there is a trick to circumvent that via using procedural variables...

Bidoche
15th November 2004, 16:52
and you feel you need to declare this sprintf !?

C++ has its own way to do the same, and I guess delphi as well.

LigH
15th November 2004, 17:56
I don't know enough about interface classes, to be sure if I need to translate all the functions of this interface class from the C++ header to Delphi; I'm not sure if I may ignore this specific function; I'm not sure if someone would miss this function if I did not translate it.

But in case I need to translate this interface class declaration completely, I need to find a way to tell Delphi: "This is a C-style function with varargs". And in general, that is allowed only for "external" functions I import out of DLLs, but it is officially not supported to declare any function to have varargs.

I'll first have to check if that "procedural variable" trick works, which I found just today (search for "Delphi varargs without external", this may show you a few pages)...

Bidoche
16th November 2004, 13:25
Just ignore those varargs functions.
2.5 has only a few and as a far as I remember, one can do without.
And 3.0 has none.