ScummVM API documentation
gmchannel.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 SKY_MUSIC_GMCHANNEL_H
23#define SKY_MUSIC_GMCHANNEL_H
24
25#include "sky/music/musicbase.h"
26
27class MidiDriver;
28
29namespace Sky {
30
31typedef struct {
32 uint16 eventDataPtr;
33 int32 nextEventTime;
34 uint16 loopPoint;
35 uint8 midiChannelNumber;
36 uint8 note;
37 bool channelActive;
39
40class GmChannel : public ChannelBase {
41public:
42 GmChannel(uint8 *pMusicData, uint16 startOfData, MidiDriver *pMidiDrv, const byte *pInstMap, const byte *veloTab);
43 ~GmChannel() override;
44 virtual void stopNote();
45 uint8 process(uint16 aktTime) override;
46 void updateVolume(uint16 pVolume) override;
47 bool isActive() override;
48private:
49 const byte *_instMap;
50 const byte *_veloTab;
51 MidiDriver *_midiDrv;
52 uint8 *_musicData;
53 uint16 _musicVolume;
54 MidiChannelType _channelData;
55 uint8 _currentChannelVolume;
56 //- normal subs
57 void setRegister(uint8 regNum, uint8 value);
58 int32 getNextEventTime();
59 uint16 getNextNote(uint8 param);
60 void adlibSetupInstrument();
61 void setupInstrument(uint8 opcode);
62 void setupChannelVolume(uint8 volume);
63 //- Streamfunctions from Command90hTable
64 void com90_caseNoteOff(); // 0
65 void com90_stopChannel(); // 1
66 void com90_setupInstrument(); // 2
67 uint8 com90_updateTempo(); // 3
68 //void com90_dummy(); // 4
69 void com90_getPitch(); // 5
70 void com90_getChannelVolume(); // 6
71 //void com90_skipTremoVibro(); // 7
72 void com90_loopMusic(); // 8
73 void com90_keyOff(); // 9
74 //void com90_error(); // 10
75 void com90_getChannelPanValue(); // 11
76 void com90_setLoopPoint(); // 12
77 void com90_getChannelControl(); // 13
78};
79
80} // End of namespace Sky
81
82#endif //SKYGMCHANNEL_H
Definition: mididrv.h:313
Definition: musicbase.h:46
Definition: gmchannel.h:40
Definition: autoroute.h:28
Definition: gmchannel.h:31