mod.h
1 /* Extended Module Player 2 * Copyright (C) 1996-2021 Claudio Matsuoka and Hipolito Carraro Jr 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a 5 * copy of this software and associated documentation files (the "Software"), 6 * to deal in the Software without restriction, including without limitation 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 * and/or sell copies of the Software, and to permit persons to whom the 9 * Software is furnished to do so, subject to the following conditions: 10 * 11 * The above copyright notice and this permission notice shall be included in 12 * all copies or substantial portions of the Software. 13 * 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 * THE SOFTWARE. 21 */ 22 23 #ifndef LIBXMP_LOADERS_MOD_H 24 #define LIBXMP_LOADERS_MOD_H 25 26 struct mod_instrument { 27 uint8 name[22]; /* Instrument name */ 28 uint16 size; /* Sample length in 16-bit words */ 29 int8 finetune; /* Finetune (signed nibble) */ 30 int8 volume; /* Linear playback volume */ 31 uint16 loop_start; /* Loop start in 16-bit words */ 32 uint16 loop_size; /* Loop length in 16-bit words */ 33 }; 34 35 struct mod_header { 36 uint8 name[20]; 37 struct mod_instrument ins[31]; 38 uint8 len; 39 uint8 restart; /* Number of patterns in Soundtracker, 40 * Restart in Noisetracker/Startrekker, 41 * 0x7F in Protracker 42 */ 43 uint8 order[128]; 44 uint8 magic[4]; 45 }; 46 47 #ifndef LIBXMP_CORE_PLAYER 48 /* Soundtracker 15-instrument module header */ 49 50 struct st_header { 51 uint8 name[20]; 52 struct mod_instrument ins[15]; 53 uint8 len; 54 uint8 restart; 55 uint8 order[128]; 56 }; 57 #endif 58 59 #endif /* LIBXMP_LOADERS_MOD_H */