WIP code update.
This commit is contained in:
parent
377e35e88f
commit
e5a5e7edd5
6 changed files with 10 additions and 9 deletions
|
|
@ -131,7 +131,7 @@ void sfz::FilePool::loadingThread() noexcept
|
|||
|
||||
SndfileHandle sndFile(reinterpret_cast<const char*>(file.c_str()));
|
||||
|
||||
std::lock_guard guard { fileHandleMutex };
|
||||
std::lock_guard<std::mutex> guard { fileHandleMutex };
|
||||
fileHandles.emplace_back(readFromFile<float>(sndFile, fileToLoad.numFrames));
|
||||
fileToLoad.voice->setFileData(fileHandles.back(), fileToLoad.ticket);
|
||||
}
|
||||
|
|
@ -142,11 +142,10 @@ void sfz::FilePool::garbageThread() noexcept
|
|||
while (!quitThread) {
|
||||
for (auto handle = fileHandles.begin(); handle < fileHandles.end();) {
|
||||
if (handle->use_count() == 1) {
|
||||
std::lock_guard guard { fileHandleMutex };
|
||||
handle->reset();
|
||||
std::lock_guard<std::mutex> guard { fileHandleMutex };
|
||||
std::iter_swap(handle, fileHandles.end() - 1);
|
||||
fileHandles.pop_back();
|
||||
DBG("Popped a background file... " << fileHandles.size() << " remaining")
|
||||
} else {
|
||||
handle++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
#pragma once
|
||||
#include <atomic>
|
||||
#include "Debug.h"
|
||||
#include "compat/inline.h"
|
||||
#include "compat/utils.h"
|
||||
|
||||
template <class Owner>
|
||||
class LeakDetector {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#pragma once
|
||||
#include "compat/inline.h"
|
||||
#include "compat/utils.h"
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <random>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include <chrono>
|
||||
#include <array>
|
||||
#include "compat/inline.h"
|
||||
#include "compat/utils.h"
|
||||
namespace sfz
|
||||
{
|
||||
SFZ_INLINE std::array<std::chrono::steady_clock::time_point, 128> noteOnTimes { };
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L)
|
||||
#if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
|
||||
#include <filesystem>
|
||||
#elif (__cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
|
||||
#elif (__cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L)
|
||||
#warning std::experimental::filesystem in use
|
||||
#include <experimental/filesystem>
|
||||
namespace std {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L)
|
||||
#if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
|
||||
#define SFZ_HAVE_CXX17 1
|
||||
#define SFZ_INLINE inline
|
||||
#else
|
||||
#define SFZ_HAVE_CXX17 0
|
||||
#define SFZ_INLINE
|
||||
#endif
|
||||
#else
|
||||
Loading…
Add table
Reference in a new issue