ScummVM API documentation
fmtowns.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef IMUSE_DRV_FMTOWNS_H
23 #define IMUSE_DRV_FMTOWNS_H
24 
25 #include "audio/softsynth/fmtowns_pc98/towns_audio.h"
26 #include "audio/mididrv.h"
27 
28 namespace Scumm {
29 
30 class TownsMidiOutputChannel;
31 class TownsMidiInputChannel;
32 class TownsMidiChanState;
33 
35 friend class TownsMidiInputChannel;
36 friend class TownsMidiOutputChannel;
37 public:
39  ~IMuseDriver_FMTowns() override;
40 
41  int open() override;
42  bool isOpen() const override { return _isOpen; }
43  void close() override;
44 
45  void send(uint32 b) override;
46 
47  void setTimerCallback(void *timer_param, Common::TimerManager::TimerProc timer_proc) override;
48 
49  uint32 getBaseTempo() override;
50  MidiChannel *allocateChannel() override;
51  MidiChannel *getPercussionChannel() override;
52 
53  void timerCallback(int timerId) override;
54 
55 private:
56  void updateParser();
57  void updateOutputChannels();
58 
59  TownsMidiOutputChannel *allocateOutputChannel(uint8 pri);
60 
61  int randomValue(int para);
62 
63  TownsMidiInputChannel **_channels;
64  TownsMidiOutputChannel **_out;
65  TownsMidiChanState *_chanState;
66  const uint8 _numParts;
67 
69  void *_timerProcPara;
70 
71  TownsAudioInterface *_intf;
72 
73  uint32 _tickCounter;
74  uint8 _allocCurPos;
75  uint8 _rand;
76 
77  bool _isOpen;
78 
79  uint8 *_operatorLevelTable;
80 
81  const uint16 _baseTempo;
82 };
83 
84 } // end of namespace Scumm
85 
86 #endif
bool isOpen() const override
Definition: fmtowns.h:42
Definition: fmtowns.h:34
void send(uint32 b) override
void(* TimerProc)(void *refCon)
Definition: timer.h:42
uint32 getBaseTempo() override
Definition: mididrv.h:309
Definition: towns_audio.h:37
Definition: mixer.h:59
Definition: mididrv.h:537
Definition: actor.h:30
Definition: towns_audio.h:31