aboutsummaryrefslogtreecommitdiff
path: root/src/midiio/include/MidiMessage.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/midiio/include/MidiMessage.h')
-rw-r--r--src/midiio/include/MidiMessage.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/src/midiio/include/MidiMessage.h b/src/midiio/include/MidiMessage.h
new file mode 100644
index 0000000..e4b59ba
--- /dev/null
+++ b/src/midiio/include/MidiMessage.h
@@ -0,0 +1,78 @@
+//
+// Copyright 1997 by Craig Stuart Sapp, All Rights Reserved.
+// Programmer: Craig Stuart Sapp <craig@ccrma.stanford.edu>
+// Creation Date: 19 December 1997
+// Last Modified: Fri Jan 23 00:21:24 GMT-0800 1998
+// Last Modified: Sun Sep 20 20:30:53 PDT 1998
+// Last Modified: Mon Oct 15 14:29:12 PDT 2001 (added is_note functions)
+// Filename: ...sig/include/sigInfo/MidiMessage.h
+// Web Address: http://sig.sapp.org/include/sigInfo/MidiMessage.h
+// Syntax: C++
+//
+// Description: A structure for handling MIDI input messages.
+// This class stores a time stamp plus up to
+// four MIDI message bytes. System Exclusive messages
+// are stored in a separate array in the MidiInPort
+// class, and their storage index is passed to the
+// user through a MIDI message for later extraction
+// of the full sysex message.
+//
+
+#ifndef _MIDIMESSAGE_H_INCLUDED
+#define _MIDIMESSAGE_H_INCLUDED
+
+#include <iostream>
+
+typedef unsigned char uchar;
+typedef unsigned long ulong;
+
+class MidiMessage {
+ public:
+ ulong time; // timestamp
+ ulong data; // MIDI command and parameters
+
+ MidiMessage (void);
+ MidiMessage (int aCommand, int aP1, int aP2,
+ int aTime = 0);
+ MidiMessage (const MidiMessage& aMessage);
+ ~MidiMessage ();
+
+ uchar& command (void);
+ MidiMessage& operator= (const MidiMessage& aMessage);
+ uchar& operator[] (int index);
+ uchar& p0 (void);
+ uchar& p1 (void);
+ uchar& p2 (void);
+ uchar& p3 (void);
+ int getArgCount (void) const;
+ int getParameterCount (void) const;
+
+ uchar getCommand (void) const;
+ uchar getP0 (void) const;
+ uchar getP1 (void) const;
+ uchar getP2 (void) const;
+ uchar getP3 (void) const;
+
+ void setCommand (uchar aCommand);
+ void setData (uchar aCommand, uchar aP1 = 0,
+ uchar aP2 = 0, uchar aP3 = 0);
+ void setP0 (uchar aP0);
+ void setP1 (uchar aP1);
+ void setP2 (uchar aP2);
+ void setP3 (uchar aP3);
+
+ int is_note (void);
+ int is_note_on (void);
+ int is_note_off (void);
+
+};
+
+
+std::ostream& operator<<(std::ostream& out, MidiMessage& aMessage);
+
+
+#endif /* _MIDIMESSAGE_H_INCLUDED */
+
+
+
+// md5sum: 4738e957fb8a233f6dbaeebda490e6a4 - MidiMessage.h =css= 20030102