/[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 231 by schoenebeck, Sun Sep 5 00:46:28 2004 UTC revision 241 by schoenebeck, Wed Sep 15 13:49:21 2004 UTC
# Line 680  namespace gig { Line 680  namespace gig {
680          if (!pVelocityTables) pVelocityTables = new VelocityTableMap;          if (!pVelocityTables) pVelocityTables = new VelocityTableMap;
681    
682          RIFF::Chunk* _3ewa = _3ewl->GetSubChunk(CHUNK_ID_3EWA);          RIFF::Chunk* _3ewa = _3ewl->GetSubChunk(CHUNK_ID_3EWA);
683          _3ewa->ReadInt32(); // unknown, allways 0x0000008C ?          _3ewa->ReadInt32(); // unknown, always 0x0000008C ?
684          LFO3Frequency = (double) GIG_EXP_DECODE(_3ewa->ReadInt32());          LFO3Frequency = (double) GIG_EXP_DECODE(_3ewa->ReadInt32());
685          EG3Attack     = (double) GIG_EXP_DECODE(_3ewa->ReadInt32());          EG3Attack     = (double) GIG_EXP_DECODE(_3ewa->ReadInt32());
686          _3ewa->ReadInt16(); // unknown          _3ewa->ReadInt16(); // unknown
# Line 1053  namespace gig { Line 1053  namespace gig {
1053                      pDimensionDefinitions[i].bits      = bits;                      pDimensionDefinitions[i].bits      = bits;
1054                      pDimensionDefinitions[i].zones     = 0x01 << bits; // = pow(2,bits)                      pDimensionDefinitions[i].zones     = 0x01 << bits; // = pow(2,bits)
1055                      pDimensionDefinitions[i].split_type = (dimension == dimension_layer ||                      pDimensionDefinitions[i].split_type = (dimension == dimension_layer ||
1056                                                             dimension == dimension_samplechannel) ? split_type_bit                                                             dimension == dimension_samplechannel ||
1057                                                                                                   : split_type_normal;                                                             dimension == dimension_releasetrigger) ? split_type_bit
1058                                                                                                      : split_type_normal;
1059                      pDimensionDefinitions[i].ranges = NULL; // it's not possible to check velocity dimensions for custom defined ranges at this point                      pDimensionDefinitions[i].ranges = NULL; // it's not possible to check velocity dimensions for custom defined ranges at this point
1060                      pDimensionDefinitions[i].zone_size  =                      pDimensionDefinitions[i].zone_size  =
1061                          (pDimensionDefinitions[i].split_type == split_type_normal) ? 128 / pDimensionDefinitions[i].zones                          (pDimensionDefinitions[i].split_type == split_type_normal) ? 128 / pDimensionDefinitions[i].zones
# Line 1152  namespace gig { Line 1153  namespace gig {
1153       * @see             Dimensions       * @see             Dimensions
1154       */       */
1155      DimensionRegion* Region::GetDimensionRegionByValue(uint Dim4Val, uint Dim3Val, uint Dim2Val, uint Dim1Val, uint Dim0Val) {      DimensionRegion* Region::GetDimensionRegionByValue(uint Dim4Val, uint Dim3Val, uint Dim2Val, uint Dim1Val, uint Dim0Val) {
1156          unsigned int bits[5] = {Dim0Val,Dim1Val,Dim2Val,Dim3Val,Dim4Val};          uint8_t bits[5] = {Dim0Val,Dim1Val,Dim2Val,Dim3Val,Dim4Val};
1157          for (uint i = 0; i < Dimensions; i++) {          for (uint i = 0; i < Dimensions; i++) {
1158              switch (pDimensionDefinitions[i].split_type) {              switch (pDimensionDefinitions[i].split_type) {
1159                  case split_type_normal:                  case split_type_normal:
# Line 1161  namespace gig { Line 1162  namespace gig {
1162                  case split_type_customvelocity:                  case split_type_customvelocity:
1163                      bits[i] = VelocityTable[bits[i]];                      bits[i] = VelocityTable[bits[i]];
1164                      break;                      break;
1165                  // else the value is already the sought dimension bit number                  case split_type_bit: // the value is already the sought dimension bit number
1166                        const uint8_t limiter_mask = (0xff << pDimensionDefinitions[i].bits) ^ 0xff;
1167                        bits[i] = bits[i] & limiter_mask; // just make sure the value don't uses more bits than allowed
1168                        break;
1169              }              }
1170          }          }
1171          return GetDimensionRegionByBit(bits[4],bits[3],bits[2],bits[1],bits[0]);          return GetDimensionRegionByBit(bits[4],bits[3],bits[2],bits[1],bits[0]);

Legend:
Removed from v.231  
changed lines
  Added in v.241

  ViewVC Help
Powered by ViewVC