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 closeEvent( QCloseEvent *);
61 Ui::MainInterfaceUI ui;
62 friend class VolumeClickHandler;
65 QSize mainSize, addSize;
67 bool need_components_update;
68 void calculateInterfaceSize();
69 void handleMainUi( QSettings* );
70 void doComponentsUpdate();
73 VideoWidget *videoWidget;
74 virtual void keyPressEvent( QKeyEvent *);
76 BackgroundWidget *bgWidget;
77 VisualSelector *visualSelector;
78 ControlsWidget *advControls;
79 PlaylistWidget *playlistWidget;
81 bool playlistEmbeddedFlag;
82 bool videoEmbeddedFlag;
84 bool advControlsEnabled;
86 InputManager *main_input_manager;
88 input_thread_t *p_input; ///< Main input associated to the playlist
93 void customEvent( QEvent *);
95 void undockPlaylist();
97 void setStatus( int );
98 void setName( QString );
99 void setDisplay( float, int, int );
100 void updateOnTimer();
108 void updateVolume( int sliderVolume );
112 class VolumeClickHandler : public QObject
115 VolumeClickHandler( intf_thread_t *_p_intf, MainInterface *_m ) :QObject(_m)
116 {m = _m; p_intf = _p_intf; }
117 virtual ~VolumeClickHandler() {};
118 bool eventFilter( QObject *obj, QEvent *e )
120 if (e->type() == QEvent::MouseButtonPress )
122 aout_VolumeMute( p_intf, NULL );
129 intf_thread_t *p_intf;