isle-portable/LEGO1/lego/legoomni/include/mxbackgroundaudiomanager.h
Anders Jenbo 9997e45fa0
Some checks are pending
CI / clang-format (push) Waiting to run
CI / ${{ matrix.name }} (false, --toolchain $GITHUB_WORKSPACE/CMake/i586-pc-msdosdjgpp.cmake, false, true, false, Ninja, DOS, ubuntu-latest, true) (push) Waiting to run
CI / ${{ matrix.name }} (false, --toolchain /usr/local/vitasdk/share/vita.toolchain.cmake, false, false, Ninja, Vita, ubuntu-latest, true, true) (push) Waiting to run
CI / ${{ matrix.name }} (false, -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0.26100.0, false, false, Visual Studio 17 2022, true, Xbox One, windows-latest, amd64, false, true) (push) Waiting to run
CI / ${{ matrix.name }} (false, -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/3DS.cmake, false, devkitpro/devkitarm:latest, false, Ninja, true, Nintendo 3DS, ubuntu-latest, true) (push) Waiting to run
CI / ${{ matrix.name }} (false, -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake, false, devkitpro/devkita64:latest, false, Ninja, Nintendo Switch, true, ubuntu-latest, true) (push) Waiting to run
CI / ${{ matrix.name }} (false, emcmake, false, false, true, Ninja, Emscripten, ubuntu-latest, true) (push) Waiting to run
CI / ${{ matrix.name }} (false, false, false, Ninja, true, MSVC (arm64), windows-latest, amd64_arm64, false) (push) Waiting to run
CI / ${{ matrix.name }} (false, false, true, Ninja, true, MSVC (x86), windows-latest, amd64_x86, false) (push) Waiting to run
CI / ${{ matrix.name }} (false, true, false, Ninja, true, MSVC (x64), windows-latest, amd64, false) (push) Waiting to run
CI / ${{ matrix.name }} (false, true, true, false, Ninja, true, MSVC (x64 Debug), windows-latest, amd64, false) (push) Waiting to run
CI / ${{ matrix.name }} (true, false, -DCMAKE_SYSTEM_NAME=iOS, false, false, Xcode, true, iOS, macos-15, true) (push) Waiting to run
CI / ${{ matrix.name }} (true, false, false, false, Ninja, Android, ubuntu-latest, true) (push) Waiting to run
CI / ${{ matrix.name }} (true, false, true, false, Ninja, macOS, macos-latest, true) (push) Waiting to run
CI / ${{ matrix.name }} (true, true, false, Ninja, true, mingw-w64-x86_64, mingw64, msys2 mingw64, windows-latest, msys2 {0}, true) (push) Waiting to run
CI / ${{ matrix.name }} (true, true, true, false, Ninja, true, Linux (Debug), ubuntu-latest, true) (push) Waiting to run
CI / ${{ matrix.name }} (true, true, true, false, Ninja, true, Linux, ubuntu-latest, true) (push) Waiting to run
CI / FreeBSD (push) Waiting to run
CI / Flatpak (${{ matrix.arch }}) (aarch64, ubuntu-22.04-arm) (push) Waiting to run
CI / Flatpak (${{ matrix.arch }}) (x86_64, ubuntu-latest) (push) Waiting to run
CI / C++ (push) Waiting to run
CI / Release (push) Blocked by required conditions
Docker / Publish web port (push) Waiting to run
DOS port (#799)
Co-authored-by: Anonymous Maarten <anonymous.maarten@gmail.com>
2026-05-04 01:25:27 +02:00

82 lines
2.3 KiB
C++

#ifndef MXBACKGROUNDAUDIOMANAGER_H
#define MXBACKGROUNDAUDIOMANAGER_H
#include "lego1_export.h"
#include "mxcore.h"
#include "mxdsaction.h"
#include "mxpresenter.h"
#include "mxtypes.h"
class MxAudioPresenter;
// VTABLE: LEGO1 0x100d9fe8
// VTABLE: BETA10 0x101bf508
// SIZE 0x150
class MxBackgroundAudioManager : public MxCore {
public:
MxBackgroundAudioManager();
~MxBackgroundAudioManager() override;
MxLong Notify(MxParam& p_param) override; // vtable+0x04
MxResult Tickle() override; // vtable+0x08
// FUNCTION: LEGO1 0x1007eb70
// FUNCTION: BETA10 0x100e9af0
const char* ClassName() const override // vtable+0x0c
{
// STRING: LEGO1 0x100f7ac4
return "MxBackgroundAudioManager";
}
// FUNCTION: LEGO1 0x1007eb80
MxBool IsA(const char* p_name) const override // vtable+0x10
{
return !strcmp(p_name, MxBackgroundAudioManager::ClassName()) || MxCore::IsA(p_name);
}
MxBool GetEnabled() { return m_enabled; }
void StartAction(MxParam& p_param);
void StopAction(MxParam& p_param);
MxResult PlayMusic(MxDSAction& p_action, MxS32 p_speed, MxPresenter::TickleState p_tickleState);
void MakePendingPresenterActive();
void FadeInPendingPresenter();
void FadeToTargetVolume();
LEGO1_EXPORT void Enable(MxBool p_enable);
virtual MxResult Create(MxAtomId& p_script, MxU32 p_frequencyMS);
void Init();
void Update(MxS32 p_targetVolume, MxS32 p_speed, MxPresenter::TickleState p_tickleState);
LEGO1_EXPORT void Stop();
void LowerVolume();
void RaiseVolume();
MxResult SetPendingPresenter(MxPresenter* p_presenter, MxS32 p_speed, MxPresenter::TickleState p_tickleState);
// SYNTHETIC: LEGO1 0x1007ec00
// MxBackgroundAudioManager::`scalar deleting destructor'
private:
MxResult OpenMusic(MxAtomId& p_script);
void DestroyMusic();
MxBool m_enabled; // 0x08
MxDSAction m_action1; // 0x0c
MxAudioPresenter* m_activePresenter; // 0xa0
MxDSAction m_action2; // 0xa4
MxAudioPresenter* m_pendingPresenter; // 0x138
// name is inferred from context
MxPresenter::TickleState m_tickleState; // 0x13c
// name inferred from parameter p_speed
MxS32 m_speed; // 0x140
MxS32 m_targetVolume; // 0x144
MxS16 m_volumeSuppressionAmount; // 0x148
MxAtomId m_script; // 0x14c
};
#endif // MXBACKGROUNDAUDIOMANAGER_H