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

Feature Request: Include main processor annotations in program details #87

Open
0xchase opened this issue Nov 11, 2024 · 0 comments
Open

Comments

@0xchase
Copy link

0xchase commented Nov 11, 2024

Currently Engine::getProgramDetails returns json with the following structure.

{
    "inputs": [ ... ],
    "outputs": [ ... ],
    "mainProcessor": "someProcessorName",
    "mainProcessorLocation": "SomeFile.cmajor:15:7:"
}

In particular, the createProgramDetails method inserts the name and location of the processor, but excludes any additional annotation appended to the main processor.

if (mainProcessor != nullptr)
{
details.setMember ("mainProcessor", mainProcessor->getFullyQualifiedReadableName());
if (auto location = mainProcessor->context.getFullLocation().getLocationDescription(); ! location.empty())
details.setMember ("mainProcessorLocation", location);
}
details.setMember ("inputs", getProgram().endpointList.inputEndpointDetails.toJSON (true));
details.setMember ("outputs", getProgram().endpointList.outputEndpointDetails.toJSON (true));

Thus, (to my knowledge) there isn't a way to retrieve a list of user annotations added to the main processor. So if I had main processor annotations like the following, there would be no way to retrieve the width and height values.

graph ElectricPiano  [[ main, width: 300, height: 200 ]]

This feature request proposes that additional annotations added to the main processor be included in the program details. There are various ways to achieve this; one is the refactor below.

{
    "inputs": [ ... ],
    "outputs": [ ... ],
    "mainProcessor": {
        "name": "someProcessorName",
        "location": "SomeFile.cmajor:15:7:",
        /* additional annotations below */
    },
}

Another would be

{
    "inputs": [ ... ],
    "outputs": [ ... ],
    "mainProcessor": "someProcessorName",
    "mainProcessorLocation": "SomeFile.cmajor:15:7:",
    "mainProcessorAnnotations": { /* additional annotations here */ }
}

I'm assuming there isn't a way I'm unaware of to retrieve these annotations. If this is a change you're amenable to but it'd be low on your priority list, I'd be happy to work on a pull request if we can agree on a design. Let me know what you think.

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

No branches or pull requests

1 participant