commit b6e22f5f5172ccbd845d77af2634fafb292cea20
parent 17178764cab76a9e8b519b3fccd3ff8fb3374c8b
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date: Sat, 27 Apr 2024 21:22:34 +0200
fix patch program number not serialized
Diffstat:
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/source/jucePluginLib/patchdb/db.cpp b/source/jucePluginLib/patchdb/db.cpp
@@ -1694,7 +1694,7 @@ namespace pluginLib::patchDB
{
synthLib::BinaryStream inStream(data);
- auto stream = inStream.tryReadChunk(chunks::g_patchManager);
+ auto stream = inStream.tryReadChunk(chunks::g_patchManager, 2);
if(!stream)
return false;
@@ -1898,7 +1898,7 @@ namespace pluginLib::patchDB
std::shared_lock lockDS(m_dataSourcesMutex);
std::shared_lock lockP(m_patchesMutex);
- synthLib::ChunkWriter cw(outStream, chunks::g_patchManager, 1);
+ synthLib::ChunkWriter cw(outStream, chunks::g_patchManager, 2);
{
synthLib::ChunkWriter cwDS(outStream, chunks::g_patchManagerDataSources, 1);
diff --git a/source/jucePluginLib/patchdb/patch.cpp b/source/jucePluginLib/patchdb/patch.cpp
@@ -47,10 +47,11 @@ namespace pluginLib::patchDB
void Patch::write(synthLib::BinaryStream& _s) const
{
- synthLib::ChunkWriter chunkWriter(_s, chunks::g_patch, 1);
+ synthLib::ChunkWriter chunkWriter(_s, chunks::g_patch, 2);
_s.write(name);
_s.write(bank);
+ _s.write(program);
if(modifications && !modifications->empty())
{
@@ -69,12 +70,13 @@ namespace pluginLib::patchDB
bool Patch::read(synthLib::BinaryStream& _in)
{
- auto in = _in.tryReadChunk(chunks::g_patch, 1);
+ auto in = _in.tryReadChunk(chunks::g_patch, 2);
if(!in)
return false;
name = in.readString();
bank = in.read<uint32_t>();
+ program = in.read<uint32_t>();
const auto hasMods = in.read<uint8_t>();