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

23
/** \file
24 25
 * This file the library contains class declaration/definition.
 * It's the the backend part of the Library widget of vlmc.
26
 * It can load and unload Medias (Medias.h/Media.cpp)
27 28
 * It can load and unload Clips (Clip.h/Clip.cpp)
 */
29

Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
30 31 32
#ifndef LIBRARY_H
#define LIBRARY_H

33
#include "MediaContainer.h"
34
#include "Project/ILoadSave.h"
35 36

#include <QObject>
37
#include <QXmlStreamWriter>
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
38

39
class   QDomElement;
Ludovic Fauvet's avatar
Ludovic Fauvet committed
40 41

class Clip;
42
class Media;
43
class ProjectManager;
44
class Workspace;
Ludovic Fauvet's avatar
Ludovic Fauvet committed
45

46 47
/**
 *  \class Library
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
48
 *  \brief Library Object that handles public Clips
49
 */
50
class Library : public MediaContainer, public ILoadSave
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
51 52 53
{
    Q_OBJECT
    Q_DISABLE_COPY( Library );
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
54

55
public:
56
    Library(Workspace* workspace);
57
    virtual ~Library(){}
58 59 60 61 62
    virtual void    addMedia( Media* media );
    virtual Media   *addMedia( const QFileInfo &fileInfo );
    virtual bool    addClip( Clip *clip );
    bool            isInCleanState() const;

Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
63
private:
64 65 66
    void            setCleanState( bool newState );
    virtual bool    load( const QDomDocument& project );
    virtual bool    save( QXmlStreamWriter& project );
67

68
private:
69
    QAtomicInt  m_nbMediaToLoad;
70
    bool        m_cleanState;
71
    Workspace*  m_workspace;
72

73

74 75 76
private slots:
    void    mediaLoaded( const Media* m );

Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
77
signals:
78
    /**
79
     *  \brief
80
     */
81
    void    projectLoaded();
82
    void    cleanStateChanged( bool newState );
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
83 84 85
};

#endif // LIBRARY_H