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 |
|
|
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++; |
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; |
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 |
); |
); |