/[svn]/gigedit/trunk/src/gigedit/CombineInstrumentsDialog.cpp
ViewVC logotype

Diff of /gigedit/trunk/src/gigedit/CombineInstrumentsDialog.cpp

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

revision 2617 by schoenebeck, Tue Jun 10 22:49:45 2014 UTC revision 2841 by persson, Sun Aug 30 10:00:49 2015 UTC
# Line 1  Line 1 
1  /*  /*
2      Copyright (c) 2014 Christian Schoenebeck      Copyright (c) 2014-2015 Christian Schoenebeck
3            
4      This file is part of "gigedit" and released under the terms of the      This file is part of "gigedit" and released under the terms of the
5      GNU General Public License version 2.      GNU General Public License version 2.
# Line 97  inline int smallestOverlapPoint(const DL Line 97  inline int smallestOverlapPoint(const DL
97   *          found with a range member point >= iStart   *          found with a range member point >= iStart
98   */   */
99  static int findLowestRegionPoint(std::vector<gig::Instrument*>& instruments, int iStart) {  static int findLowestRegionPoint(std::vector<gig::Instrument*>& instruments, int iStart) {
100      DLS::range_t searchRange = { iStart, 127 };      DLS::range_t searchRange = { uint16_t(iStart), 127 };
101      int result = -1;      int result = -1;
102      for (uint i = 0; i < instruments.size(); ++i) {      for (uint i = 0; i < instruments.size(); ++i) {
103          gig::Instrument* instr = instruments[i];          gig::Instrument* instr = instruments[i];
# Line 119  static int findLowestRegionPoint(std::ve Line 119  static int findLowestRegionPoint(std::ve
119   *          with a range end >= iStart   *          with a range end >= iStart
120   */   */
121  static int findFirstRegionEnd(std::vector<gig::Instrument*>& instruments, int iStart) {  static int findFirstRegionEnd(std::vector<gig::Instrument*>& instruments, int iStart) {
122      DLS::range_t searchRange = { iStart, 127 };      DLS::range_t searchRange = { uint16_t(iStart), 127 };
123      int result = -1;      int result = -1;
124      for (uint i = 0; i < instruments.size(); ++i) {      for (uint i = 0; i < instruments.size(); ++i) {
125          gig::Instrument* instr = instruments[i];          gig::Instrument* instr = instruments[i];
# Line 195  static RegionGroups groupByRegionInterse Line 195  static RegionGroups groupByRegionInterse
195          iStart = findLowestRegionPoint(instruments, iStart);          iStart = findLowestRegionPoint(instruments, iStart);
196          if (iStart < 0) break;          if (iStart < 0) break;
197          const int iEnd = findFirstRegionEnd(instruments, iStart);          const int iEnd = findFirstRegionEnd(instruments, iStart);
198          DLS::range_t range = { iStart, iEnd };          DLS::range_t range = { uint16_t(iStart), uint16_t(iEnd) };
199          intersections.push_back(range);          intersections.push_back(range);
200          iStart = iEnd + 1;          iStart = iEnd + 1;
201      }      }
# Line 266  static Dimensions getDimensionsForRegion Line 266  static Dimensions getDimensionsForRegion
266               itNums != it->second.end(); ++itNums)               itNums != it->second.end(); ++itNums)
267          {          {
268              const int iUpperLimit = *itNums;              const int iUpperLimit = *itNums;
269              DLS::range_t range = { iLow, iUpperLimit };              DLS::range_t range = { uint16_t(iLow), uint16_t(iUpperLimit) };
270              dims[type].push_back(range);              dims[type].push_back(range);
271              iLow = iUpperLimit + 1;              iLow = iUpperLimit + 1;
272          }          }
# Line 383  static DimensionZones preciseDimensionZo Line 383  static DimensionZones preciseDimensionZo
383          gig::DimensionRegion* dimRgn2 =          gig::DimensionRegion* dimRgn2 =
384              rgn->pDimensionRegions[ (iDimRgn & mask) | ( z << iBaseBits) ];              rgn->pDimensionRegions[ (iDimRgn & mask) | ( z << iBaseBits) ];
385          int iHigh = dimRgn2->DimensionUpperLimits[iDimension];          int iHigh = dimRgn2->DimensionUpperLimits[iDimension];
386          DLS::range_t range = { iLow, iHigh};          DLS::range_t range = { uint16_t(iLow), uint16_t(iHigh) };
387          #if DEBUG_COMBINE_INSTRUMENTS          #if DEBUG_COMBINE_INSTRUMENTS
388          printf("%d..%d, ", iLow, iHigh);          printf("%d..%d, ", iLow, iHigh);
389          fflush(stdout);          fflush(stdout);

Legend:
Removed from v.2617  
changed lines
  Added in v.2841

  ViewVC Help
Powered by ViewVC