svvitch
digital signage player
D:/vs_workspace/switch_sf/src/svvitch/PlayList.h
Go to the documentation of this file.
00001 #pragma once
00002 
00003 #include <vector>
00004 #include <Poco/Logger.h>
00005 #include "PlayListItem.h"
00006 
00007 using std::string;
00008 using std::vector;
00009 
00010 
00015 class PlayList
00016 {
00017 friend class Workspace;
00018 private:
00019     Poco::Logger& _log;
00020 
00021     string _id;
00022     string _name;
00023     string _text;
00024     vector<PlayListItemPtr> _items;
00025 
00026     void add(const PlayListItemPtr media) {
00027         _items.push_back(media);
00028     }
00029 
00030 public:
00031     PlayList(const string id, const string name, const string text = ""): _log(Poco::Logger::get("")), _id(id), _name(name), _text(text) {
00032     }
00033 
00034     ‾PlayList() {
00035         for (vector<PlayListItemPtr>::iterator it = _items.begin(); it != _items.end(); it++) SAFE_DELETE(*it);
00036         _items.clear();
00037 //      _log.information(Poco::format("delete PlayList: %s", _name));
00038     }
00039 
00040     const string& id() const {
00041         return _id;
00042     }
00043 
00044     const string& name() const {
00045         return _name;
00046     }
00047 
00048     const string& text() const {
00049         return _text;
00050     }
00051 
00052     void text(const string text) {
00053         _text = text;
00054     }
00055 
00056     const int itemCount() const {
00057         return _items.size();
00058     }
00059 
00060     const vector<PlayListItemPtr>& items() const {
00061         return _items;
00062     }
00063 };
00064 
00065 typedef PlayList* PlayListPtr;
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines