13 #ifndef MADS_DRAGONSPHERE_SOUND_PSOUND_DRAGONSPHERE_H 14 #define MADS_DRAGONSPHERE_SOUND_PSOUND_DRAGONSPHERE_H 16 #include "mads/dragonsphere/sound/psound.h" 19 namespace Dragonsphere {
46 uint16 _callbackCounter;
47 uint16 _callbackPeriod;
49 bool _pendingLoadOnly;
51 byte _maxMusicCommand;
52 bool _resetClearsCallback;
55 byte maxMusicCommand,
bool resetClearsCallback);
57 int dispatchBaseCommand(
int commandId);
59 void playSounds(
const uint16 *sequences, uint count,
bool anyChannel =
false);
60 void loadChannels(
const ChannelLoad *loads, uint count);
61 bool musicChannelsActive(uint count = kMusicChannelCount)
const;
62 void applyMusicLoad(
const MusicLoad &load);
63 bool startOrDeferMusic(
int commandId, uint16 guard,
65 uint musicChannelCount = kMusicChannelCount);
66 bool startOrDeferMusicWhenActive(
int commandId, uint16 guard,
68 uint musicChannelCount = kMusicChannelCount);
69 void deferCommand(
int commandId,
bool loadOnly);
71 virtual int executeCommand(
int commandId,
bool loadOnly) = 0;
74 int command(
int commandId,
int param)
override;
84 int command(
int commandId,
int param)
override;
87 #define DECLARE_DRAGONSPHERE_PSOUND(_section, _count) \ 88 class PSound##_section final : public DragonspherePSound { \ 90 static const uint16 _commandList[_count]; \ 91 int executeCommand(int commandId, bool loadOnly) override; \ 92 bool callFunction(uint16 targetOffset, Channel &channel) override; \ 94 explicit PSound##_section(Audio::Mixer *mixer); \ 97 DECLARE_DRAGONSPHERE_PSOUND(1, 102);
98 DECLARE_DRAGONSPHERE_PSOUND(2, 73);
99 DECLARE_DRAGONSPHERE_PSOUND(3, 74);
100 DECLARE_DRAGONSPHERE_PSOUND(4, 79);
101 DECLARE_DRAGONSPHERE_PSOUND(6, 99);
102 DECLARE_DRAGONSPHERE_PSOUND(9, 64);
106 static const uint16 _commandList[79];
107 void loadAlternateMusic();
108 int executeCommand(
int commandId,
bool loadOnly)
override;
116 static const uint16 _commandList[89];
117 int executeCommand(
int commandId,
bool loadOnly)
override;
125 static const uint16 _commandList[51];
126 int executeCommand(
int commandId,
bool loadOnly)
override;
133 bool validateDragonspherePSoundFile(
int section,
bool isDemo,
136 #undef DECLARE_DRAGONSPHERE_PSOUND 142 #endif // MADS_DRAGONSPHERE_SOUND_PSOUND_DRAGONSPHERE_H Definition: psound_dragonsphere.h:36
Definition: psound_dragonsphere.h:104
virtual bool callFunction(uint16 targetOffset, Channel &channel)=0
void serviceCallbacks() override
Definition: psound_dragonsphere.h:32
Definition: psound_dragonsphere.h:123
Definition: anim_timer.h:27
Definition: psound_dragonsphere.h:78
Definition: psound_dragonsphere.h:23
int command(int commandId, int param) override
Definition: psound_dragonsphere.h:114