You've already forked pico-launcher
mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2026-01-09 16:28:48 -08:00
29 lines
895 B
C++
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;
|
|
};
|