Lines Matching defs:index

206      * file index in SOUND_EFFECT_FILES[] (first column) and indicating if effect
220 /** @hide Maximum volume index values for audio streams */
597 pw.println("\nStream volumes (device: index)");
749 private int rescaleIndex(int index, int srcStream, int dstStream) {
750 return (index * mStreamStates[dstStream].getMaxIndex() + mStreamStates[srcStream].getMaxIndex() / 2) / mStreamStates[srcStream].getMaxIndex();
815 // get last audible index if stream is muted, current index otherwise
828 int index;
835 index = mStreamStates[streamType].getMaxIndex();
836 oldIndex = index;
856 // If stream is muted, adjust last audible index only
873 index = mStreamStates[streamType].getIndex(device, true /* lastAudible */);
886 index = mStreamStates[streamType].getIndex(device, false /* lastAudible */);
889 sendVolumeUpdate(streamType, oldIndex, index, flags);
909 public void setStreamVolume(int streamType, int index, int flags) {
920 index = mStreamStates[streamType].getMaxIndex();
921 oldIndex = index;
923 // get last audible index if stream is muted, current index otherwise
927 index = rescaleIndex(index * 10, streamType, mStreamVolumeAlias[streamType]);
929 if (!checkSafeMediaVolume(mStreamVolumeAlias[streamType], index, device)) {
937 if (index == 0) {
941 index,
951 setStreamVolumeInt(mStreamVolumeAlias[streamType], index, device, false, true);
952 // get last audible index if stream is muted, current index otherwise
953 index = mStreamStates[streamType].getIndex(device,
956 sendVolumeUpdate(streamType, oldIndex, index, flags);
1064 private void sendVolumeUpdate(int streamType, int oldIndex, int index, int flags) {
1073 index = (index + 5) / 10;
1076 intent.putExtra(AudioManager.EXTRA_VOLUME_STREAM_VALUE, index);
1107 * Sets the stream state's index, and posts a message to set system volume.
1111 * @param index Desired volume index of the stream
1115 * @param lastAudible If true, stores new index as last audible one
1118 int index,
1124 // If stream is muted, set last audible index only
1126 // Do not allow last audible index to be 0
1127 if (index != 0) {
1128 streamState.setLastAudibleIndex(index, device);
1139 if (streamState.setIndex(index, device, lastAudible) || force) {
1194 int index;
1198 index = mStreamStates[streamType].getMaxIndex();
1200 index = mStreamStates[streamType].getIndex(device, false /* lastAudible */);
1202 return (index + 5) / 10;
1419 int index = mSetModeDeathHandlers.indexOf(this);
1420 if (index < 0) {
1554 int index = mStreamStates[mStreamVolumeAlias[streamType]].getIndex(device, false);
1555 setStreamVolumeInt(mStreamVolumeAlias[streamType], index, device, true, false);
1621 * file (same index in SOUND_EFFECT_FILES[] has not been loaded.
1912 int index = mScoClients.indexOf(this);
1913 if (index < 0) {
2282 int index = mStreamStates[AudioSystem.STREAM_MUSIC].getIndex(device,
2285 (index > mSafeMediaVolumeIndex)) {
2335 // "step" is the delta in internal index units corresponding to a
2336 // change of 1 in UI index units.
2337 // Because of rounding when rescaling from one stream index range to its alias
2338 // index range, we cannot simply test oldIndex == step:
2339 // (step <= oldIndex < 2 * step) is equivalent to: (old UI index == 1)
2344 // (oldIndex < step) is equivalent to (old UI index == 0)
2656 int index = 10 * AudioManager.DEFAULT_STREAM_VOLUME[mStreamType];
2659 index = mIndexMax;
2663 mIndex.put(AudioSystem.DEVICE_OUT_DEFAULT, index);
2665 mLastAudibleIndex.put(AudioSystem.DEVICE_OUT_DEFAULT, index);
2691 int index = Settings.System.getIntForUser(
2693 if (index == -1) {
2699 // use stored last audible index if present, otherwise use current index if not 0
2700 // or default index
2701 defaultIndex = (index > 0) ?
2702 index : AudioManager.DEFAULT_STREAM_VOLUME[mStreamType];
2706 // a last audible index of 0 should never be stored for ring and notification
2721 // the initial index should never be 0 for ring and notification streams on phones
2723 if ((index == 0) && (mRingerMode == AudioManager.RINGER_MODE_NORMAL) &&
2726 index = lastAudibleIndex;
2737 mIndex.put(device, getValidIndex(10 * index));
2775 public synchronized boolean setIndex(int index, int device, boolean lastAudible) {
2777 index = getValidIndex(index);
2780 index = mIndexMax;
2783 mIndex.put(device, getValidIndex(index));
2785 if (oldIndex != index) {
2787 mLastAudibleIndex.put(device, index);
2797 int scaledIndex = rescaleIndex(index, mStreamType, streamType);
2821 Integer index = indexes.get(device);
2822 if (index == null) {
2824 index = indexes.get(AudioSystem.DEVICE_OUT_DEFAULT);
2826 return index.intValue();
2829 public synchronized void setLastAudibleIndex(int index, int device) {
2838 int scaledIndex = rescaleIndex(index, mStreamType, streamType);
2846 mLastAudibleIndex.put(device, getValidIndex(index));
2875 int index = ((Integer)entry.getValue()).intValue();
2876 index = rescaleIndex(index, srcStream.getStreamType(), mStreamType);
2879 setLastAudibleIndex(index, device);
2881 setIndex(index, device, false /* lastAudible */);
2914 private int getValidIndex(int index) {
2915 if (index < 0) {
2917 } else if (index > mIndexMax) {
2921 return index;
5828 // The volume index corresponding to the limit is stored in config_safe_media_volume_index
5892 int index = streamState.getIndex(device, lastAudible);
5893 if (index > mSafeMediaVolumeIndex) {
5918 private boolean checkSafeMediaVolume(int streamType, int index, int device) {
5923 (index > mSafeMediaVolumeIndex)) {