mirror of https://git.suyu.dev/suyu/suyu
audio_renderer: Rename AudioOut instance to audio_out
This commit is contained in:
parent
9cd79c25ed
commit
a76f0d5d06
|
@ -17,10 +17,10 @@ AudioRenderer::AudioRenderer(AudioRendererParameter params,
|
||||||
Kernel::SharedPtr<Kernel::Event> buffer_event)
|
Kernel::SharedPtr<Kernel::Event> buffer_event)
|
||||||
: worker_params{params}, buffer_event{buffer_event}, voices(params.voice_count) {
|
: worker_params{params}, buffer_event{buffer_event}, voices(params.voice_count) {
|
||||||
|
|
||||||
audio_core = std::make_unique<AudioCore::AudioOut>();
|
audio_out = std::make_unique<AudioCore::AudioOut>();
|
||||||
stream = audio_core->OpenStream(STREAM_SAMPLE_RATE, STREAM_NUM_CHANNELS, "AudioRenderer",
|
stream = audio_out->OpenStream(STREAM_SAMPLE_RATE, STREAM_NUM_CHANNELS, "AudioRenderer",
|
||||||
[=]() { buffer_event->Signal(); });
|
[=]() { buffer_event->Signal(); });
|
||||||
audio_core->StartStream(stream);
|
audio_out->StartStream(stream);
|
||||||
|
|
||||||
QueueMixedBuffer(0);
|
QueueMixedBuffer(0);
|
||||||
QueueMixedBuffer(1);
|
QueueMixedBuffer(1);
|
||||||
|
@ -236,11 +236,11 @@ void AudioRenderer::QueueMixedBuffer(Buffer::Tag tag) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
audio_core->QueueBuffer(stream, tag, std::move(buffer));
|
audio_out->QueueBuffer(stream, tag, std::move(buffer));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioRenderer::ReleaseAndQueueBuffers() {
|
void AudioRenderer::ReleaseAndQueueBuffers() {
|
||||||
const auto released_buffers{audio_core->GetTagsAndReleaseBuffers(stream, 2)};
|
const auto released_buffers{audio_out->GetTagsAndReleaseBuffers(stream, 2)};
|
||||||
for (const auto& tag : released_buffers) {
|
for (const auto& tag : released_buffers) {
|
||||||
QueueMixedBuffer(tag);
|
QueueMixedBuffer(tag);
|
||||||
}
|
}
|
||||||
|
|
|
@ -204,7 +204,7 @@ private:
|
||||||
AudioRendererParameter worker_params;
|
AudioRendererParameter worker_params;
|
||||||
Kernel::SharedPtr<Kernel::Event> buffer_event;
|
Kernel::SharedPtr<Kernel::Event> buffer_event;
|
||||||
std::vector<VoiceState> voices;
|
std::vector<VoiceState> voices;
|
||||||
std::unique_ptr<AudioCore::AudioOut> audio_core;
|
std::unique_ptr<AudioCore::AudioOut> audio_out;
|
||||||
AudioCore::StreamPtr stream;
|
AudioCore::StreamPtr stream;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue