AudioSystem Save/Restore

This commit is contained in:
Dr. Chat
2015-12-07 23:34:34 -06:00
committed by Ben Vanik
parent d2d97fe58f
commit b94ab4acbc
3 changed files with 134 additions and 4 deletions

View File

@@ -42,6 +42,13 @@ class AudioSystem {
void UnregisterClient(size_t index);
void SubmitFrame(size_t index, uint32_t samples_ptr);
bool Save(ByteStream* stream);
bool Restore(ByteStream* stream);
bool is_paused() const { return paused_; }
void Pause();
void Resume();
protected:
explicit AudioSystem(cpu::Processor* processor);
@@ -82,6 +89,10 @@ class AudioSystem {
// Event is always there in case we have no clients.
std::unique_ptr<xe::threading::Event> shutdown_event_;
xe::threading::WaitHandle* wait_handles_[kMaximumClientCount + 1];
bool paused_ = false;
threading::Fence pause_fence_;
std::unique_ptr<threading::Event> resume_event_;
};
} // namespace apu