mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 23:42:58 +02:00
CNeutrinoEventList::findEvents - add search all epg option
This commit is contained in:
@@ -316,6 +316,7 @@ epgviewer.nodetailed Keine ausführlichen Informationen verfügbar
|
|||||||
epgviewer.notfound Keine Programminformationen (EPG) gefunden
|
epgviewer.notfound Keine Programminformationen (EPG) gefunden
|
||||||
eventfinder.head EPG-Suche
|
eventfinder.head EPG-Suche
|
||||||
eventfinder.keyword Suche nach Textpassage
|
eventfinder.keyword Suche nach Textpassage
|
||||||
|
eventfinder.search_all_epg Ganze
|
||||||
eventfinder.search Suche
|
eventfinder.search Suche
|
||||||
eventfinder.search_within_epg Suche innerhalb EPG-Daten
|
eventfinder.search_within_epg Suche innerhalb EPG-Daten
|
||||||
eventfinder.search_within_list Suche innerhalb Text
|
eventfinder.search_within_list Suche innerhalb Text
|
||||||
|
@@ -317,6 +317,7 @@ epgviewer.notfound No EPG found
|
|||||||
eventfinder.head Search in EPG
|
eventfinder.head Search in EPG
|
||||||
eventfinder.keyword Keyword
|
eventfinder.keyword Keyword
|
||||||
eventfinder.search Search
|
eventfinder.search Search
|
||||||
|
eventfinder.search_all_epg whole
|
||||||
eventfinder.search_within_epg Search within
|
eventfinder.search_within_epg Search within
|
||||||
eventfinder.search_within_list Search within
|
eventfinder.search_within_list Search within
|
||||||
eventfinder.searching Search for keyword in EPG...
|
eventfinder.searching Search for keyword in EPG...
|
||||||
|
@@ -2233,50 +2233,52 @@ printf("SIevent size: %d\n", (int)sizeof(SIevent));
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* was: commandAllEventsChannelID sendAllEvents */
|
/* was: commandAllEventsChannelID sendAllEvents */
|
||||||
void CEitManager::getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search, std::string search_text)
|
void CEitManager::getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search, std::string search_text,bool all_chann)
|
||||||
{
|
{
|
||||||
dprintf("sendAllEvents for " PRINTF_CHANNEL_ID_TYPE "\n", serviceUniqueKey);
|
dprintf("sendAllEvents for " PRINTF_CHANNEL_ID_TYPE "\n", serviceUniqueKey);
|
||||||
|
|
||||||
if(!eList.empty() && search == 0)//skip on search mode
|
if(!eList.empty() && search == 0)//skip on search mode
|
||||||
eList.clear();
|
eList.clear();
|
||||||
|
|
||||||
t_channel_id serviceUniqueKey64 = serviceUniqueKey& 0xFFFFFFFFFFFFULL; //0xFFFFFFFFFFFFULL for CREATE_CHANNEL_ID64
|
t_channel_id serviceUniqueKey64 = serviceUniqueKey& 0xFFFFFFFFFFFFULL; //0xFFFFFFFFFFFFULL for CREATE_CHANNEL_ID64
|
||||||
if(serviceUniqueKey64 == 0)
|
if(serviceUniqueKey64 == 0 && !all_chann)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// service Found
|
// service Found
|
||||||
readLockEvents();
|
readLockEvents();
|
||||||
int serviceIDfound = 0;
|
int serviceIDfound = 0;
|
||||||
|
|
||||||
if (search_text.length())
|
if (search_text.length())
|
||||||
std::transform(search_text.begin(), search_text.end(), search_text.begin(), tolower);
|
std::transform(search_text.begin(), search_text.end(), search_text.begin(), tolower);
|
||||||
|
|
||||||
for (MySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey::iterator e = mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.begin(); e != mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.end(); ++e)
|
for (MySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey::iterator e = mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.begin(); e != mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.end(); ++e)
|
||||||
{
|
{
|
||||||
if ((*e)->get_channel_id() == serviceUniqueKey64 || (serviceUniqueKey64 == 1)) {
|
if ((*e)->get_channel_id() == serviceUniqueKey64 || (all_chann)) {
|
||||||
serviceIDfound = 1;
|
serviceIDfound = 1;
|
||||||
|
|
||||||
bool copy = true;
|
bool copy = true;
|
||||||
if(search == 0); // nothing to do here
|
if(search){
|
||||||
else if(search == 1) {
|
if((search == 1) || (search == 5)) {//SEARCH_EPG_TITLE == 1 SEARCH_EPG_ALL == 5 defined in eventlist.h
|
||||||
std::string eName = (*e)->getName();
|
std::string eName = (*e)->getName();
|
||||||
std::transform(eName.begin(), eName.end(), eName.begin(), tolower);
|
std::transform(eName.begin(), eName.end(), eName.begin(), tolower);
|
||||||
if(eName.find(search_text) == std::string::npos)
|
if(eName.find(search_text) == std::string::npos)
|
||||||
copy = false;
|
copy = false;
|
||||||
|
}
|
||||||
|
if((search == 2) || (!copy && search == 5)) {//SEARCH_EPG_INFO1 == 2
|
||||||
|
std::string eText = (*e)->getText();
|
||||||
|
std::transform(eText.begin(), eText.end(), eText.begin(), tolower);
|
||||||
|
if(eText.find(search_text) == std::string::npos)
|
||||||
|
copy = false;
|
||||||
|
else if(search == 5)
|
||||||
|
copy = true;
|
||||||
|
}
|
||||||
|
if((search == 3) || (!copy && search == 5)) {//SEARCH_EPG_INFO2 == 3
|
||||||
|
std::string eExtendedText = (*e)->getExtendedText();
|
||||||
|
std::transform(eExtendedText.begin(), eExtendedText.end(), eExtendedText.begin(), tolower);
|
||||||
|
if(eExtendedText.find(search_text) == std::string::npos)
|
||||||
|
copy = false;
|
||||||
|
else if(search == 5)
|
||||||
|
copy = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(search == 2) {
|
|
||||||
std::string eText = (*e)->getText();
|
|
||||||
std::transform(eText.begin(), eText.end(), eText.begin(), tolower);
|
|
||||||
if(eText.find(search_text) == std::string::npos)
|
|
||||||
copy = false;
|
|
||||||
}
|
|
||||||
else if(search == 3) {
|
|
||||||
std::string eExtendedText = (*e)->getExtendedText();
|
|
||||||
std::transform(eExtendedText.begin(), eExtendedText.end(), eExtendedText.begin(), tolower);
|
|
||||||
if(eExtendedText.find(search_text) == std::string::npos)
|
|
||||||
copy = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(copy) {
|
if(copy) {
|
||||||
for (SItimes::iterator t = (*e)->times.begin(); t != (*e)->times.end(); ++t)
|
for (SItimes::iterator t = (*e)->times.begin(); t != (*e)->times.end(); ++t)
|
||||||
{
|
{
|
||||||
@@ -2289,7 +2291,7 @@ void CEitManager::getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEve
|
|||||||
aEvent.text = (*e)->getExtendedText().substr(0, 120);
|
aEvent.text = (*e)->getExtendedText().substr(0, 120);
|
||||||
else
|
else
|
||||||
aEvent.text = (*e)->getText();
|
aEvent.text = (*e)->getText();
|
||||||
if(serviceUniqueKey64 == 1)//hack for all channel search
|
if(all_chann)//hack for all channel search
|
||||||
aEvent.channelID = (*e)->get_channel_id();
|
aEvent.channelID = (*e)->get_channel_id();
|
||||||
else
|
else
|
||||||
aEvent.channelID = serviceUniqueKey;
|
aEvent.channelID = serviceUniqueKey;
|
||||||
|
@@ -55,7 +55,7 @@ class CEitManager : public OpenThreads::Thread, public OpenThreads::Mutex
|
|||||||
bool Stop();
|
bool Stop();
|
||||||
void SetConfig(CSectionsdClient::epg_config &cfg) { config = cfg; };
|
void SetConfig(CSectionsdClient::epg_config &cfg) { config = cfg; };
|
||||||
|
|
||||||
void getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = "");
|
void getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = "", bool all_chann=false);
|
||||||
void getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSectionsdClient::responseGetCurrentNextInfoChannelID& current_next );
|
void getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSectionsdClient::responseGetCurrentNextInfoChannelID& current_next );
|
||||||
bool getEPGidShort(event_id_t epgID, CShortEPGData * epgdata);
|
bool getEPGidShort(event_id_t epgID, CShortEPGData * epgdata);
|
||||||
bool getEPGid(const event_id_t epgID, const time_t startzeit, CEPGData * epgdata);
|
bool getEPGid(const event_id_t epgID, const time_t startzeit, CEPGData * epgdata);
|
||||||
|
@@ -92,7 +92,6 @@ CNeutrinoEventList::CNeutrinoEventList()
|
|||||||
sort_mode = 0;
|
sort_mode = 0;
|
||||||
|
|
||||||
m_search_list = SEARCH_LIST_NONE;
|
m_search_list = SEARCH_LIST_NONE;
|
||||||
m_search_epg_item = SEARCH_LIST_NONE;
|
|
||||||
m_search_epg_item = SEARCH_EPG_TITLE;
|
m_search_epg_item = SEARCH_EPG_TITLE;
|
||||||
m_search_channel_id = 1;
|
m_search_channel_id = 1;
|
||||||
m_search_bouquet_id= 1;
|
m_search_bouquet_id= 1;
|
||||||
@@ -1034,7 +1033,6 @@ bool CNeutrinoEventList::findEvents(void)
|
|||||||
hide();
|
hide();
|
||||||
menu.exec(NULL,"");
|
menu.exec(NULL,"");
|
||||||
search_head_name = g_Locale->getText(LOCALE_EVENTFINDER_SEARCH);
|
search_head_name = g_Locale->getText(LOCALE_EVENTFINDER_SEARCH);
|
||||||
|
|
||||||
if(event == 1)
|
if(event == 1)
|
||||||
{
|
{
|
||||||
res = true;
|
res = true;
|
||||||
@@ -1071,7 +1069,7 @@ bool CNeutrinoEventList::findEvents(void)
|
|||||||
for (it = v.begin(); it != v.end(); ++it){
|
for (it = v.begin(); it != v.end(); ++it){
|
||||||
ch_id_map[*it & 0xFFFFFFFFFFFFULL] = *it;
|
ch_id_map[*it & 0xFFFFFFFFFFFFULL] = *it;
|
||||||
}
|
}
|
||||||
CEitManager::getInstance()->getEventsServiceKey(1/*hack*/,evtlist, m_search_epg_item,m_search_keyword);
|
CEitManager::getInstance()->getEventsServiceKey(0,evtlist, m_search_epg_item,m_search_keyword, true);//all_chann
|
||||||
|
|
||||||
std::map<t_channel_id, t_channel_id>::iterator map_it;
|
std::map<t_channel_id, t_channel_id>::iterator map_it;
|
||||||
CChannelEventList::iterator e;
|
CChannelEventList::iterator e;
|
||||||
@@ -1167,14 +1165,15 @@ const CMenuOptionChooser::keyval SEARCH_LIST_OPTIONS[SEARCH_LIST_OPTION_COUNT] =
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#define SEARCH_EPG_OPTION_COUNT 3
|
#define SEARCH_EPG_OPTION_COUNT 4
|
||||||
const CMenuOptionChooser::keyval SEARCH_EPG_OPTIONS[SEARCH_EPG_OPTION_COUNT] =
|
const CMenuOptionChooser::keyval SEARCH_EPG_OPTIONS[SEARCH_EPG_OPTION_COUNT] =
|
||||||
{
|
{
|
||||||
// { CNeutrinoEventList::SEARCH_EPG_NONE, LOCALE_PICTUREVIEWER_RESIZE_NONE },
|
// { CNeutrinoEventList::SEARCH_EPG_NONE, LOCALE_PICTUREVIEWER_RESIZE_NONE },
|
||||||
{ CNeutrinoEventList::SEARCH_EPG_TITLE, LOCALE_FONTSIZE_EPG_TITLE },
|
{ CNeutrinoEventList::SEARCH_EPG_TITLE, LOCALE_FONTSIZE_EPG_TITLE },
|
||||||
{ CNeutrinoEventList::SEARCH_EPG_INFO1, LOCALE_FONTSIZE_EPG_INFO1 },
|
{ CNeutrinoEventList::SEARCH_EPG_INFO1, LOCALE_FONTSIZE_EPG_INFO1 },
|
||||||
{ CNeutrinoEventList::SEARCH_EPG_INFO2, LOCALE_FONTSIZE_EPG_INFO2 }
|
{ CNeutrinoEventList::SEARCH_EPG_INFO2, LOCALE_FONTSIZE_EPG_INFO2 },
|
||||||
// ,{ CNeutrinoEventList::SEARCH_EPG_GENRE, LOCALE_MOVIEBROWSER_INFO_GENRE_MAJOR }
|
// { CNeutrinoEventList::SEARCH_EPG_GENRE, LOCALE_MOVIEBROWSER_INFO_GENRE_MAJOR },
|
||||||
|
{ CNeutrinoEventList::SEARCH_EPG_ALL, LOCALE_EVENTFINDER_SEARCH_ALL_EPG }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -1203,7 +1202,6 @@ int CEventFinderMenu::exec(CMenuTarget* parent, const std::string &actionkey)
|
|||||||
{
|
{
|
||||||
int res = menu_return::RETURN_REPAINT;
|
int res = menu_return::RETURN_REPAINT;
|
||||||
|
|
||||||
|
|
||||||
if(actionkey =="")
|
if(actionkey =="")
|
||||||
{
|
{
|
||||||
if(parent != NULL)
|
if(parent != NULL)
|
||||||
@@ -1335,6 +1333,7 @@ int CEventFinderMenu::showMenu(void)
|
|||||||
bool CEventFinderMenu::changeNotify(const neutrino_locale_t OptionName, void *)
|
bool CEventFinderMenu::changeNotify(const neutrino_locale_t OptionName, void *)
|
||||||
/************************************************************************************************/
|
/************************************************************************************************/
|
||||||
{
|
{
|
||||||
|
|
||||||
if (ARE_LOCALES_EQUAL(OptionName, LOCALE_EVENTFINDER_SEARCH_WITHIN_LIST))
|
if (ARE_LOCALES_EQUAL(OptionName, LOCALE_EVENTFINDER_SEARCH_WITHIN_LIST))
|
||||||
{
|
{
|
||||||
if (*m_search_list == CNeutrinoEventList::SEARCH_LIST_CHANNEL)
|
if (*m_search_list == CNeutrinoEventList::SEARCH_LIST_CHANNEL)
|
||||||
|
@@ -46,32 +46,32 @@
|
|||||||
|
|
||||||
class CNeutrinoEventList
|
class CNeutrinoEventList
|
||||||
{
|
{
|
||||||
// Eventfinder start
|
// Eventfinder start
|
||||||
public:
|
public:
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
SEARCH_EPG_NONE,
|
SEARCH_EPG_NONE,
|
||||||
SEARCH_EPG_TITLE,
|
SEARCH_EPG_TITLE,
|
||||||
SEARCH_EPG_INFO1,
|
SEARCH_EPG_INFO1,
|
||||||
SEARCH_EPG_INFO2,
|
SEARCH_EPG_INFO2,
|
||||||
SEARCH_EPG_GENRE,
|
SEARCH_EPG_GENRE,
|
||||||
SEARCH_EPG_ALL
|
SEARCH_EPG_ALL
|
||||||
}SEARCH_EPG;
|
}SEARCH_EPG;
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
SEARCH_LIST_NONE,
|
SEARCH_LIST_NONE,
|
||||||
SEARCH_LIST_CHANNEL,
|
SEARCH_LIST_CHANNEL,
|
||||||
SEARCH_LIST_BOUQUET,
|
SEARCH_LIST_BOUQUET,
|
||||||
SEARCH_LIST_ALL
|
SEARCH_LIST_ALL
|
||||||
}SEARCH_LIST;
|
}SEARCH_LIST;
|
||||||
private:
|
private:
|
||||||
int m_search_epg_item;
|
int m_search_epg_item;
|
||||||
std::string m_search_keyword;
|
std::string m_search_keyword;
|
||||||
std::string m_search_autokeyword;
|
std::string m_search_autokeyword;
|
||||||
int m_search_list;
|
int m_search_list;
|
||||||
t_channel_id m_search_channel_id;
|
t_channel_id m_search_channel_id;
|
||||||
t_bouquet_id m_search_bouquet_id;
|
t_bouquet_id m_search_bouquet_id;
|
||||||
bool m_showChannel;
|
bool m_showChannel;
|
||||||
int FunctionBarHeight;
|
int FunctionBarHeight;
|
||||||
int oldIndex;
|
int oldIndex;
|
||||||
event_id_t oldEventID;
|
event_id_t oldEventID;
|
||||||
|
@@ -344,6 +344,7 @@ typedef enum
|
|||||||
LOCALE_EVENTFINDER_HEAD,
|
LOCALE_EVENTFINDER_HEAD,
|
||||||
LOCALE_EVENTFINDER_KEYWORD,
|
LOCALE_EVENTFINDER_KEYWORD,
|
||||||
LOCALE_EVENTFINDER_SEARCH,
|
LOCALE_EVENTFINDER_SEARCH,
|
||||||
|
LOCALE_EVENTFINDER_SEARCH_ALL_EPG,
|
||||||
LOCALE_EVENTFINDER_SEARCH_WITHIN_EPG,
|
LOCALE_EVENTFINDER_SEARCH_WITHIN_EPG,
|
||||||
LOCALE_EVENTFINDER_SEARCH_WITHIN_LIST,
|
LOCALE_EVENTFINDER_SEARCH_WITHIN_LIST,
|
||||||
LOCALE_EVENTFINDER_SEARCHING,
|
LOCALE_EVENTFINDER_SEARCHING,
|
||||||
|
@@ -344,6 +344,7 @@ const char * locale_real_names[] =
|
|||||||
"eventfinder.head",
|
"eventfinder.head",
|
||||||
"eventfinder.keyword",
|
"eventfinder.keyword",
|
||||||
"eventfinder.search",
|
"eventfinder.search",
|
||||||
|
"eventfinder.search_all_epg",
|
||||||
"eventfinder.search_within_epg",
|
"eventfinder.search_within_epg",
|
||||||
"eventfinder.search_within_list",
|
"eventfinder.search_within_list",
|
||||||
"eventfinder.searching",
|
"eventfinder.searching",
|
||||||
|
Reference in New Issue
Block a user