Skip to content
Snippets Groups Projects
Commit fd3245c2 authored by Benjamin Arnaud's avatar Benjamin Arnaud Committed by Jean-Baptiste Kempf
Browse files

qt: Create MLFolder

parent c536126d
No related branches found
No related tags found
1 merge request!1300qt/qml: Add 'Group by folder' in the Video(s) main view
......@@ -162,6 +162,8 @@ libqt_plugin_la_SOURCES = \
gui/qt/medialibrary/mlbookmarkmodel.cpp \
gui/qt/medialibrary/mlbookmarkmodel.hpp \
gui/qt/medialibrary/mlevent.hpp \
gui/qt/medialibrary/mlfolder.cpp \
gui/qt/medialibrary/mlfolder.hpp \
gui/qt/medialibrary/mlfoldersmodel.cpp \
gui/qt/medialibrary/mlfoldersmodel.hpp \
gui/qt/medialibrary/mlgenre.cpp \
......
/*****************************************************************************
* Copyright (C) 2021 VLC authors and VideoLAN
*
* Authors: Benjamin Arnaud <bunjee@omega.gg>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* ( at your option ) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "mlfolder.hpp"
// Ctor / dtor
MLFolder::MLFolder(const vlc_ml_folder_t * data)
: MLItemCover(MLItemId(data->i_id, VLC_ML_PARENT_FOLDER))
, m_present(data->b_present)
, m_banned(data->b_banned)
, m_title(data->psz_name)
, m_mrl(data->psz_mrl)
, m_duration(0) // FIXME: We should have a duration field in vlc_ml_folder_t.
, m_count(data->i_nb_media) {}
// Interface
bool MLFolder::isPresent() const
{
return m_present;
}
bool MLFolder::isBanned() const
{
return m_banned;
}
QString MLFolder::getTitle() const
{
return m_title;
}
QString MLFolder::getMRL() const
{
return m_mrl;
}
int64_t MLFolder::getDuration() const
{
return m_duration;
}
unsigned int MLFolder::getCount() const
{
return m_count;
}
/*****************************************************************************
* Copyright (C) 2021 VLC authors and VideoLAN
*
* Authors: Benjamin Arnaud <bunjee@omega.gg>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* ( at your option ) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef MLFOLDER_HPP
#define MLFOLDER_HPP
// MediaLibrary includes
#include "mlitemcover.hpp"
class MLFolder : public MLItemCover
{
public:
MLFolder(const vlc_ml_folder_t * data);
public: // Interface
bool isPresent() const;
bool isBanned() const;
QString getTitle() const;
QString getMRL() const;
int64_t getDuration() const;
unsigned int getCount() const;
private:
bool m_present;
bool m_banned;
QString m_title;
QString m_mrl;
int64_t m_duration;
unsigned int m_count;
};
#endif
......@@ -770,6 +770,8 @@ modules/gui/qt/dialogs/plugins/addons_manager.cpp
modules/gui/qt/dialogs/plugins/addons_manager.hpp
modules/gui/qt/medialibrary/mlbookmarkmodel.cpp
modules/gui/qt/medialibrary/mlbookmarkmodel.hpp
modules/gui/qt/medialibrary/mlfolder.cpp
modules/gui/qt/medialibrary/mlfolder.hpp
modules/gui/qt/medialibrary/mlfoldersmodel.cpp
modules/gui/qt/medialibrary/mlfoldersmodel.hpp
modules/gui/qt/medialibrary/mlgroup.cpp
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment