699 |
dimensionManager.set_region(region); |
dimensionManager.set_region(region); |
700 |
} |
} |
701 |
|
|
702 |
|
void RegionChooser::select_next_region() { |
703 |
|
if (!instrument) return; |
704 |
|
if (!region) { |
705 |
|
for (int i = 0; i < 128; ++i) { |
706 |
|
::gig::Region* rgn = instrument->GetRegion(i); |
707 |
|
if (rgn) { |
708 |
|
set_region(rgn); |
709 |
|
return; |
710 |
|
} |
711 |
|
} |
712 |
|
} else { |
713 |
|
bool currentFound = false; |
714 |
|
for (int i = 0; i < 128; ++i) { |
715 |
|
::gig::Region* rgn = instrument->GetRegion(i); |
716 |
|
if (!rgn) continue; |
717 |
|
if (currentFound) { |
718 |
|
if (rgn != region) { |
719 |
|
set_region(rgn); |
720 |
|
return; |
721 |
|
} |
722 |
|
} else { |
723 |
|
if (rgn == region) currentFound = true; |
724 |
|
} |
725 |
|
} |
726 |
|
} |
727 |
|
} |
728 |
|
|
729 |
|
void RegionChooser::select_prev_region() { |
730 |
|
if (!instrument) return; |
731 |
|
if (!region) { |
732 |
|
for (int i = 0; i < 128; ++i) { |
733 |
|
::gig::Region* rgn = instrument->GetRegion(i); |
734 |
|
if (rgn) { |
735 |
|
set_region(rgn); |
736 |
|
return; |
737 |
|
} |
738 |
|
} |
739 |
|
} else { |
740 |
|
bool currentFound = false; |
741 |
|
for (int i = 127; i >= 0; --i) { |
742 |
|
::gig::Region* rgn = instrument->GetRegion(i); |
743 |
|
if (!rgn) continue; |
744 |
|
if (currentFound) { |
745 |
|
if (rgn != region) { |
746 |
|
set_region(rgn); |
747 |
|
return; |
748 |
|
} |
749 |
|
} else { |
750 |
|
if (rgn == region) currentFound = true; |
751 |
|
} |
752 |
|
} |
753 |
|
} |
754 |
|
} |
755 |
|
|
756 |
void RegionChooser::motion_resize_region(int x, int y) |
void RegionChooser::motion_resize_region(int x, int y) |
757 |
{ |
{ |
758 |
const int w = get_width() - 1; |
const int w = get_width() - 1; |