1 |
// Decentralized Media |
2 |
// |
3 |
// Douglas Thrift |
4 |
// |
5 |
// $Id$ |
6 |
|
7 |
#ifndef _DecentralizedMedia_hpp_ |
8 |
#define _DecentralizedMedia_hpp_ |
9 |
|
10 |
#include <menes/platform.hpp> |
11 |
|
12 |
#ifdef MENES_PRAGMA_ONCE |
13 |
#pragma once |
14 |
#endif |
15 |
|
16 |
#include <menes-api/process.hpp> |
17 |
#include <menes-waf/server.hpp> |
18 |
|
19 |
#include "BeepRemote.hpp" |
20 |
#include "MediaFolder.hpp" |
21 |
|
22 |
class DecentralizedMedia : public waf::Server |
23 |
{ |
24 |
public: |
25 |
BeepRemote bmp; |
26 |
private: |
27 |
_H<api::Thread> block; |
28 |
_H<api::Process> process; |
29 |
mutable _H<dbi::Connection> connection; |
30 |
const ext::RedBlackSet<ext::String>& extensions/*, shares*/; |
31 |
int Destroy() { return process->Join(); } |
32 |
protected: |
33 |
virtual void Process(const net::Http::Request& request, net::Http::Response& response); |
34 |
public: |
35 |
DecentralizedMedia(const ext::RedBlackSet<ext::String>& extensions, const ext::RedBlackSet<ext::String>& locals); |
36 |
virtual ~DecentralizedMedia(); |
37 |
_L<ext::String> GetArtists() const; |
38 |
_L<ext::String> GetTitles() const; |
39 |
_L<ext::String> GetAlbums() const; |
40 |
_L<ext::String> GetGenres() const; |
41 |
_L<MediaFolder> GetFolders() const; |
42 |
}; |
43 |
|
44 |
#endif//_DecentralizedMedia_hpp_ |