Files
pico-launcher/arm9/source/bgm/BgmService.h
2025-11-25 17:41:31 +01:00

29 lines
895 B
C++

#pragma once
#include <memory>
#include "IAudioStreamPlayer.h"
#include "services/settings/IAppSettingsService.h"
#include "rng/RandomGenerator.h"
#include "IBgmService.h"
/// @brief Class implementing a background music service.
class BgmService : public IBgmService
{
public:
constexpr BgmService(
std::unique_ptr<IAudioStreamPlayer> audioStreamPlayer,
IAppSettingsService& appSettingsService,
RandomGenerator& randomGenerator)
: _audioStreamPlayer(std::move(audioStreamPlayer))
, _appSettingsService(appSettingsService)
, _randomGenerator(randomGenerator) { }
bool StartBgm(const TCHAR* filePath) override;
void StartBgmFromConfig() override;
void StopBgm() override;
private:
std::unique_ptr<IAudioStreamPlayer> _audioStreamPlayer;
IAppSettingsService& _appSettingsService;
RandomGenerator& _randomGenerator;
};