mirror of
https://github.com/WinampDesktop/winamp.git
synced 2024-12-11 19:01:00 -05:00
24 lines
No EOL
561 B
C++
24 lines
No EOL
561 B
C++
#include "api.h"
|
|
#include <api/service/waservicefactory.h>
|
|
|
|
template <class api_T>
|
|
void ServiceBuild(api_T *&api_t, GUID factoryGUID_t)
|
|
{
|
|
if (plugin.service)
|
|
{
|
|
waServiceFactory *factory = plugin.service->service_getServiceByGuid(factoryGUID_t);
|
|
if (factory)
|
|
api_t = (api_T *)factory->getInterface();
|
|
}
|
|
}
|
|
|
|
template <class api_T>
|
|
void ServiceRelease(api_T *api_t, GUID factoryGUID_t)
|
|
{
|
|
if (plugin.service)
|
|
{
|
|
waServiceFactory *factory = plugin.service->service_getServiceByGuid(factoryGUID_t);
|
|
if (factory)
|
|
factory->releaseInterface(api_t);
|
|
}
|
|
} |