Changeset 32cdbfa32d03e0022874e3da3d6caa02ca9894b8
- 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
| r2833492 |
r32cdbfa |
|
| 118 | 118 | /********************************************************************** |
|---|
| 119 | 119 | * Background Widget. Show a simple image background. Currently, |
|---|
| 120 | | * it's a static cone. |
|---|
| | 120 | * it's album art if present or cone. |
|---|
| 121 | 121 | **********************************************************************/ |
|---|
| 122 | 122 | #define ICON_SIZE 128 |
|---|
| … | … | |
| 154 | 154 | backgroundLayout->setColumnStretch( 2, 1 ); |
|---|
| 155 | 155 | |
|---|
| 156 | | CONNECT( THEMIM, inputChanged( input_thread_t *), |
|---|
| 157 | | this, update( input_thread_t * ) ); |
|---|
| | 156 | CONNECT( THEMIM->getIM(), artChanged( QString ), this, update( QString ) ); |
|---|
| 158 | 157 | resize( 300, 150 ); |
|---|
| 159 | 158 | } |
|---|
| … | … | |
| 163 | 162 | } |
|---|
| 164 | 163 | |
|---|
| 165 | | void BackgroundWidget::update( input_thread_t *p_input ) |
|---|
| 166 | | { |
|---|
| 167 | | if( !p_input || p_input->b_dead ) |
|---|
| | 164 | void BackgroundWidget::update( QString url ) |
|---|
| | 165 | { |
|---|
| | 166 | if( url.isNull() ) |
|---|
| 168 | 167 | { |
|---|
| 169 | 168 | if( QDate::currentDate().dayOfYear() >= 354 ) |
|---|
| … | … | |
| 174 | 173 | } |
|---|
| 175 | 174 | |
|---|
| 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("" ) ); |
|---|
| 181 | 176 | if( arturl.isNull() ) |
|---|
| 182 | 177 | { |
|---|
| … | … | |
| 189 | 184 | { |
|---|
| 190 | 185 | 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 | } |
|---|
| 194 | 188 | } |
|---|
| 195 | 189 | |
|---|
| r2833492 |
r32cdbfa |
|
| 86 | 86 | public slots: |
|---|
| 87 | 87 | void toggle(){ TOGGLEV( this ); } |
|---|
| 88 | | void update( input_thread_t * ); |
|---|
| | 88 | void update( QString ); |
|---|
| 89 | 89 | }; |
|---|
| 90 | 90 | |
|---|
| r3d979f8 |
r32cdbfa |
|
| 97 | 97 | emit statusChanged( END_S ); // see vlc_input.h, input_state_e enum |
|---|
| 98 | 98 | delInput(); |
|---|
| | 99 | emit artChanged( "" ); |
|---|
| 99 | 100 | return; |
|---|
| 100 | 101 | } |
|---|
| … | … | |
| 183 | 184 | i_old_playing_status = val.i_int; |
|---|
| 184 | 185 | 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; |
|---|
| 185 | 196 | } |
|---|
| 186 | 197 | } |
|---|
| rf651c3b |
r32cdbfa |
|
| 47 | 47 | int i_old_playing_status; |
|---|
| 48 | 48 | QString old_name; |
|---|
| | 49 | QString artUrl; |
|---|
| 49 | 50 | int i_rate; |
|---|
| 50 | 51 | public slots: |
|---|
| … | … | |
| 77 | 78 | /// Play/pause status |
|---|
| 78 | 79 | void statusChanged( int ); |
|---|
| | 80 | void artChanged( QString ); |
|---|
| 79 | 81 | }; |
|---|
| 80 | 82 | |
|---|