Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions subed/subed-waveform.el
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,18 @@ rounded to the nearest multiple of this number."
:type 'integer
:group 'subed-waveform)

(defcustom subed-waveform-image-width nil
"Width for images that display the waveforms of one subtitle.

If nil, the width for waveforms is computed in
`subed-waveform--image-parameters'.")

(defcustom subed-waveform-image-height nil
"Height for images that display the waveforms of one subtitle.

If it is nil, the height for waveforms is computed in
`subed-waveform--image-parameters'.")

(defvar subed-waveform--overlay nil "Overlay if only a single waveform is displayed.")
(defvar subed-waveform--svg nil "SVG if only a single waveform is displayed.")

Expand Down Expand Up @@ -618,15 +630,19 @@ This function ignores arguments and can be used in hooks."
(when (subed-jump-to-subtitle-text)
(let ((overlay (subed-waveform--get-current-overlay)))
(when overlay (delete-overlay overlay))
(setq overlay (subed-waveform--make-overlay)))))))
(setq overlay (subed-waveform--make-overlay
subed-waveform-image-width
subed-waveform-image-height)))))))

(defun subed-waveform-add-to-all ()
"Update all subtitles with overlays."
(interactive)
(remove-overlays (point-min) (point-max) 'subed-waveform t)
(subed-for-each-subtitle (point-min) (point-max) nil
(subed-jump-to-subtitle-text)
(subed-waveform--make-overlay)))
(subed-waveform--make-overlay
subed-waveform-image-width
subed-waveform-image-height)))

(defun subed-waveform-refresh ()
"Add all waveforms or just the current one.
Expand Down