~aleteoryx/muditaos

ref: b95894a8abc10cddf0b58dda4b2569b01eec0d7e muditaos/module-apps/application-music-player/widgets/SongItem.hpp -rw-r--r-- 1.6 KiB
b95894a8 — Lefucjusz [MOS-1064] Fix no input language selected for French/Spanish 1 year, 9 months 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

#pragma once

#include "application-music-player/data/MusicPlayerStyle.hpp"

#include <ListItem.hpp>
#include <Text.hpp>
#include <TextFixedSize.hpp>
#include <Image.hpp>

namespace gui
{
    class SongItem : public ListItem
    {

      public:
        SongItem(const std::string &authorName,
                 const std::string &songName,
                 const std::string &duration,
                 std::function<void(const UTF8 &)> navBarTemporaryMode,
                 std::function<void()> navBarRestoreFromTemporaryMode);

        enum class ItemState
        {
            None,
            Playing,
            Paused
        };
        void setState(ItemState state);

      private:
        VBox *vBox                                                = nullptr;
        HBox *firstHBox                                           = nullptr;
        HBox *secondHBox                                          = nullptr;
        Label *authorText                                         = nullptr;
        Label *songText                                           = nullptr;
        TextFixedSize *durationText                               = nullptr;
        Image *playedSong                                         = nullptr;
        ItemState itemState                                       = ItemState::None;
        std::function<void(const UTF8 &text)> navBarTemporaryMode = nullptr;
        std::function<void()> navBarRestoreFromTemporaryMode      = nullptr;
    };

} /* namespace gui */