summaryrefslogtreecommitdiffstats
path: root/src/audio_core/voice_context.h
diff options
context:
space:
mode:
authorKelebek1 <eeeedddccc@hotmail.co.uk>2021-06-27 00:04:40 +0200
committerKelebek1 <eeeedddccc@hotmail.co.uk>2021-07-01 07:01:01 +0200
commitb455043e45737345fe73d118947db1684bd248ea (patch)
treec05414e81eff4b012bd1b33076fb60da16aace54 /src/audio_core/voice_context.h
parentDecouple audio processing and run at variable rate (diff)
downloadyuzu-b455043e45737345fe73d118947db1684bd248ea.tar
yuzu-b455043e45737345fe73d118947db1684bd248ea.tar.gz
yuzu-b455043e45737345fe73d118947db1684bd248ea.tar.bz2
yuzu-b455043e45737345fe73d118947db1684bd248ea.tar.lz
yuzu-b455043e45737345fe73d118947db1684bd248ea.tar.xz
yuzu-b455043e45737345fe73d118947db1684bd248ea.tar.zst
yuzu-b455043e45737345fe73d118947db1684bd248ea.zip
Diffstat (limited to '')
-rw-r--r--src/audio_core/voice_context.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/audio_core/voice_context.h b/src/audio_core/voice_context.h
index 70359cadb..e1050897b 100644
--- a/src/audio_core/voice_context.h
+++ b/src/audio_core/voice_context.h
@@ -60,10 +60,12 @@ struct WaveBuffer {
u8 is_looping{};
u8 end_of_stream{};
u8 sent_to_server{};
- INSERT_PADDING_BYTES(5);
+ INSERT_PADDING_BYTES(1);
+ s32 loop_count{};
u64 context_address{};
u64 context_size{};
- INSERT_PADDING_BYTES(8);
+ u32 loop_start_sample{};
+ u32 loop_end_sample{};
};
static_assert(sizeof(WaveBuffer) == 0x38, "WaveBuffer is an invalid size");
@@ -76,6 +78,9 @@ struct ServerWaveBuffer {
bool end_of_stream{};
VAddr context_address{};
std::size_t context_size{};
+ s32 loop_count{};
+ u32 loop_start_sample{};
+ u32 loop_end_sample{};
bool sent_to_dsp{true};
};
@@ -108,6 +113,7 @@ struct VoiceState {
u32 external_context_size;
bool is_external_context_used;
bool voice_dropped;
+ s32 loop_count;
};
class VoiceChannelResource {
@@ -206,7 +212,7 @@ public:
float last_volume{};
std::array<BiquadFilterParameter, AudioCommon::MAX_BIQUAD_FILTERS> biquad_filter{};
s32 wave_buffer_count{};
- s16 wave_bufffer_head{};
+ s16 wave_buffer_head{};
INSERT_PADDING_BYTES(2);
BehaviorFlags behavior_flags{};
VAddr additional_params_address{};
@@ -252,6 +258,7 @@ public:
void FlushWaveBuffers(u8 flush_count,
std::array<VoiceState*, AudioCommon::MAX_CHANNEL_COUNT>& dsp_voice_states,
s32 channel_count);
+ void SetWaveBufferCompleted(VoiceState& dsp_state, const ServerWaveBuffer& wave_buffer);
private:
std::vector<s16> stored_samples;