blob: 20d6a407c47283a510392b4fc0c734b669fa78f5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
package org.cyanogenmod.audiofx.backends;
import org.cyanogenmod.audiofx.Constants;
import android.content.Context;
import android.media.AudioDeviceInfo;
/**
* Creates an EffectSet appropriate for the current device
*/
public class EffectsFactory implements IEffectFactory {
private static final String TAG = "AudioFx-EffectsFactory";
private static int sBrand = -1; // cached value to not hit io every time we need a new effect
public EffectSet createEffectSet(Context context, int sessionId,
AudioDeviceInfo currentDevice) {
// if this throws, we're screwed, don't bother to recover. these
// are the standard effects that every android device must have,
// and if they don't exist we have bigger problems.
return new AndroidEffects(sessionId, currentDevice);
}
public static int getBrand() {
if (sBrand == -1) {
sBrand = getBrandInternal();
}
return sBrand;
}
private static int getBrandInternal() {
return Constants.EFFECT_TYPE_ANDROID;
}
}
|