summaryrefslogtreecommitdiff
path: root/libs/revolution/src/homebuttonLib/nw4hbm/snd/StrmSound.h
blob: 537d1f8d0694e3d02fa9955e446cac5c18165ed9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef NW4HBM_SND_STRM_SOUND_H
#define NW4HBM_SND_STRM_SOUND_H

#include <revolution/types.h>

#include "BasicSound.h"
#include "MoveValue.h"
#include "StrmPlayer.h"
#include "debug.h"

#include "../ut/LinkList.h"

namespace nw4hbm {
    namespace snd {
        class StrmSoundHandle;
        namespace detail {
            template <typename T>
            class SoundInstanceManager;
        }

        namespace detail {

            class StrmSound : public BasicSound {
                friend class StrmSoundHandle;

            public:
                explicit StrmSound(SoundInstanceManager<StrmSound>* manager);

                /* 0x08 */ NW4HBM_UT_RUNTIME_TYPEINFO;
                /* 0x28 */ virtual void Shutdown();
                /* 0x4C */ virtual void SetPlayerPriority(int priority);
                /* 0x5C */ virtual bool IsAttachedTempSpecialHandle();
                /* 0x60 */ virtual void DetachTempSpecialHandle();
                /* 0x68 */ virtual BasicPlayer& GetBasicPlayer() { return mStrmPlayer; }
                /* 0x6C */ virtual const BasicPlayer& GetBasicPlayer() const { return mStrmPlayer; }

                void Setup(const StrmPlayer::StrmHeader* header);

                bool Prepare(StrmBufferPool* bufferPool,
                             StrmPlayer::StartOffsetType startOffsetType, s32 startOffset,
                             int voices, StrmPlayer::StrmCallback* callback, u32 callbackData);

                void SetChannelPriority(int priority);

            private:
                /* 0x0D8 */ StrmPlayer mStrmPlayer;
                /* 0x1F4 */ StrmSoundHandle* mTempSpecialHandle;
                /* 0x1F8 */ SoundInstanceManager<StrmSound>* mManager;
                /* 0x5FC */ u8 mNumChannels;
                /* 0x600 */ void* mBuffer[CHANNEL_MAX];
                /* 0x608 */ u32 mBufSize;
                /* 0x60C */ u8 mNumBufBlocks;
                /* 0x610 */ int mAllocChannelCount;
            };
        }  // namespace detail
    }  // namespace snd
}  // namespace nw4hbm

#endif