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

Auto-name shared objects without names #57

Merged
merged 1 commit into from
Oct 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions source/include/FluidMaxWrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,20 @@ class FluidMaxWrapper
0);
}

template <typename CType = Client>
static std::enable_if_t<!IsThreadedShared<CType>::value>
checkName(ParamSetType&)
{}

template <typename CType = Client>
static std::enable_if_t<IsThreadedShared<CType>::value>
checkName(ParamSetType& params)
{
if (params.template get<0>().size() == 0)
{
params.template set<0>(std::string(symbol_unique()->s_name), nullptr);
}
}

void resizeListHandlers(index newSize)
{
Expand Down Expand Up @@ -1307,6 +1321,7 @@ class FluidMaxWrapper
}
// process in-box attributes for mutable params
attr_args_process((t_object*) this, static_cast<short>(ac), av);
checkName(mParams);
// return params so this can be called in client initaliser
return mParams;
}
Expand Down