~aleteoryx/muditaos

ref: cf019e3d9604bb7599f3bfb49d4cda47aff9815d muditaos/module-apps/application-music-player/AudioNotificationsHandler.cpp -rw-r--r-- 816 bytes
cf019e3d — Alek Rudnik [EGD-6776] Music Player All Songs Window 4 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#include "AudioNotificationsHandler.hpp"

#include <service-audio/AudioMessage.hpp>

namespace app::music_player
{

    AudioNotificationsHandler::AudioNotificationsHandler(
        std::shared_ptr<app::music_player::SongsContract::Presenter> presenter)
        : presenter(presenter)
    {}

    sys::MessagePointer AudioNotificationsHandler::handleAudioStopNotification(
        const AudioStopNotification *notification)
    {
        if (notification == nullptr) {
            return sys::msgNotHandled();
        }

        return presenter->handleAudioStopNotifiaction(notification->token) ? sys::msgNotHandled() : sys::msgHandled();
    }

} // namespace app::music_player