Sayonara Player
Loading...
Searching...
No Matches
TrackModel.h
1/* TrackModel.h */
2
3/* Copyright (C) 2011-2024 Michael Lugmair (Lucio Carreras)
4 *
5 * This file is part of sayonara player
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21/*
22 * TrackModel.h
23 *
24 * Created on: Apr 24, 2011
25 * Author: Michael Lugmair (Lucio Carreras)
26 */
27
28#ifndef LIBRARYITEMMODELTRACKS_H_
29#define LIBRARYITEMMODELTRACKS_H_
30
31#include "Gui/Library/ItemModel.h"
32#include "Utils/Pimpl.h"
33
34namespace Library
35{
36 class TrackModel :
37 public ItemModel
38 {
39 Q_OBJECT
40 PIMPL(TrackModel)
41
42 public:
43 TrackModel(QObject* parent, AbstractLibrary* library);
44 ~TrackModel() override;
45
46 [[nodiscard]] Qt::ItemFlags flags(const QModelIndex& index) const override;
47 [[nodiscard]] int rowCount(const QModelIndex& parent) const override;
48 [[nodiscard]] QVariant data(const QModelIndex& index, int role) const override;
49 bool setData(const QModelIndex& index, const QVariant& value, int role) override;
50
51 [[nodiscard]] Cover::Location cover(const QModelIndexList& indexes) const override;
52 [[nodiscard]] Id mapIndexToId(int index) const override;
53
54 protected:
55 [[nodiscard]] const MetaDataList& selectedMetadata() const override;
56 [[nodiscard]] int itemCount() const override;
57 [[nodiscard]] QString searchableString(int index, const QString& prefix) const override;
58
59 void languageChanged();
60
61 private slots:
62 void trackMetaDataChanged(int row);
63 };
64}
65
66#endif /* LIBRARYITEMMODELTRACKS_H_ */
Definition: AbstractLibrary.h:41
Definition: CoverLocation.h:39
Definition: ItemModel.h:40
Definition: TrackModel.h:38
Definition: MetaDataList.h:34