LMMS
Loading...
Searching...
No Matches
msc.h
Go to the documentation of this file.
1/*
2 * Adplug - Replayer for many OPL2/OPL3 audio file formats.
3 * Copyright (C) 1999 - 2006 Simon Peter, <dn.tlp@gmx.net>, et al.
4 *
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.
9 *
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.
14 *
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 *
19 * msc.h - MSC Player by Lubomir Bulej (pallas@kadan.cz)
20 */
21
22#include "player.h"
23
24#define MSC_SIGN_LEN 16
25#define MSC_DESC_LEN 64
26
27class CmscPlayer: public CPlayer
29 public:
30 static CPlayer * factory(Copl * newopl);
31
32 CmscPlayer(Copl * newopl);
34
35 bool load(const std::string &filename, const CFileProvider &fp);
36 bool update();
37 void rewind(int subsong);
38 float getrefresh();
39
40 std::string gettype ();
41
42 protected:
43 typedef unsigned char u8;
44 typedef unsigned short u16;
45
54
59
60 // file data
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
67
68 // decoder state
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
73
74 u8 dec_prefix; // prefix / state
75 int dec_dist; // prefix distance
76 unsigned int dec_len; // prefix length
77
78 // player state
79 unsigned char delay; // active delay
80 unsigned long play_pos; // player position
81
82 private:
83 static const u8 msc_signature [MSC_SIGN_LEN];
84
85 bool load_header (binistream * bf, msc_header * hdr);
86 bool decode_octet (u8 * output);
87};
Definition fprovide.h:29
CPlayer(Copl *newopl)
Definition player.cpp:34
unsigned char delay
Definition msc.h:79
u8 dec_prefix
Definition msc.h:74
unsigned short u16
Definition msc.h:44
int dec_dist
Definition msc.h:75
unsigned int dec_len
Definition msc.h:76
unsigned char u8
Definition msc.h:43
char * desc
Definition msc.h:61
unsigned long block_pos
Definition msc.h:70
static const u8 msc_signature[MSC_SIGN_LEN]
Definition msc.h:28
unsigned long play_pos
Definition msc.h:80
unsigned long raw_pos
Definition msc.h:71
std::string gettype()
Definition msc.cpp:175
unsigned short timer_div
Definition msc.h:65
unsigned short version
Definition msc.h:62
bool load_header(binistream *bf, msc_header *hdr)
Definition msc.cpp:185
bool load(const std::string &filename, const CFileProvider &fp)
Definition msc.cpp:66
float getrefresh()
Definition msc.cpp:169
msc_block * msc_data
Definition msc.h:66
bool decode_octet(u8 *output)
Definition msc.cpp:204
unsigned short nr_blocks
Definition msc.h:63
unsigned short block_len
Definition msc.h:64
~CmscPlayer()
Definition msc.cpp:47
static CPlayer * factory(Copl *newopl)
Definition msc.cpp:34
bool update()
Definition msc.cpp:115
void rewind(int subsong)
Definition msc.cpp:154
u8 * raw_data
Definition msc.h:72
CmscPlayer(Copl *newopl)
Definition msc.cpp:39
unsigned long block_num
Definition msc.h:69
Definition opl.h:26
static char filename[]
Definition features.c:5
#define MSC_DESC_LEN
Definition msc.h:25
#define MSC_SIGN_LEN
Definition msc.h:24
Definition msc.h:55
u8 * mb_data
Definition msc.h:57
u16 mb_length
Definition msc.h:56
Definition msc.h:46
u16 mh_timer
Definition msc.h:50
u16 mh_block_len
Definition msc.h:52
u16 mh_nr_blocks
Definition msc.h:51
u8 mh_sign[MSC_SIGN_LEN]
Definition msc.h:47
u16 mh_ver
Definition msc.h:48
u8 mh_desc[MSC_DESC_LEN]
Definition msc.h:49