Ticket #4077: queue3.patch
| File queue3.patch, 3.3 KB (added by , 18 years ago) |
|---|
-
mythmusic/mythmusic/playbackbox.cpp
464 464 else if (keyboard_accelerators) 465 465 { 466 466 for (unsigned int i = 0; i < actions.size() && !handled; i++) 467 { 467 { 468 468 QString action = actions[i]; 469 469 handled = true; 470 470 … … 627 627 playlist_popup->addButton(tr("Tracks from current Genre"), this, 628 628 SLOT(byGenre())); 629 629 playlist_popup->addButton(tr("Tracks from current Year"), this, 630 SLOT(byYear())); 630 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())); 631 635 } 632 636 633 637 playlist_popup->ShowPopup(this, SLOT(closePlaylistPopup())); … … 750 754 updatePlaylistFromQuickPlaylist(whereClause); 751 755 } 752 756 757 void 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 769 void PlaybackBoxMusic::addSelectedtoActive() 770 // adds the currently selected track to the active play queue 771 // stores the currently selected track and reselects it afterwards 772 { 773 if (!playlist_popup || !curMeta) 774 return; 775 776 // store path to current selection 777 QStringList branches_to_current_node; 778 branches_to_current_node = music_tree_list->getRouteToCurrent(); 779 780 GenericTree *node = music_tree_list->getCurrentNode(); 781 Metadata *selectedMeta = all_music->getMetadata( node->getInt() ); 782 783 QString value = formattedFieldValue(selectedMeta->ID()); 784 QString whereClause = "WHERE song_id = " + value; 785 closePlaylistPopup(); 786 updatePlaylistFromQuickPlaylist(whereClause); 787 788 music_tree_list->tryToSetCurrent(branches_to_current_node); 789 } 790 753 791 void PlaybackBoxMusic::updatePlaylistFromQuickPlaylist(QString whereClause) 754 792 { 755 793 doUpdatePlaylist(whereClause); … … 1817 1855 playlist_tree->setAttribute(1, 0); 1818 1856 playlist_tree->setAttribute(2, 0); 1819 1857 playlist_tree->setAttribute(3, 0); 1858 playlist_tree->setAttribute(4, 0); 1820 1859 1821 1860 // We ask the playlist object to write out the whole tree (all playlists 1822 1861 // and all music). It will set attributes for nodes in the tree, such as -
mythmusic/mythmusic/playbackbox.h
89 89 void byAlbum(); 90 90 void byGenre(); 91 91 void byYear(); 92 void addPlayingtoActive(); 93 void addSelectedtoActive(); 92 94 void fromCD(); 93 95 void showSmartPlaylistDialog(); 94 96 void showSearchDialog();
