From 4711e2988c91bdf0a70525ffe18040d1b8158b9a Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 21 May 2018 21:18:35 +0200 Subject: add saving to disk --- app/client/live/index.js | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'app/client/live/index.js') diff --git a/app/client/live/index.js b/app/client/live/index.js index 3a5dbd4..ce0be14 100644 --- a/app/client/live/index.js +++ b/app/client/live/index.js @@ -8,6 +8,8 @@ import Slider from '../common/slider.component' import Select from '../common/select.component' import Button from '../common/button.component' +import { startRecording, stopRecording, saveFrame } from './player' + import * as liveActions from './actions' class App extends Component { @@ -20,7 +22,8 @@ class App extends Component { this.changeEpoch = this.changeEpoch.bind(this) this.changeSequence = this.changeSequence.bind(this) this.seek = this.seek.bind(this) - this.toggle = this.toggle.bind(this) + this.togglePlaying = this.togglePlaying.bind(this) + this.toggleRecording = this.toggleRecording.bind(this) } componentWillUpdate(nextProps) { if (nextProps.opt.checkpoint_name && nextProps.opt.checkpoint_name !== this.props.opt.checkpoint_name) { @@ -41,13 +44,20 @@ class App extends Component { const frame = Math.floor(percentage * (parseInt(this.props.frame.sequence_len) || 1) + 1) this.props.actions.seek(frame) } - toggle(){ + togglePlaying(){ if (this.props.opt.processing) { this.props.actions.pause() } else { this.props.actions.play() } } + toggleRecording(){ + if (this.props.opt.recording){ + stopRecording() + } else { + startRecording() + } + } render(){ return (
@@ -89,10 +99,22 @@ class App extends Component { /> + +
-- cgit v1.2.3-70-g09d2