Revision 106ae28d
Added by Leszek Koltunski over 5 years ago
src/main/java/org/distorted/library/effectqueue/EffectQueue.java | ||
---|---|---|
361 | 361 |
return false; |
362 | 362 |
} |
363 | 363 |
|
364 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
365 |
|
|
366 |
public int getNumEffects() |
|
367 |
{ |
|
368 |
return mNumEffects; |
|
369 |
} |
|
370 |
|
|
364 | 371 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
365 | 372 |
|
366 | 373 |
public void doWork() |
... | ... | |
395 | 402 |
mCurrentDuration[mNumEffects] = 0; |
396 | 403 |
mEffects[mNumEffects] = job.effect; |
397 | 404 |
mName[mNumEffects] = job.effect.getName().ordinal(); |
405 |
|
|
406 |
mNumEffects++; |
|
407 |
changed = true; |
|
398 | 408 |
} |
399 | 409 |
else if( position>=0 && position<=mNumEffects ) |
400 | 410 |
{ |
401 |
//android.util.Log.e("queue", "adding new effect to pos "+position); |
|
402 |
|
|
403 | 411 |
for(int j=mNumEffects; j>position; j--) |
404 | 412 |
{ |
405 | 413 |
mCurrentDuration[j] = mCurrentDuration[j-1]; |
... | ... | |
410 | 418 |
mCurrentDuration[position] = 0; |
411 | 419 |
mEffects[position] = job.effect; |
412 | 420 |
mName[position] = job.effect.getName().ordinal(); |
413 |
} |
|
414 | 421 |
|
415 |
mNumEffects++; |
|
416 |
changed = true; |
|
422 |
mNumEffects++; |
|
423 |
changed = true; |
|
424 |
} |
|
417 | 425 |
} |
418 | 426 |
else |
419 | 427 |
{ |
src/main/java/org/distorted/library/main/DistortedEffects.java | ||
---|---|---|
218 | 218 |
int num = effect.getType().ordinal(); |
219 | 219 |
return mQueues[num].add(effect,position); |
220 | 220 |
} |
221 |
|
|
222 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
223 |
/** |
|
224 |
* Return number of effects of the given type currently in the Queue. |
|
225 |
* |
|
226 |
* @param type The EffectType. |
|
227 |
* @return Number of effects of the given type currently in the Queue. |
|
228 |
*/ |
|
229 |
public int getNumEffects(EffectType type) |
|
230 |
{ |
|
231 |
int num = type.ordinal(); |
|
232 |
return mQueues[num].getNumEffects(); |
|
233 |
} |
|
221 | 234 |
} |
Also available in: Unified diff
Progress with DistortedCube.