Ticket #2685: albumart.diff
File albumart.diff, 4.8 KB (added by , 17 years ago) |
---|
-
mythmusic/mythmusic/playbackbox.cpp
86 86 showrating = gContext->GetNumSetting("MusicShowRatings", 0); 87 87 listAsShuffled = gContext->GetNumSetting("ListAsShuffled", 0); 88 88 cycle_visualizer = gContext->GetNumSetting("VisualCycleOnSongChange", 0); 89 show_album_art = gContext->GetNumSetting("AlbumArtOnSongChange", 0); 89 90 90 91 // Through the magic of themes, our "GUI" already exists we just need to 91 92 // wire up it … … 1157 1158 return; 1158 1159 1159 1160 banner_timer->start(8000); 1161 if (show_album_art) 1162 mainvisual->forceVisual("AlbumArt"); 1160 1163 mainvisual->addInformation("\"" + mdata->Title() + "\"\n" + 1161 1164 mdata->Artist() + " - " + mdata->Album()); 1162 1165 } … … 1173 1176 { 1174 1177 banner_timer->stop(); 1175 1178 mainvisual->addInformation(""); 1179 if (show_album_art) 1180 mainvisual->unforceVisual(); 1176 1181 } 1177 1182 1178 1183 void PlaybackBoxMusic::CycleVisualizer() -
mythmusic/mythmusic/mainvisual.h
79 79 void setVis( VisualBase *newvis ); 80 80 void setVisual( const QString &visualname ); 81 81 82 void forceVisual ( const QString &visualname ); 83 void unforceVisual(); 84 82 85 QString getCurrentVisual() const; 83 86 QString getCurrentVisualDesc() const; 84 87 int numVisualizers() const; … … 120 123 121 124 QString current_visual_name; 122 125 QStringList allowed_modes; 126 127 QString next_visual; 128 bool visual_forced; 123 129 }; 124 130 125 131 class InfoWidget : public QWidget -
mythmusic/mythmusic/globalsettings.cpp
356 356 return gc; 357 357 }; 358 358 359 static HostCheckBox *AlbumArtOnSongChange() 360 { 361 HostCheckBox *gc = new HostCheckBox("AlbumArtOnSongChange"); 362 gc->setLabel(QObject::tr("Show album art at start of each song")); 363 gc->setValue(false); 364 gc->setHelpText(QObject::tr("Show the album art when the song " 365 "change.")); 366 return gc; 367 }; 368 359 369 static HostSpinBox *VisualScaleWidth() 360 370 { 361 371 HostSpinBox *gc = new HostSpinBox("VisualScaleWidth", 1, 2, 1); … … 566 576 playersettings2->setLabel(QObject::tr("Visualization Settings")); 567 577 playersettings2->addChild(VisualizationMode()); 568 578 playersettings2->addChild(VisualCycleOnSongChange()); 579 playersettings2->addChild(AlbumArtOnSongChange()); 569 580 playersettings2->addChild(VisualModeDelay()); 570 581 playersettings2->addChild(VisualScaleWidth()); 571 582 playersettings2->addChild(VisualScaleHeight()); -
mythmusic/mythmusic/playbackbox.h
179 179 GenericTree *playlist_tree; 180 180 181 181 bool cycle_visualizer; 182 bool show_album_art; 182 183 bool show_whole_tree; 183 184 bool keyboard_accelerators; 184 185 bool volume_control; -
mythmusic/mythmusic/mainvisual.cpp
104 104 MainVisual::MainVisual(QWidget *parent, const char *name) 105 105 : QWidget( parent, name ), vis( 0 ), playing( FALSE ), fps( 20 ) 106 106 { 107 visual_forced = false; 108 107 109 int screenwidth = 0, screenheight = 0; 108 110 float wmult = 0, hmult = 0; 109 111 … … 137 139 nodes.clear(); 138 140 } 139 141 142 void MainVisual::forceVisual( const QString &visualname ) 143 { 144 if (visual_forced) 145 return; 146 next_visual = getCurrentVisual(); 147 setVisual(visualname); 148 visual_forced = true; 149 } 150 151 void MainVisual::unforceVisual(void) 152 { 153 if (!visual_forced) 154 return; 155 visual_forced = false; 156 setVisual(next_visual); 157 } 158 140 159 void MainVisual::setVisual( const QString &visualname ) 141 160 { 161 if (visual_forced) 162 { 163 next_visual = visualname; 164 return; 165 } 166 142 167 VisualBase *newvis = 0; 143 168 144 169 allowed_modes = QStringList::split(",", visualname); … … 214 239 215 240 QString MainVisual::getCurrentVisual(void) const 216 241 { 242 if (visual_forced) 243 return next_visual; 244 //else 217 245 return current_visual_name; 218 246 } 219 247 … … 221 249 { 222 250 /* XXX This should be changed to a real call to visual->description() 223 251 * it works as long as ::name and ::desc uses the same string */ 252 if (visual_forced) 253 return next_visual; 254 //else 224 255 return QObject::tr(current_visual_name); 225 256 } 226 257