Changeset 170df325b5bcaaf624c7337115a8549c886d931c

Show
Ignore:
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
  • modules/gui/qt4/Modules.am

    r834d0aa r170df32  
    7878        components/open.cpp \ 
    7979        components/playlist/standardpanel.cpp \ 
     80        components/video_widget.cpp \ 
    8081        util/input_slider.cpp 
    8182        $(NULL) 
     
    9697    components/open.hpp \ 
    9798    components/playlist/panels.hpp \ 
     99    components/video_widget.hpp \ 
    98100    util/input_slider.hpp \ 
    99101    ui/input_stats.ui \ 
  • modules/gui/qt4/main_interface.cpp

    r834d0aa r170df32  
    2121 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ 
    2222 
     23#include "qt4.hpp" 
    2324#include "main_interface.hpp" 
    2425#include "input_manager.hpp" 
     
    2627#include "util/qvlcframe.hpp" 
    2728#include "dialogs_provider.hpp" 
     29#include "components/video_widget.hpp" 
    2830#include <QCloseEvent> 
    2931#include <assert.h> 
    3032#include <QPushButton> 
    3133 
    32 MainInterface::MainInterface( intf_thread_t *_p_intf ) : QMainWindow(), p_intf( _p_intf ) 
     34MainInterface::MainInterface( intf_thread_t *_p_intf ) : QMainWindow(), 
     35                                                         p_intf( _p_intf ) 
    3336{ 
    3437    /* All UI stuff */ 
     
    5457    ui.volHighLabel->setPixmap( QPixmap( ":/pixmaps/volume-high.png" ) ); 
    5558 
    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(); 
    5769 
    5870    //QVLCMenu::createMenuBar(); 
     
    90102} 
    91103 
     104QSize 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 
    92111void MainInterface::stop() 
    93112{ 
    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 ); 
    100114} 
    101115void MainInterface::play() 
    102116{ 
    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 ); 
    109118} 
    110119void MainInterface::prev() 
    111120{ 
    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 ); 
    118122} 
    119123void MainInterface::next() 
    120124{ 
    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 ); 
    127126} 
    128  
    129  
    130  
    131  
    132  
    133127 
    134128void MainInterface::setDisplay( float pos, int time, int length ) 
  • modules/gui/qt4/main_interface.hpp

    r1b16878 r170df32  
    3232class QCloseEvent; 
    3333class InputSlider; 
     34class VideoWidget; 
    3435 
    3536class MainInterface : public QMainWindow 
     
    3940    MainInterface( intf_thread_t *); 
    4041    virtual ~MainInterface(); 
     42 
     43    virtual QSize sizeHint() const; 
     44 
     45    int i_saved_width, i_saved_height; 
     46 
    4147protected: 
    4248    void closeEvent( QCloseEvent *); 
    4349private: 
     50    VideoWidget *videoWidget; 
    4451    InputManager *main_input_manager; 
    4552    InputSlider *slider; 
     
    4754    input_thread_t *p_input; 
    4855    intf_thread_t *p_intf; 
    49  
    5056    Ui::MainInterfaceUI ui; 
    5157private slots: 
  • modules/gui/qt4/playlist_model.cpp

    r596ccd7 r170df32  
    256256    if( ( !b_input && i_cached_id == i_id) ||  
    257257        ( b_input && i_cached_input_id ==i_id ) ) 
     258    { 
    258259        return b_input ? p_cached_item_bi : p_cached_item; 
     260    } 
    259261 
    260262    if( !b_input && root->i_id == i_id ) 
     
    280282        { 
    281283            ICACHE( i_id, (*it) ); 
     284            return p_cached_item_bi; 
    282285        } 
    283286        if( (*it)->children.size() ) 
     
    299302        it++; 
    300303    } 
     304    fprintf( stderr, "Never found" ); 
    301305    return NULL; 
    302306} 
  • modules/gui/qt4/qt4.cpp

    r834d0aa r170df32  
    6767    memset( p_intf->p_sys, 0, sizeof( intf_sys_t ) ); 
    6868 
     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                             
    6974    p_intf->p_sys->p_sub = msg_Subscribe( p_intf, MSG_QUEUE_NORMAL ); 
    7075 
     
    8792    vlc_mutex_unlock( &p_intf->object_lock ); 
    8893 
     94    vlc_object_release( p_intf->p_sys->p_playlist ); 
    8995    msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub ); 
    9096    free( p_intf->p_sys ); 
     
    130136    } 
    131137 
    132  
    133138    if( p_intf->pf_show_dialog ) 
    134139        vlc_thread_ready( p_intf ); 
  • modules/gui/qt4/qt4.hpp

    r776ba66 r170df32  
    3131class MainInterface; 
    3232class DialogsProvider; 
    33  
     33class VideoWidget; 
    3434 
    3535struct intf_sys_t 
     
    3737    QApplication *p_app; 
    3838    MainInterface *p_mi; 
     39    playlist_t *p_playlist; 
     40    msg_subscription_t *p_sub; ///< Subscription to the message bank 
    3941 
    40     msg_subscription_t *p_sub; ///< Subscription to the message bank 
     42    VideoWidget *p_video; 
     43    int i_saved_height, i_saved_width; 
    4144}; 
     45 
     46#define THEPL p_intf->p_sys->p_playlist 
    4247 
    4348static int DialogEvent_Type = QEvent::User + 1; 
  • modules/gui/qt4/ui/main_interface.ui

    r47315c3 r170df32  
    99    <x>0</x> 
    1010    <y>0</y> 
    11     <width>428</width> 
    12     <height>79</height> 
     11    <width>444</width> 
     12    <height>80</height> 
    1313   </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> 
    1422  </property> 
    1523  <property name="windowTitle" > 
     
    3644        <sizepolicy> 
    3745         <hsizetype>5</hsizetype> 
    38          <vsizetype>5</vsizetype> 
     46         <vsizetype>0</vsizetype> 
    3947         <horstretch>0</horstretch> 
    4048         <verstretch>0</verstretch> 
     
    5159        <sizepolicy> 
    5260         <hsizetype>0</hsizetype> 
    53          <vsizetype>5</vsizetype> 
     61         <vsizetype>0</vsizetype> 
    5462         <horstretch>0</horstretch> 
    5563         <verstretch>0</verstretch>