Added audren:u#GetAudioRendererState

This commit is contained in:
David Marcec
2018-09-23 22:32:01 +10:00
parent 93fea4e179
commit c461188f51
5 changed files with 21 additions and 1 deletions

View File

@ -79,6 +79,10 @@ u32 AudioRenderer::GetMixBufferCount() const {
return worker_params.mix_buffer_count;
}
u32 AudioRenderer::GetState() const {
return stream->GetState();
}
std::vector<u8> AudioRenderer::UpdateAudioRenderer(const std::vector<u8>& input_params) {
// Copy UpdateDataHeader struct
UpdateDataHeader config{};

View File

@ -170,6 +170,7 @@ public:
u32 GetSampleRate() const;
u32 GetSampleCount() const;
u32 GetMixBufferCount() const;
u32 GetState() const;
private:
class VoiceState;

View File

@ -49,9 +49,14 @@ void Stream::Play() {
}
void Stream::Stop() {
state = State::Stopped;
ASSERT_MSG(false, "Unimplemented");
}
u32 Stream::GetState() const {
return static_cast<u32>(state);
}
s64 Stream::GetBufferReleaseCycles(const Buffer& buffer) const {
const std::size_t num_samples{buffer.GetSamples().size() / GetNumChannels()};
return CoreTiming::usToCycles((static_cast<u64>(num_samples) * 1000000) / sample_rate);

View File

@ -72,6 +72,9 @@ public:
/// Gets the number of channels
u32 GetNumChannels() const;
/// Get the state
u32 GetState() const;
private:
/// Current state of the stream
enum class State {