标志参数是什么意思,机器人设备可能的最小和最大范围是多少 [英] What does the flag parameter mean and what is range of possible min and max of droid device

查看:75
本文介绍了标志参数是什么意思,机器人设备可能的最小和最大范围是多少的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  1. 我想知道什么是标志(或什么是可能的值标记)

  1. I want to know what is flag(or what are the possible values for flag) in

audiomanager.setStreamVolume(int streamType,int索引,int标志);

我知道我们可以使用来获得最大的流量

I know we can get the maximum stream using

audiomanger.getMaxStream(audioManager.getStreamMax(AudioManager.STREAM_MUSIC));

但是在某些设备上它给出13,15,它取决于Android版本或设备硬件以及它的范围(最小可能值,最大可能值)

But in some device it gives 13,15, it depends on Android version or device hardware and what is it range(minimum possible value, maximum possible value)

设置特定流的音量索引.

Sets the volume index for a particular stream.

如果设备执行isVolumeFixed()指示的固定音量策略,则此方法无效.

This method has no effect if the device implements a fixed volume policy as indicated by isVolumeFixed().// what does it mean.

参数

streamType  The stream whose volume index should be set.

index   The volume index to set. See getStreamMaxVolume(int) for the largest valid value.

flags   One or more flags. // what are these flags 

推荐答案

关于标志参数:在 AudioManager.java 中定义了一些标志.您可以使用其中任何一种来获得所需的效果.例子:

About the flag parameter: There are some flags defined in AudioManager.java. You can use any one of them to get the desired affect. example :

audioManager.setStreamVolume(audioManager.STREAM_MUSIC,progress,AudioManager.FLAG_SHOW_UI);

或者简单地

audioManager.setStreamVolume(audioManager.STREAM_MUSIC,progress,1);

这是 AudioManager.java 中的代码段,显示了它们的定义方式.

here is the code segment from AudioManager.java showing how they are defined.

public static final int FLAG_SHOW_UI = 1 << 0;

/**
 * Whether to include ringer modes as possible options when changing volume.
 * For example, if true and volume level is 0 and the volume is adjusted
 * with {@link #ADJUST_LOWER}, then the ringer mode may switch the silent or
 * vibrate mode.
 * <p>
 * By default this is on for the ring stream. If this flag is included,
 * this behavior will be present regardless of the stream type being
 * affected by the ringer mode.
 *
 * @see #adjustVolume(int, int)
 * @see #adjustStreamVolume(int, int, int)
 */
public static final int FLAG_ALLOW_RINGER_MODES = 1 << 1;

/**
 * Whether to play a sound when changing the volume.
 * <p>
 * If this is given to {@link #adjustVolume(int, int)} or
 * {@link #adjustSuggestedStreamVolume(int, int, int)}, it may be ignored
 * in some cases (for example, the decided stream type is not
 * {@link AudioManager#STREAM_RING}, or the volume is being adjusted
 * downward).
 *
 * @see #adjustStreamVolume(int, int, int)
 * @see #adjustVolume(int, int)
 * @see #setStreamVolume(int, int, int)
 */
public static final int FLAG_PLAY_SOUND = 1 << 2;

/**
 * Removes any sounds/vibrate that may be in the queue, or are playing (related to
 * changing volume).
 */
public static final int FLAG_REMOVE_SOUND_AND_VIBRATE = 1 << 3;

/**
 * Whether to vibrate if going into the vibrate ringer mode.
 */
public static final int FLAG_VIBRATE = 1 << 4;

/**
 * Indicates to VolumePanel that the volume slider should be disabled as user
 * cannot change the stream volume
 * @hide
 */
public static final int FLAG_FIXED_VOLUME = 1 << 5;

/**
 * Indicates the volume set/adjust call is for Bluetooth absolute volume
 * @hide
 */
public static final int FLAG_BLUETOOTH_ABS_VOLUME = 1 << 6;

/**
 * Adjusting the volume was prevented due to silent mode, display a hint in the UI.
 * @hide
 */
public static final int FLAG_SHOW_SILENT_HINT = 1 << 7;

/**
 * Indicates the volume call is for Hdmi Cec system audio volume
 * @hide
 */
public static final int FLAG_HDMI_SYSTEM_AUDIO_VOLUME = 1 << 8;

/**
 * Indicates that this should only be handled if media is actively playing.
 * @hide
 */
public static final int FLAG_ACTIVE_MEDIA_ONLY = 1 << 9;

/**
 * Like FLAG_SHOW_UI, but only dialog warnings and confirmations, no sliders.
 * @hide
 */
public static final int FLAG_SHOW_UI_WARNINGS = 1 << 10;

/**
 * Adjusting the volume down from vibrated was prevented, display a hint in the UI.
 * @hide
 */
public static final int FLAG_SHOW_VIBRATE_HINT = 1 << 11;

/**
 * Adjusting the volume due to a hardware key press.
 * @hide
 */
public static final int FLAG_FROM_KEY = 1 << 12;

这篇关于标志参数是什么意思,机器人设备可能的最小和最大范围是多少的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