peaks.js
peaks.js copied to clipboard
Fixed position on zoomed waveform
My goal is to create a waveform display similar to what DJ apps have and Peaks.js is almost ideal for this. The overview synced with the zoomed waveform is great. It would be really great if I can somehow get the zoomed waveform to be in a fixed position at the center and let the waveform itself move. The zoomed waveform indicator would always point to the current position in time.
Picture for reference:
The zoomed waveform indicator would not move at all. The waveform would move below it. The overview waveform behaves as normal.
I'm ready to do my best for a PR but I'd love some pointers!
I can see that some refactoring would be needed to add this feature... The main things that would need to change are:
-
WaveformZoomView._syncPlayhead
, which is responsible for scrolling the waveform when the playhead reaches the right-hand side of the view - The
WaveformZoomView
'sMouseDragHandler
, which responds to click and drag events to scroll the waveform - The playhead animation in
PlayheadLayer
, which updates the playhead position during playback -
PlayheadLayer.updatePlayheadTime
, which updates the playhead position, e.g., after the user changes the zoom level
Is there still the possibility of implementing this? I'm coming over from wavesurfer and having the fixed playhead feels more natural.
Welcome! Yes, I'm interested to implement this, but can't give any promises when.
Commenting to indicate interest in this feature with caveat that I do not have enough free time to contribute code rn