summaryrefslogtreecommitdiff
path: root/attic/muse_qt4_evolution/midiplugins/libmidiplugin/mempi.h
diff options
context:
space:
mode:
authorRobert Jonsson <spamatica@gmail.com>2011-03-07 19:01:11 +0000
committerRobert Jonsson <spamatica@gmail.com>2011-03-07 19:01:11 +0000
commite40fc849149dd97c248866a4a1d026dda5e57b62 (patch)
treeb12b358f3b3a0608001d30403358f8443118ec5f /attic/muse_qt4_evolution/midiplugins/libmidiplugin/mempi.h
parent1bd4f2e8d9745cabb667b043171cad22c8577768 (diff)
clean3
Diffstat (limited to 'attic/muse_qt4_evolution/midiplugins/libmidiplugin/mempi.h')
-rw-r--r--attic/muse_qt4_evolution/midiplugins/libmidiplugin/mempi.h97
1 files changed, 97 insertions, 0 deletions
diff --git a/attic/muse_qt4_evolution/midiplugins/libmidiplugin/mempi.h b/attic/muse_qt4_evolution/midiplugins/libmidiplugin/mempi.h
new file mode 100644
index 00000000..a5f114b6
--- /dev/null
+++ b/attic/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
+