ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/DecentralizedMedia/Player.hpp
Revision: 549
Committed: 2005-07-04T21:28:02-07:00 (19 years, 11 months ago) by douglas
File size: 1116 byte(s)
Log Message:
WTF!

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 douglas 549 #include <menes/api/process.hpp>
17     #include <menes/api/threads.hpp>
18     #include <menes/mta/locks.hpp>
19 douglas 542
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 douglas 545 int position;
33 douglas 542 mta::ReaderWriterLock playlistLock;
34     _L<MediaFile> playlist;
35 douglas 544 mutable api::ThreadMutex queueLock;
36     mutable std::queue<api::Path> queue;
37     mutable mta::ReaderWriterLock sharesLock;
38 douglas 547 ext::RedBlackMap<api::Address, ext::RedBlackMap<cse::String, _R<Share> > > shares;
39 douglas 542 bool running;
40     _S<api::Thread> adder, copier;
41     int Adder();
42 douglas 544 int Copier() const;
43 douglas 546 void Change();
44 douglas 542 public:
45     Player(const _R<dbi::Connection>& connection, int player);
46     ~Player();
47 douglas 548 _finline int GetPosition() const { return position; }
48     _finline const _L<MediaFile>& GetPlaylist() const { return playlist; };
49 douglas 542 void Add(const _R<Share>& share);
50     };
51    
52     #endif//_Player_hpp_

Properties

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