當前位置: 首頁>>代碼示例>>Java>>正文


Java State類代碼示例

本文整理匯總了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);
}
 
開發者ID:feigxj,項目名稱:VideoRecorder-master,代碼行數:26,代碼來源:FFmpegRecorderActivity.java

示例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);
}
 
開發者ID:peirenlei,項目名稱:FFmpegRecorder,代碼行數:24,代碼來源:FFmpegRecorderActivity.java

示例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;
            }
        }
    };
}
 
開發者ID:feigxj,項目名稱:VideoRecorder-master,代碼行數:58,代碼來源:FFmpegRecorderActivity.java

示例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;
			}
		}
	};
}
 
開發者ID:peirenlei,項目名稱:FFmpegRecorder,代碼行數:68,代碼來源:FFmpegRecorderActivity.java


注:本文中的com.qd.recorder.ProgressView.State類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。