Changeset 170df325b5bcaaf624c7337115a8549c886d931c
- Timestamp:
- 01/07/06 20:34:03
(2 years ago)
- Author:
- Clément Stenac <zorglub@videolan.org>
- git-committer:
- Clément Stenac <zorglub@videolan.org> 1151778843 +0000
- git-parent:
[3793e3726479b56b294d7946f0599725dd8f2654]
- git-author:
- Clément Stenac <zorglub@videolan.org> 1151778843 +0000
- Message:
Preliminary embedded vout implementation
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r834d0aa |
r170df32 |
|
| 78 | 78 | components/open.cpp \ |
|---|
| 79 | 79 | components/playlist/standardpanel.cpp \ |
|---|
| | 80 | components/video_widget.cpp \ |
|---|
| 80 | 81 | util/input_slider.cpp |
|---|
| 81 | 82 | $(NULL) |
|---|
| … | … | |
| 96 | 97 | components/open.hpp \ |
|---|
| 97 | 98 | components/playlist/panels.hpp \ |
|---|
| | 99 | components/video_widget.hpp \ |
|---|
| 98 | 100 | util/input_slider.hpp \ |
|---|
| 99 | 101 | ui/input_stats.ui \ |
|---|
| r834d0aa |
r170df32 |
|
| 21 | 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ |
|---|
| 22 | 22 | |
|---|
| | 23 | #include "qt4.hpp" |
|---|
| 23 | 24 | #include "main_interface.hpp" |
|---|
| 24 | 25 | #include "input_manager.hpp" |
|---|
| … | … | |
| 26 | 27 | #include "util/qvlcframe.hpp" |
|---|
| 27 | 28 | #include "dialogs_provider.hpp" |
|---|
| | 29 | #include "components/video_widget.hpp" |
|---|
| 28 | 30 | #include <QCloseEvent> |
|---|
| 29 | 31 | #include <assert.h> |
|---|
| 30 | 32 | #include <QPushButton> |
|---|
| 31 | 33 | |
|---|
| 32 | | MainInterface::MainInterface( intf_thread_t *_p_intf ) : QMainWindow(), p_intf( _p_intf ) |
|---|
| | 34 | MainInterface::MainInterface( intf_thread_t *_p_intf ) : QMainWindow(), |
|---|
| | 35 | p_intf( _p_intf ) |
|---|
| 33 | 36 | { |
|---|
| 34 | 37 | /* All UI stuff */ |
|---|
| … | … | |
| 54 | 57 | ui.volHighLabel->setPixmap( QPixmap( ":/pixmaps/volume-high.png" ) ); |
|---|
| 55 | 58 | |
|---|
| 56 | | resize( QSize( 450, 80 ) ); |
|---|
| | 59 | |
|---|
| | 60 | // if( config_GetInt( p_intf, "embedded" ) ) |
|---|
| | 61 | { |
|---|
| | 62 | videoWidget = new VideoWidget( p_intf ); |
|---|
| | 63 | videoWidget->resize( 1,1 ); |
|---|
| | 64 | ui.vboxLayout->insertWidget( 0, videoWidget ); |
|---|
| | 65 | } |
|---|
| | 66 | resize( QSize( 500, 121 ) ); |
|---|
| | 67 | i_saved_width = width(); |
|---|
| | 68 | i_saved_height = height(); |
|---|
| 57 | 69 | |
|---|
| 58 | 70 | //QVLCMenu::createMenuBar(); |
|---|
| … | … | |
| 90 | 102 | } |
|---|
| 91 | 103 | |
|---|
| | 104 | QSize MainInterface::sizeHint() const |
|---|
| | 105 | { |
|---|
| | 106 | int i_width = __MAX( i_saved_width, p_intf->p_sys->p_video->i_video_width ); |
|---|
| | 107 | return QSize( i_width, i_saved_height + |
|---|
| | 108 | p_intf->p_sys->p_video->i_video_height ); |
|---|
| | 109 | } |
|---|
| | 110 | |
|---|
| 92 | 111 | void MainInterface::stop() |
|---|
| 93 | 112 | { |
|---|
| 94 | | /// \todo store playlist globally |
|---|
| 95 | | playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf, |
|---|
| 96 | | VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); |
|---|
| 97 | | if( !p_playlist ) return; |
|---|
| 98 | | playlist_Stop( p_playlist ); |
|---|
| 99 | | vlc_object_release( p_playlist ); |
|---|
| | 113 | playlist_Stop( THEPL ); |
|---|
| 100 | 114 | } |
|---|
| 101 | 115 | void MainInterface::play() |
|---|
| 102 | 116 | { |
|---|
| 103 | | /// \todo store playlist globally |
|---|
| 104 | | playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf, |
|---|
| 105 | | VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); |
|---|
| 106 | | if( !p_playlist ) return; |
|---|
| 107 | | playlist_Play( p_playlist ); |
|---|
| 108 | | vlc_object_release( p_playlist ); |
|---|
| | 117 | playlist_Play( THEPL ); |
|---|
| 109 | 118 | } |
|---|
| 110 | 119 | void MainInterface::prev() |
|---|
| 111 | 120 | { |
|---|
| 112 | | /// \todo store playlist globally |
|---|
| 113 | | playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf, |
|---|
| 114 | | VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); |
|---|
| 115 | | if( !p_playlist ) return; |
|---|
| 116 | | playlist_Prev( p_playlist ); |
|---|
| 117 | | vlc_object_release( p_playlist ); |
|---|
| | 121 | playlist_Prev( THEPL ); |
|---|
| 118 | 122 | } |
|---|
| 119 | 123 | void MainInterface::next() |
|---|
| 120 | 124 | { |
|---|
| 121 | | /// \todo store playlist globally |
|---|
| 122 | | playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf, |
|---|
| 123 | | VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); |
|---|
| 124 | | if( !p_playlist ) return; |
|---|
| 125 | | playlist_Next( p_playlist ); |
|---|
| 126 | | vlc_object_release( p_playlist ); |
|---|
| | 125 | playlist_Next( THEPL ); |
|---|
| 127 | 126 | } |
|---|
| 128 | | |
|---|
| 129 | | |
|---|
| 130 | | |
|---|
| 131 | | |
|---|
| 132 | | |
|---|
| 133 | 127 | |
|---|
| 134 | 128 | void MainInterface::setDisplay( float pos, int time, int length ) |
|---|
| r1b16878 |
r170df32 |
|
| 32 | 32 | class QCloseEvent; |
|---|
| 33 | 33 | class InputSlider; |
|---|
| | 34 | class VideoWidget; |
|---|
| 34 | 35 | |
|---|
| 35 | 36 | class MainInterface : public QMainWindow |
|---|
| … | … | |
| 39 | 40 | MainInterface( intf_thread_t *); |
|---|
| 40 | 41 | virtual ~MainInterface(); |
|---|
| | 42 | |
|---|
| | 43 | virtual QSize sizeHint() const; |
|---|
| | 44 | |
|---|
| | 45 | int i_saved_width, i_saved_height; |
|---|
| | 46 | |
|---|
| 41 | 47 | protected: |
|---|
| 42 | 48 | void closeEvent( QCloseEvent *); |
|---|
| 43 | 49 | private: |
|---|
| | 50 | VideoWidget *videoWidget; |
|---|
| 44 | 51 | InputManager *main_input_manager; |
|---|
| 45 | 52 | InputSlider *slider; |
|---|
| … | … | |
| 47 | 54 | input_thread_t *p_input; |
|---|
| 48 | 55 | intf_thread_t *p_intf; |
|---|
| 49 | | |
|---|
| 50 | 56 | Ui::MainInterfaceUI ui; |
|---|
| 51 | 57 | private slots: |
|---|
| r596ccd7 |
r170df32 |
|
| 256 | 256 | if( ( !b_input && i_cached_id == i_id) || |
|---|
| 257 | 257 | ( b_input && i_cached_input_id ==i_id ) ) |
|---|
| | 258 | { |
|---|
| 258 | 259 | return b_input ? p_cached_item_bi : p_cached_item; |
|---|
| | 260 | } |
|---|
| 259 | 261 | |
|---|
| 260 | 262 | if( !b_input && root->i_id == i_id ) |
|---|
| … | … | |
| 280 | 282 | { |
|---|
| 281 | 283 | ICACHE( i_id, (*it) ); |
|---|
| | 284 | return p_cached_item_bi; |
|---|
| 282 | 285 | } |
|---|
| 283 | 286 | if( (*it)->children.size() ) |
|---|
| … | … | |
| 299 | 302 | it++; |
|---|
| 300 | 303 | } |
|---|
| | 304 | fprintf( stderr, "Never found" ); |
|---|
| 301 | 305 | return NULL; |
|---|
| 302 | 306 | } |
|---|
| r834d0aa |
r170df32 |
|
| 67 | 67 | memset( p_intf->p_sys, 0, sizeof( intf_sys_t ) ); |
|---|
| 68 | 68 | |
|---|
| | 69 | p_intf->p_sys->p_playlist = (playlist_t *)vlc_object_find( p_intf, |
|---|
| | 70 | VLC_OBJECT_PLAYLIST, FIND_ANYWHERE ); |
|---|
| | 71 | if( !p_intf->p_sys->p_playlist ) |
|---|
| | 72 | return VLC_EGENERIC; |
|---|
| | 73 | |
|---|
| 69 | 74 | p_intf->p_sys->p_sub = msg_Subscribe( p_intf, MSG_QUEUE_NORMAL ); |
|---|
| 70 | 75 | |
|---|
| … | … | |
| 87 | 92 | vlc_mutex_unlock( &p_intf->object_lock ); |
|---|
| 88 | 93 | |
|---|
| | 94 | vlc_object_release( p_intf->p_sys->p_playlist ); |
|---|
| 89 | 95 | msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub ); |
|---|
| 90 | 96 | free( p_intf->p_sys ); |
|---|
| … | … | |
| 130 | 136 | } |
|---|
| 131 | 137 | |
|---|
| 132 | | |
|---|
| 133 | 138 | if( p_intf->pf_show_dialog ) |
|---|
| 134 | 139 | vlc_thread_ready( p_intf ); |
|---|
| r776ba66 |
r170df32 |
|
| 31 | 31 | class MainInterface; |
|---|
| 32 | 32 | class DialogsProvider; |
|---|
| 33 | | |
|---|
| | 33 | class VideoWidget; |
|---|
| 34 | 34 | |
|---|
| 35 | 35 | struct intf_sys_t |
|---|
| … | … | |
| 37 | 37 | QApplication *p_app; |
|---|
| 38 | 38 | MainInterface *p_mi; |
|---|
| | 39 | playlist_t *p_playlist; |
|---|
| | 40 | msg_subscription_t *p_sub; ///< Subscription to the message bank |
|---|
| 39 | 41 | |
|---|
| 40 | | msg_subscription_t *p_sub; ///< Subscription to the message bank |
|---|
| | 42 | VideoWidget *p_video; |
|---|
| | 43 | int i_saved_height, i_saved_width; |
|---|
| 41 | 44 | }; |
|---|
| | 45 | |
|---|
| | 46 | #define THEPL p_intf->p_sys->p_playlist |
|---|
| 42 | 47 | |
|---|
| 43 | 48 | static int DialogEvent_Type = QEvent::User + 1; |
|---|
| r47315c3 |
r170df32 |
|
| 9 | 9 | <x>0</x> |
|---|
| 10 | 10 | <y>0</y> |
|---|
| 11 | | <width>428</width> |
|---|
| 12 | | <height>79</height> |
|---|
| | 11 | <width>444</width> |
|---|
| | 12 | <height>80</height> |
|---|
| 13 | 13 | </rect> |
|---|
| | 14 | </property> |
|---|
| | 15 | <property name="sizePolicy" > |
|---|
| | 16 | <sizepolicy> |
|---|
| | 17 | <hsizetype>0</hsizetype> |
|---|
| | 18 | <vsizetype>0</vsizetype> |
|---|
| | 19 | <horstretch>0</horstretch> |
|---|
| | 20 | <verstretch>0</verstretch> |
|---|
| | 21 | </sizepolicy> |
|---|
| 14 | 22 | </property> |
|---|
| 15 | 23 | <property name="windowTitle" > |
|---|
| … | … | |
| 36 | 44 | <sizepolicy> |
|---|
| 37 | 45 | <hsizetype>5</hsizetype> |
|---|
| 38 | | <vsizetype>5</vsizetype> |
|---|
| | 46 | <vsizetype>0</vsizetype> |
|---|
| 39 | 47 | <horstretch>0</horstretch> |
|---|
| 40 | 48 | <verstretch>0</verstretch> |
|---|
| … | … | |
| 51 | 59 | <sizepolicy> |
|---|
| 52 | 60 | <hsizetype>0</hsizetype> |
|---|
| 53 | | <vsizetype>5</vsizetype> |
|---|
| | 61 | <vsizetype>0</vsizetype> |
|---|
| 54 | 62 | <horstretch>0</horstretch> |
|---|
| 55 | 63 | <verstretch>0</verstretch> |
|---|