lossyWAV 1.3.0 source translated to C++ from Delphi |
- No over 30 sec clips of copyrighted music. Cite properly and never more than necessary for the discussion.
- No copyrighted software without permission.
- Click here for complete Hydrogenaudio Terms of Service
lossyWAV 1.3.0 source translated to C++ from Delphi |
Aug 26 2012, 22:02
Post
#1
|
|
|
Group: Members Posts: 345 Joined: 5-August 03 Member No.: 8183 |
Here is the first public preview of the source translation of lossyWAV 1.3.0 to C++. It is not finished, but the main work is done.
- vc10_err.txt list the current compiler output in Visual Studio C++ 2010. - A number of built-in Delphi functions are not yet converted. Most are trivial, but Write() involves some work. Please note, I know very little of how the code actually works, I basically translated it line by line, and did minor optimizations. Developers can look over the code and compare with the Delphi source. I have tried to take into account a number of C++'s quirks, e.g.: - integer / integer -> integer (not floating point, but if one operand is float, it returns float) - unsigned int (opr) signed int -> unsigned int - & is bitwise-and, && is boolean-and, likewise with or: |, || - c++ base 0 arrays, versus base X in delphi. (range_array class in nSupport.h emulates that) Optimizations: * var = var opr value --> var opr= value; * var = var + 1 --> ++ var; * and a few more I added file nSupport.h that has a few Delphi emulation functions and classes. The shared global variables are only declared in the header file. I've not defined them in the cpp files yet.
Attached File(s)
|
|
|
|
![]() |
Aug 27 2012, 23:19
Post
#2
|
|
|
Group: Members Posts: 345 Joined: 5-August 03 Member No.: 8183 |
Thank you guys. I already did IntToStr() and Copy(), but the rest goes straight in. Actually, I simply replaced directly Copy() with substr() and did the -1 adjustment. I've defined variables in cpp files, and implemented Bit_Scan_Left() and ..Right(). Both GCC and Visual Studio have intrinsic functions for these, and they are now used. There is a C-implementation for other compilers/HW as well. /add: I've also done Val()
I think the stdint.h thing is a minor problem, only the int32_t and int64_t are used. Most important now is to get it working on ONE compiler, then it's a simple matter to port it to others (older etc). The WAV-reading files could possibly be used, although I hope it's is easier to implement the rest of the Delphi IO functions that are missing. These are roughly: AssignFile BlockRead BlockWrite Close CloseFile DirectoryExists Eof FileGetAttr FileMode FilePos FileSetAttr Reset Rewrite Seek Others: Build DateTimeToString Format Now Like I said before, many of these can be replaced with a single correponding c++ stdlib function, others need small wrappers. This post has been edited by tycho: Aug 27 2012, 23:50 |
|
|
|
tycho lossyWAV 1.3.0 source translated to C++ from Delphi Aug 26 2012, 22:02
Nick.C Thanks tycho - I'll have a look tomorrow....
... Aug 26 2012, 22:09
tycho You're welcome, Nick.
Not sure, but your comp... Aug 26 2012, 22:59
[JAZ] A couple of code snippets:
in nSupport.h:
CODE
i... Aug 27 2012, 20:22
db1989 QUOTE ([JAZ] @ Aug 27 2012, 20:22... Aug 27 2012, 21:40
[JAZ] Oops..
Yes, you're right. I should have looked... Aug 27 2012, 22:01
db1989 I was going to say it was good (and my something-n... Aug 27 2012, 22:30
tycho Here is v03 of the translation. (I didn't pub... Aug 28 2012, 21:26
tycho Attached, lossyWAV-cpp_v04.
I finally made it to ... Sep 4 2012, 06:34
Nick.C Thanks Tycho.
I''ve got it to compile wit... Sep 4 2012, 18:40
tycho QUOTE (Nick.C @ Sep 4 2012, 09:40) Thanks... Sep 5 2012, 00:38
Nick.C After a bit of debugging, I've got this versio... Sep 5 2012, 13:03![]() ![]() |
|
Lo-Fi Version | Time is now: 19th June 2013 - 08:14 |