Search in sources :

Example 1 with PresetReverb

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

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)

Example 2 with PresetReverb

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

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 3 with PresetReverb

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

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)

Example 4 with PresetReverb

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

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 5 with PresetReverb

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

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)

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