jak-project/game/sound/common/synth.h

38 lines
663 B
C
Raw Permalink Normal View History

// Copyright: 2021 - 2024, Ziemas
2022-05-19 16:54:36 -04:00
// SPDX-License-Identifier: ISC
#pragma once
#include <forward_list>
#include <memory>
#include <unordered_map>
#include <vector>
#include "envelope.h"
#include "sound_types.h"
#include "voice.h"
#include "common/common_types.h"
2022-05-19 16:54:36 -04:00
namespace snd {
struct SpuVolume {
/* 0 */ s16 left;
/* 2 */ s16 right;
};
class Synth {
2022-05-19 16:54:36 -04:00
public:
Synth() {
mVolume.left.Set(0x3FFF);
mVolume.right.Set(0x3FFF);
2022-05-19 16:54:36 -04:00
}
s16Output Tick();
void AddVoice(std::shared_ptr<Voice> voice);
void SetMasterVol(u32 volume);
2022-05-19 16:54:36 -04:00
private:
std::forward_list<std::shared_ptr<Voice>> mVoices;
2022-05-19 16:54:36 -04:00
VolumePair mVolume{};
2022-05-19 16:54:36 -04:00
};
} // namespace snd