* Displays a song in playlist waveform. * * @param {Node} element - Element to display the waveform in. * @param {SVG} svg - The waveform path. * @param {String} playlist - The playlist the waveform is in. * @param {Integer} song - The index of the song we are displaying the waveform
(element, svg, playlist, song)
| 423 | * @param {Integer} song - The index of the song we are displaying the waveform for. |
| 424 | */ |
| 425 | function displaySongInPlaylistWaveform(element, svg, playlist, song) { |
| 426 | /* |
| 427 | Ensure it's the active song in the active playlist. |
| 428 | */ |
| 429 | if ( |
| 430 | config.active_playlist == playlist && |
| 431 | config.playlists[config.active_playlist].active_index == song |
| 432 | ) { |
| 433 | let waveformPath = element.querySelector("svg g path"); |
| 434 | |
| 435 | waveformPath.setAttribute("d", svg); |
| 436 | } |
| 437 | } |
| 438 | |
| 439 | /** |
| 440 | * Determines if the user is using waveforms |