summaryrefslogtreecommitdiffabout
path: root/include/midillo/MTrk.h
Side-by-side diff
Diffstat (limited to 'include/midillo/MTrk.h') (more/less context) (show whitespace changes)
-rw-r--r--include/midillo/MTrk.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/include/midillo/MTrk.h b/include/midillo/MTrk.h
new file mode 100644
index 0000000..0884388
--- a/dev/null
+++ b/include/midillo/MTrk.h
@@ -0,0 +1,54 @@
+#ifndef __MIDILLO_MTRK_H
+#define __MIDILLO_MTRK_H
+
+#include <istream>
+#include <ostream>
+#include <list>
+#include <midillo/chunk.h>
+#include <midillo/event.h>
+
+/**
+ * @file
+ * @brief MTrk -- track chunk container
+ */
+
+namespace midillo {
+ using std::istream;
+ using std::ostream;
+
+ /**
+ * MTrk track chunk container class
+ */
+ class MTrk_t : public chunk_t {
+ public:
+ /**
+ * MIDI events contained in the track
+ */
+ events_t events;
+
+ /**
+ * Load MTrk chunk from the stream
+ * @param s input stream
+ */
+ void load(istream& s);
+
+ /**
+ * Save MTrk chunk to the stream
+ * @param s output stream
+ */
+ void save(ostream& s) const;
+
+ /**
+ * Dump textual representation of MTrk chunk to stream
+ * @param s output stream
+ */
+ void dump(ostream& s) const;
+ };
+
+ inline ostream& operator<<(ostream& s,const MTrk_t& mtrk) {
+ mtrk.dump(s); return s;
+ }
+
+}
+
+#endif /* __MIDILLO_MTRK_H */