Skip to content

Commit

Permalink
get profile common helper
Browse files Browse the repository at this point in the history
  • Loading branch information
recp committed Jan 15, 2024
1 parent 2ee509c commit fafd109
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/ak/profile.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions src/profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit fafd109

Please sign in to comment.