summaryrefslogtreecommitdiff
path: root/public/bundle.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-06-06 04:16:37 +0200
committerJules Laplace <julescarbon@gmail.com>2018-06-06 04:16:37 +0200
commitb92b633cf0c2d528e45c04828a9ce1f5679aeaa3 (patch)
treee4d08933cdad76a8115b90527d7cc7d486f86f0d /public/bundle.js
parent2f4d1e9c43770ca4e72b736a08cd0e3b3945274f (diff)
frame count slider
Diffstat (limited to 'public/bundle.js')
-rw-r--r--public/bundle.js151
1 files changed, 84 insertions, 67 deletions
diff --git a/public/bundle.js b/public/bundle.js
index 1d48d38..3f0a8dc 100644
--- a/public/bundle.js
+++ b/public/bundle.js
@@ -3208,7 +3208,7 @@ var Slider = function (_Component) {
_this.timeout = 0;
_this.state = {
- value: props.opt[props.name]
+ value: props.live ? props.opt[props.name] : props.value
};
_this.handleInput = _this.handleInput.bind(_this);
_this.handleRange = _this.handleRange.bind(_this);
@@ -3240,7 +3240,7 @@ var Slider = function (_Component) {
}
if (old_value !== new_value) {
this.setState({ value: new_value });
- this.props.actions.set_param(this.props.name, new_value);
+ this.props.live && this.props.actions.set_param(this.props.name, new_value);
this.props.onChange && this.props.onChange(new_value);
}
clearTimeout(this.timeout);
@@ -3260,7 +3260,7 @@ var Slider = function (_Component) {
}
this.setState({ value: new_value });
this.timeout = setTimeout(function () {
- _this2.props.actions.set_param(_this2.props.name, new_value);
+ _this2.props.live && _this2.props.actions.set_param(_this2.props.name, new_value);
_this2.props.onChange && _this2.props.onChange(new_value);
}, SLIDER_THROTTLE_TIME);
}
@@ -6557,7 +6557,7 @@ var Pix2PixLive = function (_Component) {
options: this.props.epochs,
onChange: this.changeEpoch
}),
- (0, _preact.h)(_slider2.default, {
+ (0, _preact.h)(_slider2.default, { live: true,
name: 'position',
min: 0.0, max: 1.0, type: 'float',
value: (this.props.frame.sequence_i || 0) / (this.props.frame.sequence_len || 1),
@@ -6598,15 +6598,15 @@ var Pix2PixLive = function (_Component) {
title: 'Transition',
name: 'transition'
},
- (0, _preact.h)(_slider2.default, {
+ (0, _preact.h)(_slider2.default, { live: true,
name: 'transition_period',
min: 10, max: 5000, type: 'int'
}),
- (0, _preact.h)(_slider2.default, {
+ (0, _preact.h)(_slider2.default, { live: true,
name: 'transition_min',
min: 0.001, max: 0.2, type: 'float'
}),
- (0, _preact.h)(_slider2.default, {
+ (0, _preact.h)(_slider2.default, { live: true,
name: 'transition_max',
min: 0.1, max: 1.0, type: 'float'
})
@@ -6617,15 +6617,15 @@ var Pix2PixLive = function (_Component) {
title: 'Recursion',
name: 'recursive'
},
- (0, _preact.h)(_slider2.default, {
+ (0, _preact.h)(_slider2.default, { live: true,
name: 'recursive_frac',
min: 0.0, max: 0.5, type: 'float'
}),
- (0, _preact.h)(_slider2.default, {
+ (0, _preact.h)(_slider2.default, { live: true,
name: 'recurse_roll',
min: -64, max: 64, type: 'int'
}),
- (0, _preact.h)(_slider2.default, {
+ (0, _preact.h)(_slider2.default, { live: true,
name: 'recurse_roll_axis',
min: 0, max: 1, type: 'int'
})
@@ -6636,11 +6636,11 @@ var Pix2PixLive = function (_Component) {
title: 'Sequence',
name: 'sequence'
},
- (0, _preact.h)(_slider2.default, {
+ (0, _preact.h)(_slider2.default, { live: true,
name: 'sequence_frac',
min: 0.0, max: 0.5, type: 'float'
}),
- (0, _preact.h)(_slider2.default, {
+ (0, _preact.h)(_slider2.default, { live: true,
name: 'process_frac',
min: 0, max: 1, type: 'float'
})
@@ -6655,7 +6655,7 @@ var Pix2PixLive = function (_Component) {
title: 'Clahe',
name: 'clahe'
},
- (0, _preact.h)(_slider2.default, {
+ (0, _preact.h)(_slider2.default, { live: true,
name: 'clip_limit',
min: 1.0, max: 4.0, type: 'float'
})
@@ -6666,11 +6666,11 @@ var Pix2PixLive = function (_Component) {
title: 'Posterize',
name: 'posterize'
},
- (0, _preact.h)(_slider2.default, {
+ (0, _preact.h)(_slider2.default, { live: true,
name: 'spatial_window',
min: 2, max: 128, type: 'int'
}),
- (0, _preact.h)(_slider2.default, {
+ (0, _preact.h)(_slider2.default, { live: true,
name: 'color_window',
min: 2, max: 128, type: 'int'
})
@@ -6681,11 +6681,11 @@ var Pix2PixLive = function (_Component) {
title: 'Blur',
name: 'blur'
},
- (0, _preact.h)(_slider2.default, {
+ (0, _preact.h)(_slider2.default, { live: true,
name: 'blur_radius',
min: 3, max: 7, type: 'odd'
}),
- (0, _preact.h)(_slider2.default, {
+ (0, _preact.h)(_slider2.default, { live: true,
name: 'blur_sigma',
min: 0, max: 2, type: 'float'
})
@@ -6696,11 +6696,11 @@ var Pix2PixLive = function (_Component) {
title: 'Canny Edge Detection',
name: 'canny'
},
- (0, _preact.h)(_slider2.default, {
+ (0, _preact.h)(_slider2.default, { live: true,
name: 'canny_lo',
min: 10, max: 200, type: 'int'
}),
- (0, _preact.h)(_slider2.default, {
+ (0, _preact.h)(_slider2.default, { live: true,
name: 'canny_hi',
min: 10, max: 200, type: 'int'
})
@@ -7715,7 +7715,8 @@ var SpectrogramUpload = function (_Component) {
_this.state = {
file: null,
name: "",
- frames: []
+ frames: [],
+ max: 3000
};
var audioElement = document.createElement('audio');
audioElement.addEventListener('loadedmetadata', function () {
@@ -7770,7 +7771,6 @@ var SpectrogramUpload = function (_Component) {
// module={pix2wavModule}
// data={pix2wav.data}
// folder={folder}
- console.log(this.props);
var _state = this.state,
file = _state.file,
frames = _state.frames;
@@ -7831,56 +7831,73 @@ var SpectrogramUpload = function (_Component) {
)
),
(0, _preact.h)(
- _common.Param,
- { title: 'Name' },
- file.name
- ),
- (0, _preact.h)(
- _common.Param,
- { title: 'Type' },
- file.type
- ),
- (0, _preact.h)(
- _common.Param,
- { title: 'Size' },
+ _common.Group,
+ { title: 'Metadata' },
(0, _preact.h)(
- 'span',
- { className: size[0] },
- size[1]
- )
- ),
- (0, _preact.h)(
- _common.Param,
- { title: 'Date' },
- (0, _moment2.default)(file.lastModifiedDate).format("YYYY-MM-DD h:mm a")
- ),
- (0, _preact.h)(
- _common.Param,
- { title: 'Duration' },
- Math.floor(duration) + ' s.'
- ),
- (0, _preact.h)('br', null),
- (0, _preact.h)(
- _common.Param,
- { title: 'Status' },
- this.props.pix2wav.status,
- this.props.upload.status
+ _common.Param,
+ { title: 'Name' },
+ file.name
+ ),
+ (0, _preact.h)(
+ _common.Param,
+ { title: 'Type' },
+ file.type
+ ),
+ (0, _preact.h)(
+ _common.Param,
+ { title: 'Size' },
+ (0, _preact.h)(
+ 'span',
+ { className: size[0] },
+ size[1]
+ )
+ ),
+ (0, _preact.h)(
+ _common.Param,
+ { title: 'Date' },
+ (0, _moment2.default)(file.lastModifiedDate).format("YYYY-MM-DD h:mm a")
+ ),
+ (0, _preact.h)(
+ _common.Param,
+ { title: 'Duration' },
+ Math.floor(duration) + ' s.'
+ ),
+ (0, _preact.h)('br', null),
+ (0, _preact.h)(
+ _common.Param,
+ { title: 'Status' },
+ this.props.pix2wav.status,
+ this.props.upload.status
+ ),
+ (0, _preact.h)('br', null)
),
- (0, _preact.h)(_common.TextInput, {
- title: 'Dataset name',
- onChange: function onChange(e) {
- return _this5.setState({ name: e.target.value });
- },
- value: this.state.name
- }),
(0, _preact.h)(
- _common.Button,
- {
- onClick: function onClick() {
- return _this5.buildZip();
+ _common.Group,
+ { title: 'Data settings' },
+ (0, _preact.h)(_common.TextInput, {
+ title: 'Dataset name',
+ onChange: function onChange(e) {
+ return _this5.setState({ name: e.target.value });
+ },
+ value: this.state.name
+ }),
+ (0, _preact.h)(_common.Slider, {
+ name: 'max frame count',
+ min: 10, max: 10000, type: 'int',
+ value: this.state.max,
+ onChange: function onChange(max) {
+ return _this5.setState({ max: max });
}
- },
- 'Build Zip'
+ }),
+ (0, _preact.h)(
+ _common.Button,
+ {
+ onClick: function onClick() {
+ return _this5.buildZip();
+ }
+ },
+ 'Build Zip'
+ )
),
(0, _preact.h)(_common.Progress, null)
);