Changeset 32cdbfa32d03e0022874e3da3d6caa02ca9894b8

Show
Ignore:
Timestamp:
31/12/07 13:16:53 (10 months ago)
Author:
Ilkka Ollakka <ileoo@videolan.org>
git-committer:
Ilkka Ollakka <ileoo@videolan.org> 1199103413 +0000
git-parent:

[4251cd0a3cbc740d4e11d84be8b9bcd89fca5446]

git-author:
Ilkka Ollakka <ileoo@videolan.org> 1199103413 +0000
Message:

add artChanged signal to inputmanager and change backgroundwidget to use
it.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/gui/qt4/components/interface_widgets.cpp

    r2833492 r32cdbfa  
    118118/********************************************************************** 
    119119 * Background Widget. Show a simple image background. Currently, 
    120  * it's a static cone. 
     120 * it's album art if present or cone. 
    121121 **********************************************************************/ 
    122122#define ICON_SIZE 128 
     
    154154    backgroundLayout->setColumnStretch( 2, 1 ); 
    155155 
    156     CONNECT( THEMIM, inputChanged( input_thread_t *), 
    157              this, update( input_thread_t * ) ); 
     156    CONNECT( THEMIM->getIM(), artChanged( QString ), this, update( QString ) ); 
    158157    resize( 300, 150 ); 
    159158} 
     
    163162} 
    164163 
    165 void BackgroundWidget::update( input_thread_t *p_input
    166 { 
    167     if( !p_input || p_input->b_dead
     164void BackgroundWidget::update( QString url
     165{ 
     166    if( url.isNull()
    168167    { 
    169168        if( QDate::currentDate().dayOfYear() >= 354 ) 
     
    174173    } 
    175174 
    176     vlc_object_yield( p_input ); 
    177     char *psz_arturl = input_item_GetArtURL( input_GetItem(p_input) ); 
    178     vlc_object_release( p_input ); 
    179  
    180     QString arturl = qfu( psz_arturl ).replace( "file://",QString("" ) ); 
     175    QString arturl = url.replace( "file://",QString("" ) ); 
    181176    if( arturl.isNull() ) 
    182177    { 
     
    189184    { 
    190185        label->setPixmap( QPixmap( arturl ) ); 
    191         msg_Dbg( p_intf, "changing input b_need_update done %s", psz_arturl ); 
    192     } 
    193     free( psz_arturl ); 
     186        msg_Dbg( p_intf, "changing input b_need_update done "); 
     187    } 
    194188} 
    195189 
  • modules/gui/qt4/components/interface_widgets.hpp

    r2833492 r32cdbfa  
    8686public slots: 
    8787    void toggle(){ TOGGLEV( this ); } 
    88     void update( input_thread_t * ); 
     88    void update( QString ); 
    8989}; 
    9090 
  • modules/gui/qt4/input_manager.cpp

    r3d979f8 r32cdbfa  
    9797        emit statusChanged( END_S ); // see vlc_input.h, input_state_e enum 
    9898        delInput(); 
     99        emit artChanged( "" ); 
    99100        return; 
    100101    } 
     
    183184        i_old_playing_status = val.i_int; 
    184185        emit statusChanged( val.i_int == PAUSE_S ? PAUSE_S : PLAYING_S ); 
     186    } 
     187 
     188    QString url; 
     189    char *psz_art = input_item_GetArtURL( input_GetItem( p_input ) ); 
     190    url.sprintf("%s", psz_art ); 
     191    free( psz_art ); 
     192    if( artUrl != url ) 
     193    { 
     194        emit artChanged( url ); 
     195        artUrl = url; 
    185196    } 
    186197} 
  • modules/gui/qt4/input_manager.hpp

    rf651c3b r32cdbfa  
    4747    int             i_old_playing_status; 
    4848    QString         old_name; 
     49    QString         artUrl; 
    4950    int             i_rate; 
    5051public slots: 
     
    7778    /// Play/pause status 
    7879    void statusChanged( int ); 
     80    void artChanged( QString ); 
    7981}; 
    8082