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

227: Save (and restore) number of sources and first source ID in presets #229

Merged
merged 8 commits into from
Feb 27, 2025

Conversation

vberthiaume
Copy link
Member

Not saving source-link for now because the manual explains we're not saving those since they are automated

@vberthiaume vberthiaume changed the title 112: Save (and restore) number of sources and first source ID in presets 227: Save (and restore) number of sources and first source ID in presets Feb 17, 2025
for (auto & source : mSources) {
SourceSnapshot snapshot{};
SourceSnapshot snapshot;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

est-ce qu'on est surs que ça change rien ? ça peut avoir un impact si le type est "plain-old-data".

ex.: https://gcc.godbolt.org/z/nzqbPvvv8

ici on voit que dans le premier cas en haut, la mémoire est renvoyée directement de la fonction; dans le second cas elle se fait zeroed avant.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh wow ok, bien vu!

terminalPosition
= juce::Point<float>{ inversedTerminalPosition.getX(), inversedTerminalPosition.getY() * -1.0f };
auto const inversedTerminalPosition{ inversedNormalizedTerminalPosition * 2.0f - juce::Point<float>{ 1.0f, 1.0f } };
terminalPosition = juce::Point<float>{ inversedTerminalPosition.getX(), inversedTerminalPosition.getY() * -1.0f };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

j'ai l'impression qu'il y a pas mal de petits changements de formatting qui inviteraient à faire une MR globale de clang-format, qu'en penses-tu ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(à noter qu'il faut vraiment la faire à un moment ou tout est mergé et il n'y a rien d'autre en cours sinon ça va être l'enfer)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha ouais 💯

auto const xName{ getFixedPosSourceName(FixedPositionType::terminal, SourceIndex{ 0 }, 0) };
auto const yName{ getFixedPosSourceName(FixedPositionType::terminal, SourceIndex{ 0 }, 1) };
auto const zName{ getFixedPosSourceName(FixedPositionType::terminal, SourceIndex{ 0 }, 2) };
//TODO VB: is terminal the same as final?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pas sûr qu'on veuille garder ces commentaires dans la version finale ^^'


// For some legacy reason, we store a normalized value with inversed Y and elevation
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kinda makes sense, a lot of spatialization systems work like this

@@ -56,6 +56,15 @@ struct SourcesSnapshots {
SourceSnapshot & operator[](SourceIndex const index);
int size() const { return secondaries.size() + 1; }

juce::String toString ()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this method can be marked const

juce::String toString ()
{
juce::String ret;
ret += primary.position.toString() + ", " + primary.z.toString() + "; ";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hopefully one day juce supports std::format :D with it it would be:

ret += std::format("{}, {}; ", primary.position, primary.z);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right... another thing is we'd need to change the c++ version in the projucer. I'll make a note of it

@guillaumeriousat
Copy link
Collaborator

J'ai testé avec les fix, ça marche !

@guillaumeriousat guillaumeriousat self-requested a review February 27, 2025 21:45
Copy link
Collaborator

@guillaumeriousat guillaumeriousat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maintenant que j'ai les pouvoirs, j'approuve !

@vberthiaume vberthiaume merged commit ed5db28 into dev-sat Feb 27, 2025
3 checks passed
@vberthiaume vberthiaume deleted the feature/112-preset branch February 27, 2025 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants