From 49720ad168e0abef844f10baf6d4f3968eb15318 Mon Sep 17 00:00:00 2001 From: "Tim E. Real" Date: Wed, 3 Nov 2010 01:03:08 +0000 Subject: Removed mpevent(.h, .cpp) and evdata.h from /libsynti, conflicting with copies in /muse, causing crashes. Version in /muse is newer. Should only be one version. --- muse2/synti/libsynti/CMakeLists.txt | 3 +- muse2/synti/libsynti/evdata.h | 67 ----------------------- muse2/synti/libsynti/evdata.h.OLD | 67 +++++++++++++++++++++++ muse2/synti/libsynti/gui.cpp | 3 +- muse2/synti/libsynti/mpevent.cpp | 22 -------- muse2/synti/libsynti/mpevent.cpp.OLD | 22 ++++++++ muse2/synti/libsynti/mpevent.h | 100 ----------------------------------- muse2/synti/libsynti/mpevent.h.OLD | 100 +++++++++++++++++++++++++++++++++++ 8 files changed, 192 insertions(+), 192 deletions(-) delete mode 100644 muse2/synti/libsynti/evdata.h create mode 100644 muse2/synti/libsynti/evdata.h.OLD delete mode 100644 muse2/synti/libsynti/mpevent.cpp create mode 100644 muse2/synti/libsynti/mpevent.cpp.OLD delete mode 100644 muse2/synti/libsynti/mpevent.h create mode 100644 muse2/synti/libsynti/mpevent.h.OLD (limited to 'muse2/synti/libsynti') diff --git a/muse2/synti/libsynti/CMakeLists.txt b/muse2/synti/libsynti/CMakeLists.txt index 10154a93..6f72b31c 100644 --- a/muse2/synti/libsynti/CMakeLists.txt +++ b/muse2/synti/libsynti/CMakeLists.txt @@ -28,7 +28,8 @@ add_library(synti mono.cpp poly.cpp # midievent.cpp - mpevent.cpp + # Removed. Causing conflicts with /muse/mpevent + ## mpevent.cpp ) # diff --git a/muse2/synti/libsynti/evdata.h b/muse2/synti/libsynti/evdata.h deleted file mode 100644 index 4e529bec..00000000 --- a/muse2/synti/libsynti/evdata.h +++ /dev/null @@ -1,67 +0,0 @@ -//========================================================= -// MusE -// Linux Music Editor -// $Id: evdata.h,v 1.1 2004/02/13 13:55:03 wschweer Exp $ -// -// (C) Copyright 1999-2003 Werner Schweer (ws@seh.de) -//========================================================= - -#ifndef __EVDATA_H__ -#define __EVDATA_H__ - -//#include -#include // p4.0.2 - -//--------------------------------------------------------- -// EvData -// variable len event data (sysex, meta etc.) -//--------------------------------------------------------- - -class EvData { - int* refCount; - - public: - unsigned char* data; - int dataLen; - - EvData() { - data = 0; - dataLen = 0; - refCount = new int(1); - } - EvData(const EvData& ed) { - data = ed.data; - dataLen = ed.dataLen; - refCount = ed.refCount; - (*refCount)++; - } - - EvData& operator=(const EvData& ed) { - if (data == ed.data) - return *this; - if (--(*refCount) == 0) { - delete refCount; - delete[] data; - } - data = ed.data; - dataLen = ed.dataLen; - refCount = ed.refCount; - (*refCount)++; - return *this; - } - - ~EvData() { - if (--(*refCount) == 0) { - delete[] data; - delete refCount; - } - } - void setData(const unsigned char* p, int l) { - data = new unsigned char[l]; - memcpy(data, p, l); - dataLen = l; - } - }; - -#endif - diff --git a/muse2/synti/libsynti/evdata.h.OLD b/muse2/synti/libsynti/evdata.h.OLD new file mode 100644 index 00000000..4e529bec --- /dev/null +++ b/muse2/synti/libsynti/evdata.h.OLD @@ -0,0 +1,67 @@ +//========================================================= +// MusE +// Linux Music Editor +// $Id: evdata.h,v 1.1 2004/02/13 13:55:03 wschweer Exp $ +// +// (C) Copyright 1999-2003 Werner Schweer (ws@seh.de) +//========================================================= + +#ifndef __EVDATA_H__ +#define __EVDATA_H__ + +//#include +#include // p4.0.2 + +//--------------------------------------------------------- +// EvData +// variable len event data (sysex, meta etc.) +//--------------------------------------------------------- + +class EvData { + int* refCount; + + public: + unsigned char* data; + int dataLen; + + EvData() { + data = 0; + dataLen = 0; + refCount = new int(1); + } + EvData(const EvData& ed) { + data = ed.data; + dataLen = ed.dataLen; + refCount = ed.refCount; + (*refCount)++; + } + + EvData& operator=(const EvData& ed) { + if (data == ed.data) + return *this; + if (--(*refCount) == 0) { + delete refCount; + delete[] data; + } + data = ed.data; + dataLen = ed.dataLen; + refCount = ed.refCount; + (*refCount)++; + return *this; + } + + ~EvData() { + if (--(*refCount) == 0) { + delete[] data; + delete refCount; + } + } + void setData(const unsigned char* p, int l) { + data = new unsigned char[l]; + memcpy(data, p, l); + dataLen = l; + } + }; + +#endif + diff --git a/muse2/synti/libsynti/gui.cpp b/muse2/synti/libsynti/gui.cpp index b5faf54a..23a18fee 100644 --- a/muse2/synti/libsynti/gui.cpp +++ b/muse2/synti/libsynti/gui.cpp @@ -94,8 +94,7 @@ void MessGui::sendSysex(unsigned char* p, int n) { // MidiPlayEvent pe(0, 0, ME_SYSEX, p, n); // sendEvent(pe); - - printf("MusE TESTING: MessGui::sendSysex(): sendEvent\n"); + sendEvent(MidiPlayEvent(0, 0, ME_SYSEX, p, n)); } diff --git a/muse2/synti/libsynti/mpevent.cpp b/muse2/synti/libsynti/mpevent.cpp deleted file mode 100644 index 482bc952..00000000 --- a/muse2/synti/libsynti/mpevent.cpp +++ /dev/null @@ -1,22 +0,0 @@ -//========================================================= -// MusE -// Linux Music Editor -// $Id: mpevent.cpp,v 1.1 2004/02/12 18:30:30 wschweer Exp $ -// -// (C) Copyright 2002-2004 Werner Schweer (ws@seh.de) -//========================================================= - -#include "mpevent.h" - -//--------------------------------------------------------- -// MEvent -//--------------------------------------------------------- - -MEvent::MEvent(unsigned t, int port, int tpe, const unsigned char* data, int len) - { - _time = t; - _port = port; - edata.setData(data, len); - _type = tpe; - } - diff --git a/muse2/synti/libsynti/mpevent.cpp.OLD b/muse2/synti/libsynti/mpevent.cpp.OLD new file mode 100644 index 00000000..482bc952 --- /dev/null +++ b/muse2/synti/libsynti/mpevent.cpp.OLD @@ -0,0 +1,22 @@ +//========================================================= +// MusE +// Linux Music Editor +// $Id: mpevent.cpp,v 1.1 2004/02/12 18:30:30 wschweer Exp $ +// +// (C) Copyright 2002-2004 Werner Schweer (ws@seh.de) +//========================================================= + +#include "mpevent.h" + +//--------------------------------------------------------- +// MEvent +//--------------------------------------------------------- + +MEvent::MEvent(unsigned t, int port, int tpe, const unsigned char* data, int len) + { + _time = t; + _port = port; + edata.setData(data, len); + _type = tpe; + } + diff --git a/muse2/synti/libsynti/mpevent.h b/muse2/synti/libsynti/mpevent.h deleted file mode 100644 index 8568169f..00000000 --- a/muse2/synti/libsynti/mpevent.h +++ /dev/null @@ -1,100 +0,0 @@ -//========================================================= -// MusE -// Linux Music Editor -// $Id: mpevent.h,v 1.1 2004/02/12 18:30:31 wschweer Exp $ -// -// (C) Copyright 1999-2002 Werner Schweer (ws@seh.de) -//========================================================= - -#ifndef __MPEVENT_H__ -#define __MPEVENT_H__ - -#include "evdata.h" - -//--------------------------------------------------------- -// MEvent -// baseclass for MidiPlayEvent and MidiRecordEvent -//--------------------------------------------------------- - -//--------------------------------------------------------- -// MEvent -//--------------------------------------------------------- - -class MEvent { - unsigned _time; - EvData edata; - unsigned char _port, _channel, _type; - int _a, _b; - - public: - MEvent() {} - MEvent(unsigned tm, int p, int c, int t, int a, int b) - : _time(tm), _port(p), _channel(c & 0xf), _type(t), _a(a), _b(b) {} - MEvent(unsigned t, int p, int type, const unsigned char* data, int len); - MEvent(unsigned t, int p, int tpe, EvData d) : _time(t), edata(d), _port(p), _type(tpe) {} - - ~MEvent() {} - - int port() const { return _port; } - int channel() const { return _channel; } - int type() const { return _type; } - int dataA() const { return _a; } - int dataB() const { return _b; } - unsigned time() const { return _time; } - - void setPort(int val) { _port = val; } - void setChannel(int val) { _channel = val; } - void setType(int val) { _type = val; } - void setA(int val) { _a = val; } - void setB(int val) { _b = val; } - void setTime(unsigned val) { _time = val; } - - const EvData& eventData() const { return edata; } - unsigned char* data() const { return edata.data; } - int len() const { return edata.dataLen; } - void setData(const EvData& e) { edata = e; } - void setData(const unsigned char* p, int len) { edata.setData(p, len); } - bool isNote() const { return _type == 0x90; } - bool isNoteOff() const { return (_type == 0x80)||(_type == 0x90 && _b == 0); } - }; - -//--------------------------------------------------------- -// MidiRecordEvent -// allocated and deleted in midiseq thread context -//--------------------------------------------------------- - -class MidiPlayEvent; - -class MidiRecordEvent : public MEvent { - public: - MidiRecordEvent() {} - MidiRecordEvent(const MEvent& e) : MEvent(e) {} - MidiRecordEvent(unsigned tm, int p, int c, int t, int a, int b) - : MEvent(tm, p, c, t, a, b) {} - MidiRecordEvent(unsigned t, int p, int tpe, const unsigned char* data, int len) - : MEvent(t, p, tpe, data, len) {} - MidiRecordEvent(unsigned t, int p, int type, EvData data) - : MEvent(t, p, type, data) {} - ~MidiRecordEvent() {} - }; - -//--------------------------------------------------------- -// MidiPlayEvent -// allocated and deleted in audio thread context -//--------------------------------------------------------- - -class MidiPlayEvent : public MEvent { - public: - MidiPlayEvent() {} - MidiPlayEvent(const MEvent& e) : MEvent(e) {} - MidiPlayEvent(unsigned tm, int p, int c, int t, int a, int b) - : MEvent(tm, p, c, t, a, b) {} - MidiPlayEvent(unsigned t, int p, int type, const unsigned char* data, int len) - : MEvent(t, p, type, data, len) {} - MidiPlayEvent(unsigned t, int p, int type, EvData data) - : MEvent(t, p, type, data) {} - ~MidiPlayEvent() {} - }; - -#endif - diff --git a/muse2/synti/libsynti/mpevent.h.OLD b/muse2/synti/libsynti/mpevent.h.OLD new file mode 100644 index 00000000..8568169f --- /dev/null +++ b/muse2/synti/libsynti/mpevent.h.OLD @@ -0,0 +1,100 @@ +//========================================================= +// MusE +// Linux Music Editor +// $Id: mpevent.h,v 1.1 2004/02/12 18:30:31 wschweer Exp $ +// +// (C) Copyright 1999-2002 Werner Schweer (ws@seh.de) +//========================================================= + +#ifndef __MPEVENT_H__ +#define __MPEVENT_H__ + +#include "evdata.h" + +//--------------------------------------------------------- +// MEvent +// baseclass for MidiPlayEvent and MidiRecordEvent +//--------------------------------------------------------- + +//--------------------------------------------------------- +// MEvent +//--------------------------------------------------------- + +class MEvent { + unsigned _time; + EvData edata; + unsigned char _port, _channel, _type; + int _a, _b; + + public: + MEvent() {} + MEvent(unsigned tm, int p, int c, int t, int a, int b) + : _time(tm), _port(p), _channel(c & 0xf), _type(t), _a(a), _b(b) {} + MEvent(unsigned t, int p, int type, const unsigned char* data, int len); + MEvent(unsigned t, int p, int tpe, EvData d) : _time(t), edata(d), _port(p), _type(tpe) {} + + ~MEvent() {} + + int port() const { return _port; } + int channel() const { return _channel; } + int type() const { return _type; } + int dataA() const { return _a; } + int dataB() const { return _b; } + unsigned time() const { return _time; } + + void setPort(int val) { _port = val; } + void setChannel(int val) { _channel = val; } + void setType(int val) { _type = val; } + void setA(int val) { _a = val; } + void setB(int val) { _b = val; } + void setTime(unsigned val) { _time = val; } + + const EvData& eventData() const { return edata; } + unsigned char* data() const { return edata.data; } + int len() const { return edata.dataLen; } + void setData(const EvData& e) { edata = e; } + void setData(const unsigned char* p, int len) { edata.setData(p, len); } + bool isNote() const { return _type == 0x90; } + bool isNoteOff() const { return (_type == 0x80)||(_type == 0x90 && _b == 0); } + }; + +//--------------------------------------------------------- +// MidiRecordEvent +// allocated and deleted in midiseq thread context +//--------------------------------------------------------- + +class MidiPlayEvent; + +class MidiRecordEvent : public MEvent { + public: + MidiRecordEvent() {} + MidiRecordEvent(const MEvent& e) : MEvent(e) {} + MidiRecordEvent(unsigned tm, int p, int c, int t, int a, int b) + : MEvent(tm, p, c, t, a, b) {} + MidiRecordEvent(unsigned t, int p, int tpe, const unsigned char* data, int len) + : MEvent(t, p, tpe, data, len) {} + MidiRecordEvent(unsigned t, int p, int type, EvData data) + : MEvent(t, p, type, data) {} + ~MidiRecordEvent() {} + }; + +//--------------------------------------------------------- +// MidiPlayEvent +// allocated and deleted in audio thread context +//--------------------------------------------------------- + +class MidiPlayEvent : public MEvent { + public: + MidiPlayEvent() {} + MidiPlayEvent(const MEvent& e) : MEvent(e) {} + MidiPlayEvent(unsigned tm, int p, int c, int t, int a, int b) + : MEvent(tm, p, c, t, a, b) {} + MidiPlayEvent(unsigned t, int p, int type, const unsigned char* data, int len) + : MEvent(t, p, type, data, len) {} + MidiPlayEvent(unsigned t, int p, int type, EvData data) + : MEvent(t, p, type, data) {} + ~MidiPlayEvent() {} + }; + +#endif + -- cgit v1.2.3