aboutsummaryrefslogtreecommitdiff
path: root/sample-plugin
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2016-05-19 23:54:42 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2016-05-19 23:54:42 +0800
commit78b384662f484e946a6a17c96e6c309df0c039da (patch)
tree70093f05f4e9d02bbc8ddfdd2ddc8bef1cca1751 /sample-plugin
parent8ef9703ee2a4b22395935030606fcf69e3acad86 (diff)
downloadQMidiPlayer-78b384662f484e946a6a17c96e6c309df0c039da.tar.xz
Added a sample plugin as a template.
Implemented scanPlugin for Windows.
Diffstat (limited to 'sample-plugin')
-rw-r--r--sample-plugin/sample-plugin.pro23
-rw-r--r--sample-plugin/sampleplugin.cpp11
-rw-r--r--sample-plugin/sampleplugin.hpp24
3 files changed, 58 insertions, 0 deletions
diff --git a/sample-plugin/sample-plugin.pro b/sample-plugin/sample-plugin.pro
new file mode 100644
index 0000000..5ee7c48
--- /dev/null
+++ b/sample-plugin/sample-plugin.pro
@@ -0,0 +1,23 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2016-05-19T09:25:32
+#
+#-------------------------------------------------
+
+QT -= core gui
+
+CONFIG += c++11
+
+TARGET = sample-plugin
+TEMPLATE = lib
+
+DEFINES += SAMPLEPLUGIN_LIBRARY
+
+SOURCES += sampleplugin.cpp
+
+HEADERS += sampleplugin.hpp
+
+unix {
+ target.path = /usr/lib
+ INSTALLS += target
+}
diff --git a/sample-plugin/sampleplugin.cpp b/sample-plugin/sampleplugin.cpp
new file mode 100644
index 0000000..64e5584
--- /dev/null
+++ b/sample-plugin/sampleplugin.cpp
@@ -0,0 +1,11 @@
+#include <cstdio>
+#include "sampleplugin.hpp"
+
+qmpSamplePlugin::qmpSamplePlugin(qmpPluginAPI* _api){api=_api;}
+qmpSamplePlugin::~qmpSamplePlugin(){api=NULL;}
+void qmpSamplePlugin::init()
+{fputs("Hello world from plugin init!\n",stderr);}
+void qmpSamplePlugin::deinit()
+{fputs("Bye!\n",stderr);}
+const char* qmpSamplePlugin::pluginGetName(){return "QMidiPlayer Sample Plugin";}
+const char* qmpSamplePlugin::pluginGetVersion(){return "0.0.0";}
diff --git a/sample-plugin/sampleplugin.hpp b/sample-plugin/sampleplugin.hpp
new file mode 100644
index 0000000..75a5dcf
--- /dev/null
+++ b/sample-plugin/sampleplugin.hpp
@@ -0,0 +1,24 @@
+#ifndef SAMPLEPLUGIN_H
+#define SAMPLEPLUGIN_H
+
+#include "../include/qmpcorepublic.hpp"
+
+class qmpSamplePlugin:public qmpPluginIntf
+{
+ private:
+ qmpPluginAPI* api;
+ public:
+ qmpSamplePlugin(qmpPluginAPI* _api);
+ ~qmpSamplePlugin();
+ void init();
+ void deinit();
+ const char* pluginGetName();
+ const char* pluginGetVersion();
+};
+
+extern "C"{
+ qmpPluginIntf* qmpPluginGetInterface(qmpPluginAPI* api)
+ {return new qmpSamplePlugin(api);}
+}
+
+#endif // SAMPLEPLUGIN_H