Merge pull request #523 from paulfd/clear-synth-mutex
Remove the callback mutex for the clear method
This commit is contained in:
commit
aa73913d3c
2 changed files with 5 additions and 5 deletions
|
|
@ -192,8 +192,6 @@ void sfz::Synth::buildRegion(const std::vector<Opcode>& regionOpcodes)
|
||||||
|
|
||||||
void sfz::Synth::clear()
|
void sfz::Synth::clear()
|
||||||
{
|
{
|
||||||
const std::lock_guard<SpinMutex> disableCallback { callbackGuard };
|
|
||||||
|
|
||||||
// Clear the background queues before removing everyone
|
// Clear the background queues before removing everyone
|
||||||
resources.filePool.waitForBackgroundLoading();
|
resources.filePool.waitForBackgroundLoading();
|
||||||
|
|
||||||
|
|
@ -473,10 +471,10 @@ void sfz::Synth::handleEffectOpcodes(const std::vector<Opcode>& rawMembers)
|
||||||
|
|
||||||
bool sfz::Synth::loadSfzFile(const fs::path& file)
|
bool sfz::Synth::loadSfzFile(const fs::path& file)
|
||||||
{
|
{
|
||||||
clear();
|
|
||||||
|
|
||||||
const std::lock_guard<SpinMutex> disableCallback { callbackGuard };
|
const std::lock_guard<SpinMutex> disableCallback { callbackGuard };
|
||||||
|
|
||||||
|
clear();
|
||||||
|
|
||||||
std::error_code ec;
|
std::error_code ec;
|
||||||
fs::path realFile = fs::canonical(file, ec);
|
fs::path realFile = fs::canonical(file, ec);
|
||||||
|
|
||||||
|
|
@ -494,9 +492,10 @@ bool sfz::Synth::loadSfzFile(const fs::path& file)
|
||||||
|
|
||||||
bool sfz::Synth::loadSfzString(const fs::path& path, absl::string_view text)
|
bool sfz::Synth::loadSfzString(const fs::path& path, absl::string_view text)
|
||||||
{
|
{
|
||||||
|
const std::lock_guard<SpinMutex> disableCallback { callbackGuard };
|
||||||
|
|
||||||
clear();
|
clear();
|
||||||
|
|
||||||
const std::lock_guard<SpinMutex> disableCallback { callbackGuard };
|
|
||||||
parser.parseString(path, text);
|
parser.parseString(path, text);
|
||||||
if (parser.getErrorCount() > 0)
|
if (parser.getErrorCount() > 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -683,6 +683,7 @@ private:
|
||||||
* @brief Remove all regions, resets all voices and clears everything
|
* @brief Remove all regions, resets all voices and clears everything
|
||||||
* to bring back the synth in its original state.
|
* to bring back the synth in its original state.
|
||||||
*
|
*
|
||||||
|
* The callback mutex should be taken to call this function.
|
||||||
*/
|
*/
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue