@@ -201,8 +201,7 @@ void EarVstExportSources::generateAdmAndChna(ReaperAPI const& api)
201
201
for (auto & newError : newErrors) {
202
202
warningStrings.push_back (newError.what ());
203
203
}
204
- }
205
- else if (param && env) {
204
+ } else if (param && env) {
206
205
// We have an envelope for this ADM parameter
207
206
auto newErrors = cumulatedPointData.useEnvelopeDataForParameter (*env, *param, admParameter, api);
208
207
for (auto &newError : newErrors) {
@@ -367,16 +366,18 @@ std::optional<double> EarVstExportSources::getValueFor(std::shared_ptr<admplug::
367
366
bool EarVstExportSources::getEnvelopeBypassed (TrackEnvelope* env, ReaperAPI const & api)
368
367
{
369
368
bool envBypassed = false ;
370
- char chunk[1024 ]; // For a plugin parameter (PARMENV) the ACT flag should always be within the first couple bytes of the state chunk
371
- bool getRes = api.GetEnvelopeStateChunk (env, chunk, 1024 , false );
372
- if (getRes) {
373
- std::istringstream chunkSs (chunk);
374
- std::string line;
375
- while (std::getline (chunkSs, line)) {
376
- auto activePos = line.rfind (" ACT " , 0 );
377
- if ((activePos != std::string::npos) && (line.size () > (activePos + 4 ))) {
378
- envBypassed = line.at (activePos + 4 ) == ' 0' ;
379
- break ;
369
+ if (env) {
370
+ char chunk[1024 ]; // For a plugin parameter (PARMENV) the ACT flag should always be within the first couple bytes of the state chunk
371
+ bool getRes = api.GetEnvelopeStateChunk (env, chunk, 1024 , false );
372
+ if (getRes) {
373
+ std::istringstream chunkSs (chunk);
374
+ std::string line;
375
+ while (std::getline (chunkSs, line)) {
376
+ auto activePos = line.rfind (" ACT " , 0 );
377
+ if ((activePos != std::string::npos) && (line.size () > (activePos + 4 ))) {
378
+ envBypassed = line.at (activePos + 4 ) == ' 0' ;
379
+ break ;
380
+ }
380
381
}
381
382
}
382
383
}
0 commit comments