mirror of
https://github.com/thestk/stk
synced 2026-02-07 17:56:16 +00:00
Granulate.cpp: change variable types from std::vector<Grain>::size_type to size_t
This commit is contained in:
@@ -106,8 +106,8 @@ void Granulate :: reset( void )
|
|||||||
gPointer_ = 0;
|
gPointer_ = 0;
|
||||||
|
|
||||||
// Reset grain parameters.
|
// Reset grain parameters.
|
||||||
std::vector<Grain>::size_type count;
|
size_t count;
|
||||||
std::vector<Grain>::size_type nVoices = (unsigned int)grains_.size();
|
size_t nVoices = (unsigned int)grains_.size();
|
||||||
for ( unsigned int i=0; i<grains_.size(); i++ ) {
|
for ( unsigned int i=0; i<grains_.size(); i++ ) {
|
||||||
grains_[i].repeats = 0;
|
grains_[i].repeats = 0;
|
||||||
count = ( i * gDuration_ * 0.001 * Stk::sampleRate() / nVoices );
|
count = ( i * gDuration_ * 0.001 * Stk::sampleRate() / nVoices );
|
||||||
@@ -127,12 +127,12 @@ void Granulate :: setVoices( unsigned int nVoices )
|
|||||||
handleError( message.str(), StkError::DEBUG_PRINT );
|
handleError( message.str(), StkError::DEBUG_PRINT );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::vector<Grain>::size_type oldSize = grains_.size();
|
size_t oldSize = grains_.size();
|
||||||
grains_.resize( nVoices );
|
grains_.resize( nVoices );
|
||||||
|
|
||||||
// Initialize new grain voices.
|
// Initialize new grain voices.
|
||||||
std::vector<Grain>::size_type count;
|
size_t count;
|
||||||
for ( std::vector<Grain>::size_type i=oldSize; i<nVoices; i++ ) {
|
for ( size_t i=oldSize; i<nVoices; i++ ) {
|
||||||
grains_[i].repeats = 0;
|
grains_[i].repeats = 0;
|
||||||
count = ( i * gDuration_ * 0.001 * Stk::sampleRate() / nVoices );
|
count = ( i * gDuration_ * 0.001 * Stk::sampleRate() / nVoices );
|
||||||
grains_[i].counter = count;
|
grains_[i].counter = count;
|
||||||
|
|||||||
Reference in New Issue
Block a user