summaryrefslogtreecommitdiff
path: root/include/d
diff options
context:
space:
mode:
authorrobojumper <robojumper@gmail.com>2025-06-15 21:22:07 +0200
committerrobojumper <robojumper@gmail.com>2025-09-13 10:51:36 +0200
commitf6e5303ea2b8f0b8aa78d03492575c072af65aca (patch)
tree8ac8f51148886aec69bac1ba191c338ac4624071 /include/d
parent6cb7f3bfdc8b4f69e2443fad99fb7d807cf9ea7c (diff)
d_snd_anim_sound OK
Diffstat (limited to 'include/d')
-rw-r--r--include/d/snd/d_snd_anim_sound.h30
-rw-r--r--include/d/snd/d_snd_small_effect_mgr.h19
-rw-r--r--include/d/snd/d_snd_source.h4
-rw-r--r--include/d/snd/d_snd_source_mgr.h3
-rw-r--r--include/d/snd/d_snd_state_mgr.h9
5 files changed, 63 insertions, 2 deletions
diff --git a/include/d/snd/d_snd_anim_sound.h b/include/d/snd/d_snd_anim_sound.h
new file mode 100644
index 00000000..c54a49e9
--- /dev/null
+++ b/include/d/snd/d_snd_anim_sound.h
@@ -0,0 +1,30 @@
+#ifndef D_SND_ANIM_SOUND_H
+#define D_SND_ANIM_SOUND_H
+
+#include "d/snd/d_snd_types.h"
+#include "nw4r/snd/snd_AnimSound.h"
+
+// Could also inherit from AnimSound
+class dSndAnimSound_c {
+public:
+ dSndAnimSound_c(dSoundSource_c *source);
+ void setData(const void *data);
+ void setFrame(f32 frame);
+ void resetFrame(f32 frame);
+ void setRate(f32 rate);
+
+ void setCallback(dSoundSource_c *source);
+ void setCallback(nw4r::snd::AnimSound::Callback cb, void *userData);
+
+private:
+ static void animCallback(int, s32, const char *, UNKWORD, void *userData);
+
+ /* 0x00 */ nw4r::snd::AnimSound mSound;
+ /* 0x90 */ const void *mpData;
+ /* 0x94 */ f32 field_0x94;
+ /* 0x98 */ f32 field_0x98;
+ /* 0x9C */ bool mNeedFrameReset;
+ /* 0xA0 */ nw4r::snd::AnimSound::PlayDirection mDirection;
+};
+
+#endif
diff --git a/include/d/snd/d_snd_small_effect_mgr.h b/include/d/snd/d_snd_small_effect_mgr.h
index b77ec967..cb40ed80 100644
--- a/include/d/snd/d_snd_small_effect_mgr.h
+++ b/include/d/snd/d_snd_small_effect_mgr.h
@@ -29,7 +29,14 @@ public:
dSndSmallEffectMgr_c();
+ void initialize();
void calc();
+ void calcTimer();
+
+ void stopAllSound(s32 fadeFrames);
+ void stopAllSoundDemoRelated(s32 fadeFrames); // TODO: better name
+ void stopAllSoundExceptEvent(s32 fadeFrames);
+ void stopAllSoundExceptEffectOrLink(s32 fadeFrames);
bool playSound(u32 soundId);
// used for clawshots cursor, pan depends on where on the screen
@@ -47,7 +54,17 @@ public:
bool playDowsingPingSound(f32 volume, f32 pitch);
bool holdDowsingNearestSound();
-
+
+ bool playSirenCountdownSound(s32 timer);
+ bool playMinigameCountdownSound();
+ bool playMinigameTimeUpSound(s32 timer);
+ bool playMinigameStartSound();
+ bool playMinigameFinishSound();
+ bool playMinigameFinishWhistleSound();
+ bool playMinigameScoreUpSound(s32 param);
+ bool playMinigameScoreDownSound();
+ bool playMinigameMusasabiSound(s32 count);
+
bool playSkbSound(u32 soundId);
bool playButtonPressSoundWhenAdvancingTextBoxes(f32);
diff --git a/include/d/snd/d_snd_source.h b/include/d/snd/d_snd_source.h
index a2851e76..68429f14 100644
--- a/include/d/snd/d_snd_source.h
+++ b/include/d/snd/d_snd_source.h
@@ -63,7 +63,9 @@ public:
virtual void d_s_vt_0x1D4();
virtual void d_s_vt_0x1D8();
virtual void d_s_vt_0x1DC();
- virtual void d_s_vt_0x1E0();
+ virtual void onAnimSoundEvent(UNKWORD arg) {
+ field_0x154 = arg;
+ }
virtual void d_s_vt_0x1E4();
virtual u32 d_s_vt_0x1E8(u32 soundId);
diff --git a/include/d/snd/d_snd_source_mgr.h b/include/d/snd/d_snd_source_mgr.h
index 272c75a2..fa890401 100644
--- a/include/d/snd/d_snd_source_mgr.h
+++ b/include/d/snd/d_snd_source_mgr.h
@@ -26,6 +26,9 @@ public:
return GetInstance()->mpBoomerangSource;
}
+ void stopAllSound();
+ void stopAllNonPlayerSound();
+
private:
static bool isCertainEnemyType(dSoundSource_c *source);
void removeSourceFromList(dSoundSource_c *source, nw4r::ut::List *list);
diff --git a/include/d/snd/d_snd_state_mgr.h b/include/d/snd/d_snd_state_mgr.h
index 7a5356a4..bb068732 100644
--- a/include/d/snd/d_snd_state_mgr.h
+++ b/include/d/snd/d_snd_state_mgr.h
@@ -36,6 +36,10 @@ public:
static bool isInStage(const char *stageName);
+ s32 getStageId_0x044() const {
+ return field_0x044;
+ }
+
u32 getField_0x11C() const {
return field_0x11C;
}
@@ -62,6 +66,11 @@ public:
void setFlowEvent(u32 eventId);
+ const char *getCurrentStageMusicDemoName() const;
+ bool isInDemo() const {
+ return getCurrentStageMusicDemoName() != nullptr;
+ }
+
private:
u32 getStageTypeFlags(const char *stageName) const;
// ET, FS, or corresponding Sky Keep rooms