2 * Adplug - Replayer for many OPL2/OPL3 audio file formats.
3 * Copyright (C) 1999 - 2006 Simon Peter, <dn.tlp@gmx.net>, et al.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 * msc.h - MSC Player by Lubomir Bulej (pallas@kadan.cz)
24 #define MSC_SIGN_LEN 16
25 #define MSC_DESC_LEN 64
27 class CmscPlayer: public CPlayer
30 static CPlayer * factory(Copl * newopl);
32 CmscPlayer(Copl * newopl);
35 bool load(const std::string &filename, const CFileProvider &fp);
37 void rewind(int subsong);
40 std::string gettype ();
43 typedef unsigned char u8;
44 typedef unsigned short u16;
47 u8 mh_sign [MSC_SIGN_LEN];
49 u8 mh_desc [MSC_DESC_LEN];
61 char * desc; // song desctiption
62 unsigned short version; // file version
63 unsigned short nr_blocks; // number of music blocks
64 unsigned short block_len; // maximal block length
65 unsigned short timer_div; // timer divisor
66 msc_block * msc_data; // compressed music data
69 unsigned long block_num; // active block
70 unsigned long block_pos; // position in block
71 unsigned long raw_pos; // position in data buffer
72 u8 * raw_data; // decompression buffer
74 u8 dec_prefix; // prefix / state
75 int dec_dist; // prefix distance
76 unsigned int dec_len; // prefix length
79 unsigned char delay; // active delay
80 unsigned long play_pos; // player position
83 static const u8 msc_signature [MSC_SIGN_LEN];
85 bool load_header (binistream * bf, msc_header * hdr);
86 bool decode_octet (u8 * output);