Skip to content

Commit

Permalink
store receive envelope chunks in snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
nofishonfriday committed Mar 24, 2018
1 parent c8e5e2d commit e59f34e
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion ObjectState/TrackSends.cpp
Expand Up @@ -30,6 +30,8 @@
#include "../SnM/SnM_Dlg.h"
#include "TrackSends.h"

#include "SnM\SnM_ChunkParserPatcher.h"

// Functions for getting/setting track sends

// Resolve missing receive tracks
Expand Down Expand Up @@ -212,6 +214,8 @@ void TrackSends::Build(MediaTrack* tr)
while ((pDest = (MediaTrack*)GetSetTrackSendInfo(tr, 0, idx++, "P_DESTTRACK", NULL)))
{
GUID guid = *(GUID*)GetSetMediaTrackInfo(pDest, "GUID", NULL);

/* // NF: disabled this check for now because we need to parse anyway to get the receive env's chunks
// Have we already parsed this particular dest track string?
bool bParsed = false;
for (int i = 0; i < m_sends.GetSize(); i++)
Expand All @@ -222,15 +226,31 @@ void TrackSends::Build(MediaTrack* tr)
}
if (bParsed)
continue;
*/

// We haven't parsed yet!
trackStr = SWS_GetSetObjectState(pDest, NULL);
pos = 0;
WDL_FastString receiveEnvs;
SNM_ChunkParserPatcher p(pDest);

while (GetChunkLine(trackStr, line, 4096, &pos, false))
{
if (strncmp(line, searchStr, strlen(searchStr)) == 0)
m_sends.Add(new TrackSend(&guid, line));
receiveEnvs.Append(line);
}

// store the receive env's chunks
receiveEnvs.Append("\n");
WDL_FastString AUXVOL, AUXPAN, AUXMUTE;
if (p.GetSubChunk("AUXVOLENV", 2, 0, &AUXVOL, "MIDIOUT"))
receiveEnvs.Append(&AUXVOL);
if (p.GetSubChunk("AUXPANENV", 2, 0, &AUXPAN, "MIDIOUT"))
receiveEnvs.Append(&AUXPAN);
if (p.GetSubChunk("AUXMUTEENV", 2, 0, &AUXMUTE, "MIDIOUT"))
receiveEnvs.Append(&AUXMUTE);

m_sends.Add(new TrackSend(&guid, receiveEnvs.Get()));
SWS_FreeHeapPtr(trackStr);
}
}
Expand Down

0 comments on commit e59f34e

Please sign in to comment.