aboutsummaryrefslogtreecommitdiff
path: root/sample-plugin
diff options
context:
space:
mode:
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