本文整理汇总了Java中com.qd.recorder.ProgressView.State类的典型用法代码示例。如果您正苦于以下问题:Java State类的具体用法?Java State怎么用?Java State使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
State类属于com.qd.recorder.ProgressView包,在下文中一共展示了State类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: releaseResources
import com.qd.recorder.ProgressView.State; //导入依赖的package包/类
/**
* 释放资源,停止录制视频和音频
*/
private void releaseResources() {
if (recorderThread != null) {
recorderThread.finish();
}
isRecordingSaved = true;
try {
if (videoRecorder != null) {
videoRecorder.stop();
videoRecorder.release();
}
} catch (com.googlecode.javacv.FrameRecorder.Exception e) {
e.printStackTrace();
}
yuvIplImage = null;
videoRecorder = null;
lastSavedframe = null;
//progressView.putProgressList((int) totalTime);
//停止刷新进度
progressView.setCurrentState(State.PAUSE);
}
示例2: releaseResources
import com.qd.recorder.ProgressView.State; //导入依赖的package包/类
/**
* �ͷ���Դ��ֹͣ¼����Ƶ����Ƶ
*/
private void releaseResources(){
isRecordingSaved = true;
try {
if(videoRecorder != null)
{
videoRecorder.stop();
videoRecorder.release();
}
} catch (com.googlecode.javacv.FrameRecorder.Exception e) {
e.printStackTrace();
}
yuvIplImage = null;
videoRecorder = null;
lastSavedframe = null;
//progressView.putProgressList((int) totalTime);
//ֹͣˢ�½���
progressView.setCurrentState(State.PAUSE);
}
示例3: initHandler
import com.qd.recorder.ProgressView.State; //导入依赖的package包/类
private void initHandler() {
mHandler = new Handler() {
@Override
public void dispatchMessage(Message msg) {
switch (msg.what) {
case 2:
int resId = 0;
if (currentRecorderState == RecorderState.PRESS) {
resId = R.drawable.video_text01;
} else if (currentRecorderState == RecorderState.LOOSEN) {
resId = R.drawable.video_text02;
} else if (currentRecorderState == RecorderState.CHANGE) {
resId = R.drawable.video_text03;
} else if (currentRecorderState == RecorderState.SUCCESS) {
resId = R.drawable.video_text04;
}
stateImageView.setImageResource(resId);
break;
case 3:
if (!recording)
initiateRecording(true);
else {
//更新暂停的时间
stopPauseTime = System.currentTimeMillis();
totalPauseTime = stopPauseTime - startPauseTime - ((long) (1.0 / (double) frameRate) * 1000);
pausedTime += totalPauseTime;
}
rec = true;
//开始进度条增长
progressView.setCurrentState(State.START);
//setTotalVideoTime();
break;
case 4:
//设置进度条暂停状态
progressView.setCurrentState(State.PAUSE);
//将暂停的时间戳添加到进度条的队列中
progressView.putProgressList((int) totalTime);
rec = false;
startPauseTime = System.currentTimeMillis();
if (totalTime >= RECORDING_MINIMUM_TIME) {
currentRecorderState = RecorderState.SUCCESS;
mHandler.sendEmptyMessage(2);
} else if (totalTime >= RECORDING_CHANGE_TIME) {
currentRecorderState = RecorderState.CHANGE;
mHandler.sendEmptyMessage(2);
}
break;
case 5:
currentRecorderState = RecorderState.SUCCESS;
mHandler.sendEmptyMessage(2);
break;
default:
break;
}
}
};
}
示例4: initHandler
import com.qd.recorder.ProgressView.State; //导入依赖的package包/类
private void initHandler(){
mHandler = new Handler(){
@Override
public void dispatchMessage(Message msg) {
switch (msg.what) {
/*case 1:
final byte[] data = (byte[]) msg.obj;
ThreadPoolUtils.execute(new Runnable() {
@Override
public void run() {
getFirstCapture(data);
}
});
break;*/
case 2:
int resId = 0;
if(currentRecorderState == RecorderState.PRESS){
resId = R.drawable.video_text01;
}else if(currentRecorderState == RecorderState.LOOSEN){
resId = R.drawable.video_text02;
}else if(currentRecorderState == RecorderState.CHANGE){
resId = R.drawable.video_text03;
}else if(currentRecorderState == RecorderState.SUCCESS){
resId = R.drawable.video_text04;
}
stateImageView.setImageResource(resId);
break;
case 3:
if(!recording)
initiateRecording(true);
else{
//������ͣ��ʱ��
stopPauseTime = System.currentTimeMillis();
totalPauseTime = stopPauseTime - startPauseTime - ((long) (1.0/(double)frameRate)*1000);
pausedTime += totalPauseTime;
}
rec = true;
//��ʼ����������
progressView.setCurrentState(State.START);
//setTotalVideoTime();
break;
case 4:
//���ý�������ͣ״̬
progressView.setCurrentState(State.PAUSE);
//����ͣ��ʱ�����ӵ��������Ķ�����
progressView.putProgressList((int) totalTime);
rec = false;
startPauseTime = System.currentTimeMillis();
if(totalTime >= recordingMinimumTime){
currentRecorderState = RecorderState.SUCCESS;
mHandler.sendEmptyMessage(2);
}else if(totalTime >= recordingChangeTime){
currentRecorderState = RecorderState.CHANGE;
mHandler.sendEmptyMessage(2);
}
break;
case 5:
currentRecorderState = RecorderState.SUCCESS;
mHandler.sendEmptyMessage(2);
break;
default:
break;
}
}
};
}