3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2008 Anders Dahnielson <anders@dahnielson.com> * |
* Copyright (C) 2008 Anders Dahnielson <anders@dahnielson.com> * |
6 |
* Copyright (C) 2009 - 2010 Anders Dahnielson and Grigor Iliev * |
* Copyright (C) 2009 - 2011 Anders Dahnielson and Grigor Iliev * |
7 |
* * |
* * |
8 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
9 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
149 |
} |
} |
150 |
|
|
151 |
bool Region::HasLoop() { |
bool Region::HasLoop() { |
152 |
bool b = loop_mode == ::sfz::LOOP_CONTINUOUS || loop_mode == ::sfz::LOOP_SUSTAIN; // TODO: ONE_SHOT mode |
bool b = loop_mode == ::sfz::LOOP_UNSET ? pSample->GetLoops() : |
153 |
|
(loop_mode == ::sfz::LOOP_CONTINUOUS || loop_mode == ::sfz::LOOP_SUSTAIN); |
154 |
return b && GetLoopStart() && GetLoopEnd() && GetLoopEnd() > GetLoopStart(); |
return b && GetLoopStart() && GetLoopEnd() && GetLoopEnd() > GetLoopStart(); |
155 |
} |
} |
156 |
|
|
157 |
uint Region::GetLoopStart() { |
uint Region::GetLoopStart() { |
158 |
return (!loop_start) ? 0 : *loop_start; // TODO: use sample loop when loop_start not defined |
return (!loop_start) ? pSample->GetLoopStart() : *loop_start; |
159 |
} |
} |
160 |
|
|
161 |
uint Region::GetLoopEnd() { |
uint Region::GetLoopEnd() { |
162 |
return (!loop_end) ? 0 : *loop_end; // TODO: use sample loop when loop_end not defined |
return (!loop_end) ? pSample->GetLoopEnd() : *loop_end; |
163 |
} |
} |
164 |
|
|
165 |
uint Region::GetLoopCount() { |
uint Region::GetLoopCount() { |
285 |
end.unset(); |
end.unset(); |
286 |
loop_crossfade.unset(); |
loop_crossfade.unset(); |
287 |
offset.unset(); offset_random.unset(); |
offset.unset(); offset_random.unset(); |
288 |
loop_mode = NO_LOOP; |
loop_mode = LOOP_UNSET; |
289 |
loop_start.unset(); loop_end.unset(); |
loop_start.unset(); loop_end.unset(); |
290 |
sync_beats.unset(); sync_offset.unset(); |
sync_beats.unset(); sync_offset.unset(); |
291 |
|
|