Library.h 2.32 KB
Newer Older
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
1
2
3
/*****************************************************************************
 * Library.h: Multimedia library
 *****************************************************************************
4
 * Copyright (C) 2008-2016 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 <QObject>
Ludovic Fauvet's avatar
Ludovic Fauvet committed
35
36

class Clip;
37
class Media;
38
class ProjectManager;
39
class Workspace;
luyikei's avatar
luyikei committed
40
class Settings;
Ludovic Fauvet's avatar
Ludovic Fauvet committed
41

42
43
/**
 *  \class Library
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
44
 *  \brief Library Object that handles public Clips
45
 */
luyikei's avatar
luyikei committed
46
class Library : public MediaContainer
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
47
48
{
    Q_OBJECT
luyikei's avatar
luyikei committed
49
    Q_DISABLE_COPY( Library )
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
50

51
public:
luyikei's avatar
luyikei committed
52
53
    Library( Settings* projectSettings );
    virtual ~Library();
54
55
56
57
58
    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
59
private:
60
    void            setCleanState( bool newState );
61

62
private:
63
    QAtomicInt  m_nbMediaToLoad;
64
    bool        m_cleanState;
65
    Workspace*  m_workspace;
66

luyikei's avatar
luyikei committed
67
    Settings*   m_settings;
luyikei's avatar
luyikei committed
68
69
    void        preSave();
    void        postLoad();
70

71
72
73
private slots:
    void    mediaLoaded( const Media* m );

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

#endif // LIBRARY_H