diff --git a/include/ak/profile.h b/include/ak/profile.h index 9bfc5af2..be4246d7 100644 --- a/include/ak/profile.h +++ b/include/ak/profile.h @@ -86,6 +86,10 @@ ak_platform(void); void ak_setPlatform(const char platform[64]); +AK_EXPORT +AkProfileCommon* +ak_getProfileCommon(struct AkEffect * __restrict effect); + #ifdef __cplusplus } #endif diff --git a/src/profile.c b/src/profile.c index f93cca5d..669ffa30 100644 --- a/src/profile.c +++ b/src/profile.c @@ -155,3 +155,18 @@ void ak_profile_deinit(void) { ak_free(ak__profileTypes); } + +AK_EXPORT +AkProfileCommon* +ak_getProfileCommon(struct AkEffect * __restrict effect) { + AkProfile *profile; + + profile = effect->profile; + while (profile) { + if (profile->type == AK_PROFILE_TYPE_COMMON) + break; + profile = profile->next; + } + + return (AkProfileCommon *)profile; +}