You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
851 B
48 lines
851 B
package com.otaliastudios.cameraview.controls;
|
|
|
|
|
|
import com.otaliastudios.cameraview.CameraView;
|
|
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.Nullable;
|
|
|
|
/**
|
|
* Audio values indicate whether to record audio stream when record video.
|
|
*
|
|
* @see CameraView#setAudio(Audio)
|
|
*/
|
|
public enum Audio implements Control {
|
|
|
|
/**
|
|
* No Audio.
|
|
*/
|
|
OFF(0),
|
|
|
|
/**
|
|
* With Audio.
|
|
*/
|
|
ON(1);
|
|
|
|
final static Audio DEFAULT = ON;
|
|
|
|
private int value;
|
|
|
|
Audio(int value) {
|
|
this.value = value;
|
|
}
|
|
|
|
int value() {
|
|
return value;
|
|
}
|
|
|
|
@NonNull
|
|
static Audio fromValue(int value) {
|
|
Audio[] list = Audio.values();
|
|
for (Audio action : list) {
|
|
if (action.value() == value) {
|
|
return action;
|
|
}
|
|
}
|
|
return DEFAULT;
|
|
}
|
|
}
|
|
|