mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Using media player for voice / video messages.
Media::Player::Widget displays the current voice / video message if it is played and the current song otherwise. It is created when a voice / video message starts and is destroyed when all the voice / video messages in the playlist are finished.
This commit is contained in:
@@ -666,7 +666,7 @@ bool Voice::updateStatusText() {
|
||||
statusSize = FileStatusSizeLoaded;
|
||||
using State = Media::Player::State;
|
||||
auto state = Media::Player::mixer()->currentState(AudioMsgId::Type::Voice);
|
||||
if (state.id == AudioMsgId(_data, _parent->fullId()) && !Media::Player::IsStopped(state.state) && state.state != State::Finishing) {
|
||||
if (state.id == AudioMsgId(_data, _parent->fullId()) && !Media::Player::IsStoppedOrStopping(state.state)) {
|
||||
statusSize = -1 - (state.position / state.frequency);
|
||||
realDuration = (state.length / state.frequency);
|
||||
showPause = (state.state == State::Playing || state.state == State::Resuming || state.state == State::Starting);
|
||||
@@ -950,7 +950,7 @@ bool Document::updateStatusText() {
|
||||
statusSize = FileStatusSizeLoaded;
|
||||
using State = Media::Player::State;
|
||||
auto state = Media::Player::mixer()->currentState(AudioMsgId::Type::Song);
|
||||
if (state.id == AudioMsgId(_data, _parent->fullId()) && !Media::Player::IsStopped(state.state) && state.state != State::Finishing) {
|
||||
if (state.id == AudioMsgId(_data, _parent->fullId()) && !Media::Player::IsStoppedOrStopping(state.state)) {
|
||||
statusSize = -1 - (state.position / state.frequency);
|
||||
realDuration = (state.length / state.frequency);
|
||||
showPause = (state.state == State::Playing || state.state == State::Resuming || state.state == State::Starting);
|
||||
|
Reference in New Issue
Block a user