~ubuntu-branches/ubuntu/maverick/vlc/maverick

« back to all changes in this revision

Viewing changes to modules/gui/qt4/main_interface.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-09-17 21:56:14 UTC
  • mfrom: (1.1.17 upstream)
  • Revision ID: james.westby@ubuntu.com-20080917215614-tj0vx8xzd57e52t8
Tags: 0.9.2-1ubuntu1
* New Upstream Release, exception granted by
    - dktrkranz, norsetto, Hobbsee (via irc). LP: #270404

Changes done in ubuntu:

* add libxul-dev to build-depends
* make sure that vlc is build against libxul in configure. This doesn't
  change anything in the package, but makes it more robust if building
  in an 'unclean' chroot or when modifying the package.
* debian/control: make Vcs-* fields point to the motumedia branch
* add libx264-dev and libass-dev to build-depends
  LP: #210354, #199870
* actually enable libass support by passing --enable-libass to configure
* enable libdca: add libdca-dev to build depends and --enable-libdca
* install the x264 plugin.

Changes already in the pkg-multimedia branch in debian:

* don't install usr/share/vlc/mozilla in debian/mozilla-plugin-vlc.install  
* new upstream .desktop file now registers flash video mimetype LP: #261567
* add Xb-Npp-Applications to mozilla-plugin-vlc
* remove duplicate entries in debian/vlc-nox.install

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************************
 
2
 * main_interface.hpp : Main Interface
 
3
 ****************************************************************************
 
4
 * Copyright (C) 2006-2007 the VideoLAN team
 
5
 * $Id$
 
6
 *
 
7
 * Authors: Clément Stenac <zorglub@videolan.org>
 
8
 *          Jean-Baptiste Kempf <jb@videolan.org>
 
9
 *
 
10
 * This program is free software; you can redistribute it and/or modify
 
11
 * it under the terms of the GNU General Public License as published by
 
12
 * the Free Software Foundation; either version 2 of the License, or
 
13
 * (at your option) any later version.
 
14
 *
 
15
 * This program is distributed in the hope that it will be useful,
 
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
18
 * GNU General Public License for more details.
 
19
 *
 
20
 * You should have received a copy of the GNU General Public License
 
21
 * along with this program; if not, write to the Free Software
 
22
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 
23
 *****************************************************************************/
 
24
 
 
25
#ifndef _MAIN_INTERFACE_H_
 
26
#define _MAIN_INTERFACE_H_
 
27
 
 
28
#include "qt4.hpp"
 
29
#include "util/qvlcframe.hpp"
 
30
#include "components/preferences_widgets.hpp"
 
31
 
 
32
#include <vlc_aout.h>
 
33
 
 
34
#include <QSystemTrayIcon>
 
35
 
 
36
class QSettings;
 
37
class QCloseEvent;
 
38
class QKeyEvent;
 
39
class QLabel;
 
40
class QEvent;
 
41
class InputManager;
 
42
class VideoWidget;
 
43
class BackgroundWidget;
 
44
class PlaylistWidget;
 
45
class VisualSelector;
 
46
class AdvControlsWidget;
 
47
class ControlsWidget;
 
48
class FullscreenControllerWidget;
 
49
class SpeedControlWidget;
 
50
class QMenu;
 
51
class QSize;
 
52
//class QDockWidet;
 
53
 
 
54
enum {
 
55
    CONTROLS_HIDDEN = 0x0,
 
56
    CONTROLS_VISIBLE = 0x1,
 
57
    CONTROLS_ADVANCED = 0x2
 
58
};
 
59
 
 
60
typedef enum pl_dock_e {
 
61
    PL_UNDOCKED,
 
62
    PL_BOTTOM,
 
63
    PL_RIGHT,
 
64
    PL_LEFT
 
65
} pl_dock_e;
 
66
 
 
67
class MainInterface : public QVLCMW
 
