forked from flucoma/flucoma-max
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
8 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d410b7e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlexHarker I've attempted to implement your suggestions, please let me know if you have anything further as I'm still not very familiar with Max's t_atom and t_symbol types.
Further, line 34
t_symbol* defaultOutName{nullptr};
has an array with nullptr inside it for some reason. When setting outName on line 35, botht_symbol* outName;
andt_symbol* outName{nullptr};
seem to produce an object in Max that works and has a buffer name one can set without crashing. Would you know what difference (if any) this makes?d410b7e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like what I would have done.
t_symbol * is generally a pointer to a single t_symbol, rather than an array (Max uses a system where strings are cached into unique pointers that can be compared directly because in the old days it would have made things much faster). Setting it using {} is just a different kind of C++ initialiser syntax.
I would also set outName to a nullptr (as you suggest above) for consistency, although technically I don't think this struct ever gets constructed in a C++ sense. That could do with addressing and checking elsewhere. @weefuzzy might be able to check my thinking there.
d410b7e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking at this. Just so I'm all caught up: inferring back through flucoma-max issues, bumping the SDK version on windows revealed (among other bad things) that this objects is using the wrong attribute macro for its type? (
atom
vssymbol
). The fix being pursued here is just to change the actual type to symbol anyway because it seems only to needatom
-ness in one place?Seems reasonable, but if it's just an issue of fixing flucoma#371 in
main
then my preference would be for the minimal change sufficient to fix the bug. If that is just correcting the macro, then go with that. The better-ness of usingsymbol
here can then be explored in a different PR. OTOH, if correcting the macro isn't sufficient, then doing it this way seems more justifiable.(I honestly can't remember if there was any better reason I had for making this an
atom
in the first place. I'd need to take a proper look at the code again (which is unlikely to happen in the next few days))d410b7e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @weefuzzy - thanks - I am sure that it is better for it to be a symbol, because it is only ever set to a symbol, (in fact I think it is set directly from a variable that can only be a symbol) so I believe the changes as proposed to be totally sane. Likely the atom before was not set correctly on object load.
What I was looking for your input on was the issue of setting items in the constructor using initializer brackets {nullptr} as (as far as I can see) the struct is actually not constructed (as it is a max object it is made with object_alloc, which may zero, but won't respect constructor values). Can you check my thinking on that?
I guess I'm also a little hazy on why this is a attribute (or at least if it should be read-only) as it seems to get set from other places than I'd expect and I can't obviously see a place where the attribute value would be used, but I've only skimmed it.
Last thing is that @junofern is one of the CCL interns, so we will be seeing more PRs shortly...
d410b7e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlexHarker just making a note here, I have 2 branches on this repo now, the one associated with the original PR is now reverted to just changing the CLASS_ATR, and there is a separate one that has all these symbol changes in it.