Ticket #2685: albumart.diff

File albumart.diff, 4.8 KB (added by dave@…, 14 years ago)
  • mythmusic/mythmusic/playbackbox.cpp

     
    8686    showrating = gContext->GetNumSetting("MusicShowRatings", 0);
    8787    listAsShuffled = gContext->GetNumSetting("ListAsShuffled", 0);
    8888    cycle_visualizer = gContext->GetNumSetting("VisualCycleOnSongChange", 0);
     89    show_album_art = gContext->GetNumSetting("AlbumArtOnSongChange", 0);
    8990
    9091    // Through the magic of themes, our "GUI" already exists we just need to
    9192    // wire up it
     
    11571158        return;
    11581159   
    11591160    banner_timer->start(8000);
     1161    if (show_album_art)
     1162        mainvisual->forceVisual("AlbumArt");
    11601163    mainvisual->addInformation("\"" + mdata->Title() + "\"\n" +
    11611164                               mdata->Artist() + " - " + mdata->Album());
    11621165}
     
    11731176{
    11741177    banner_timer->stop();
    11751178    mainvisual->addInformation("");
     1179    if (show_album_art)
     1180        mainvisual->unforceVisual();
    11761181}
    11771182
    11781183void PlaybackBoxMusic::CycleVisualizer()
  • mythmusic/mythmusic/mainvisual.h

     
    7979    void setVis( VisualBase *newvis );
    8080    void setVisual( const QString &visualname );
    8181
     82    void forceVisual ( const QString &visualname );
     83    void unforceVisual();
     84
    8285    QString getCurrentVisual() const;
    8386    QString getCurrentVisualDesc() const;
    8487    int numVisualizers() const;
     
    120123
    121124    QString current_visual_name;
    122125    QStringList allowed_modes;
     126
     127    QString next_visual;
     128    bool visual_forced;
    123129};
    124130
    125131class InfoWidget : public QWidget
  • mythmusic/mythmusic/globalsettings.cpp

     
    356356    return gc;
    357357};
    358358
     359static 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
    359369static HostSpinBox *VisualScaleWidth()
    360370{
    361371    HostSpinBox *gc = new HostSpinBox("VisualScaleWidth", 1, 2, 1);
     
    566576    playersettings2->setLabel(QObject::tr("Visualization Settings"));
    567577    playersettings2->addChild(VisualizationMode());
    568578    playersettings2->addChild(VisualCycleOnSongChange());
     579    playersettings2->addChild(AlbumArtOnSongChange());
    569580    playersettings2->addChild(VisualModeDelay());
    570581    playersettings2->addChild(VisualScaleWidth());
    571582    playersettings2->addChild(VisualScaleHeight());
  • mythmusic/mythmusic/playbackbox.h

     
    179179    GenericTree *playlist_tree;
    180180   
    181181    bool cycle_visualizer;
     182    bool show_album_art;
    182183    bool show_whole_tree;
    183184    bool keyboard_accelerators;
    184185    bool volume_control;
  • mythmusic/mythmusic/mainvisual.cpp

     
    104104MainVisual::MainVisual(QWidget *parent, const char *name)
    105105    : QWidget( parent, name ), vis( 0 ), playing( FALSE ), fps( 20 )
    106106{
     107    visual_forced = false;
     108
    107109    int screenwidth = 0, screenheight = 0;
    108110    float wmult = 0, hmult = 0;
    109111   
     
    137139    nodes.clear();
    138140}
    139141
     142void 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
     151void MainVisual::unforceVisual(void)
     152{
     153    if (!visual_forced)
     154        return;
     155    visual_forced = false;
     156    setVisual(next_visual);
     157}
     158
    140159void MainVisual::setVisual( const QString &visualname )
    141160{
     161    if (visual_forced)
     162    {
     163        next_visual = visualname;
     164        return;
     165    }
     166
    142167    VisualBase *newvis = 0;
    143168
    144169    allowed_modes = QStringList::split(",", visualname);
     
    214239
    215240QString MainVisual::getCurrentVisual(void) const
    216241{
     242    if (visual_forced)
     243        return next_visual;
     244    //else
    217245    return current_visual_name;
    218246}
    219247
     
    221249{
    222250    /* XXX This should be changed to a real call to visual->description()
    223251     * it works as long as ::name and ::desc uses the same string */
     252    if (visual_forced)
     253        return next_visual;
     254    //else
    224255    return QObject::tr(current_visual_name);
    225256}
    226257