68
{
 
69
    Q_OBJECT;
 
70
 
 
71
    friend class VolumeClickHandler;
 
72
    friend class InteractionDialog;
 
73
    friend class PlaylistWidget;
 
74
 
 
75
public:
 
76
    MainInterface( intf_thread_t *);
 
77
    virtual ~MainInterface();
 
78
 
 
79
    /* Video requests from core */
 
80
    void *requestVideo( vout_thread_t *p_nvout, int *pi_x,
 
81
                        int *pi_y, unsigned int *pi_width,
 
82
                        unsigned int *pi_height );
 
83
    void releaseVideo( void * );
 
84
    int controlVideo( void *p_window, int i_query, va_list args );
 
85
 
 
86
    /* Getters */
 
87
    QSystemTrayIcon *getSysTray() { return sysTray; };
 
88
    QMenu *getSysTrayMenu() { return systrayMenu; };
 
89
    int getControlsVisibilityStatus();
 
90
 
 
91
    /* Sizehint() */
 
92
    QSize sizeHint() const;
 
93
protected:
 
94
//    void resizeEvent( QResizeEvent * );
 
95
    void dropEvent( QDropEvent *);
 
96
    void dragEnterEvent( QDragEnterEvent * );
 
97
    void dragMoveEvent( QDragMoveEvent * );
 
98
    void dragLeaveEvent( QDragLeaveEvent * );
 
99
    void closeEvent( QCloseEvent *);
 
100
 
 
101
private:
 
102
    QSettings           *settings;
 
103
    QSystemTrayIcon     *sysTray;
 
104
    QMenu               *systrayMenu;
 
105
    QString              input_name;
 
106
    QVBoxLayout         *mainLayout;
 
107
    ControlsWidget      *controls;
 
108
    FullscreenControllerWidget *fullscreenControls;
 
109
    QMenu               *speedControlMenu;
 
110
    SpeedControlWidget  *speedControl;
 
111
 
 
112
    void handleMainUi( QSettings* );
 
113
    void askForPrivacy();
 
114
    int  privacyDialog( QList<ConfigControl *> *controls );
 
115
 
 
116
    /* Systray */
 
117
    void handleSystray();
 
118
    void createSystray();
 
119
 
 
120
    void createStatusBar();
 
121
    void initSystray();
 
122
 
 
123
    /* Video */
 
124
    VideoWidget         *videoWidget;
 
125
 
 
126
    BackgroundWidget    *bgWidget;
 
127
    VisualSelector      *visualSelector;
 
128
    PlaylistWidget      *playlistWidget;
 
129
 
 
130
    bool                 videoIsActive; ///< Having a video now / THEMIM->hasV
 
131
    bool                 videoEmbeddedFlag; ///< Want an external Video Window
 
132
    bool                 playlistVisible; ///< Is the playlist visible ?
 
133
    bool                 visualSelectorEnabled;
 
134
    bool                 notificationEnabled; /// Systray Notifications
 
135
    bool                 b_remainingTime; /* Show elapsed or remaining time */
 
136
    bool                 bgWasVisible;
 
137
    int                  i_visualmode; ///< Visual Mode
 
138
    pl_dock_e            i_pl_dock;
 
139
    bool                 isDocked() { return ( i_pl_dock != PL_UNDOCKED ); }
 
140
 
 
141
    input_thread_t      *p_input;    ///< Main input associated to the playlist
 
142
 
 
143
    /* Status Bar */
 
144
    QLabel              *timeLabel;
 
145
    QLabel              *speedLabel;
 
146
    QLabel              *nameLabel;
 
147
 
 
148
    virtual void customEvent( QEvent *);
 
149
    virtual void keyPressEvent( QKeyEvent *);
 
150
    virtual void wheelEvent( QWheelEvent * );
 
151
 
 
152
public slots:
 
153
    void undockPlaylist();
 
154
    void dockPlaylist( pl_dock_e i_pos = PL_BOTTOM );
 
155
    void toggleMinimalView();
 
156
    void togglePlaylist();
 
157
    void toggleUpdateSystrayMenu();
 
158
    void toggleAdvanced();
 
159
    void toggleFullScreen();
 
160
    void toggleFSC();
 
161
 
 
162
    /* Manage the Video Functions from the vout threads */
 
163
    void releaseVideoSlot( void * );
 
164
 
 
165
private slots:
 
166
    void debug();
 
167
    void updateOnTimer();
 
168
    void doComponentsUpdate();
 
169
    void setStatus( int );
 
170
    void setRate( int );
 
171
    void setName( QString );
 
172
    void setVLCWindowsTitle( QString title = "" );
 
173
    void setDisplayPosition( float, int, int );
 
174
    void toggleTimeDisplay();
 
175
#if 0
 
176
    void visual();
 
177
#endif
 
178
    void handleSystrayClick( QSystemTrayIcon::ActivationReason );
 
179
    void updateSystrayTooltipName( QString );
 
180
    void updateSystrayTooltipStatus( int );
 
181
    void showSpeedMenu( QPoint );
 
182
signals:
 
183
    void askReleaseVideo( void * );
 
184
    void askVideoToResize( unsigned int, unsigned int );
 
185
    void askVideoToToggle();
 
186
    void askBgWidgetToToggle();
 
187
    void askUpdate();
 
188
};
 
189
 
 
190
#endif