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 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 iDVBChannel, public eDVBDemux, public Object
45 ePtr<eDVBFrontend> m_frontend;
46 ePtr<iDVBFrontendParameters> m_current_frontend_parameters;
47 eDVBChannelID m_channel_id;
48 Signal1<void,iDVBChannel*> m_stateChanged;
50 ePtr<eDVBResourceManager> m_mgr;
52 void frontendStateChanged(iDVBFrontend*fe);
53 ePtr<eConnection> m_conn_frontendStateChanged;
55 eDVBChannel(eDVBResourceManager *mgr, int adapter, int frontend, int demux);
56 virtual ~eDVBChannel();
58 /* only for managed channels */
59 RESULT setChannel(const eDVBChannelID &id);
61 RESULT connectStateChange(const Slot1<void,iDVBChannel*> &stateChange, ePtr<eConnection> &connection);
62 RESULT getState(int &state);
64 RESULT setCIRouting(const eDVBCIRouting &routing);
65 RESULT getDemux(ePtr<iDVBDemux> &demux);
66 RESULT getFrontend(ePtr<iDVBFrontend> &frontend);