aboutsummaryrefslogtreecommitdiff
path: root/sound/mods/module.h
diff options
context:
space:
mode:
authorEugene Sandulenko2006-10-16 22:20:46 +0000
committerEugene Sandulenko2006-10-16 22:20:46 +0000
commit7282e24d3bec5aaa598c6602da18f05783b5abaa (patch)
treeb2177e5fc5434513d7b6aa023086e79d85a65ede /sound/mods/module.h
parent0a51fbb326afe2604a457eef907a6901b06b7152 (diff)
downloadscummvm-rg350-7282e24d3bec5aaa598c6602da18f05783b5abaa.tar.gz
scummvm-rg350-7282e24d3bec5aaa598c6602da18f05783b5abaa.tar.bz2
scummvm-rg350-7282e24d3bec5aaa598c6602da18f05783b5abaa.zip
Add WIP (not yet plugged in) Protracker modules player
svn-id: r24351
Diffstat (limited to 'sound/mods/module.h')
-rw-r--r--sound/mods/module.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/sound/mods/module.h b/sound/mods/module.h
new file mode 100644
index 0000000000..3b39f3991e
--- /dev/null
+++ b/sound/mods/module.h
@@ -0,0 +1,75 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2006 The ScummVM project
+ * Based on code by madmoose
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef __SOUND_MODS_MODULE_H__
+#define __SOUND_MODS_MODULE_H__
+
+namespace Modules {
+
+/*
+ * Storing notes and patterns like this
+ * wastes insane amounts of memory.
+ *
+ * They should be stored in memory
+ * like they are in the file.
+ */
+
+typedef struct {
+ byte sample;
+ uint16 period;
+ uint16 effect;
+} note_t;
+
+typedef note_t pattern_t[64][4];
+
+typedef struct {
+ byte name[23];
+ uint16 len;
+ byte finetune;
+ byte vol;
+ uint16 repeat;
+ uint16 replen;
+ byte *data;
+} sample_t;
+
+class Module {
+public:
+ byte songname[21];
+
+ sample_t sample[32];
+
+ byte songlen;
+ byte undef;
+ byte songpos[128];
+ byte sig[4];
+ pattern_t *pattern;
+
+ Module();
+ ~Module();
+
+ bool load(const char *fn);
+};
+
+} // End of namespace Modules
+
+#endif