NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
snd_StrmSoundHandle.h
1#ifndef NW4R_SND_STRM_SOUND_HANDLE_H
2#define NW4R_SND_STRM_SOUND_HANDLE_H
3
4/*******************************************************************************
5 * headers
6 */
7
8#include <types.h>
9
10#include "nw4r/snd/snd_SoundHandle.h"
11#include "nw4r/snd/snd_StrmSound.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 StrmSound; }}}
20
21/*******************************************************************************
22 * classes and functions
23 */
24
25namespace nw4r { namespace snd
26{
27 // [R89JEL]:/bin/RVL/Debug/mainD.elf:.debug::0x3074e
28 class StrmSoundHandle : private ut::NonCopyable
29 {
30 // methods
31 public:
32 // methods
33 StrmSoundHandle(SoundHandle*);
34 ~StrmSoundHandle() { DetachSound(); }
35 bool IsAttachedSound() const { return mSound != nullptr; }
36
37 void DetachSound();
38
39 void SetVolume(ulong trackFlags, f32 volume, int fadeFrames) {
40 if (IsAttachedSound())
41 mSound->SetTrackVolume(trackFlags, volume, fadeFrames);
42 }
43
44 // members
45 private:
46 /* base NonCopyable */ // size 0x00, offset 0x00
47 detail::StrmSound *mSound; // size 0x04, offset 0x00
48 }; // size 0x04
49}} // namespace nw4r::snd
50
51#endif // NW4R_SND_STRM_SOUND_HANDLE_H