diff options
author | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
---|---|---|
committer | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
commit | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Plugins/Input/in_wmvdrm/api.cpp | |
parent | 537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff) | |
download | winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz |
Initial community commit
Diffstat (limited to 'Src/Plugins/Input/in_wmvdrm/api.cpp')
-rw-r--r-- | Src/Plugins/Input/in_wmvdrm/api.cpp | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/Src/Plugins/Input/in_wmvdrm/api.cpp b/Src/Plugins/Input/in_wmvdrm/api.cpp new file mode 100644 index 00000000..05749577 --- /dev/null +++ b/Src/Plugins/Input/in_wmvdrm/api.cpp @@ -0,0 +1,56 @@ +#include "main.h" +#include "api.h" +#include <windows.h> +#include "../Winamp/wa_ipc.h" +#include "FactoryHelper.h" +#include "MetaTagFactory.h" +#include "factory_Handler.h" +#include "AlbumArt.h" +#include "RawReader.h" +#include "../nu/Singleton.h" +MetaTagFactory metaTagFactory; + +api_service *serviceManager = 0; +api_playlistmanager *playlistManager=0; +api_config *AGAVE_API_CONFIG=0; +api_application *applicationApi=0; + +// wasabi based services for localisation support +api_language *WASABI_API_LNG = 0; +HINSTANCE WASABI_API_LNG_HINST = 0, WASABI_API_ORIG_HINST = 0; +api_memmgr *WASABI_API_MEMMGR = 0; +WPLHandlerFactory wplHandlerFactory; +ASXHandlerFactory asxHandlerFactory; +AlbumArtFactory albumArtFactory; +static RawMediaReaderService raw_media_reader_service; +static SingletonServiceFactory<svc_raw_media_reader, RawMediaReaderService> raw_factory; + +int LoadWasabi() +{ + ServiceBuild(AGAVE_API_CONFIG, AgaveConfigGUID); + ServiceBuild(playlistManager, api_playlistmanagerGUID); + ServiceBuild(WASABI_API_APP, applicationApiServiceGuid); + ServiceBuild(WASABI_API_LNG, languageApiGUID); + ServiceBuild(WASABI_API_MEMMGR, memMgrApiServiceGuid); + plugin.service->service_register(&metaTagFactory); + plugin.service->service_register(&wplHandlerFactory); + plugin.service->service_register(&asxHandlerFactory); + plugin.service->service_register(&albumArtFactory); + raw_factory.Register(plugin.service, &raw_media_reader_service); + + return TRUE; +} + +void UnloadWasabi() +{ + plugin.service->service_deregister(&metaTagFactory); + plugin.service->service_deregister(&wplHandlerFactory); + plugin.service->service_deregister(&asxHandlerFactory); + plugin.service->service_deregister(&albumArtFactory); + plugin.service->service_deregister(&raw_factory); + ServiceRelease(playlistManager, api_playlistmanagerGUID); + ServiceRelease(AGAVE_API_CONFIG, AgaveConfigGUID); + ServiceRelease(WASABI_API_APP, applicationApiServiceGuid); + ServiceRelease(WASABI_API_LNG, languageApiGUID); + ServiceRelease(WASABI_API_MEMMGR, memMgrApiServiceGuid); +}
\ No newline at end of file |