diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-12-19 21:17:31 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-12-19 21:17:31 +0100 |
| commit | c1f5e3337aee07fb6378374b4b7cc5db847e4c15 (patch) | |
| tree | f3437cc979970754294f95369d3e8c4c2b98816f /app/client | |
| parent | a0fa03a9a0219771e0173db5a811d20b20fe3ba0 (diff) | |
updating params
Diffstat (limited to 'app/client')
| -rw-r--r-- | app/client/live/live.actions.js | 5 | ||||
| -rw-r--r-- | app/client/modules/biggan/views/biggan.live.js | 40 | ||||
| -rw-r--r-- | app/client/socket/socket.live.js | 5 | ||||
| -rw-r--r-- | app/client/types.js | 1 |
4 files changed, 32 insertions, 19 deletions
diff --git a/app/client/live/live.actions.js b/app/client/live/live.actions.js index c4d29f7..863ebe4 100644 --- a/app/client/live/live.actions.js +++ b/app/client/live/live.actions.js @@ -14,6 +14,11 @@ export const set_param = (key, value) => { return { type: types.player.set_param, key, value, } } +export const send_command = (cmd, payload) => { + socket.live.send_command(cmd, payload) + return { type: types.player.send_command, } +} + export const set_fullscreen = (value) => { return { type: types.player.set_fullscreen, value } } diff --git a/app/client/modules/biggan/views/biggan.live.js b/app/client/modules/biggan/views/biggan.live.js index b3ad670..06785f5 100644 --- a/app/client/modules/biggan/views/biggan.live.js +++ b/app/client/modules/biggan/views/biggan.live.js @@ -30,7 +30,8 @@ class BigGANLive extends Component { this.props.actions.queue.stop_task('gpu') } render() { - const { biggan } = this.props + const { biggan, actions } = this.props + console.log(actions) // if (biggan.loading) { // return <Loading progress={biggan.progress} /> // } @@ -43,15 +44,16 @@ class BigGANLive extends Component { <div className='params column audioParams'> <Group> {this.renderRestartButton()} + <p class='last_message'>{this.props.last_message}</p> </Group> - <ParamGroup + <Group title={"Latent"} name='latent' > <Button title={"Shuffle"} - onClick={() => {}} + onClick={() => actions.live.send_command('switch', 'latent')} >{"Latent"}</Button> <Slider live name='latent_n' @@ -61,69 +63,69 @@ class BigGANLive extends Component { <Slider live name='latent_speed' title={"Update Speed"} - min={0.0001} max={2} type='float' + min={0.0001} max={10} type='float' /> <Slider live name='truncation' title={"Truncation"} min={0.0001} max={4} type='float' /> - </ParamGroup> + </Group> - <ParamGroup + <Group title={"Label"} name='label' > <Slider live - name='label_class_count' + name='num_classes' title={"Classes to mix"} min={1} max={10} type='int' /> <Button title={"Shuffle"} - onClick={() => {}} + onClick={() => actions.live.send_command('switch', 'label')} >{"Label"}</Button> <Slider live name='label_speed' title={"Mix Speed"} - min={0} max={1} type='float' + min={0.0001} max={10} type='float' /> <Slider live name='label_lerp_n' title={"Mix"} min={0} max={1} type='float' /> - </ParamGroup> + </Group> - <ParamGroup + <Group title={"Orbit"} name='orbit' > <Slider live name='orbit_speed' title={"Orbit speed"} - min={0} max={1} type='float' + min={-4} max={4} type='float' /> <Slider live - name='orbit_scale' + name='orbit_radius' title={"Radius"} - min={0} max={0.25} type='float' + min={0} max={1.0} type='float' /> <Button - title={"Noise"} - onClick={() => {}} + title={"Shuffle"} + onClick={() => actions.live.send_command('switch', 'orbit_noise')} >{"Spin"}</Button> <Slider live - name='orbit_lerp_speed' + name='orbit_noise_speed' title={"Noise Speed"} min={0} max={1} type='float' /> <Slider live - name='orbit_lerp_n' + name='orbit_noise_n' title={"Noise Mix"} min={0} max={1} type='float' /> - </ParamGroup> + </Group> </div> </div> diff --git a/app/client/socket/socket.live.js b/app/client/socket/socket.live.js index a1a7a3f..279ba84 100644 --- a/app/client/socket/socket.live.js +++ b/app/client/socket/socket.live.js @@ -53,6 +53,11 @@ socket.on('res', (data) => { socket.on('frame', player.onFrame) +export function send_command(cmd, payload) { + socket.emit('cmd', { + cmd, payload, + }) +} export function list_checkpoints(module) { socket.emit('cmd', { cmd: 'list_checkpoints', diff --git a/app/client/types.js b/app/client/types.js index f25067b..46b4307 100644 --- a/app/client/types.js +++ b/app/client/types.js @@ -65,6 +65,7 @@ export default { player: { get_params: 'GET_PARAMS', set_param: 'SET_PARAM', + send_command: 'SEND_COMMAND', loading_checkpoints: 'LOADING_CHECKPOINTS', loading_checkpoint: 'LOADING_CHECKPOINT', |
