aboutsummaryrefslogtreecommitdiff
path: root/Src/Plugins/SDK/plLoadEx/ExComponent.cpp
diff options
context:
space:
mode:
authorJean-Francois Mauguit <jfmauguit@mac.com>2024-09-24 09:03:25 -0400
committerGitHub <noreply@github.com>2024-09-24 09:03:25 -0400
commitbab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Plugins/SDK/plLoadEx/ExComponent.cpp
parent4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff)
parent20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff)
downloadwinamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/Plugins/SDK/plLoadEx/ExComponent.cpp')
-rw-r--r--Src/Plugins/SDK/plLoadEx/ExComponent.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/Src/Plugins/SDK/plLoadEx/ExComponent.cpp b/Src/Plugins/SDK/plLoadEx/ExComponent.cpp
new file mode 100644
index 00000000..a9283fe6
--- /dev/null
+++ b/Src/Plugins/SDK/plLoadEx/ExComponent.cpp
@@ -0,0 +1,32 @@
+#include "ExComponent.h"
+#include "api/service/api_service.h" // Service Manager is central to Wasabi
+#include "SimpleHandlerFactory.h" // the Service Factory we're going to regsister
+
+// the service factory we're going to register
+static SimpleHandlerFactory simpleHandlerFactory;
+
+void ExComponent::RegisterServices(api_service *service)
+{
+ // If we need any services, we can retrieve them here
+ // however, you have no guarantee that a service you want will be active yet
+ // so it's best to "lazy load" and get it the first time you need it
+
+ // Register any services we provide here
+ service->service_register(&simpleHandlerFactory);
+}
+
+void ExComponent::DeregisterServices(api_service *service)
+{
+ // Unregister our services
+ service->service_deregister(&simpleHandlerFactory);
+
+ // And release any services we retrieved
+}
+
+// Define the dispatch table
+#define CBCLASS ExComponent
+START_DISPATCH;
+VCB(API_WA5COMPONENT_REGISTERSERVICES, RegisterServices)
+VCB(API_WA5COMPONENT_DEREEGISTERSERVICES, DeregisterServices)
+END_DISPATCH;
+#undef CBCLASS