Replies: 7 comments 20 replies
-
Oh, and long-term: what do you think of the idea of modernizing the repo and refactoring to 100% TypeScript? |
Beta Was this translation helpful? Give feedback.
-
Yes, those all sound like good additions. I need to look at rAF usage. Because of the extra CPU load it introduces I only really want to use it where needed. For example, we have code that switches the playhead animation between rAF and timeupdate, depending on whether the extra precision is needed. |
Beta Was this translation helpful? Give feedback.
-
I'll add one to the list - it's an easy patch but seems like a good default or option to provide:
|
Beta Was this translation helpful? Give feedback.
-
I like the idea to add an option to hide the axis, but the options become awkward if there's a need to configure this differently for the zoomview and overview waveforms. I'm thinking of changing the options structure anyway to support other features, so I'll raise another discussion about that. |
Beta Was this translation helpful? Give feedback.
-
Any thoughts on handling markers? I like click-drag for drawing segments, so single-click seems like the obvious choice for adding a marker, except it's overloaded by the single-click to set the play head. |
Beta Was this translation helpful? Give feedback.
-
Allowing click/drag to draw a regionI hacked together a POC for this here - jdelStrother@drag-segments.
I'm not totally sure how it ought to ideally work, though. My app expects to be able to control the ids of peaks' segments, so here the drag handler is creating a temporary segment with an arbitrary id, broadcasting a I could see arguments for other ways, though. eg some clients might want to be able to specify other attributes (color, id, etc) on the new segment immediately as the drag starts, but we'd then need to add a callback from zoomview's drag handler back out to client code. Or we forget about creating segments within zoomview's drag handler, and instead emit Any thoughts? |
Beta Was this translation helpful? Give feedback.
-
I'm starting to work on this, will follow up in issue #499. |
Beta Was this translation helpful? Give feedback.
-
Hey @chrisn!
I wanted to start a discussion here about some new stuff I've been thinking about adding to Peaks.js. Let me know your thoughts on these:
Mousewheel/trackpad scrolling
We've talked about this and agree it's a good idea. I'm not sure if it necessarily needs to be disabled by default, though. As long as the Peaks.js version number is increased so as to be a breaking change, I think it would be fine. I think most people would expect that mousewheel/trackpad gestures would scroll the waveform (I was surprised to find that it required clicking and dragging).
Allowing click/drag to draw a region
Adding new regions is a little clunky at the moment. I find it more intuitive to be able to click and drag to draw a region. This option would obviously need to be off by default because it would conflict with click/drag scrolling. Unless gesture scrolling becomes the default, then maybe it would be ok.
More events for zoomview interaction
In my fork, I've added
zoomview.mousedown
,zoomview.mouseup
, andzoomview.drag
to allow me to create the region drawing feature mentioned above. IMO, adding more events for flexibility is never a bad thing! So if we didn't add region drawing, people could implement it themselves the way I have by using these events.More precise
player.timeupdate
eventsNow that we're using
requestAnimationFrame()
, it might be good to have that loop emit theplayer.timeupdate
event rather than the HTML audiotimeupdate
native event. Use case: I'd like to add the ability for segment playback to fade in and out, but to do so, I need more fine-grained reports of the playback position so I can make really fast volume adjustments. Alternatively, we could add a new event likeplayer.fastupdate
(or whatever) that would be emitted by therequestAnimationFrame()
loop.Ability to hide the axis completely
I added a
hideAxis
option to my fork which hides the axis from the waveform, which simply skips anyself._createAxisLabels()
calls. Any objections to making this option official?Beta Was this translation helpful? Give feedback.
All reactions