MainWindow.h 4.43 KB
Newer Older
Ludovic Fauvet's avatar
Ludovic Fauvet committed
1
/*****************************************************************************
2
 * MainWindow.h: VLMC MainWindow
Ludovic Fauvet's avatar
Ludovic Fauvet committed
3
 *****************************************************************************
Ludovic Fauvet's avatar
Ludovic Fauvet committed
4
 * Copyright (C) 2008-2010 VideoLAN
Ludovic Fauvet's avatar
Ludovic Fauvet committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
 *
 * Authors: Ludovic Fauvet <etix@l0cal.com>
 *
 * 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 MAINWINDOW_H
#define MAINWINDOW_H

#include <QApplication>
27
#include <QSlider>
28 29
#include <QToolButton>
#include <QButtonGroup>
30

31
#include "vlmc.h"
32
#include "config.h"
Ludovic Fauvet's avatar
Ludovic Fauvet committed
33
#include "ui_MainWindow.h"
34

Ludovic Fauvet's avatar
Ludovic Fauvet committed
35 36 37 38 39 40
class Timeline;
class PreviewWidget;
class Settings;
class ProjectWizard;
class ImportController;
class WorkflowFileRenderer;
41
class WorkflowRenderer;
42

Ludovic Fauvet's avatar
Ludovic Fauvet committed
43 44 45
class MainWindow : public QMainWindow
{
    Q_OBJECT
Ludovic Fauvet's avatar
Ludovic Fauvet committed
46
    Q_DISABLE_COPY( MainWindow )
Ludovic Fauvet's avatar
Ludovic Fauvet committed
47 48

public:
49

Ludovic Fauvet's avatar
Ludovic Fauvet committed
50
    explicit MainWindow( QWidget *parent = 0 );
51
    void registerWidgetInWindowMenu( QDockWidget* widget );
52
    ~MainWindow();
Ludovic Fauvet's avatar
Ludovic Fauvet committed
53

Ludovic Fauvet's avatar
Ludovic Fauvet committed
54 55 56 57
public slots:
    void        zoomIn();
    void        zoomOut();

Ludovic Fauvet's avatar
Ludovic Fauvet committed
58
protected:
59 60
    virtual void    changeEvent( QEvent *e );
    virtual void    closeEvent( QCloseEvent* e );
Ludovic Fauvet's avatar
Ludovic Fauvet committed
61 62

private:
63
    void        initializeDockWidgets( void );
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
64
    void        setupLibrary();
65
    void        createStatusBar();
66
    void        createGlobalPreferences();
67
    void        createProjectPreferences();
68
    void        initVlmcPreferences();
69
    void        loadVlmcPreferences( const QString& subPart );
Ludovic Fauvet's avatar
Ludovic Fauvet committed
70
#ifdef WITH_CRASHBUTTON
71 72
    void        setupCrashTester();
#endif
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
73 74 75 76 77 78 79
    /**
     *  \brief  Will check if vlmc closed nicely or crashed.
     *          If so, the emergency backup will be opened.
     *  \return true if a project was restored. If so, the wizzard should
     *          not be opened.
     */
    bool        restoreSession();
80

81 82 83
    Ui::MainWindow          m_ui;
    QSlider*                m_zoomSlider;
    Timeline*               m_timeline;
84 85
    PreviewWidget*          m_clipPreview;
    PreviewWidget*          m_projectPreview;
86 87
    WorkflowFileRenderer*   m_fileRenderer;
    WorkflowRenderer        *m_renderer;
88
    Settings*               m_globalPreferences;
89
    Settings*               m_DefaultProjectPreferences;
90
    Settings*               m_projectPreferences;
91
    ProjectWizard*          m_pWizard;
92
    ImportController*       m_importController;
Ludovic Fauvet's avatar
Ludovic Fauvet committed
93 94

private slots:
95 96 97 98 99 100 101 102 103 104
    void                    on_actionBypass_effects_engine_toggled(bool );
    void                    on_actionFullscreen_triggered( bool checked );
    void                    on_actionQuit_triggered();
    void                    on_actionAbout_triggered();
    void                    on_actionPreferences_triggered();
    void                    on_actionTranscode_triggered();
    void                    on_actionRender_triggered();
    void                    on_actionNew_Project_triggered();
    void                    on_actionLoad_Project_triggered();
    void                    on_actionSave_triggered();
Hugo Beauzee-Luyssen's avatar
Hugo Beauzee-Luyssen committed
105
    void                    on_actionSave_As_triggered();
106 107
    void                    on_actionHelp_triggered();
    void                    on_actionProject_Preferences_triggered();
108
    void                    on_actionClose_Project_triggered();
109 110
    void                    on_actionUndo_triggered();
    void                    on_actionRedo_triggered();
111
    void                    on_actionCrash_triggered();
112
    void                    on_actionImport_triggered();
113
    void                    toolButtonClicked( int id );
114
    void                    projectUpdated( const QString& projectName, bool savedStatus );
115 116
    void                    canUndoChanged( bool canUndo );
    void                    canRedoChanged( bool canRedo );
117 118

signals:
119 120
    void                    translateDockWidgetTitle();
    void                    toolChanged( ToolButtons );
121

122
};
Ludovic Fauvet's avatar
Ludovic Fauvet committed
123 124

#endif // MAINWINDOW_H