Search in sources :

Example 11 with PresetReverb

use of android.media.audiofx.PresetReverb in project android_frameworks_base by ParanoidAndroid.

the class PresetReverbTest method getEffect.

private void getEffect(int session) {
    synchronized (sInstances) {
        if (sInstances.containsKey(session)) {
            mPresetReverb = sInstances.get(session);
        } else {
            try {
                mPresetReverb = new PresetReverb(0, session);
            } catch (IllegalArgumentException e) {
                Log.e(TAG, "PresetReverb effect not supported");
            } catch (UnsupportedOperationException e) {
                Log.e(TAG, "PresetReverb library not loaded");
            } catch (RuntimeException e) {
                Log.e(TAG, "PresetReverb effect not found");
            }
            sInstances.put(session, mPresetReverb);
        }
    }
    mReleaseButton.setEnabled(false);
    mOnOffButton.setEnabled(false);
    if (mPresetReverb != null) {
        if (mSettings != "") {
            mPresetReverb.setProperties(new PresetReverb.Settings(mSettings));
        }
        mPresetReverb.setEnableStatusListener(mEffectListener);
        mPresetReverb.setControlStatusListener(mEffectListener);
        mPresetReverb.setParameterListener(mEffectListener);
        mReleaseButton.setChecked(true);
        mReleaseButton.setEnabled(true);
        mOnOffButton.setChecked(mPresetReverb.getEnabled());
        mOnOffButton.setEnabled(true);
    }
}
Also used : PresetReverb(android.media.audiofx.PresetReverb)

Example 12 with PresetReverb

use of android.media.audiofx.PresetReverb in project android_frameworks_base by ParanoidAndroid.

the class MediaPresetReverbTest method getReverb.

//-----------------------------------------------------------------
// private methods
//----------------------------------
private void getReverb(int session) {
    if (mReverb == null || session != mSession) {
        if (session != mSession && mReverb != null) {
            mReverb.release();
            mReverb = null;
        }
        try {
            mReverb = new PresetReverb(0, session);
            mSession = session;
        } catch (IllegalArgumentException e) {
            Log.e(TAG, "getReverb() PresetReverb not found exception: " + e);
        } catch (UnsupportedOperationException e) {
            Log.e(TAG, "getReverb() Effect library not loaded exception: " + e);
        }
    }
    assertNotNull("could not create mReverb", mReverb);
}
Also used : PresetReverb(android.media.audiofx.PresetReverb)

Example 13 with PresetReverb

use of android.media.audiofx.PresetReverb in project platform_frameworks_base by android.

the class MediaPresetReverbTest method getReverb.

//-----------------------------------------------------------------
// private methods
//----------------------------------
private void getReverb(int session) {
    if (mReverb == null || session != mSession) {
        if (session != mSession && mReverb != null) {
            mReverb.release();
            mReverb = null;
        }
        try {
            mReverb = new PresetReverb(0, session);
            mSession = session;
        } catch (IllegalArgumentException e) {
            Log.e(TAG, "getReverb() PresetReverb not found exception: " + e);
        } catch (UnsupportedOperationException e) {
            Log.e(TAG, "getReverb() Effect library not loaded exception: " + e);
        }
    }
    assertNotNull("could not create mReverb", mReverb);
}
Also used : PresetReverb(android.media.audiofx.PresetReverb)

Example 14 with PresetReverb

use of android.media.audiofx.PresetReverb in project android_frameworks_base by DirtyUnicorns.

the class MediaPresetReverbTest method getReverb.

//-----------------------------------------------------------------
// private methods
//----------------------------------
private void getReverb(int session) {
    if (mReverb == null || session != mSession) {
        if (session != mSession && mReverb != null) {
            mReverb.release();
            mReverb = null;
        }
        try {
            mReverb = new PresetReverb(0, session);
            mSession = session;
        } catch (IllegalArgumentException e) {
            Log.e(TAG, "getReverb() PresetReverb not found exception: " + e);
        } catch (UnsupportedOperationException e) {
            Log.e(TAG, "getReverb() Effect library not loaded exception: " + e);
        }
    }
    assertNotNull("could not create mReverb", mReverb);
}
Also used : PresetReverb(android.media.audiofx.PresetReverb)

Example 15 with PresetReverb

use of android.media.audiofx.PresetReverb in project android_frameworks_base by DirtyUnicorns.

the class MediaPresetReverbTest method test0_0ConstructorAndRelease.

//-----------------------------------------------------------------
// PRESET REVEB TESTS:
//----------------------------------
//-----------------------------------------------------------------
// 0 - constructor
//----------------------------------
//Test case 0.0: test constructor and release
@LargeTest
public void test0_0ConstructorAndRelease() throws Exception {
    boolean result = false;
    String msg = "test1_0ConstructorAndRelease()";
    PresetReverb reverb = null;
    try {
        reverb = new PresetReverb(0, 0);
        assertNotNull(msg + ": could not create PresetReverb", reverb);
        try {
            assertTrue(msg + ": invalid effect ID", (reverb.getId() != 0));
        } catch (IllegalStateException e) {
            msg = msg.concat(": PresetReverb not initialized");
        }
        result = true;
    } catch (IllegalArgumentException e) {
        msg = msg.concat(": PresetReverb not found");
    } catch (UnsupportedOperationException e) {
        msg = msg.concat(": Effect library not loaded");
    } finally {
        if (reverb != null) {
            reverb.release();
        }
    }
    assertTrue(msg, result);
}
Also used : PresetReverb(android.media.audiofx.PresetReverb) LargeTest(android.test.suitebuilder.annotation.LargeTest)

Aggregations

PresetReverb (android.media.audiofx.PresetReverb)19 LargeTest (android.test.suitebuilder.annotation.LargeTest)6 BassBoost (android.media.audiofx.BassBoost)1 Equalizer (android.media.audiofx.Equalizer)1 Visualizer (android.media.audiofx.Visualizer)1