Reworked DSP serialization
This commit is contained in:
parent
55c75b5e3e
commit
c983528862
8 changed files with 128 additions and 13 deletions
|
@ -6,6 +6,10 @@
|
|||
|
||||
#include <array>
|
||||
#include <vector>
|
||||
#include <boost/serialization/array.hpp>
|
||||
#include <boost/serialization/deque.hpp>
|
||||
#include <boost/serialization/priority_queue.hpp>
|
||||
#include <boost/serialization/vector.hpp>
|
||||
#include <queue>
|
||||
#include "audio_core/audio_types.h"
|
||||
#include "audio_core/codec.h"
|
||||
|
@ -85,6 +89,24 @@ private:
|
|||
bool from_queue;
|
||||
u32_dsp play_position; // = 0;
|
||||
bool has_played; // = false;
|
||||
|
||||
private:
|
||||
template <class Archive>
|
||||
void serialize(Archive& ar, const unsigned int) {
|
||||
ar& physical_address;
|
||||
ar& length;
|
||||
ar& adpcm_ps;
|
||||
ar& adpcm_yn;
|
||||
ar& adpcm_dirty;
|
||||
ar& is_looping;
|
||||
ar& buffer_id;
|
||||
ar& mono_or_stereo;
|
||||
ar& format;
|
||||
ar& from_queue;
|
||||
ar& play_position;
|
||||
ar& has_played;
|
||||
}
|
||||
friend class boost::serialization::access;
|
||||
};
|
||||
|
||||
struct BufferOrder {
|
||||
|
@ -107,7 +129,7 @@ private:
|
|||
|
||||
// Buffer queue
|
||||
|
||||
std::priority_queue<Buffer, std::vector<Buffer>, BufferOrder> input_queue;
|
||||
std::priority_queue<Buffer, std::vector<Buffer>, BufferOrder> input_queue = {};
|
||||
MonoOrStereo mono_or_stereo = MonoOrStereo::Mono;
|
||||
Format format = Format::ADPCM;
|
||||
|
||||
|
@ -115,7 +137,7 @@ private:
|
|||
|
||||
u32 current_sample_number = 0;
|
||||
u32 next_sample_number = 0;
|
||||
AudioInterp::StereoBuffer16 current_buffer;
|
||||
AudioInterp::StereoBuffer16 current_buffer = {};
|
||||
|
||||
// buffer_id state
|
||||
|
||||
|
@ -135,7 +157,27 @@ private:
|
|||
|
||||
// Filter state
|
||||
|
||||
SourceFilters filters;
|
||||
SourceFilters filters = {};
|
||||
|
||||
private:
|
||||
template <class Archive>
|
||||
void serialize(Archive& ar, const unsigned int) {
|
||||
ar& enabled;
|
||||
ar& sync;
|
||||
ar& gain;
|
||||
ar& input_queue;
|
||||
ar& mono_or_stereo;
|
||||
ar& format;
|
||||
ar& current_sample_number;
|
||||
ar& next_sample_number;
|
||||
ar& current_buffer;
|
||||
ar& buffer_update;
|
||||
ar& current_buffer_id;
|
||||
ar& adpcm_coeffs;
|
||||
ar& rate_multiplier;
|
||||
ar& interpolation_mode;
|
||||
}
|
||||
friend class boost::serialization::access;
|
||||
|
||||
} state;
|
||||
|
||||
|
@ -150,6 +192,12 @@ private:
|
|||
bool DequeueBuffer();
|
||||
/// INTERNAL: Generates a SourceStatus::Status based on our internal state.
|
||||
SourceStatus::Status GetCurrentStatus();
|
||||
|
||||
template <class Archive>
|
||||
void serialize(Archive& ar, const unsigned int) {
|
||||
ar& state;
|
||||
}
|
||||
friend class boost::serialization::access;
|
||||
};
|
||||
|
||||
} // namespace AudioCore::HLE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue