Archived
1
0
This repository has been archived on 2024-10-17. You can view files and clone it, but cannot push or open issues or pull requests.
winamp/Src/Plugins/Input/in_mp3/FactoryHelper.h

25 lines
601 B
C
Raw Normal View History

2024-09-24 12:54:57 +00:00
#include "api__in_mp3.h"
#include <api/service/waservicefactory.h>
template <class api_T>
void ServiceBuild(api_T *&api_t, GUID factoryGUID_t)
{
if (mod.service)
{
waServiceFactory *factory = mod.service->service_getServiceByGuid(factoryGUID_t);
if (factory)
api_t = reinterpret_cast<api_T *>( factory->getInterface() );
}
}
template <class api_T>
void ServiceRelease(api_T *api_t, GUID factoryGUID_t)
{
if (mod.service && api_t)
{
waServiceFactory *factory = mod.service->service_getServiceByGuid(factoryGUID_t);
if (factory)
factory->releaseInterface(api_t);
}
api_t = NULL;
}