Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c++ glue class generator #66

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

c++ glue class generator #66

wants to merge 1 commit into from

Conversation

Trinitou
Copy link

@Trinitou Trinitou commented Oct 4, 2023

This is an initial draft for a c++ glue class generator.

I tested including it into a test c++ project and using some of the classes and it compiled.

I have not much time to continue this but wanted to propose as others hopefully might want to jump on board or use it as a bad example ;)

Decisions

(please change if you know it better)

  • I put everything into separate headers to better be able to handle include and forward declaration dependencies.
  • I left out the Referenceable class completely and used raw pointers for the references instead. I think the ID assigment better should happen during XML creation/parsing.

Known issues

  • comments are not transferred correctly, e.g. in Arrangement.h you can clearly see the issues. Also I think some comments get lost completely
  • enums probably rather should be enum classes
  • maybe the usage of raw pointers for the references is not the optimal solution (?)
  • ...

@Trinitou Trinitou mentioned this pull request Oct 4, 2023
@daveronan
Copy link

So if I understand this correctly, I can use this to programmatically create project files in C++?

@Trinitou
Copy link
Author

Trinitou commented Jul 18, 2024

So if I understand this correctly, I can use this to programmatically create project files in C++?

Actually for now it's only providing headers with struct declarations for the dawproject types. (and even this might be needed to be polished in some way)
To being able to really use it, it's still missing the c++ code to parse/write those structs from/to XML and also the bits needed to zip/unzip whole dawproject files including audio files. I once started to write something for the XML part but that was incomplete and I currently don't have much time to continue it I fear.

So you'd still need to do some work to get this code really doing something for you.

The other (also totally valid) way to go about it would be to manually write the XML parsing/writing code for only the bits and pieces of dawproject you need for your project using something like tinyxml. But that might be a bit tedious and if dawproject gets updated/extended, you will have to adjust your code manually then.

@daveronan
Copy link

So if I understand this correctly, I can use this to programmatically create project files in C++?

Actually for now it's only providing headers with struct declarations for the dawproject types. (and even this might be needed to be polished in some way) To being able to really use it, it's still missing the c++ code to parse/write those structs from/to XML and also the bits needed to zip/unzip whole dawproject files including audio files. I once started to write something for the XML part but that was incomplete and I currently don't have much time to continue it I fear.

So you'd still need to do some work to get this code really doing something for you.

The other (also totally valid) way to go about it would be to manually write the XML parsing/writing code for only the bits and pieces of dawproject you need for your project using something like tinyxml. But that might be a bit tedious and if dawproject gets updated/extended, you will have to adjust your code manually then.

Ok, cool. I saw examples in there for java after I left that comment, so it's just a case of converting them it looks like. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants