use of android.media.SoundPool in project Tapad by berict.
the class MainActivity method clearDeck.
public void clearDeck(Activity activity) {
// clear button colors
int[] buttonIds = { R.id.btn00, R.id.btn11, R.id.btn12, R.id.btn13, R.id.btn14, R.id.btn21, R.id.btn22, R.id.btn23, R.id.btn24, R.id.btn31, R.id.btn32, R.id.btn33, R.id.btn34, R.id.btn41, R.id.btn42, R.id.btn43, R.id.btn44 };
for (int buttonId : buttonIds) {
View pad = activity.findViewById(buttonId);
pad.setBackgroundColor(activity.getResources().getColor(R.color.grey));
}
// stop all looping sounds
Integer[] streamIds = w.getLoopStreamIds();
SoundPool soundPool = sound.getSoundPool();
try {
for (Integer streamId : streamIds) {
soundPool.stop(streamId);
}
} finally {
w.clearLoopStreamId();
}
}
Aggregations