2020-04-19 23:04:05 +02:00
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
2020-03-27 20:36:02 +01:00
|
|
|
// Copyright © 2020 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
|
|
|
|
2020-01-24 23:04:16 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
|
2020-02-17 20:11:59 +01:00
|
|
|
namespace skyline::service::audio::IAudioRenderer {
|
2020-01-24 23:04:16 +01:00
|
|
|
enum class EffectState : u8 {
|
|
|
|
None = 0, //!< The effect isn't being used
|
2020-08-21 15:28:47 +02:00
|
|
|
New = 1,
|
2020-01-24 23:04:16 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2020-09-28 12:05:17 +02:00
|
|
|
* @brief Input containing information on what effects to use on an audio stream
|
2020-01-24 23:04:16 +01:00
|
|
|
*/
|
|
|
|
struct EffectIn {
|
|
|
|
u8 _unk0_;
|
|
|
|
u8 isNew; //!< Whether the effect was used in the previous samples
|
2020-08-12 21:12:34 +02:00
|
|
|
u8 _unk1_[0xBE];
|
2020-01-24 23:04:16 +01:00
|
|
|
};
|
2020-08-12 21:12:34 +02:00
|
|
|
static_assert(sizeof(EffectIn) == 0xC0);
|
2020-01-24 23:04:16 +01:00
|
|
|
|
|
|
|
/**
|
2020-09-28 12:05:17 +02:00
|
|
|
* @brief Returned to inform the guest of the state of an effect
|
2020-01-24 23:04:16 +01:00
|
|
|
*/
|
|
|
|
struct EffectOut {
|
2020-08-21 15:28:47 +02:00
|
|
|
EffectState state;
|
2020-01-24 23:04:16 +01:00
|
|
|
u8 _pad0_[15];
|
|
|
|
};
|
|
|
|
static_assert(sizeof(EffectOut) == 0x10);
|
|
|
|
|
|
|
|
/**
|
2020-09-28 12:05:17 +02:00
|
|
|
* @brief The Effect class stores the state of audio post processing effects
|
|
|
|
*/
|
2020-01-24 23:04:16 +01:00
|
|
|
class Effect {
|
|
|
|
public:
|
2020-08-21 15:28:47 +02:00
|
|
|
EffectOut output{};
|
2020-01-24 23:04:16 +01:00
|
|
|
|
2021-02-06 13:36:58 +01:00
|
|
|
void ProcessInput(const EffectIn &input) {
|
2020-01-24 23:04:16 +01:00
|
|
|
if (input.isNew)
|
|
|
|
output.state = EffectState::New;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|