1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- #include "../Agave/Component/ifc_wa5component.h"
- #include "api__xspf.h"
- #include "XSPFHandlerFactory.h"
- api_service *WASABI_API_SVC = 0;
- api_mldb *AGAVE_API_MLDB = 0;
- api_tagz *AGAVE_API_TAGZ = 0;
- api_application *WASABI_API_APP = 0;
- api_language *WASABI_API_LNG = 0;
- HINSTANCE WASABI_API_LNG_HINST = 0, WASABI_API_ORIG_HINST = 0;
- static XSPFHandlerFactory xspfHandlerFactory;
- class XSPFComponent : public ifc_wa5component
- {
- public:
- void RegisterServices(api_service *service);
- void DeregisterServices(api_service *service);
- protected:
- RECVS_DISPATCH;
- };
- static HINSTANCE GetMyInstance()
- {
- MEMORY_BASIC_INFORMATION mbi = {0};
- if(VirtualQuery(GetMyInstance, &mbi, sizeof(mbi)))
- return (HINSTANCE)mbi.AllocationBase;
- return NULL;
- }
- void XSPFComponent::RegisterServices(api_service *service)
- {
- WASABI_API_SVC = service;
- WASABI_API_SVC->service_register(&xspfHandlerFactory);
- waServiceFactory *sf = WASABI_API_SVC->service_getServiceByGuid(languageApiGUID);
- if (sf) WASABI_API_LNG = reinterpret_cast<api_language*>(sf->getInterface());
-
- WASABI_API_START_LANG(GetMyInstance(),playlistLangGUID);
- }
- void XSPFComponent::DeregisterServices(api_service *service)
- {
- WASABI_API_SVC->service_deregister(&xspfHandlerFactory);
- }
- static XSPFComponent xspfComponent;
- extern "C" __declspec(dllexport) ifc_wa5component *GetWinamp5SystemComponent()
- {
- return &xspfComponent;
- }
- #define CBCLASS XSPFComponent
- START_DISPATCH;
- VCB(API_WA5COMPONENT_REGISTERSERVICES, RegisterServices)
- VCB(API_WA5COMPONENT_DEREEGISTERSERVICES, DeregisterServices)
- END_DISPATCH;
- #undef CBCLASS
|