Ticket #4617: mythmusic-current-title.patch

File mythmusic-current-title.patch, 1.6 KB (added by otto at kolsi dot fi, 13 years ago)
  • mythmusic/mythmusic/playbackbox.cpp

     
    608608                                  SLOT(byGenre()));
    609609        playlist_popup->addButton(tr("Tracks from current Year"), this,
    610610                                  SLOT(byYear()));
     611        playlist_popup->addButton(tr("Tracks with same Title"), this,
     612                                  SLOT(byTitle()));
    611613    }
    612614   
    613615    playlist_popup->ShowPopup(this, SLOT(closePlaylistPopup()));
     
    733735    updatePlaylistFromQuickPlaylist(whereClause);
    734736}
    735737
     738void PlaybackBoxMusic::byTitle()
     739{
     740   if (!playlist_popup || !curMeta)
     741        return;
     742
     743    QString value = formattedFieldValue(curMeta->Title().utf8());
     744    QString whereClause = "WHERE music_songs.name = " + value +
     745                          " ORDER BY music_artists.artist_name, album_name, track";
     746    closePlaylistPopup();
     747    updatePlaylistFromQuickPlaylist(whereClause);
     748}
     749
    736750void PlaybackBoxMusic::updatePlaylistFromQuickPlaylist(QString whereClause)
    737751{
    738752    doUpdatePlaylist(whereClause);
  • mythmusic/mythmusic/playbackbox.h

     
    9393    void byAlbum();
    9494    void byGenre();
    9595    void byYear();
     96    void byTitle();
    9697    void fromCD();
    9798    void showSmartPlaylistDialog();
    9899    void showSearchDialog();