Search in sources :

Example 16 with SoundPool

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();
    }
}
Also used : SoundPool(android.media.SoundPool) View(android.view.View)

Aggregations

SoundPool (android.media.SoundPool)16 ContentResolver (android.content.ContentResolver)5 IntentFilter (android.content.IntentFilter)5 LockPatternUtils (com.android.internal.widget.LockPatternUtils)5 KeyguardDisplayManager (com.android.keyguard.KeyguardDisplayManager)5 Uri (android.net.Uri)2 View (android.view.View)2 Test (org.junit.Test)2 Config (org.robolectric.annotation.Config)2 Intent (android.content.Intent)1 MediaPlayer (android.media.MediaPlayer)1 OnPreparedListener (android.media.MediaPlayer.OnPreparedListener)1 OnLoadCompleteListener (android.media.SoundPool.OnLoadCompleteListener)1 OnClickListener (android.view.View.OnClickListener)1 Button (android.widget.Button)1 TextView (android.widget.TextView)1 EMServiceNotReadyException (com.easemob.exceptions.EMServiceNotReadyException)1 CameraHelper (com.juns.wechat.chat.utils.CameraHelper)1 LuaTable (org.luaj.vm2.LuaTable)1 LuaValue (org.luaj.vm2.LuaValue)1