// Player // // Douglas Thrift // // $Id$ #ifndef _Player_hpp_ #define _Player_hpp_ #include #ifdef MENES_PRAGMA_ONCE #pragma once #endif #include #include #include #include #include "BeepRemote.hpp" #include "MediaFile.hpp" #include "Share.hpp" class Player { private: enum State { STOPPED, PLAYING, PAUSED } state; BeepRemote remote; _R player_; mta::ReaderWriterLock playlistLock; _L playlist; api::ThreadMutex queueLock; std::queue queue; mta::ReaderWriterLock sharesLock; ext::RedBlackMap > > shares; bool running; _S adder, copier; int Adder(); int Copier(const ext::RedBlackMap > >& shares); public: Player(const _R& connection, int player); ~Player(); void Add(const _R& share); }; #endif//_Player_hpp_