4 #include <lib/dvb/idvb.h>
5 #include <lib/dvb/demux.h>
6 #include <lib/dvb/frontend.h>
7 #include <connection.h>
11 class eDVBResourceManager: public virtual iDVBResourceManager
17 eSmartPtrList<eDVBFrontend> fe;
18 eSmartPtrList<eDVBDemux> demux;
20 std::multimap<eDVBChannelID,eDVBChannel*> m_active_channels;
21 ePtr<iDVBChannelList> m_list;
22 ePtr<iDVBSatelliteEquipmentControl> m_sec;
23 static eDVBResourceManager *instance;
25 eDVBResourceManager();
26 virtual ~eDVBResourceManager();
28 static RESULT getInstance(ePtr<eDVBResourceManager> &ptr) { if (instance) { ptr = instance; return 0; } return -1; }
30 RESULT setChannelList(iDVBChannelList *list);
31 RESULT getChannelList(ePtr<iDVBChannelList> &list);
33 RESULT allocateChannel(const eDVBChannelID &channelid, ePtr<iDVBChannel> &channel);
34 RESULT allocateRawChannel(ePtr<iDVBChannel> &channel);
35 RESULT allocatePVRChannel(int caps);
37 RESULT addChannel(const eDVBChannelID &chid, eDVBChannel *ch);
38 RESULT removeChannel(const eDVBChannelID &chid, eDVBChannel *ch);
41 class eDVBChannel: public virtual iDVBChannel, public virtual eDVBDemux, public Object
43 ePtr<eDVBFrontend> m_frontend;
44 ePtr<iDVBFrontendParameters> m_current_frontend_parameters;
45 eDVBChannelID m_channel_id;
46 Signal1<void,iDVBChannel*> m_stateChanged;
48 ePtr<eDVBResourceManager> m_mgr;
50 void frontendStateChanged(iDVBFrontend*fe);
51 ePtr<eConnection> m_conn_frontendStateChanged;
53 eDVBChannel(eDVBResourceManager *mgr, int adapter, int frontend, int demux);
54 virtual ~eDVBChannel();
56 /* only for managed channels */
57 RESULT setChannel(const eDVBChannelID &id);
59 RESULT connectStateChange(const Slot1<void,iDVBChannel*> &stateChange, ePtr<eConnection> &connection);
60 RESULT getState(int &state);
62 RESULT setCIRouting(const eDVBCIRouting &routing);
63 RESULT getDemux(ePtr<iDVBDemux> &demux);
64 RESULT getFrontend(ePtr<iDVBFrontend> &frontend);