diff options
author | Andrzej Rybczak <electricityispower@gmail.com> | 2009-02-14 17:38:39 +0100 |
---|---|---|
committer | Andrzej Rybczak <electricityispower@gmail.com> | 2009-02-14 17:38:39 +0100 |
commit | 5a06f2a4fc702e96914f5e128f1de7f8018d5b08 (patch) | |
tree | 54fbf497969a3687ecf8db5111bbec90092bbada /src/media_library.h | |
parent | 111652e2d6a019e775acac3b01a55c53fc647dba (diff) |
change namespace MediaLibrary into class
Diffstat (limited to 'src/media_library.h')
-rw-r--r-- | src/media_library.h | 46 |
1 files changed, 32 insertions, 14 deletions
diff --git a/src/media_library.h b/src/media_library.h index 6f49bd5e..254803ca 100644 --- a/src/media_library.h +++ b/src/media_library.h @@ -22,23 +22,41 @@ #define _H_MEDIA_LIBRARY #include "ncmpcpp.h" +#include "screen.h" -namespace MediaLibrary +class MediaLibrary : public Screen<Window> { - void Init(); - void Resize(); - void Refresh(); - void SwitchTo(); - void Update(); - - void EnterPressed(bool = 1); - inline void SpacePressed(); -} + public: + virtual void Init(); + virtual void SwitchTo(); + virtual void Resize(); + + virtual std::string Title(); + + virtual void Refresh(); + virtual void Update(); + + virtual void EnterPressed() { AddToPlaylist(1); } + virtual void SpacePressed() { AddToPlaylist(0); } + + void NextColumn(); + void PrevColumn(); + + Menu<std::string> *Artists; + Menu<string_pair> *Albums; + Menu<MPD::Song> *Songs; + + protected: + void AddToPlaylist(bool); + + static size_t itsLeftColWidth; + static size_t itsMiddleColWidth; + static size_t itsMiddleColStartX; + static size_t itsRightColWidth; + static size_t itsRightColStartX; +}; -void MediaLibrary::SpacePressed() -{ - EnterPressed(0); -} +extern MediaLibrary *myLibrary; #endif |