1 /*****************************************************************************
2 * main_interface.hpp : Main Interface
3 ****************************************************************************
4 * Copyright (C) 2006 the VideoLAN team
7 * Authors: Clément Stenac <zorglub@videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/
23 #ifndef _MAIN_INTERFACE_H_
24 #define _MAIN_INTERFACE_H_
28 #include "ui/main_interface.h"
29 #include "util/qvlcframe.hpp"
41 class BackgroundWidget;
43 class VolumeClickHandler;
47 class MainInterface : public QVLCMW
51 MainInterface( intf_thread_t *);
52 virtual ~MainInterface();
53 void *requestVideo( vout_thread_t *p_nvout, int *pi_x,
54 int *pi_y, unsigned int *pi_width,
55 unsigned int *pi_height );
56 void releaseVideo( void *);
57 int controlVideo( void *p_window, int i_query, va_list args );
59 void resizeEvent( QResizeEvent * );
60 void dropEvent( QDropEvent *);
61 void dragEnterEvent( QDragEnterEvent * );
62 void dragMoveEvent( QDragMoveEvent * );
63 void dragLeaveEvent( QDragLeaveEvent * );
64 void closeEvent( QCloseEvent *);
65 Ui::MainInterfaceUI ui;
66 friend class VolumeClickHandler;
69 QSize mainSize, addSize;
71 bool need_components_update;
72 void calculateInterfaceSize();
73 void handleMainUi( QSettings* );
74 void doComponentsUpdate();
77 VideoWidget *videoWidget;
78 virtual void keyPressEvent( QKeyEvent *);
79 virtual void wheelEvent( QWheelEvent * );
81 bool embeddedPlaylistWasActive;
86 BackgroundWidget *bgWidget;
87 VisualSelector *visualSelector;
88 ControlsWidget *advControls;
89 PlaylistWidget *playlistWidget;
91 bool playlistEmbeddedFlag;
92 bool videoEmbeddedFlag;
94 bool advControlsEnabled;
95 bool visualSelectorEnabled;
97 InputManager *main_input_manager;
99 input_thread_t *p_input; ///< Main input associated to the playlist
104 void customEvent( QEvent *);
106 void undockPlaylist();
108 void setNavigation( int );
109 void setStatus( int );
110 void setName( QString );
111 void setDisplay( float, int, int );
112 void updateOnTimer();
120 void updateVolume( int sliderVolume );
124 class VolumeClickHandler : public QObject
127 VolumeClickHandler( intf_thread_t *_p_intf, MainInterface *_m ) :QObject(_m)
128 {m = _m; p_intf = _p_intf; }
129 virtual ~VolumeClickHandler() {};
130 bool eventFilter( QObject *obj, QEvent *e )
132 if (e->type() == QEvent::MouseButtonPress )
134 aout_VolumeMute( p_intf, NULL );
141 intf_thread_t *p_intf;