Skip to content

Commit 3de38b8

Browse files
committed
bugfix: minor ui
1 parent 9d4a0c8 commit 3de38b8

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,16 @@ This is an extension that plays and displays spectrograms of mp3 and flac audio
55

66
## Release Notes
77

8+
### 3.0.0
9+
- Added support for `WAV`
10+
- Added seekbar
11+
- Added color configuration
12+
- Fixed bugs
13+
- Improved treeview
14+
- New logo and icon
15+
816
### 2.0.0
9-
- Added `flac` support
17+
- Added support for `FLAC`
1018
- Added 5-second seeking buttons
1119
- Greatly reduced extension size
1220

@@ -17,7 +25,7 @@ This is an extension that plays and displays spectrograms of mp3 and flac audio
1725
- Refactored code
1826

1927
### 1.0.1
20-
- Fixed path issue for MacOS
28+
- Fixed path issue for macOS
2129

2230
### 1.0.0
2331
- Initial release of Spectrogram

src/controller.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,15 @@ const REFRESH_ICON = '<i class="codicon codicon-refresh"></i>'
133133
source.connect(audioCtx.destination)
134134
source.connect(analyser)
135135
source.onended = playEnd
136-
if (audioCtx.state === 'running') draw()
137-
source.start()
138136

137+
if (audioCtx.state === 'running') {
138+
draw()
139+
togglePlaybackButtons('PLAYING')
140+
} else togglePlaybackButtons('READY')
141+
142+
source.start()
139143
startAt = Date.now()
140144
durationWatch()
141-
togglePlaybackButtons('READY')
142145
seekbar.value = '0'
143146
seekbar.max = lengthMs.toString()
144147
}
@@ -231,10 +234,9 @@ const REFRESH_ICON = '<i class="codicon codicon-refresh"></i>'
231234
}
232235

233236
function durationWatch() {
234-
if (audioCtx.state === 'running') {
235-
updateDurationText()
236-
durationId = setTimeout(durationWatch, 1000)
237-
}
237+
if (audioCtx.state !== 'running') return
238+
updateDurationText()
239+
durationId = setTimeout(durationWatch, 1000)
238240
}
239241

240242
function updateDurationText() {

0 commit comments

Comments
 (0)