~aleteoryx/muditaos

bdcec85e152c6ae74048db585b8f67794fe33152 — Lefucjusz 3 years ago 2b1ae19
[MOS-532] Music player progress bar behaviour fix

Fix of the issue that after pausing playback
using bluetooth device button the progress
bar remained in progress and playback
time continued to count.
Correction of typo in variable name.
M module-apps/application-music-player/presenters/SongsPresenter.cpp => module-apps/application-music-player/presenters/SongsPresenter.cpp +8 -1
@@ 1,4 1,4 @@
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "SongsPresenter.hpp"


@@ 218,6 218,10 @@ namespace app::music_player
                changePlayingStateCallback(app::music::SongState::NotPlaying);
            }
            updateViewSongState();
            songProgressTimer.stop();
            updateTrackProgressRatio();
            updateViewProgresState();
            refreshView();
            return true;
        }
        return false;


@@ 231,6 235,9 @@ namespace app::music_player
                changePlayingStateCallback(app::music::SongState::Playing);
            }
            updateViewSongState();
            songProgressTimestamp = std::chrono::system_clock::now();
            songProgressTimer.start();
            refreshView();
            return true;
        }
        return false;

M module-apps/application-music-player/windows/MusicPlayerMainWindow.cpp => module-apps/application-music-player/windows/MusicPlayerMainWindow.cpp +5 -5
@@ 290,11 290,11 @@ namespace gui
        bottomBox->setMinimumSize(trackProgress::barWidth, trackProgress::bottomHeight);
        bottomBox->setEdges(RectangleEdge::None);

        auto letfBox = new HBox(bottomBox);
        letfBox->setAlignment(Alignment(Alignment::Horizontal::Left, Alignment::Vertical::Bottom)); //
        letfBox->setMinimumSize(trackProgress::barWidth / 2 - 1, trackProgress::bottomHeight);
        letfBox->setEdges(RectangleEdge::None);
        currentTimeText = new Text(letfBox, 0, 0, trackProgress::descriptionWidth, trackProgress::descriptionHeight);
        auto leftBox = new HBox(bottomBox);
        leftBox->setAlignment(Alignment(Alignment::Horizontal::Left, Alignment::Vertical::Bottom)); //
        leftBox->setMinimumSize(trackProgress::barWidth / 2 - 1, trackProgress::bottomHeight);
        leftBox->setEdges(RectangleEdge::None);
        currentTimeText = new Text(leftBox, 0, 0, trackProgress::descriptionWidth, trackProgress::descriptionHeight);
        currentTimeText->setMaximumWidth(trackProgress::barWidth / 2 - 1);
        currentTimeText->setAlignment(Alignment(Alignment::Horizontal::Left, Alignment::Vertical::Center));
        currentTimeText->setTextType(TextType::SingleLine);