Ticket #3676: mythmusic-albumart.patch
File mythmusic-albumart.patch, 2.7 KB (added by , 17 years ago) |
---|
-
mythmusic/mythmusic/playbackbox.cpp
old new void PlaybackBoxMusic::wipeTrackInfo() 2027 2092 ratings_image->setRepeat(0); 2028 2093 if (current_visualization_text) 2029 2094 current_visualization_text->SetText(""); 2095 2096 if (albumart_image) 2097 WipeAlbumArt(); 2030 2098 } 2031 2099 2032 2100 void PlaybackBoxMusic::updateTrackInfo(Metadata *mdata) … … void PlaybackBoxMusic::updateTrackInfo(M 2037 2105 artist_text->SetText(mdata->FormatArtist()); 2038 2106 if (album_text) 2039 2107 album_text->SetText(mdata->Album()); 2108 if (albumart_image) 2109 ShowAlbumArtImage(mdata); 2040 2110 2041 2111 setTrackOnLCD(mdata); 2042 2112 } 2043 2113 2114 void PlaybackBoxMusic::ShowAlbumArtImage(Metadata *mdata) 2115 { 2116 QSize img_size = albumart_image->GetSize(true); 2117 2118 QImage albumArt = mdata->getAlbumArt(IT_FRONTCOVER); 2119 2120 if (!albumart_image) 2121 return; 2122 2123 if (!albumArt.isNull()) 2124 { 2125 // draw the albumArt image 2126 albumArt = albumArt.smoothScale(img_size.width(), img_size.height(), QImage::ScaleMin); 2127 2128 QPixmap img(img_size.width(), img_size.height()); 2129 2130 albumart_image->hide(); 2131 2132 if (img.convertFromImage(albumArt)) 2133 { 2134 albumart_image->SetImage(img); 2135 albumart_image->show(); 2136 } 2137 // else 2138 // albumart_image->hide(); 2139 } 2140 else 2141 albumart_image->hide(); 2142 } 2143 2144 void PlaybackBoxMusic::WipeAlbumArt() 2145 { 2146 if (albumart_image) 2147 albumart_image->hide(); 2148 } 2149 2044 2150 void PlaybackBoxMusic::openOutputDevice(void) 2045 2151 { 2046 2152 QString adevice; … … void PlaybackBoxMusic::wireUpTheme() 2205 2317 volume_status->SetTotal(100); 2206 2318 volume_status->SetOrder(-1); 2207 2319 } 2320 2208 2321 visual_blackhole = getUIBlackHoleType("visual_blackhole"); 2209 2322 2323 albumart_image = getUIImageType("albumart"); 2324 if (albumart_image) 2325 albumart_image->hide(); 2326 2210 2327 // Buttons 2211 2328 prev_button = getUIPushButtonType("prev_button"); 2212 2329 if (prev_button) -
./mythmusic/mythmusic/playbackbox.h
old new class PlaybackBoxMusic : public MythThem 76 76 void toggleFullBlankVisualizer(); 77 77 void end(); 78 78 void resetScrollCount(); 79 void ShowAlbumArtImage(Metadata *mdata); 80 void WipeAlbumArt(); 79 81 80 82 void handlePush(QString buttonname); 81 83 … … class PlaybackBoxMusic : public MythThem 234 236 235 237 UIPushButtonType *m_pushedButton; 236 238 239 UIImageType *albumart_image; 240 237 241 UITextButtonType *shuffle_button; 238 242 UITextButtonType *repeat_button; 239 243 UITextButtonType *pledit_button;