bitwig / dawproject

Open exchange format for DAWs
MIT License
751 stars 19 forks source link

C++ Rewrite/port? #62

Open Rossmaxx opened 11 months ago

Rossmaxx commented 11 months ago

I really like what you guys are doing with DAWproject and the fact that you can have daw agnostic project files.

It would be nice if someone could port this codebase to C++. Most daws these days use C++ so it wouldn't make much sense to add a java based dependency to the daws. Also, it would make the work of daw maintainers easier to implement DAWproject compatibility.

Some of the developers at LMMS had a brief discussion on their discord related to project files and DAWproject popped up. One of the devs there had this concern of adding java to our project but they all agree on adding DAWproject support.

git-moss commented 11 months ago

There is actually not much to port. This is plain XML compressed in a ZIP file (use your favorite ZIP library). You can also go with any simple XML de-/serializer (e.g. https://github.com/zeux/pugixml). If you need wrapper classes they can be generated from the XML schemas: Project.xsd and Metadata.xsd.

Trinitou commented 11 months ago

issue relates to #39

kurasu commented 11 months ago

What moss said.

Also there is no need to use java, just think of it as the reference implementation.

Making a C++ port depends on the approach though: if you just use off-the shelf ZIP and XML structures and read/write to a generic XML tree, I don't think writing a shared library will help you much as the majority of the code is about how to integrate with your own data structures. For validating the XML structure you can use the XSD files.

The other approach is to create a concrete wrapper classes resembling the element/attribute model which would then mirror the java version (which was used to generate the schemas in the first place). That could make sense as a deliverable others could reuse as it would be a bit more rigid and less error-prone than dealing with the generic model directly.

I did some experimentation on a branch (swift) to generate swift code from the java reflection, which is somewhat half-done, but that approach could be used to generate C++ classes. If somebody is interested in picking that up I'm happy to provide some guidance and eventually make that part of the main repo.

Trinitou commented 11 months ago

I started some c++ glue stuff a while ago and now created a draft pull request: #66 (rather unfinished but just want to mention it here)