Ticket #4077: queue.patch

File queue.patch, 2.2 KB (added by Paul Lambert <paul at planar.id.au>, 13 years ago)

patch to mythmusic

  • mythmusic/mythmusic/playbackbox.cpp

     
    628628                                  SLOT(byGenre()));
    629629        playlist_popup->addButton(tr("Tracks from current Year"), this,
    630630                                  SLOT(byYear()));
     631        playlist_popup->addButton(tr("Add playing to active play queue"), this,
     632                                  SLOT(addPlayingtoActive()));
     633        playlist_popup->addButton(tr("Add selected to active play queue"), this,
     634                                  SLOT(addSelectedtoActive()));
    631635    }
    632636   
    633637    playlist_popup->ShowPopup(this, SLOT(closePlaylistPopup()));
     
    750754    updatePlaylistFromQuickPlaylist(whereClause);
    751755}
    752756
     757void PlaybackBoxMusic::addPlayingtoActive()
     758// adds the currently playing track to the active play queue
     759{
     760    if (!playlist_popup || !curMeta)
     761        return;
     762
     763    QString value = formattedFieldValue(curMeta->ID());
     764    QString whereClause = "WHERE song_id = " + value;
     765    closePlaylistPopup();
     766    updatePlaylistFromQuickPlaylist(whereClause);
     767}
     768
     769void PlaybackBoxMusic::addSelectedtoActive()
     770// adds the currently selected track to the active play queue
     771{
     772    if (!playlist_popup || !curMeta)
     773        return;
     774
     775    GenericTree *node = music_tree_list->getCurrentNode();
     776    Metadata *selectedMeta = all_music->getMetadata( node->getInt() );
     777
     778    QString value = formattedFieldValue(selectedMeta->ID());
     779    QString whereClause = "WHERE song_id = " + value;
     780    closePlaylistPopup();
     781    updatePlaylistFromQuickPlaylist(whereClause);
     782}
     783
    753784void PlaybackBoxMusic::updatePlaylistFromQuickPlaylist(QString whereClause)
    754785{
    755786    doUpdatePlaylist(whereClause);
  • mythmusic/mythmusic/playbackbox.h

     
    8989    void byAlbum();
    9090    void byGenre();
    9191    void byYear();
     92    void addPlayingtoActive();
     93    void addSelectedtoActive();
    9294    void fromCD();
    9395    void showSmartPlaylistDialog();
    9496    void showSearchDialog();