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;
46 class MainInterface : public QVLCMW
50 MainInterface( intf_thread_t *);
51 virtual ~MainInterface();
52 void *requestVideo( vout_thread_t *p_nvout, int *pi_x,
53 int *pi_y, unsigned int *pi_width,
54 unsigned int *pi_height );
55 void releaseVideo( void *);
56 int controlVideo( void *p_window, int i_query, va_list args );
58 void resizeEvent( QResizeEvent * );
59 void closeEvent( QCloseEvent *);
60 Ui::MainInterfaceUI ui;
61 friend class VolumeClickHandler;
64 QSize mainSize, addSize;
66 bool need_components_update;
67 void calculateInterfaceSize();
68 void handleMainUi( QSettings* );
69 void doComponentsUpdate();
72 VideoWidget *videoWidget;
73 virtual void keyPressEvent( QKeyEvent *);
75 BackgroundWidget *bgWidget;
76 VisualSelector *visualSelector;
77 PlaylistWidget *playlistWidget;
79 bool playlistEmbeddedFlag;
80 bool videoEmbeddedFlag;
83 InputManager *main_input_manager;
85 input_thread_t *p_input; ///< Main input associated to the playlist
90 void customEvent( QEvent *);
92 void undockPlaylist();
94 void setStatus( int );
95 void setName( QString );
96 void setDisplay( float, int, int );
104 void updateVolume( int sliderVolume );
108 class VolumeClickHandler : public QObject
111 VolumeClickHandler( intf_thread_t *_p_intf, MainInterface *_m ) :QObject(_m)
112 {m = _m; p_intf = _p_intf; }
113 virtual ~VolumeClickHandler() {};
114 bool eventFilter( QObject *obj, QEvent *e )
116 if (e->type() == QEvent::MouseButtonPress )
118 aout_VolumeMute( p_intf, NULL );
125 intf_thread_t *p_intf;