summaryrefslogtreecommitdiff
path: root/muse_qt4_evolution/midiplugins/libmidiplugin/mempi.h
diff options
context:
space:
mode:
authorRobert Jonsson <spamatica@gmail.com>2009-12-27 11:30:35 +0000
committerRobert Jonsson <spamatica@gmail.com>2009-12-27 11:30:35 +0000
commitb703eab295330e6f81564fbb39a10a1a2fdd2f54 (patch)
treee46b5c9a6bc22fd661c15d1d2123f5bf631cef80 /muse_qt4_evolution/midiplugins/libmidiplugin/mempi.h
parent5d5fa0fdf913907edbc3d2d29a7548f0cb658c94 (diff)
moved old qt4 branch
Diffstat (limited to 'muse_qt4_evolution/midiplugins/libmidiplugin/mempi.h')
-rw-r--r--muse_qt4_evolution/midiplugins/libmidiplugin/mempi.h97
1 files changed, 97 insertions, 0 deletions
diff --git a/muse_qt4_evolution/midiplugins/libmidiplugin/mempi.h b/muse_qt4_evolution/midiplugins/libmidiplugin/mempi.h
new file mode 100644
index 00000000..a5f114b6
--- /dev/null
+++ b/muse_qt4_evolution/midiplugins/libmidiplugin/mempi.h
@@ -0,0 +1,97 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: mempi.h,v 1.10 2005/07/16 09:31:50 wschweer Exp $
+// (C) Copyright 2005 Werner Schweer (ws@seh.de)
+//=========================================================
+
+//
+// MusE experimental midi plugin interface
+//
+
+#ifndef __MEMPI_H__
+#define __MEMPI_H__
+
+#define MEMPI_MAJOR_VERSION 1
+#define MEMPI_MINOR_VERSION 1
+
+#include <set>
+#include "evdata.h"
+#include "memory.h"
+#include "midievent.h"
+
+class MempiP;
+
+//---------------------------------------------------------
+// MempiHost
+// Host Infos
+//---------------------------------------------------------
+
+struct MempiHost {
+ virtual int division() const; // midi division
+ virtual int tempo(unsigned tick) const;
+ virtual unsigned tick2frame(unsigned tick) const;
+ virtual unsigned frame2tick(unsigned frame) const;
+ virtual void bar(int tick, int* bar, int* beat, unsigned* rest) const;
+ virtual unsigned bar2tick(int bar, int beat, int tick) const;
+ virtual ~MempiHost() {}
+ };
+
+//---------------------------------------------------------
+// Mempi
+// Instance class
+// MusE experimental midi plugin interface
+// Instance virtual interface class
+//---------------------------------------------------------
+
+class Mempi {
+ MempiP* d;
+ const char* _name; // mempi instance name
+
+ protected:
+ const MempiHost* host;
+
+ public:
+ // modul interface
+ Mempi(const char* name, const MempiHost*);
+ virtual ~Mempi();
+ virtual bool init() { return false; }
+ const char* name() const { return _name; }
+
+ // process interface
+ virtual void process(unsigned, unsigned, MidiEventList*, MidiEventList*) = 0;
+
+ // session interface
+ virtual void getInitData(int*, const unsigned char**) const {}
+ virtual void setInitData(int, const unsigned char*) {}
+
+ // GUI interface routines
+ virtual bool hasGui() const { return false; }
+ virtual bool guiVisible() const { return false; }
+ virtual void showGui(bool) {}
+ virtual void getGeometry(int* x, int* y, int* w, int* h) const;
+ virtual void setGeometry(int, int, int, int) {}
+ };
+
+//---------------------------------------------------------
+// MEMPI
+// Class descriptor
+//---------------------------------------------------------
+
+enum MempiType { MEMPI_FILTER = 0, MEMPI_GENERATOR = 1 };
+
+struct MEMPI {
+ const char* name;
+ const char* description;
+ const char* version;
+ MempiType type;
+ int majorMempiVersion, minorMempiVersion;
+ Mempi* (*instantiate)(const char* name, const MempiHost*);
+ };
+
+extern "C" {
+ const MEMPI* mempi_descriptor();
+ }
+
+#endif
+