summaryrefslogtreecommitdiff
path: root/search.cpp
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2010-08-01 14:08:10 +0200
committerJochen Dolze <vdr@dolze.de>2010-08-01 14:08:10 +0200
commit5bdb0a08787c65532625ca74aebee76bbf2606a6 (patch)
tree3961adccb8811a6e5c9d38b48892d98d2ef59064 /search.cpp
parent12b3d28424b4867e7ccea5efcf569b71a22f068d (diff)
downloadvdr-plugin-tvonscreen-5bdb0a08787c65532625ca74aebee76bbf2606a6.tar.gz
vdr-plugin-tvonscreen-5bdb0a08787c65532625ca74aebee76bbf2606a6.tar.bz2
Reformatted source (into ANSI-C style)
Diffstat (limited to 'search.cpp')
-rw-r--r--search.cpp210
1 files changed, 105 insertions, 105 deletions
diff --git a/search.cpp b/search.cpp
index 3ef27d8..2a62938 100644
--- a/search.cpp
+++ b/search.cpp
@@ -12,127 +12,127 @@
EventItem::EventItem(const class cEvent *ev)
{
- char buf[200];
- const char *txt,*chan;
- cString time1,time2,date;
- cChannel *channel;
-
- myev=ev;
- channel = Channels.GetByChannelID(ev->ChannelID(), true);
- time1=ev->GetTimeString();
- time2=ev->GetEndTimeString();
- date=ev->GetDateString();
- chan=channel->ShortName(true);
- txt=ev->Title();
-
- snprintf(buf,sizeof(buf)-1,"%.6s %s - %s %s/%s",(const char *)date,(const char *)time1,(const char *)time2,chan,txt);
- SetText(buf);
+ char buf[200];
+ const char *txt,*chan;
+ cString time1,time2,date;
+ cChannel *channel;
+
+ myev=ev;
+ channel = Channels.GetByChannelID(ev->ChannelID(), true);
+ time1=ev->GetTimeString();
+ time2=ev->GetEndTimeString();
+ date=ev->GetDateString();
+ chan=channel->ShortName(true);
+ txt=ev->Title();
+
+ snprintf(buf,sizeof(buf)-1,"%.6s %s - %s %s/%s",(const char *)date,(const char *)time1,(const char *)time2,chan,txt);
+ SetText(buf);
}
// -----------------------------------------------------------------------------
cSearchMenu::cSearchMenu(const class cEvent *ev) : cOsdMenu(tr("Search"))
{
- myev=ev;
-
- const char *title;
- title=ev->Title();
-
- char txt[200];
- snprintf(txt,sizeof(txt),"%s '%s'...",tr("Search for"),title);
- SetTitle(txt);
-
- SetStatus(tr("Searching..."));
- Display();
- Skins.Message(mtInfo, tr("Searching..."));
- const cSchedules* Schedules = cSchedules::Schedules(_schedulesLock);
-
- const cSchedule *s;
- s=Schedules->GetSchedule(ev->ChannelID());
-
- int cc=search(s,ev);
-
- snprintf(txt,sizeof(txt),"%s '%s':",tr("Search for"),title);
- SetTitle(txt);
- if (cc>0)
- {
- SetStatus("");
- SetHelp(tr("Record"), tr("Details"), tr("in all"), tr("Back"));
- }
- else
- {
- SetStatus(tr("Nothing found!"));
- SetHelp(NULL, NULL, tr("in all"), tr("Back"));
- }
- Display();
+ myev=ev;
+
+ const char *title;
+ title=ev->Title();
+
+ char txt[200];
+ snprintf(txt,sizeof(txt),"%s '%s'...",tr("Search for"),title);
+ SetTitle(txt);
+
+ SetStatus(tr("Searching..."));
+ Display();
+ Skins.Message(mtInfo, tr("Searching..."));
+ const cSchedules* Schedules = cSchedules::Schedules(_schedulesLock);
+
+ const cSchedule *s;
+ s=Schedules->GetSchedule(ev->ChannelID());
+
+ int cc=search(s,ev);
+
+ snprintf(txt,sizeof(txt),"%s '%s':",tr("Search for"),title);
+ SetTitle(txt);
+ if (cc>0)
+ {
+ SetStatus("");
+ SetHelp(tr("Record"), tr("Details"), tr("in all"), tr("Back"));
+ }
+ else
+ {
+ SetStatus(tr("Nothing found!"));
+ SetHelp(NULL, NULL, tr("in all"), tr("Back"));
+ }
+ Display();
}
- const cEvent *cev=NULL;
+const cEvent *cev=NULL;
int cSearchMenu::search(const cSchedule *s,const class cEvent *ev)
{
- const char *title;
- title=ev->Title();
-
- int cc=0;
- cev=s->GetPresentEvent();
- while(cev)
- {
- if (cev!=ev || tvonscreenCfg.showsearchinitiator)
- {
- const char *ctitle;
- ctitle=cev->Title();
- if (ctitle && title && strstr(ctitle,title)) // || strstr(title,ctitle))
- {
- Add(new EventItem(cev));
- cc++;
- }
- }
- cev=magazine::getNext(s,cev);
- }
- return cc;
+ const char *title;
+ title=ev->Title();
+
+ int cc=0;
+ cev=s->GetPresentEvent();
+ while (cev)
+ {
+ if (cev!=ev || tvonscreenCfg.showsearchinitiator)
+ {
+ const char *ctitle;
+ ctitle=cev->Title();
+ if (ctitle && title && strstr(ctitle,title)) // || strstr(title,ctitle))
+ {
+ Add(new EventItem(cev));
+ cc++;
+ }
+ }
+ cev=magazine::getNext(s,cev);
+ }
+ return cc;
}
void cSearchMenu::searchIn(const cSchedule** schedArray,int schedArrayNum)
{
- cChannel* channel;
- const char *title;
- title=myev->Title();
-
- char txt[200];
- snprintf(txt,sizeof(txt),"%s '%s'...",tr("Search for"),title);
- SetTitle(txt);
- Clear();
-
- SetStatus(tr("Searching..."));
- Display();
- Skins.Message(mtInfo, tr("Searching..."));
- int cc=0;
-
- for(int i=0;i<schedArrayNum;i++)
- {
- channel = Channels.GetByChannelID(schedArray[i]->ChannelID(), true);
- snprintf(txt,sizeof(txt),"%s /%-20.20s",tr("Searching..."),channel->ShortName(true));
- Skins.Message(mtInfo, txt);
- cc+=search(schedArray[i],myev);
- }
-
- snprintf(txt,sizeof(txt),"%s '%s':",tr("Search for"),title);
- SetTitle(txt);
- if (cc>0)
- {
- SetStatus("");
- SetHelp(tr("Record"), tr("Details"), NULL, tr("Back"));
- }
- else
- {
- SetStatus(tr("Nothing found!"));
- SetHelp(NULL, NULL, NULL, tr("Back"));
- }
- Display();
+ cChannel* channel;
+ const char *title;
+ title=myev->Title();
+
+ char txt[200];
+ snprintf(txt,sizeof(txt),"%s '%s'...",tr("Search for"),title);
+ SetTitle(txt);
+ Clear();
+
+ SetStatus(tr("Searching..."));
+ Display();
+ Skins.Message(mtInfo, tr("Searching..."));
+ int cc=0;
+
+ for (int i=0;i<schedArrayNum;i++)
+ {
+ channel = Channels.GetByChannelID(schedArray[i]->ChannelID(), true);
+ snprintf(txt,sizeof(txt),"%s /%-20.20s",tr("Searching..."),channel->ShortName(true));
+ Skins.Message(mtInfo, txt);
+ cc+=search(schedArray[i],myev);
+ }
+
+ snprintf(txt,sizeof(txt),"%s '%s':",tr("Search for"),title);
+ SetTitle(txt);
+ if (cc>0)
+ {
+ SetStatus("");
+ SetHelp(tr("Record"), tr("Details"), NULL, tr("Back"));
+ }
+ else
+ {
+ SetStatus(tr("Nothing found!"));
+ SetHelp(NULL, NULL, NULL, tr("Back"));
+ }
+ Display();
}
const class cEvent *cSearchMenu::currentSelected(void)
{
- EventItem *item = (EventItem *)Get(Current());
- return item ? item->Event() : NULL;
+ EventItem *item = (EventItem *)Get(Current());
+ return item ? item->Event() : NULL;
}