return eEPGCache::getInstance()->lookupEventTime(ref, start_time, ptr);
}
-int eDVBService::isPlayable(const eServiceReference &ref, const eServiceReference &ignore)
+int eDVBService::isPlayable(const eServiceReference &ref, const eServiceReference &ignore, bool simulate)
{
ePtr<eDVBResourceManager> res_mgr;
if ( eDVBResourceManager::getInstance( res_mgr ) )
eDVBChannelID chid, chid_ignore;
((const eServiceReferenceDVB&)ref).getChannelID(chid);
((const eServiceReferenceDVB&)ignore).getChannelID(chid_ignore);
- return res_mgr->canAllocateChannel(chid, chid_ignore);
+ return res_mgr->canAllocateChannel(chid, chid_ignore, simulate);
}
return 0;
}
return 0;
}
-int eDVBResourceManager::canAllocateFrontend(ePtr<iDVBFrontendParameters> &feparm)
+int eDVBResourceManager::canAllocateFrontend(ePtr<iDVBFrontendParameters> &feparm, bool simulate)
{
+ eSmartPtrList<eDVBRegisteredFrontend> &frontends = simulate ? m_simulate_frontend : m_frontend;
ePtr<eDVBRegisteredFrontend> best;
int bestval = 0;
- for (eSmartPtrList<eDVBRegisteredFrontend>::iterator i(m_frontend.begin()); i != m_frontend.end(); ++i)
+ for (eSmartPtrList<eDVBRegisteredFrontend>::iterator i(frontends.begin()); i != frontends.end(); ++i)
if (!i->m_inuse)
{
int c = i->m_frontend->isCompatibleWith(feparm);
return 0;
}
-int eDVBResourceManager::canAllocateChannel(const eDVBChannelID &channelid, const eDVBChannelID& ignore)
+int eDVBResourceManager::canAllocateChannel(const eDVBChannelID &channelid, const eDVBChannelID& ignore, bool simulate)
{
+ std::list<active_channel> &active_channels = simulate ? m_active_simulate_channels : m_active_channels;
int ret=0;
- if (m_cached_channel)
+ if (!simulate && m_cached_channel)
{
eDVBChannel *cache_chan = (eDVBChannel*)&(*m_cached_channel);
if(channelid==cache_chan->getChannelID())
/* first, check if a channel is already existing. */
// eDebug("allocate channel.. %04x:%04x", channelid.transport_stream_id.get(), channelid.original_network_id.get());
- for (std::list<active_channel>::iterator i(m_active_channels.begin()); i != m_active_channels.end(); ++i)
+ for (std::list<active_channel>::iterator i(active_channels.begin()); i != active_channels.end(); ++i)
{
// eDebug("available channel.. %04x:%04x", i->m_channel_id.transport_stream_id.get(), i->m_channel_id.original_network_id.get());
if (i->m_channel_id == channelid)
int *decremented_cached_channel_fe_usecount=NULL,
*decremented_fe_usecount=NULL;
- for (std::list<active_channel>::iterator i(m_active_channels.begin()); i != m_active_channels.end(); ++i)
+ for (std::list<active_channel>::iterator i(active_channels.begin()); i != active_channels.end(); ++i)
{
+ eSmartPtrList<eDVBRegisteredFrontend> &frontends = simulate ? m_simulate_frontend : m_frontend;
// eDebug("available channel.. %04x:%04x", i->m_channel_id.transport_stream_id.get(), i->m_channel_id.original_network_id.get());
if (i->m_channel_id == ignore)
{
ePtr<iDVBFrontend> fe;
if (!i->m_channel->getFrontend(fe))
{
- for (eSmartPtrList<eDVBRegisteredFrontend>::iterator ii(m_frontend.begin()); ii != m_frontend.end(); ++ii)
+ for (eSmartPtrList<eDVBRegisteredFrontend>::iterator ii(frontends.begin()); ii != frontends.end(); ++ii)
{
if ( &(*fe) == &(*ii->m_frontend) )
{
ePtr<iDVBFrontend> fe;
if (!channel->getFrontend(fe))
{
- for (eSmartPtrList<eDVBRegisteredFrontend>::iterator ii(m_frontend.begin()); ii != m_frontend.end(); ++ii)
+ eSmartPtrList<eDVBRegisteredFrontend> &frontends = simulate ? m_simulate_frontend : m_frontend;
+ for (eSmartPtrList<eDVBRegisteredFrontend>::iterator ii(frontends.begin()); ii != frontends.end(); ++ii)
{
if ( &(*fe) == &(*ii->m_frontend) )
{
goto error;
}
- ret = canAllocateFrontend(feparm);
+ ret = canAllocateFrontend(feparm, simulate);
error:
if (decremented_fe_usecount)
};
RESULT connectChannelAdded(const Slot1<void,eDVBChannel*> &channelAdded, ePtr<eConnection> &connection);
- int canAllocateChannel(const eDVBChannelID &channelid, const eDVBChannelID &ignore);
+ int canAllocateChannel(const eDVBChannelID &channelid, const eDVBChannelID &ignore, bool simulate=false);
/* allocate channel... */
RESULT allocateChannel(const eDVBChannelID &channelid, eUsePtr<iDVBChannel> &channel, bool simulate=false);
#ifdef SWIG
public:
#endif
- int canAllocateFrontend(ePtr<iDVBFrontendParameters> &feparm);
+ int canAllocateFrontend(ePtr<iDVBFrontendParameters> &feparm, bool simulate=false);
bool canMeasureFrontendInputPower();
PSignal1<void,int> frontendUseMaskChanged;
SWIG_VOID(RESULT) allocateRawChannel(eUsePtr<iDVBChannel> &SWIG_OUTPUT, int slot_index);
// iStaticServiceInformation
RESULT getName(const eServiceReference &ref, std::string &name);
RESULT getEvent(const eServiceReference &ref, ePtr<eServiceEvent> &ptr, time_t start_time);
- int isPlayable(const eServiceReference &ref, const eServiceReference &ignore);
+ int isPlayable(const eServiceReference &ref, const eServiceReference &ignore, bool simulate=false);
PyObject *getInfoObject(const eServiceReference &ref, int); // implemented in lib/service/servicedvb.h
/* for filtering: */
/* needed for service groups */
-PyObject *getBestPlayableServiceReference(const eServiceReference &bouquet_ref, const eServiceReference &ignore);
+PyObject *getBestPlayableServiceReference(const eServiceReference &bouquet_ref, const eServiceReference &ignore, bool simulate=false);
%{
-PyObject *getBestPlayableServiceReference(const eServiceReference &bouquet_ref, const eServiceReference &ignore)
+PyObject *getBestPlayableServiceReference(const eServiceReference &bouquet_ref, const eServiceReference &ignore, bool simulate=false)
{
eStaticServiceDVBBouquetInformation info;
if (info.isPlayable(bouquet_ref, ignore))
virtual int getLength(const eServiceReference &ref);
virtual SWIG_VOID(RESULT) getEvent(const eServiceReference &ref, ePtr<eServiceEvent> &SWIG_OUTPUT, time_t start_time=-1);
// returns true when not implemented
- virtual int isPlayable(const eServiceReference &ref, const eServiceReference &ignore);
+ virtual int isPlayable(const eServiceReference &ref, const eServiceReference &ignore, bool simulate=false);
virtual int getInfo(const eServiceReference &ref, int w);
virtual std::string getInfoString(const eServiceReference &ref,int w);
return -1;
}
-int iStaticServiceInformation::isPlayable(const eServiceReference &ref, const eServiceReference &ignore)
+int iStaticServiceInformation::isPlayable(const eServiceReference &ref, const eServiceReference &ignore, bool simulate)
{
return 0;
}
return -1;
}
-int eStaticServiceDVBBouquetInformation::isPlayable(const eServiceReference &ref, const eServiceReference &ignore)
+int eStaticServiceDVBBouquetInformation::isPlayable(const eServiceReference &ref, const eServiceReference &ignore, bool simulate)
{
if (ref.flags & eServiceReference::isGroup)
{
{ 2, 1, 3 } // -T -S -C
};
((const eServiceReferenceDVB&)*it).getChannelID(chid);
- int tmp=res->canAllocateChannel(chid, chid_ignore);
+ int tmp=res->canAllocateChannel(chid, chid_ignore, simulate);
switch(tmp)
{
case 0:
eServiceReference &getPlayableService() { return m_playable_service; }
RESULT getName(const eServiceReference &ref, std::string &name);
int getLength(const eServiceReference &ref);
- int isPlayable(const eServiceReference &ref, const eServiceReference &ignore);
+ int isPlayable(const eServiceReference &ref, const eServiceReference &ignore, bool simulate=false);
RESULT getEvent(const eServiceReference &ref, ePtr<eServiceEvent> &ptr, time_t start_time);
};