1 /*****************************************************************************
2 * Copyright (C) 2019 VLC authors and VideoLAN
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * ( at your option ) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
17 *****************************************************************************/
25 #include "vlc_common.h"
32 #include <vlc_media_library.h>
33 #include "mlhelper.hpp"
34 #include "mlqmltypes.hpp"
36 class MLGenre
: public QObject
, public MLItem
40 Q_PROPERTY(MLItemId id READ getId CONSTANT
)
41 Q_PROPERTY(QString name READ getName CONSTANT
)
42 Q_PROPERTY(unsigned int nbtracks READ getNbTracks CONSTANT
)
43 Q_PROPERTY(QString cover READ getCover WRITE setCover NOTIFY coverChanged
)
46 MLGenre( vlc_medialibrary_t
* _ml
, const vlc_ml_genre_t
*_data
, QObject
*_parent
= nullptr);
49 QString
getName() const;
50 unsigned int getNbTracks() const;
51 QString
getCover() const;
53 MLGenre
* clone(QObject
*parent
= nullptr) const;
56 void coverChanged( const QString
);
57 void askGenerateCover( QPrivateSignal
) const;
60 void setCover(const QString cover
);
63 void generateThumbnail();
66 MLGenre( const MLGenre
& genre
, QObject
*_parent
= nullptr);
68 vlc_medialibrary_t
* m_ml
;
72 QRunnable
* m_coverTask
= nullptr;
73 unsigned int m_nbTracks
;