Esempio n. 1
0
        private void Update()
        {
            // Press the S key to trigger audio and background color change - useful for testing A/V sync
            if (Input.GetKeyDown(KeyCode.S))
            {
                if (_audioHit != null && _capture.IsCapturing())
                {
                    AudioSource.PlayClipAtPoint(_audioHit, Vector3.zero);
                    Camera.main.backgroundColor = new Color(Random.value, Random.value, Random.value, 0);
                }
            }

            // ESC to stop capture and quit
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                if (_capture != null && _capture.IsCapturing())
                {
                    _capture.StopCapture();
                }
                else
                {
                    Application.Quit();
                }
            }

            // Spin the camera around
            if (_spinCamera && Camera.main != null)
            {
                Camera.main.transform.RotateAround(Vector3.zero, Vector3.up, 20f * Time.deltaTime * _speed);
            }
        }
Esempio n. 2
0
        protected void GUI_BaseOptions()
        {
            serializedObject.Update();

            if (_baseCapture == null)
            {
                return;
            }

            //DrawDefaultInspector();

            if (!_baseCapture.IsCapturing())
            {
                GUILayout.Space(8f);
                EditorUtils.BoolAsDropdown("Capture Mode", _propIsRealtime, "Realtime Capture", "Offline Render");
                GUILayout.Space(8f);

                if (serializedObject.ApplyModifiedProperties())
                {
                    EditorUtility.SetDirty(target);
                }

                GUI_User();

                // After the user mode we must update the serialised object again
                serializedObject.Update();

                EditorUtils.DrawSection("Start / Stop", ref _isExpandedStartStop, GUI_StartStop);
                EditorUtils.DrawSection("Output", ref _isExpandedOutput, GUI_OutputFilePath);
                EditorUtils.DrawSection("Visual", ref _isExpandedVisual, GUI_Visual);
                EditorUtils.DrawSection("Audio", ref _isExpandedAudio, GUI_Audio);
                EditorUtils.DrawSection("Post", ref _isExpandedPost, GUI_Post);
                EditorUtils.DrawSection("Misc", ref _isExpandedMisc, GUI_Misc);
                EditorUtils.DrawSection("About", ref _isExpandedAbout, GUI_About);

                if (serializedObject.ApplyModifiedProperties())
                {
                    EditorUtility.SetDirty(target);
                }

                GUI_Controls();
            }
            else
            {
                GUI_Stats();
                GUI_Progress();
                GUI_Controls();
            }
        }
Esempio n. 3
0
        void Update()
        {
#if VIMEO_AVPRO_CAPTURE_SUPPORT
            // Hooking into AVPro by monitoring status changes
            if (_recorder != null && _recorder.encoderType == EncoderType.AVProMovieCapture && _avproEncoder != null)
            {
                if (_avproEncoder.IsCapturing())
                {
                    isRecording = true;
                }
                else if (isRecording)   // it was recording, but no longer
                {
                    isRecording = false;

                    if (File.Exists(_avproEncoder.LastFilePath))   // if the file exists, then it finished
                    {
                        Debug.Log("[VimeoRecorder] AVPro recording finished");
                        _recorder.EndRecording();
                    }
                    else
                    {
                        Debug.Log("[VimeoRecorder] AVPro recording cancelled");
                    }
                }
            }
#endif // VIMEO_AVPRO_CAPTURE_SUPPORT
        }
Esempio n. 4
0
        public override bool RequiresConstantRepaint()
        {
            CaptureBase capture = (this.target) as CaptureBase;

            return(Application.isPlaying && capture.isActiveAndEnabled && capture.IsCapturing() && !capture.IsPaused());
        }