25 #define EUP_USE_MEMPOOL 27 #include "audio/softsynth/fmtowns_pc98/towns_audio.h" 28 #include "common/array.h" 29 #include "common/func.h" 31 #ifdef EUP_USE_MEMPOOL 32 #include "common/memorypool.h" 40 virtual bool init() {
return true; }
42 virtual void send(uint8 command) = 0;
55 int assignPartToChannel(
int chan,
int part);
57 void send(uint8 command);
59 void setTimerA(
bool enable,
int tempo);
60 void setTimerB(
bool enable,
int tempo);
62 void loadInstrument(
int chanType,
int id,
const uint8 *data);
63 void setInstrument(
int chan,
int instrID);
64 void loadWaveTable(
const uint8 *data);
65 void unloadWaveTable(
int id);
67 void reserveSoundEffectChannels(
int num);
68 void playSoundEffect(
int chan,
int note,
int velo,
const uint8 *data);
69 void stopSoundEffect(
int chan);
70 bool soundEffectIsPlaying(
int chan);
72 void channelPan(
int chan,
int mode);
73 void channelPitch(
int chan,
int pitch);
74 void channelVolume(
int chan,
int vol);
76 void setOutputVolume(
int chanType,
int volLeft,
int volRight);
77 void cdaToggle(
int a);
79 void setMusicVolume(
int volume);
80 void setSoundEffectVolume(
int volume);
85 void controlChange_volume();
86 void controlChange_panPos();
87 void controlChange_allNotesOff();
92 int8 *_partToChanMapping;
93 int8 *_sustainChannels;
112 void send(uint8 command);
122 int startTrack(
const uint8 *data,
int trackSize,
int barLen);
127 int setTempo(
int tempo);
128 void setLoopStatus(
bool loop);
130 bool isPlaying() {
return _playing; }
132 int configPart_enable(
int part,
int val);
133 int configPart_setType(
int part,
int val);
134 int configPart_remap(
int part,
int val);
135 int configPart_adjustVolume(
int part,
int val);
136 int configPart_setTranspose(
int part,
int val);
138 void timerCallback(
int timerId);
144 void resetPartConfig();
147 void updatePulseCounters();
150 void updateCheckEot();
153 void proceedToNextEvent();
155 void updateHangingNotes();
156 void clearHangingNotes();
158 void resetAllControls();
161 uint8 appendEvent(uint8 evt, uint8 chan);
163 bool event_notImpl();
165 bool event_polyphonicAftertouch();
166 bool event_controlChange_pitchWheel();
167 bool event_programChange_channelAftertouch();
170 bool event_advanceBar();
171 bool event_setTempo();
172 bool event_typeOrdrChange();
174 uint8 applyTranspose(uint8 in);
175 uint8 applyVolumeAdjust(uint8 in);
177 void sendByte(uint8 type, uint8 command);
178 void sendPendingEvent(
int type,
int evt,
int note,
int velo);
179 void sendControllerReset(
int type,
int part);
180 void sendAllNotesOff(
int type,
int part);
181 void sendTempo(
int tempo);
183 uint8 *_partConfig_enable;
184 uint8 *_partConfig_type;
185 uint8 *_partConfig_ordr;
186 int8 *_partConfig_volume;
187 int8 *_partConfig_transpose;
189 struct PendingEvent {
190 PendingEvent(
int ev,
int tp,
int nt,
int vl,
int ln, PendingEvent *chain) : evt(ev), type(tp), note(nt), velo(vl), len(ln), next(chain) {}
199 #ifdef EUP_USE_MEMPOOL 202 PendingEvent *_pendingEventsChain;
206 EuphonyEventsArray _euphonyEvents;
208 uint8 _defaultBarLength;
210 int _playerUpdatesLeft;
211 int _tempoControlMode;
212 int _updatesPerPulseRemainder;
213 int _updatesPerPulse;
215 int8 _tempoMode1PulseCounter;
219 int8 _tempoMode1UpdateF8;
230 const uint8 *_musicStart;
231 const uint8 *_musicPos;
232 uint32 _musicTrackSize;
Definition: towns_euphony.h:105
Definition: towns_audio.h:37
Definition: towns_euphony.h:47
Definition: towns_euphony.h:115
Definition: towns_euphony.h:35
Definition: towns_audio.h:31