Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于播放条、播放控制按钮在拖动后、音乐播放结束后的修复 #12

Merged
merged 7 commits into from
Apr 24, 2019

Conversation

pzhlkj6612
Copy link
Member

@pzhlkj6612 pzhlkj6612 commented Apr 24, 2019

你好,我做了一些修改。

尝试修复的问题:


  1. 播放时拖动 sliderSong 进行 seek 后,如果时间正好,sliderSong 会跳回当前播放的位置:

https://github.com/Beslyric-for-X/Beslyric-for-X/blob/81d51042e3e1273faeaca3002eb3f92cbd2b227e/Entities/MusicPlayer/musicPlayer.cpp#L891-L902



  1. 暂停时拖动 sliderSong 进行 seek 后会继续播放音乐,但 btnPlayAndPause 的样式并不会由“播放”变为“暂停”;

  2. 音乐播放结束后 btnPlayAndPause 的样式不会由“暂停”变为“播放”;

  3. btnPlayAndPause 的样式是在切换状态时直接修改,而不是由 musicPlayer 发出的信号决定:

https://github.com/Beslyric-for-X/Beslyric-for-X/blob/81d51042e3e1273faeaca3002eb3f92cbd2b227e/BottomWidgets/BottomWidget.cpp#L157-L160

https://github.com/Beslyric-for-X/Beslyric-for-X/blob/81d51042e3e1273faeaca3002eb3f92cbd2b227e/BottomWidgets/BottomWidget.cpp#L169



  1. PlayThread 在进行 Seek 前后对音乐进行暂停和播放没有发出相应的信号:

https://github.com/Beslyric-for-X/Beslyric-for-X/blob/81d51042e3e1273faeaca3002eb3f92cbd2b227e/Entities/MusicPlayer/musicPlayer.cpp#L603

https://github.com/Beslyric-for-X/Beslyric-for-X/blob/81d51042e3e1273faeaca3002eb3f92cbd2b227e/Entities/MusicPlayer/musicPlayer.cpp#L621



  1. MusicPlayer 构造函数中存在对 m_positionUpdateTimer 属性的设置,但在BottomWidget::initEntity()方法中有代码将其覆盖:

https://github.com/Beslyric-for-X/Beslyric-for-X/blob/81d51042e3e1273faeaca3002eb3f92cbd2b227e/Entities/MusicPlayer/musicPlayer.cpp#L777-L778

https://github.com/Beslyric-for-X/Beslyric-for-X/blob/81d51042e3e1273faeaca3002eb3f92cbd2b227e/BottomWidgets/BottomWidget.cpp#L117-L118



代码中留下了部分输出日志的代码,还有一些注释。

请仔细检查我的改动,谢谢。

@BensonLaur
Copy link
Member

好的,我后面也测试看看

Copy link
Member

@BensonLaur BensonLaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

本地 checkout 测试完成,确认完成了所提到的修复的点,运行良好

@BensonLaur BensonLaur merged commit 2d828f7 into BesLyric-for-X:master Apr 24, 2019
@pzhlkj6612 pzhlkj6612 added the _Refactor the player 整个播放逻辑需要重做。 label Feb 24, 2020
@pzhlkj6612 pzhlkj6612 added this to the v3.1.1 milestone Feb 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
_Refactor the player 整个播放逻辑需要重做。
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants