1 /*****************************************************************************
2 * input_manager.hpp : Manage an input and interact with its GUI elements
3 ****************************************************************************
4 * Copyright (C) 2006-2007 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.
22 *****************************************************************************/
24 #ifndef _INPUT_MANAGER_H_
25 #define _INPUT_MANAGER_H_
28 #include <vlc_input.h>
32 class InputManager : public QObject
36 InputManager( QObject *, intf_thread_t * );
37 virtual ~InputManager();
40 bool hasInput() { return p_input && !p_input->b_dead && !p_input->b_die; }
41 bool hasAudio() { return b_has_audio; }
42 bool hasVideo() { return b_has_video; }
43 bool b_has_audio, b_has_video, b_had_audio, b_had_video;
45 intf_thread_t *p_intf;
46 input_thread_t *p_input;
47 int i_old_playing_status;
52 void togglePlayPause();
53 void update(); ///< Periodic updates
54 void setInput( input_thread_t * ); ///< Our controlled input changed
55 void sliderUpdate( float ); ///< User dragged the slider. We get new pos
64 void telexGotoPage( int );
65 void telexToggle( bool );
66 void telexSetTransparency( bool );
69 /// Send new position, new time and new length
70 void positionUpdated( float , int, int );
71 void rateChanged( int );
72 void nameChanged( QString );
73 /// Used to signal whether we should show navigation buttons
74 void navigationChanged( int );
76 void teletextEnabled( bool );
79 void statusChanged( int );
80 void artChanged( QString );
83 class MainInputManager : public QObject
87 static MainInputManager *getInstance( intf_thread_t *_p_intf )
90 instance = new MainInputManager( _p_intf );
93 static void killInstance()
95 if( instance ) delete instance;
97 virtual ~MainInputManager();
98 input_thread_t *getInput() { return p_input; };
99 InputManager *getIM() { return im; };
102 MainInputManager( intf_thread_t * );
105 intf_thread_t *p_intf;
106 input_thread_t *p_input;
107 static MainInputManager *instance;
109 void togglePlayPause();
116 void inputChanged( input_thread_t * );