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

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

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

revision 3306 by schoenebeck, Thu Jun 22 10:54:10 2017 UTC revision 3307 by schoenebeck, Tue Jul 11 23:06:38 2017 UTC
# Line 40  Line 40 
40  struct RegionFeatures {  struct RegionFeatures {
41      int sampleRefs;      int sampleRefs;
42      int loops;      int loops;
43        int validDimRegs;
44    
45      RegionFeatures() {      RegionFeatures() {
46          sampleRefs = loops = 0;          sampleRefs = loops = validDimRegs = 0;
47      }      }
48  };  };
49    
# Line 50  static RegionFeatures regionFeatures(gig Line 51  static RegionFeatures regionFeatures(gig
51      RegionFeatures f;      RegionFeatures f;
52      for (int i = 0; i < rgn->DimensionRegions; ++i) {      for (int i = 0; i < rgn->DimensionRegions; ++i) {
53          gig::DimensionRegion* dr = rgn->pDimensionRegions[i];          gig::DimensionRegion* dr = rgn->pDimensionRegions[i];
54            DimensionCase c = dimensionCaseOf(dr);
55            if (!isUsedCase(c, rgn)) continue;
56            f.validDimRegs++;
57          if (dr->pSample) f.sampleRefs++;          if (dr->pSample) f.sampleRefs++;
58          // the user doesn't care about loop if there is no valid sample reference          // the user doesn't care about loop if there is no valid sample reference
59          if (dr->pSample && dr->SampleLoops) f.loops++;          if (dr->pSample && dr->SampleLoops) f.loops++;
# Line 396  void RegionChooser::draw_regions(const C Line 400  void RegionChooser::draw_regions(const C
400          RegionFeatures features = regionFeatures(r);          RegionFeatures features = regionFeatures(r);
401    
402          const bool bShowLoopSymbol = features.loops > 0;          const bool bShowLoopSymbol = features.loops > 0;
403          const bool bShowSampleRefSymbol = features.sampleRefs < r->DimensionRegions;          const bool bShowSampleRefSymbol = features.sampleRefs < features.validDimRegs;
404          if (bShowLoopSymbol || bShowSampleRefSymbol) {          if (bShowLoopSymbol || bShowSampleRefSymbol) {
405              const int margin = 2;              const int margin = 2;
406              const int wRgn = x2 - x;              const int wRgn = x2 - x;
# Line 420  void RegionChooser::draw_regions(const C Line 424  void RegionChooser::draw_regions(const C
424                  const int wPic = 12;                  const int wPic = 12;
425                  const int hPic = 14;                  const int hPic = 14;
426                  Gdk::Cairo::set_source_pixbuf(                  Gdk::Cairo::set_source_pixbuf(
427                      cr, (features.loops == r->DimensionRegions) ? blackLoop : grayLoop,                      cr, (features.loops == features.validDimRegs) ? blackLoop : grayLoop,
428                      x + (wRgn-wPic)/2.f,                      x + (wRgn-wPic)/2.f,
429                      (bShowSampleRefSymbol) ? h1 - hPic - margin : (h1-hPic)/2.f                      (bShowSampleRefSymbol) ? h1 - hPic - margin : (h1-hPic)/2.f
430                  );                  );

Legend:
Removed from v.3306  
changed lines
  Added in v.3307

  ViewVC Help
Powered by ViewVC