VDR_ResponsePacket* vresp = RequestResponse(&vrp);
if (vresp->noResponse()) { delete vresp; return NULL; }
- //ChannelList* chanList = new ChannelList();
- std::shared_ptr<ChannelList> chanList = std::make_shared<ChannelList>();
+ // shared_ptr for a ChannelList (std::vector<Channel*>) with custom deleter to delete all the Channel* objects
+ std::shared_ptr<ChannelList> chanList(new ChannelList(),
+ [] (ChannelList* cl) { for (Channel* p : *cl) delete p; });
bool h264support=Video::getInstance()->supportsh264();
bool mpeg2support=Video::getInstance()->supportsmpeg2();
#include "i18n.h"
#include "control.h"
#include "tcp.h"
-#include "channel.h"
class RecInfo;
class Event;
-//class Channel;
+class Channel;
class VDR_RequestPacket;
class VDR_ResponsePacket;
#ifdef VOMP_MEDIAPLAYER
class TVMediaInfo;
typedef std::vector<Event*> EventList;
-//typedef std::vector<Channel*> ChannelList;
+typedef std::vector<Channel*> ChannelList;
typedef std::vector<RecTimer*> RecTimerList;
-// Subclass vector to add custom delete behaviour for the contents
-class ChannelList : public std::vector<Channel*>
-{
- public:
- ~ChannelList()
- {
- for (Channel* p : *this) delete p;
- }
-};
-
struct RecTimerSorter // : public binary_function<double, double, bool>
{
bool operator() (const RecTimer* a, const RecTimer* b)