NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
snd_SeqSoundHandle.h
1#ifndef NW4R_SND_SEQ_SOUND_HANDLE_H
2#define NW4R_SND_SEQ_SOUND_HANDLE_H
3
4/*******************************************************************************
5 * headers
6 */
7
8#include <types.h>
9
10#include "nw4r/snd/snd_SeqSound.h"
11#include "nw4r/snd/snd_SeqTrack.h"
12#include "nw4r/ut/ut_NonCopyable.h" // ut::NonCopyable
13
14/*******************************************************************************
15 * types
16 */
17
18// forward declarations
19namespace nw4r { namespace snd { namespace detail { class SeqSound; }}}
20
21/*******************************************************************************
22 * classes and functions
23 */
24
25namespace nw4r { namespace snd
26{
27 // [R89JEL]:/bin/RVL/Debug/mainD.elf:.debug::0x2e9b6
28 class SeqSoundHandle : private ut::NonCopyable
29 {
30 // methods
31 public:
32 SeqSoundHandle(SoundHandle*);
33 ~SeqSoundHandle() { DetachSound(); }
34 // methods
35 bool IsAttachedSound() const { return mSound != nullptr; }
36
37 void DetachSound();
38
39 void WriteVariable(int varNo, s16 value) {
40 if (IsAttachedSound())
41 mSound->WriteVariable(varNo, value);
42 }
43
44 void ReadVariable(int varNo, s16 *value) {
45 if (IsAttachedSound())
46 mSound->ReadVariable(varNo, value);
47 }
48
49 void SetTrackMute(ulong trackFlags, SeqMute mute) {
50 if (IsAttachedSound())
51 mSound->SetTrackMute(trackFlags, mute);
52 }
53
54 void SetTempoRatio(f32 tempoRatio) {
55 if (IsAttachedSound())
56 mSound->SetTempoRatio(tempoRatio);
57 }
58
59 void SetVolume(ulong trackFlags, f32 volume) {
60 if (IsAttachedSound())
61 mSound->SetTrackVolume(trackFlags, volume);
62 }
63
64 // members
65 private:
66 /* base ut::NonCopyable */ // size 0x00, offset 0x00
67 detail::SeqSound *mSound; // size 0x04, offset 0x00
68 }; // size 0x04
69}} // namespace nw4r::snd
70
71#endif // NW4R_SND_SEQ_SOUND_HANDLE_H