ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/DecentralizedMedia/Player.hpp
Revision: 542
Committed: 2005-07-03T00:31:07-07:00 (19 years, 11 months ago) by douglas
File size: 1031 byte(s)
Log Message:
Grr!

File Contents

# User Rev Content
1 douglas 542 // Player
2     //
3     // Douglas Thrift
4     //
5     // $Id$
6    
7     #ifndef _Player_hpp_
8     #define _Player_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-api/threads.hpp>
18     #include <menes-mta/locks.hpp>
19    
20     #include <queue>
21    
22     #include "BeepRemote.hpp"
23     #include "MediaFile.hpp"
24     #include "Share.hpp"
25    
26     class Player
27     {
28     private:
29     enum State { STOPPED, PLAYING, PAUSED } state;
30     BeepRemote remote;
31     _R<api::Process> player_;
32     mta::ReaderWriterLock playlistLock;
33     _L<MediaFile> playlist;
34     api::ThreadMutex queueLock;
35     std::queue<api::Path> queue;
36     mta::ReaderWriterLock sharesLock;
37     ext::RedBlackMap<api::InternetAddress, ext::RedBlackMap<cse::String, _R<Share> > > shares;
38     bool running;
39     _S<api::Thread> adder, copier;
40     int Adder();
41     int Copier(const ext::RedBlackMap<api::InternetAddress, ext::RedBlackMap<cse::String, _R<Share> > >& shares);
42     public:
43     Player(const _R<dbi::Connection>& connection, int player);
44     ~Player();
45     void Add(const _R<Share>& share);
46     };
47    
48     #endif//_Player_hpp_

Properties

Name Value
svn:eol-style native
svn:keywords Id