committed by
Jean-Baptiste Kempf
4 changed files with 125 additions and 0 deletions
@ -0,0 +1,64 @@ |
|||
/*****************************************************************************
|
|||
* 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; |
|||
} |
|||
@ -0,0 +1,57 @@ |
|||
/*****************************************************************************
|
|||
* 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 |
|||
Loading…
Reference in new issue