当前位置: 首页>>代码示例>>Java>>正文


Java Equalizer.getNumberOfPresets方法代码示例

本文整理汇总了Java中android.media.audiofx.Equalizer.getNumberOfPresets方法的典型用法代码示例。如果您正苦于以下问题:Java Equalizer.getNumberOfPresets方法的具体用法?Java Equalizer.getNumberOfPresets怎么用?Java Equalizer.getNumberOfPresets使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.media.audiofx.Equalizer的用法示例。


在下文中一共展示了Equalizer.getNumberOfPresets方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isEqualizerSupported

import android.media.audiofx.Equalizer; //导入方法依赖的package包/类
public static boolean isEqualizerSupported() {
    int noOfBands = 0;
    int noOfPresents = 0;
    try {
        Equalizer equalizer = new Equalizer(0, 0);
        noOfBands = equalizer.getNumberOfBands();
        noOfPresents = equalizer.getNumberOfPresets();
        equalizer.release();
        equalizer = null;
    } catch (Exception e) {

    }

    return noOfBands > 0 && noOfPresents > 0 && !isHTC();

}
 
开发者ID:reyanshmishra,项目名称:Rey-MusicPlayer,代码行数:17,代码来源:MusicUtils.java

示例2: initEq

import android.media.audiofx.Equalizer; //导入方法依赖的package包/类
public static void initEq(int audioID) {
    EndEq();
    try {
        equalizer = new Equalizer(0, audioID);
        preset = (short) Extras.getInstance().saveEq().getInt(SAVE_PRESET, 0);
        if (preset < equalizer.getNumberOfPresets()){
            usePreset(preset);
        }else {
            for (short b = 0; b < equalizer.getNumberOfBands(); b++) {
                short level = (short) Extras.getInstance().saveEq().getInt(BAND_LEVEL + b, 0);
                setBandLevel(b, level);
            }
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:RajneeshSingh007,项目名称:MusicX-music-player,代码行数:18,代码来源:Equalizers.java

示例3: apply

import android.media.audiofx.Equalizer; //导入方法依赖的package包/类
public void apply(Equalizer equalizer)
{
	for (short i = 0; i < bandLevels.length; i++)
	{
		equalizer.setBandLevel(i, bandLevels[i]);
	}

	if (preset >= 0 && preset < equalizer.getNumberOfPresets())
	{
		equalizer.usePreset(preset);
	}

	equalizer.setEnabled(enabled);
}
 
开发者ID:ultrasonic,项目名称:ultrasonic,代码行数:15,代码来源:EqualizerController.java

示例4: getEqualizerPresets

import android.media.audiofx.Equalizer; //导入方法依赖的package包/类
private static Preset[] getEqualizerPresets(Equalizer equalizer) {
    Preset[] presets = new Preset[equalizer.getNumberOfPresets()];

    for (short i = 0; i < presets.length; i++) {
        presets[i] = new Preset(equalizer.getPresetName(i));
    }

    return presets;
}
 
开发者ID:marverenic,项目名称:Jockey,代码行数:10,代码来源:RemoteEqualizer.java

示例5: PresetSpinnerAdapter

import android.media.audiofx.Equalizer; //导入方法依赖的package包/类
public PresetSpinnerAdapter(Context context, Equalizer equalizer) {
    super(context, android.R.layout.simple_spinner_item);
    setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

    short numPresets = equalizer.getNumberOfPresets();
    String[] presets = new String[numPresets + 1];

    for (short i = 0; i < numPresets; i++)
        presets[i] = equalizer.getPresetName(i);

    customPresetIndex = presets.length - 1;
    presets[customPresetIndex] = context.getString(R.string.custom);

    addAll(presets);
}
 
开发者ID:lenworthrose,项目名称:music-app,代码行数:16,代码来源:EqualizerActivity.java

示例6: apply

import android.media.audiofx.Equalizer; //导入方法依赖的package包/类
public void apply(Equalizer equalizer) {
    for (short i = 0; i < bandLevels.length; i++) {
        equalizer.setBandLevel(i, bandLevels[i]);
    }
    if (preset >= 0 && preset < equalizer.getNumberOfPresets()) {
        equalizer.usePreset(preset);
    }
    equalizer.setEnabled(enabled);
}
 
开发者ID:MadMarty,项目名称:madsonic-5.5,代码行数:10,代码来源:EqualizerController.java


注:本文中的android.media.audiofx.Equalizer.getNumberOfPresets方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。