mpd: redesign Item and adjust browser

This commit is contained in:
Andrzej Rybczak
2014-11-02 00:22:02 +01:00
parent 30d57afcac
commit 0457af36fe
19 changed files with 783 additions and 557 deletions

View File

@@ -63,31 +63,25 @@ struct Browser: Screen<NC::Menu<MPD::Item>>, Filterable, HasSongs, Searchable, T
virtual MPD::SongList getSelectedSongs() OVERRIDE;
// private members
const std::string &CurrentDir() { return itsBrowsedDir; }
void fetchSupportedExtensions();
bool isLocal() { return itsBrowseLocally; }
void LocateSong(const MPD::Song &);
void GetDirectory(std::string, std::string = "/");
# ifndef WIN32
void GetLocalDirectory(MPD::ItemList &, const std::string &, bool) const;
void ClearDirectory(const std::string &) const;
void ChangeBrowseMode();
bool deleteItem(const MPD::Item &, std::string &errmsg);
# endif // !WIN32
static bool isParentDirectory(const MPD::Item &item) {
return item.type == MPD::Item::Type::Directory && item.name == "..";
}
bool inRootDirectory();
bool isParentDirectory(const MPD::Item &item);
const std::string &currentDirectory();
bool isLocal() { return m_local_browser; }
void locateSong(const MPD::Song &s);
void getDirectory(std::string directory);
void changeBrowseMode();
void remove(const MPD::Item &item);
static void fetchSupportedExtensions();
protected:
virtual bool isLockable() OVERRIDE { return true; }
private:
bool itsBrowseLocally;
size_t itsScrollBeginning;
std::string itsBrowsedDir;
bool m_local_browser;
size_t m_scroll_beginning;
std::string m_current_directory;
};
extern Browser *myBrowser;