mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-18 05:55:45 -04:00
Initial community commit
This commit is contained in:
25
Src/Plugins/Input/in_mp3/FactoryHelper.h
Normal file
25
Src/Plugins/Input/in_mp3/FactoryHelper.h
Normal file
@ -0,0 +1,25 @@
|
||||
#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;
|
||||
}
|
Reference in New Issue
Block a user