本文整理匯總了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;
}
}
};
}