MetaDataManager.h 2.01 KB
Newer Older
1 2 3
/*****************************************************************************
 * MetaDataWorker.h: MetaDataManager
 *****************************************************************************
4
 * Copyright (C) 2008-2014 VideoLAN
5
 *
Hugo Beauzée-Luyssen's avatar
Hugo Beauzée-Luyssen committed
6
 * Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
 *
 * 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 METADATAMANAGER_H
#define METADATAMANAGER_H

26
#include <QThread>
27
#include <QQueue>
28
#include <QMutex>
29

30 31
#include "Tools/Singleton.hpp"

32
class   Media;
33 34 35 36
namespace LibVLCpp
{
    class   MediaPlayer;
}
37

38
class MetaDataManager : public QThread, public Singleton<MetaDataManager>
39 40
{
    Q_OBJECT
41
    Q_DISABLE_COPY( MetaDataManager );
42 43 44 45 46

    public:
        void    computeMediaMetadata( Media* media );
    private:
        MetaDataManager();
47 48
        ~MetaDataManager();

49 50
    protected:
        virtual void            run();
51 52

    private:
53
        QMutex                  m_computingMutex;
54 55 56 57 58
        QQueue<Media*>          m_mediaToCompute;
        bool                    m_computeInProgress;
        LibVLCpp::MediaPlayer   *m_mediaPlayer;
        friend class            Singleton<MetaDataManager>;

59 60
    signals:
        void                    failedToCompute( Media* );
61
        void                    startingComputing( const Media* );
62 63 64
};

#endif //METADATAMANAGER_H