Search in sources :

Example 16 with PresetReverb

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

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

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

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

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

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

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

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