LMMS
Loading...
Searching...
No Matches
hsc.h
Go to the documentation of this file.
1/*
2 * Adplug - Replayer for many OPL2/OPL3 audio file formats.
3 * Copyright (C) 1999 - 2007 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 * hsc.h - HSC Player by Simon Peter <dn.tlp@gmx.net>
20 */
21
22#ifndef H_ADPLUG_HSCPLAYER
23#define H_ADPLUG_HSCPLAYER
24
25#include "player.h"
26
27class ChscPlayer: public CPlayer
28{
29 public:
30 static CPlayer *factory(Copl *newopl);
31
32 ChscPlayer(Copl *newopl): CPlayer(newopl), mtkmode(0) {}
33
34 bool load(const std::string &filename, const CFileProvider &fp);
35 bool update();
36 void rewind(int subsong);
37 float getrefresh() { return 18.2f; }; // refresh rate is fixed at 18.2Hz
38
39 std::string gettype() { return std::string("HSC Adlib Composer / HSC-Tracker"); }
40 unsigned int getpatterns();
41 unsigned int getpattern() { return song[songpos]; }
42 unsigned int getorders();
43 unsigned int getorder() { return songpos; }
44 unsigned int getrow() { return pattpos; }
45 unsigned int getspeed() { return speed; }
46 unsigned int getinstruments();
47
48 protected:
49 struct hscnote {
50 unsigned char note, effect;
51 }; // note type in HSC pattern
52
53 struct hscchan {
54 unsigned char inst; // current instrument
55 signed char slide; // used for manual slide-effects
56 unsigned short freq; // actual replaying frequency
57 }; // HSC channel data
58
59 hscchan channel[9]; // player channel-info
60 unsigned char instr[128][12]; // instrument data
61 unsigned char song[0x80]; // song-arrangement (MPU-401 Trakker enhanced)
62 hscnote patterns[50][64*9]; // pattern data
63 unsigned char pattpos,songpos, // various bytes & flags
65 unsigned int speed,del;
66 unsigned char adl_freq[9]; // adlib frequency registers
67 int mtkmode; // flag: MPU-401 Trakker mode on/off
68
69 private:
70 void setfreq(unsigned char chan, unsigned short freq);
71 void setvolume(unsigned char chan, int volc, int volm);
72 void setinstr(unsigned char chan, unsigned char insnr);
73};
74
75#endif
Definition fprovide.h:29
CPlayer(Copl *newopl)
Definition player.cpp:34
unsigned int getorders()
Definition hsc.cpp:262
unsigned int getorder()
Definition hsc.h:43
unsigned int getrow()
Definition hsc.h:44
ChscPlayer(Copl *newopl)
Definition hsc.h:32
unsigned char instr[128][12]
Definition hsc.h:60
unsigned int getpatterns()
Definition hsc.cpp:250
unsigned int getpattern()
Definition hsc.h:41
void setfreq(unsigned char chan, unsigned short freq)
Definition hsc.cpp:294
unsigned int speed
Definition hsc.h:65
hscnote patterns[50][64 *9]
Definition hsc.h:62
unsigned int getinstruments()
Definition hsc.cpp:274
unsigned char adl_freq[9]
Definition hsc.h:66
unsigned char song[0x80]
Definition hsc.h:61
unsigned char pattpos
Definition hsc.h:63
int mtkmode
Definition hsc.h:67
unsigned int del
Definition hsc.h:65
std::string gettype()
Definition hsc.h:39
float getrefresh()
Definition hsc.h:37
bool load(const std::string &filename, const CFileProvider &fp)
Definition hsc.cpp:34
unsigned char songend
Definition hsc.h:64
void setvolume(unsigned char chan, int volc, int volm)
Definition hsc.cpp:302
void setinstr(unsigned char chan, unsigned char insnr)
Definition hsc.cpp:314
static CPlayer * factory(Copl *newopl)
Definition hsc.cpp:29
unsigned char bd
Definition hsc.h:64
unsigned int getspeed()
Definition hsc.h:45
bool update()
Definition hsc.cpp:77
unsigned char pattbreak
Definition hsc.h:64
hscchan channel[9]
Definition hsc.h:59
void rewind(int subsong)
Definition hsc.cpp:235
unsigned char fadein
Definition hsc.h:64
unsigned char mode6
Definition hsc.h:64
unsigned char songpos
Definition hsc.h:63
Definition opl.h:26
static char filename[]
Definition features.c:5
JHUFF_TBL long freq[]
Definition jchuff.h:50
Definition hsc.h:53
unsigned short freq
Definition hsc.h:56
signed char slide
Definition hsc.h:55
unsigned char inst
Definition hsc.h:54
Definition hsc.h:49
unsigned char note
Definition hsc.h:50
unsigned char effect
Definition hsc.h:50