provide generic interface for dealing with selected items
This commit is contained in:
@@ -81,7 +81,7 @@ void Playlist::EnterPressed()
|
||||
|
||||
void Playlist::SpacePressed()
|
||||
{
|
||||
Select(w);
|
||||
w->SelectCurrent();
|
||||
w->Scroll(wDown);
|
||||
}
|
||||
|
||||
@@ -90,6 +90,16 @@ MPD::Song *Playlist::CurrentSong()
|
||||
return !w->Empty() ? &w->Current() : 0;
|
||||
}
|
||||
|
||||
void Playlist::GetSelectedSongs(MPD::SongList &v)
|
||||
{
|
||||
vector<size_t> selected;
|
||||
w->GetSelected(selected);
|
||||
for (vector<size_t>::const_iterator it = selected.begin(); it != selected.end(); it++)
|
||||
{
|
||||
v.push_back(new MPD::Song(w->at(*it)));
|
||||
}
|
||||
}
|
||||
|
||||
std::string Playlist::TotalLength()
|
||||
{
|
||||
std::ostringstream result;
|
||||
|
||||
Reference in New Issue
Block a user