mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-26 15:02:56 +02:00
getservices: add FindChannelFuzzy() function
Add a function that returns a channel if tsid, onid, sid and satellite position matches and the frequency matches +-2MHz. (This frequency tolerance allows ubouquets to be used after updates to satellites.xml)
This commit is contained in:
committed by
micha-bbg
parent
1320462626
commit
536484f698
@@ -128,6 +128,8 @@ class CServiceManager
|
||||
CZapitChannel* FindChannelByName(std::string name);
|
||||
CZapitChannel* FindCurrentChannel(const t_channel_id channel_id);
|
||||
CZapitChannel* FindChannel48(const t_channel_id channel_id);
|
||||
CZapitChannel* FindChannelFuzzy(const t_channel_id channel_id,
|
||||
const t_satellite_position pos, const freq_id_t freq);
|
||||
|
||||
std::string GetServiceName(t_channel_id channel_id);
|
||||
|
||||
|
@@ -3,6 +3,8 @@
|
||||
*
|
||||
* (C) 2002, 2003 by Andreas Oberritter <obi@tuxbox.org>
|
||||
*
|
||||
* (C) 2007-2009, 2013 Stefan Seyfried
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
@@ -220,6 +222,18 @@ CZapitChannel * CServiceManager::FindChannel48(const t_channel_id channel_id)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CZapitChannel* CServiceManager::FindChannelFuzzy(const t_channel_id channel_id,
|
||||
const t_satellite_position pos, const freq_id_t freq)
|
||||
{
|
||||
CZapitChannel *ret;
|
||||
ret = FindChannel48(channel_id);
|
||||
if (!ret || !(pos == ret->getSatellitePosition()))
|
||||
return NULL;
|
||||
if (abs((int)ret->getFreqId() - (int)freq) < 3)
|
||||
return ret;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool CServiceManager::GetAllRadioChannels(ZapitChannelList &list, int flags)
|
||||
{
|
||||
list.clear();
|
||||
|
Reference in New Issue
Block a user