#ifndef MUSIC_H #define MUSIC_H #include "http.h" #include "http_connection.h" #include #include #include namespace fs = boost::filesystem; class MusicListing { public: typedef boost::shared_ptr p; fs::path path; virtual void render(HTTP::Connection::p req, HTTPResponse& res) = 0; }; class MusicTrack : public MusicListing { public: MusicTrack(const fs::path path); virtual void render(HTTP::Connection::p req, HTTPResponse& res); }; class MusicDirectory : public MusicListing { public: typedef boost::shared_ptr p; typedef std::vector PathListings; PathListings directories; PathListings tracks; MusicDirectory(const fs::path root); virtual void render(HTTP::Connection::p req, HTTPResponse& res); }; namespace music { extern fs::path root_directory; void init(std::string root); MusicListing::p get(const std::vector& path); MusicListing::p get(const std::string& path); MusicDirectory::p get_directory(const std::string& path); std::vector find_artist(const std::string artist); }; #endif