visualizer: add framerate
This commit is contained in:
parent
44f55be3b8
commit
c9a275d3c3
3 changed files with 4 additions and 1 deletions
|
|
@ -57,6 +57,7 @@
|
|||
- switch: added `click` mode
|
||||
- plot/eq: removed `smooth`
|
||||
- plots/sliders/pads: reversed `logScale` behavior to match standard implementations; can be either `false` (disabled), `true` (logarithmic scale) or `number` (manual log scale, negative for exponential scale)
|
||||
- visualizer: added `framerate` property
|
||||
- menu: always centered menu
|
||||
- modal: modals can't overflow their parents' (modal, tab, panel) boundaries
|
||||
- input: removed `vertical`
|
||||
|
|
|
|||
|
|
@ -439,6 +439,7 @@
|
|||
| property | type |default | description |
|
||||
| --- | --- | --- | --- |
|
||||
| <h6 id="visualizer_duration">duration<a class="headerlink" href="#visualizer_duration" title="Permanent link">#</a></h6> | `number` | <code>1</code> | Defines visualization duration in seconds |
|
||||
| <h6 id="visualizer_framerate">framerate<a class="headerlink" href="#visualizer_framerate" title="Permanent link">#</a></h6> | `number` | <code>30</code> | Defines visualization framerate |
|
||||
| <h6 id="visualizer_rangeY">rangeY<a class="headerlink" href="#visualizer_rangeY" title="Permanent link">#</a></h6> | `object` | <code>\{<br/> "min": 0,<br/> "max": 1<br/>}</code> | Defines the min and max values for the y axis |
|
||||
| <h6 id="visualizer_origin">origin<a class="headerlink" href="#visualizer_origin" title="Permanent link">#</a></h6> | `number` | <code>"auto"</code> | Defines the y axis origin. Set to `false` to disable it |
|
||||
| <h6 id="visualizer_logScaleY">logScaleY<a class="headerlink" href="#visualizer_logScaleY" title="Permanent link">#</a></h6> | `boolean`|<br/>`number` | <code>false</code> | Set to `true` to use logarithmic scale for the y axis (base 10). Set to a `number` to define the logarithm's base. |
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ module.exports = class Visualizer extends StaticProperties(Plot, {rangeX: {min:
|
|||
_visualizer:'visualizer',
|
||||
|
||||
duration: {type: 'number', value: 1, help: 'Defines visualization duration in seconds'},
|
||||
framerate: {type: 'number', value: 30, help: 'Defines visualization framerate'},
|
||||
rangeY: {type: 'object', value: {min:0,max:1}, help: 'Defines the min and max values for the y axis'},
|
||||
origin: {type: 'number', value: 'auto', help: 'Defines the y axis origin. Set to `false` to disable it'},
|
||||
logScaleY: {type: 'boolean|number', value: false, help: 'Set to `true` to use logarithmic scale for the y axis (base 10). Set to a `number` to define the logarithm\'s base.'},
|
||||
|
|
@ -33,7 +34,7 @@ module.exports = class Visualizer extends StaticProperties(Plot, {rangeX: {min:
|
|||
|
||||
super(options)
|
||||
|
||||
this.fps = CANVAS_FRAMERATE
|
||||
this.fps = clip(this.getProp('framerate'), [1, CANVAS_FRAMERATE])
|
||||
this.length = Math.round(clip(this.fps * this.getProp('duration'), [8, 4096]))
|
||||
this.value = new Array(this.length).fill(this.rangeY.min)
|
||||
this.cancel = false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue