Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
对 #13 中提到的部分问题的修复,在 BottomWidget::onSliderSongPressed()、BottomWidget::onSliderSongMoved(int) 和 BottomWidget::onSliderSongReleased() 三个方法中进行了修改:
对 AdjustingPos 的赋值和判定进行重写,AdjustingPos 的值现在由 bInMakingMode 和 musicPlayer->state() 决定,而 AdjustingPos 决定最终是否执行 musicPlayer->seek(posAdjust);
添加成员变量 sliderSongOriginalPos 记录 sliderSong 在 BottomWidget::onSliderSongPressed() 时的位置,在 BottomWidget::onSliderSongReleased() 时将 sliderSong 的当前值与 sliderSongOriginalPos 比较,相同则不执行 musicPlayer->seek(posAdjust);
整理的逻辑:
移除 BottomWidget 中除了 onAudioFinished(bool)、onAudioPlay() 和 onAudioPause() 中的对 btnPlayAndPause 样式的修改(包括之前注释掉的),也移除了相关的判定;
切换播放暂停状态的代码从 BottomWidget 移动到 MusicPlayer::playAndPause() 中:
代码中留下了输出日志的代码和注释。
请仔细检查我的改动,谢谢。