IPB

Welcome Guest ( Log In | Register )

> Upload forum rules

- 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
tycho
post 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)
Attached File  lossyWAV_cpp.7z ( 90.42K ) Number of downloads: 92
 
Go to the top of the page
+Quote Post
 
Start new topic
Replies
tycho
post Aug 28 2012, 21:26
Post #2





Group: Members
Posts: 345
Joined: 5-August 03
Member No.: 8183



Here is v03 of the translation. (I didn't publish v02). I know its silly not to use github, but I haven't gotten around to it. To compare the two directory trees, use WinMerge. Now, it almost compiles, only complaining about some missing functions, and two more issues:

Append
AssignFile
BlockWrite
Close
DirectoryExists
Pos
Reset
Rewrite
blockread
closeFile
eof
filegetattr
filemode
filepos
filesetattr
seek

These calls should replaced by the native c++ <iostream> lib calls in nWav.cpp and nParameter.cpp without making wrapper function. I would be happy if someone (JAZ?) would take the job - it's not hard, but I need a break. Google "Append delphi", etc. will give the required documentation at delphibasics.co.uk.

Write <-- this is harder, may wait (empty function defined in nSupport.h)
datetimetostring

Nick, also the argument to datetimetostring() call in nCore is a little mysterious to me - not sure handle that one.
Attached File(s)
Attached File  lossyWAV_cpp_v03.7z ( 90.1K ) Number of downloads: 68
 
Go to the top of the page
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd September 2014 - 03:07