/[svn]/libgig/trunk/src/gig.cpp
ViewVC logotype

Diff of /libgig/trunk/src/gig.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3203 by schoenebeck, Tue May 23 14:51:01 2017 UTC revision 3323 by schoenebeck, Thu Jul 20 22:09:54 2017 UTC
# Line 341  namespace { Line 341  namespace {
341    
342    
343    
344    // *************** eg_opt_t ***************
345    // *
346    
347        eg_opt_t::eg_opt_t() {
348            AttackCancel     = true;
349            AttackHoldCancel = true;
350            DecayCancel      = true;
351            ReleaseCancel    = true;
352        }
353    
354        void eg_opt_t::serialize(Serialization::Archive* archive) {
355            SRLZ(AttackCancel);
356            SRLZ(AttackHoldCancel);
357            SRLZ(DecayCancel);
358            SRLZ(ReleaseCancel);
359        }
360    
361    
362    
363  // *************** Sample ***************  // *************** Sample ***************
364  // *  // *
365    
# Line 1711  namespace { Line 1730  namespace {
1730              VCFType                         = vcf_type_lowpass;              VCFType                         = vcf_type_lowpass;
1731              memset(DimensionUpperLimits, 127, 8);              memset(DimensionUpperLimits, 127, 8);
1732          }          }
1733            // format extension for EG behavior options, these will *NOT* work with
1734            // Gigasampler/GigaStudio !
1735            RIFF::Chunk* lsde = _3ewl->GetSubChunk(CHUNK_ID_LSDE);
1736            if (lsde) {
1737                unsigned char byte = lsde->ReadUint8();
1738                EGOptions.AttackCancel     = byte & 1;
1739                EGOptions.AttackHoldCancel = byte & (1 << 1);
1740                EGOptions.DecayCancel      = byte & (1 << 2);
1741                EGOptions.ReleaseCancel    = byte & (1 << 3);
1742            }
1743    
1744          pVelocityAttenuationTable = GetVelocityTable(VelocityResponseCurve,          pVelocityAttenuationTable = GetVelocityTable(VelocityResponseCurve,
1745                                                       VelocityResponseDepth,                                                       VelocityResponseDepth,
# Line 1899  namespace { Line 1928  namespace {
1928          SRLZ(MSDecode);          SRLZ(MSDecode);
1929          //SRLZ(SampleStartOffset);          //SRLZ(SampleStartOffset);
1930          SRLZ(SampleAttenuation);          SRLZ(SampleAttenuation);
1931            SRLZ(EGOptions);
1932    
1933          // derived attributes from DLS::Sampler          // derived attributes from DLS::Sampler
1934          SRLZ(FineTune);          SRLZ(FineTune);
# Line 2205  namespace { Line 2235  namespace {
2235          if (chunksize >= 148) {          if (chunksize >= 148) {
2236              memcpy(&pData[140], DimensionUpperLimits, 8);              memcpy(&pData[140], DimensionUpperLimits, 8);
2237          }          }
2238    
2239            // format extension for EG behavior options, these will *NOT* work with
2240            // Gigasampler/GigaStudio !
2241            RIFF::Chunk* lsde = pParentList->GetSubChunk(CHUNK_ID_LSDE);
2242            if (!lsde) {
2243                // only add this "LSDE" chunk if the EG options do not match the
2244                // default EG behavior
2245                eg_opt_t defaultOpt;
2246                if (memcmp(&EGOptions, &defaultOpt, sizeof(eg_opt_t))) {
2247                    lsde = pParentList->AddSubChunk(CHUNK_ID_LSDE, 1);
2248                    // move LSDE chunk to the end of parent list
2249                    pParentList->MoveSubChunk(lsde, (RIFF::Chunk*)NULL);
2250                }
2251            }
2252            if (lsde) {
2253                unsigned char* pByte = (unsigned char*) lsde->LoadChunkData();
2254                *pByte =
2255                    (EGOptions.AttackCancel     ? 1 : 0) |
2256                    (EGOptions.AttackHoldCancel ? (1<<1) : 0) |
2257                    (EGOptions.DecayCancel      ? (1<<2) : 0) |
2258                    (EGOptions.ReleaseCancel    ? (1<<3) : 0);
2259            }
2260      }      }
2261    
2262      double* DimensionRegion::GetReleaseVelocityTable(curve_type_t releaseVelocityResponseCurve, uint8_t releaseVelocityResponseDepth) {      double* DimensionRegion::GetReleaseVelocityTable(curve_type_t releaseVelocityResponseCurve, uint8_t releaseVelocityResponseDepth) {

Legend:
Removed from v.3203  
changed lines
  Added in v.3323

  ViewVC Help
Powered by ViewVC