ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/truck/DashInterface/MenuList.cpp
(Generate patch)

Comparing DashInterface/MenuList.cpp (file contents):
Revision 47 by douglas, 2008-03-07T03:08:31-08:00 vs.
Revision 49 by douglas, 2008-03-08T21:23:41-08:00

# Line 16 | Line 16 | MenuList::MenuItem::MenuItem(MenuList *l
16   {
17   }
18  
19 + MenuList::MusicItem::MusicItem(Audacious::Audacious &audacious, bool &append, MusicLibrary::Library &library) : audacious(audacious), append(append), library(library)
20 + {
21 + }
22 +
23   MenuList::MenuList(MenuList *parent, Display &display, size_t size) : parent(parent), display(display), cursor(0), list(size)
24   {
25   }
# Line 35 | Line 39 | MenuList::~MenuList()
39  
40   MenuList *MenuList::Enter()
41   {
42 <        return list[state.item]->Select();
42 >        return Select(list[state.item]);
43   }
44  
45   MenuList *MenuList::Right()
# Line 43 | Line 47 | MenuList *MenuList::Right()
47          MenuItem *item(list[state.item]);
48  
49          if (dynamic_cast<SubItem *>(item))
50 <                return item->Select();
50 >                return Select(item);
51  
52          return this;
53   }
# Line 94 | Line 98 | void MenuList::Render()
98                          }
99                          else
100                                  display.Set(1, _index, std::string(19, ' '));
101 +
102 +                previous = this;
103          }
104          else
105                  _forall (size_t, index, state.top, size < state.bottom ? size : state.bottom)
# Line 176 | Line 182 | TopList::ShuffleItem::operator bool() co
182          return audacious.IsRunning() ? audacious.IsShuffle() : false;
183   }
184  
185 < TopList::MusicItem::MusicItem(MenuList *list, Audacious::Audacious &audacious, bool &append, MusicLibrary::Library &library) : MenuItem(list), audacious(audacious), append(append), library(library)
185 > TopList::MusicItem::MusicItem(MenuList *list, Audacious::Audacious &audacious, bool &append, MusicLibrary::Library &library) : MenuItem(list), MenuList::MusicItem(audacious, append, library)
186   {
187   }
188  
# Line 203 | Line 209 | ArtistList::ArtistList(MenuList *parent,
209          list[0] = new AllItem(this, audacious, append, library);
210   }
211  
212 < ArtistList::AllItem::AllItem(MenuList *list, Audacious::Audacious &audacious, bool &append, MusicLibrary::Library &library) : MenuItem(list), audacious(audacious), append(append), library(library)
212 > ArtistList::AllItem::AllItem(MenuList *list, Audacious::Audacious &audacious, bool &append, MusicLibrary::Library &library) : MenuItem(list), MusicItem(audacious, append, library)
213   {
214   }
215  
216   MenuList *ArtistList::AllItem::Select()
217   {
218 <        std::cerr << _B("All Artists!") << std::endl;
218 >        _L<std::string> songs;
219  
220 <        return list;
220 >        _foreach (const _L<MusicLibrary::Song>, song, library.GetSongs())
221 >                songs.push_back(song->GetPath());
222 >
223 >        if (audacious.IsRunning())
224 >                audacious.Playlist(songs, append);
225 >
226 >        return NULL;
227   }
228  
229   ArtistList::AllItem::operator std::string() const

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines