Audio/Music: Rework Play() (ensure music has started before return and handle exceptions in thread)

This commit is contained in:
Jérôme Leclercq
2021-05-25 12:12:15 +02:00
parent c880a431a2
commit 001c9a6a61
2 changed files with 68 additions and 24 deletions

View File

@@ -11,6 +11,9 @@
#include <Nazara/Audio/Enums.hpp>
#include <Nazara/Audio/SoundEmitter.hpp>
#include <Nazara/Audio/SoundStream.hpp>
#include <condition_variable>
#include <exception>
#include <mutex>
namespace Nz
{
@@ -56,7 +59,7 @@ namespace Nz
std::unique_ptr<MusicImpl> m_impl;
bool FillAndQueueBuffer(unsigned int buffer);
void MusicThread();
void MusicThread(std::condition_variable& cv, std::mutex& m, std::exception_ptr& err);
void StopThread();
};
}