mirror of
https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
synced 2023-10-05 13:01:48 +00:00
Compare commits
59 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
e7753834bc | ||
|
d1e5e240ec | ||
|
6e83787437 | ||
|
333a3d397f | ||
|
80acee49e1 | ||
|
6095fb4dbc | ||
|
e01a63b29e | ||
|
0975e97519 | ||
|
929d8db9ba | ||
|
56250e3af8 | ||
|
d825d700eb | ||
|
ae206f4768 | ||
|
c7f0131d52 | ||
|
52d887d854 | ||
|
6f7042d41f | ||
|
9009f4f385 | ||
|
b70112ae50 | ||
|
9df447454c | ||
|
8ae5d34bef | ||
|
7d44c8f91f | ||
|
e399518900 | ||
|
dfb2c2b031 | ||
|
060089548a | ||
|
56014ea736 | ||
|
f56219c93c | ||
|
7ca598f64e | ||
|
4474b5f5b5 | ||
|
d5ecea55a6 | ||
|
3a940d061c | ||
|
10f6d90f16 | ||
|
168973331c | ||
|
ff599e4cda | ||
|
f7e5ac3208 | ||
|
a8ca6f19da | ||
|
68af1b2086 | ||
|
d9b8af10e7 | ||
|
9f98eddc41 | ||
|
431e99d1d4 | ||
|
415e433c73 | ||
|
0f092903e8 | ||
|
e62ea368e8 | ||
|
c1fe8a8dfd | ||
|
d0969687ea | ||
|
b086cf85dc | ||
|
b054fa2c12 | ||
|
aa26a69ef8 | ||
|
91488f0f60 | ||
|
39dfe767fc | ||
|
8f1f2dea33 | ||
|
f592012442 | ||
|
c6d01ba60b | ||
|
d5b3844dcc | ||
|
2ed3344bb9 | ||
|
82fb45a088 | ||
|
e476e0e8c0 | ||
|
881c95a61c | ||
|
bf2937d86c | ||
|
6ae27238af | ||
|
cbc6f44264 |
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
*.o
|
||||
*.so
|
||||
po/*.mo
|
||||
po/*.pot
|
||||
.dependencies
|
43
HISTORY
43
HISTORY
@@ -138,3 +138,46 @@ Version 1.2.2
|
||||
|
||||
- added scraper2vdr support
|
||||
- introduced tabbed EPG detail view
|
||||
|
||||
Version 1.2.3
|
||||
|
||||
- Compile under VDR 2.3.1+
|
||||
- Reinsert old tvscraper compatibility
|
||||
- New Makefile style
|
||||
- Show inactive timer in EPG grid
|
||||
- Center channel logos in EPG
|
||||
- Clock in timeline if displaymode horizontal
|
||||
|
||||
Version 1.2.4
|
||||
|
||||
- Add Support for new SVDRPPeering
|
||||
- Add italian translation
|
||||
- Use graphicsmagick instead of imagemagick
|
||||
- Correct a switchtimer error
|
||||
- Add "switchMinsBefore" to setup menu
|
||||
- Eliminate some warnings
|
||||
- Center channel logos in favorite view
|
||||
- Update "services/epgsearch.h"
|
||||
|
||||
Version 1.2.5
|
||||
|
||||
- Compile again with VDR < 2.3.0
|
||||
- Correct some x positions in EPG grid
|
||||
- Fixed a "invalid lock sequence report" in "cRecManager::PerformSearchTimerSearch"
|
||||
- Eliminate a seqfault in "cRecManager::DeleteSearchTimer"
|
||||
- Show Inactive timer in DrawHeader
|
||||
- Add "switchMode" to setup menu
|
||||
|
||||
Version 1.2.6
|
||||
|
||||
- Some changes for VDR < 2.3.0
|
||||
- Changes for Rec Icon in DrawHeader and Grid
|
||||
- Eliminate a compiler warning in searchtimer.c
|
||||
- Correct an error in setup page
|
||||
- Optical changes in displaymode vertical
|
||||
- Different setup parameter for displayTime in horizontal and vertical mode
|
||||
- Optimizations in setup menu
|
||||
- Add .gitignore
|
||||
- Channelgroup in cRecMenuSearchTimerEdit
|
||||
(Create and modify of channelgroups isn't yet possible, should be done in epgsearch)
|
||||
- Change channel icon size in cRecMenuSearchTimerEdit
|
||||
|
24
Makefile
24
Makefile
@@ -4,7 +4,8 @@
|
||||
# $Id$
|
||||
|
||||
# External image lib to use: imagemagick, graphicsmagick
|
||||
IMAGELIB = imagemagick
|
||||
#IMAGELIB = imagemagick
|
||||
IMAGELIB = graphicsmagick
|
||||
|
||||
# The official name of this plugin.
|
||||
# This name will be used in the '-P...' option of VDR to load the plugin.
|
||||
@@ -68,7 +69,8 @@ all: $(SOFILE) i18n
|
||||
### Implicit rules:
|
||||
|
||||
%.o: %.c
|
||||
$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
|
||||
@echo CC $@
|
||||
$(Q)$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $<
|
||||
|
||||
### Dependencies:
|
||||
|
||||
@@ -88,17 +90,21 @@ I18Nmsgs = $(addprefix $(DESTDIR)$(LOCDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLU
|
||||
I18Npot = $(PODIR)/$(PLUGIN).pot
|
||||
|
||||
%.mo: %.po
|
||||
msgfmt -c -o $@ $<
|
||||
@echo MO $@
|
||||
$(Q)msgfmt -c -o $@ $<
|
||||
|
||||
$(I18Npot): $(wildcard *.c)
|
||||
xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='<see README>' -o $@ `ls $^`
|
||||
@echo GT $@
|
||||
$(Q)xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='<see README>' -o $@ `ls $^`
|
||||
|
||||
%.po: $(I18Npot)
|
||||
msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $<
|
||||
@echo PO $@
|
||||
$(Q)msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $<
|
||||
@touch $@
|
||||
|
||||
$(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
|
||||
install -D -m644 $< $@
|
||||
@echo IN $@
|
||||
$(Q)install -D -m644 $< $@
|
||||
|
||||
.PHONY: i18n
|
||||
i18n: $(I18Nmo) $(I18Npot)
|
||||
@@ -108,10 +114,12 @@ install-i18n: $(I18Nmsgs)
|
||||
### Targets:
|
||||
|
||||
$(SOFILE): $(OBJS)
|
||||
$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) $(LIBS) -o $@
|
||||
@echo LD $@
|
||||
$(Q)$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) $(LIBS) -o $@
|
||||
|
||||
install-lib: $(SOFILE)
|
||||
install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION)
|
||||
@echo IN $@
|
||||
$(Q)install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION)
|
||||
|
||||
install-themes:
|
||||
@mkdir -p $(DESTDIR)$(VDRCONFDIR)/themes
|
||||
|
@@ -5,9 +5,13 @@ cChannelColumn::cChannelColumn(int num, const cChannel *channel, cMyTime *myTime
|
||||
this->channel = channel;
|
||||
this->num = num;
|
||||
this->myTime = myTime;
|
||||
#if VDRVERSNUM < 20301
|
||||
hasTimer = channel->HasTimer();
|
||||
#endif
|
||||
hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel);
|
||||
#if VDRVERSNUM < 20301
|
||||
schedulesLock = new cSchedulesLock(false, 100);
|
||||
#endif
|
||||
header = NULL;
|
||||
}
|
||||
|
||||
@@ -15,7 +19,9 @@ cChannelColumn::~cChannelColumn(void) {
|
||||
if (header)
|
||||
delete header;
|
||||
grids.Clear();
|
||||
#if VDRVERSNUM < 20301
|
||||
delete schedulesLock;
|
||||
#endif
|
||||
}
|
||||
|
||||
void cChannelColumn::clearGrids() {
|
||||
@@ -33,7 +39,15 @@ void cChannelColumn::drawHeader() {
|
||||
}
|
||||
|
||||
bool cChannelColumn::readGrids() {
|
||||
#if VDRVERSNUM >= 20301
|
||||
const cSchedules* schedules;
|
||||
{
|
||||
LOCK_SCHEDULES_READ;
|
||||
schedules = Schedules;
|
||||
}
|
||||
#else
|
||||
schedules = cSchedules::Schedules(*schedulesLock);
|
||||
#endif
|
||||
const cSchedule *Schedule = NULL;
|
||||
Schedule = schedules->GetSchedule(channel);
|
||||
if (!Schedule) {
|
||||
@@ -186,7 +200,15 @@ void cChannelColumn::AddNewGridsAtStart() {
|
||||
return;
|
||||
}
|
||||
//if not, i have to add new ones to the list
|
||||
#if VDRVERSNUM >= 20301
|
||||
const cSchedules* schedules;
|
||||
{
|
||||
LOCK_SCHEDULES_READ;
|
||||
schedules = Schedules;
|
||||
}
|
||||
#else
|
||||
schedules = cSchedules::Schedules(*schedulesLock);
|
||||
#endif
|
||||
const cSchedule *Schedule = NULL;
|
||||
Schedule = schedules->GetSchedule(channel);
|
||||
if (!Schedule) {
|
||||
@@ -234,7 +256,15 @@ void cChannelColumn::AddNewGridsAtEnd() {
|
||||
return;
|
||||
}
|
||||
//if not, i have to add new ones to the list
|
||||
#if VDRVERSNUM >= 20301
|
||||
const cSchedules* schedules;
|
||||
{
|
||||
LOCK_SCHEDULES_READ;
|
||||
schedules = Schedules;
|
||||
}
|
||||
#else
|
||||
schedules = cSchedules::Schedules(*schedulesLock);
|
||||
#endif
|
||||
const cSchedule *Schedule = NULL;
|
||||
Schedule = schedules->GetSchedule(channel);
|
||||
if (!Schedule) {
|
||||
@@ -342,12 +372,14 @@ cGrid *cChannelColumn::addDummyGrid(time_t start, time_t end, cGrid *firstGrid,
|
||||
}
|
||||
|
||||
void cChannelColumn::SetTimers() {
|
||||
#if VDRVERSNUM < 20301
|
||||
hasTimer = channel->HasTimer();
|
||||
#endif
|
||||
hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel);
|
||||
for (cGrid *grid = grids.First(); grid; grid = grids.Next(grid)) {
|
||||
bool gridHadTimer = grid->HasTimer();
|
||||
grid->SetTimer();
|
||||
if (gridHadTimer != grid->HasTimer())
|
||||
if (gridHadTimer || gridHadTimer != grid->HasTimer())
|
||||
grid->SetDirty();
|
||||
bool gridHadSwitchTimer = grid->HasSwitchTimer();
|
||||
grid->SetSwitchTimer();
|
||||
@@ -364,4 +396,4 @@ void cChannelColumn::dumpGrids() {
|
||||
esyslog("tvguide: grid %d: start: %s, stop: %s", i, *cMyTime::printTime(grid->StartTime()), *cMyTime::printTime(grid->EndTime()));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -20,7 +20,10 @@ private:
|
||||
const cChannel *channel;
|
||||
cHeaderGrid *header;
|
||||
cList<cGrid> grids;
|
||||
#if VDRVERSNUM >= 20301
|
||||
#else
|
||||
cSchedulesLock *schedulesLock;
|
||||
#endif
|
||||
const cSchedules *schedules;
|
||||
bool hasTimer;
|
||||
bool hasSwitchTimer;
|
||||
@@ -50,7 +53,11 @@ public:
|
||||
void ClearOutdatedEnd();
|
||||
int GetNum() {return num;};
|
||||
void SetNum(int num) {this->num = num;};
|
||||
#if VDRVERSNUM >= 20301
|
||||
void setTimer();
|
||||
#else
|
||||
void setTimer() {hasTimer = channel->HasTimer();};
|
||||
#endif
|
||||
bool HasTimer() { return hasTimer; };
|
||||
void setSwitchTimer() {hasSwitchTimer = SwitchTimers.ChannelInSwitchList(channel);};
|
||||
bool HasSwitchTimer() { return hasSwitchTimer; };
|
||||
|
@@ -10,12 +10,21 @@ cChannelGroups::~cChannelGroups(void) {
|
||||
void cChannelGroups::ReadChannelGroups(void) {
|
||||
bool setStart = false;
|
||||
int lastChannelNumber = 0;
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
const cChannel *first = Channels->First();
|
||||
#else
|
||||
const cChannel *first = Channels.First();
|
||||
#endif
|
||||
if (!first->GroupSep()) {
|
||||
channelGroups.push_back(cChannelGroup(tr("Main Program")));
|
||||
setStart = true;
|
||||
}
|
||||
#if VDRVERSNUM >= 20301
|
||||
for (const cChannel *channel = Channels->First(); channel; channel = Channels->Next(channel)) {
|
||||
#else
|
||||
for (const cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) {
|
||||
#endif
|
||||
if (setStart && (channelGroups.size() > 0)) {
|
||||
channelGroups[channelGroups.size()-1].SetChannelStart(channel->Number());
|
||||
setStart = false;
|
||||
@@ -60,7 +69,7 @@ const char* cChannelGroups::GetPrev(int group) {
|
||||
|
||||
const char* cChannelGroups::GetNext(int group) {
|
||||
if (group > -1) {
|
||||
if ((group+1) < channelGroups.size())
|
||||
if ((group+1) < (int)channelGroups.size())
|
||||
return channelGroups[group+1].GetName();
|
||||
}
|
||||
return "";
|
||||
@@ -80,7 +89,7 @@ int cChannelGroups::GetNextGroupChannelNumber(const cChannel *channel) {
|
||||
int currentGroup = GetGroup(channel);
|
||||
if (currentGroup == -1)
|
||||
return 0;
|
||||
if ((currentGroup+1) < channelGroups.size()) {
|
||||
if ((currentGroup+1) < (int)channelGroups.size()) {
|
||||
return channelGroups[currentGroup+1].StartChannel();
|
||||
}
|
||||
return 0;
|
||||
@@ -103,7 +112,12 @@ void cChannelGroups::DrawChannelGroups(const cChannel *start, const cChannel *st
|
||||
int groupLast = group;
|
||||
int line = 0;
|
||||
int lineStart = 0;
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
for (const cChannel *channel = Channels->Next(start); channel; channel = Channels->Next(channel)) {
|
||||
#else
|
||||
for (const cChannel *channel = Channels.Next(start); channel; channel = Channels.Next(channel)) {
|
||||
#endif
|
||||
if (channel->GroupSep())
|
||||
continue;
|
||||
group = GetGroup(channel);
|
||||
|
@@ -11,7 +11,12 @@ cChannelJump::cChannelJump(cChannelGroups *channelGroups) {
|
||||
pixmapText = NULL;
|
||||
channel = 0;
|
||||
if (!tvguideConfig.hideLastGroup) {
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
maxChannels = Channels->MaxNumber();
|
||||
#else
|
||||
maxChannels = Channels.MaxNumber();
|
||||
#endif
|
||||
} else {
|
||||
maxChannels = channelGroups->GetLastValidChannel();
|
||||
}
|
||||
|
@@ -10,8 +10,8 @@ private:
|
||||
int channel;
|
||||
cChannelGroups *channelGroups;
|
||||
int maxChannels;
|
||||
int startTime;
|
||||
int timeout;
|
||||
long unsigned int startTime;
|
||||
long unsigned int timeout;
|
||||
cPixmap *pixmapBack;
|
||||
cPixmap *pixmapText;
|
||||
void SetPixmaps(void);
|
||||
@@ -26,4 +26,4 @@ public:
|
||||
int GetChannel(void) { return channel; };
|
||||
};
|
||||
|
||||
#endif //__TVGUIDE_CHANNELJUMP_H
|
||||
#endif //__TVGUIDE_CHANNELJUMP_H
|
||||
|
8
config.c
8
config.c
@@ -10,6 +10,7 @@ cTvguideConfig::cTvguideConfig() {
|
||||
channelCols = 5;
|
||||
channelRows = 10;
|
||||
displayTime = 160;
|
||||
displayHorizontalTime = 160;
|
||||
displayStatusHeader = 1;
|
||||
displayChannelGroups = 1;
|
||||
displayTimeBase = 1;
|
||||
@@ -64,6 +65,8 @@ cTvguideConfig::cTvguideConfig() {
|
||||
favLimitChannels = 0;
|
||||
favStartChannel = 0;
|
||||
favStopChannel = 0;
|
||||
switchMode = 0;
|
||||
switchMinsBefore = 2;
|
||||
fontIndex = 0;
|
||||
fontNameDefault = "VDRSymbols Sans:Book";
|
||||
FontButtonDelta = 0;
|
||||
@@ -255,6 +258,7 @@ bool cTvguideConfig::SetupParse(const char *Name, const char *Value) {
|
||||
else if (strcmp(Name, "channelCols") == 0) channelCols = atoi(Value);
|
||||
else if (strcmp(Name, "channelRows") == 0) channelRows = atoi(Value);
|
||||
else if (strcmp(Name, "displayTime") == 0) displayTime = atoi(Value);
|
||||
else if (strcmp(Name, "displayHorizontalTime") == 0) displayHorizontalTime = atoi(Value);
|
||||
else if (strcmp(Name, "hideChannelLogos") == 0) hideChannelLogos = atoi(Value);
|
||||
else if (strcmp(Name, "logoExtension") == 0) logoExtension = atoi(Value);
|
||||
else if (strcmp(Name, "logoWidthRatio") == 0) logoWidthRatio = atoi(Value);
|
||||
@@ -299,6 +303,8 @@ bool cTvguideConfig::SetupParse(const char *Name, const char *Value) {
|
||||
else if (strcmp(Name, "favLimitChannels") == 0) favLimitChannels = atoi(Value);
|
||||
else if (strcmp(Name, "favStartChannel") == 0) favStartChannel = atoi(Value);
|
||||
else if (strcmp(Name, "favStopChannel") == 0) favStopChannel = atoi(Value);
|
||||
else if (strcmp(Name, "switchMode") == 0) switchMode = atoi(Value);
|
||||
else if (strcmp(Name, "switchMinsBefore") == 0) switchMinsBefore = atoi(Value);
|
||||
else if (strcmp(Name, "fontIndex") == 0) fontIndex = atoi(Value);
|
||||
else if (strcmp(Name, "FontButtonDelta") == 0) FontButtonDelta = atoi(Value);
|
||||
else if (strcmp(Name, "FontDetailViewDelta") == 0) FontDetailViewDelta = atoi(Value);
|
||||
@@ -331,4 +337,4 @@ bool cTvguideConfig::SetupParse(const char *Name, const char *Value) {
|
||||
else if (strcmp(Name, "limitLogoCache") == 0) limitLogoCache = atoi(Value);
|
||||
else return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
5
config.h
5
config.h
@@ -58,6 +58,7 @@ class cTvguideConfig {
|
||||
int channelRows;
|
||||
int numGrids;
|
||||
int displayTime;
|
||||
int displayHorizontalTime;
|
||||
int displayStatusHeader;
|
||||
int displayChannelGroups;
|
||||
int displayTimeBase;
|
||||
@@ -118,6 +119,8 @@ class cTvguideConfig {
|
||||
int favLimitChannels;
|
||||
int favStartChannel;
|
||||
int favStopChannel;
|
||||
int switchMode;
|
||||
int switchMinsBefore;
|
||||
int fontIndex;
|
||||
const char *fontNameDefault;
|
||||
int FontButtonDelta;
|
||||
@@ -252,4 +255,4 @@ THEME_CLR(theme, clrRecMenuTimelineBack, 0xFF828282);
|
||||
THEME_CLR(theme, clrRecMenuTimelineActive, 0xFF3F3F3F);
|
||||
THEME_CLR(theme, clrRecMenuTimelineConflict, 0x30FF0000);
|
||||
THEME_CLR(theme, clrRecMenuTimelineConflictOverlap, 0x90FF0000);
|
||||
#endif //__TVGUIDE_CONFIG_H
|
||||
#endif //__TVGUIDE_CONFIG_H
|
||||
|
21
detailview.c
21
detailview.c
@@ -9,20 +9,25 @@ cDetailView::~cDetailView(void){
|
||||
Cancel(-1);
|
||||
while (Active())
|
||||
cCondWait::SleepMs(10);
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
footer->LeaveDetailedViewMode(Channels->GetByChannelID(event->ChannelID()));
|
||||
#else
|
||||
footer->LeaveDetailedViewMode(Channels.GetByChannelID(event->ChannelID()));
|
||||
#endif
|
||||
if (view)
|
||||
delete view;
|
||||
}
|
||||
|
||||
void cDetailView::InitiateView(void) {
|
||||
static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr");
|
||||
static cPlugin *pScraper = GetScraperPlugin();
|
||||
ScraperGetEventType call;
|
||||
if (!event)
|
||||
return;
|
||||
call.event = event;
|
||||
if (!pScraper2Vdr) {
|
||||
if (!pScraper) {
|
||||
view = new cEPGView();
|
||||
} else if (pScraper2Vdr->Service("GetEventType", &call)) {
|
||||
} else if (pScraper->Service("GetEventType", &call)) {
|
||||
if (call.type == tMovie) {
|
||||
view = new cMovieView(call.movieId);
|
||||
} else if (call.type == tSeries) {
|
||||
@@ -42,7 +47,12 @@ void cDetailView::InitiateView(void) {
|
||||
dateTime = cString::sprintf("%s %s - %s (%d %s)", *event->GetDateString(), *event->GetTimeString(), *event->GetEndTimeString(), event->Duration()/60, tr("min"));
|
||||
}
|
||||
view->SetDateTime(*dateTime);
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
view->SetChannel(Channels->GetByChannelID(event->ChannelID(), true));
|
||||
#else
|
||||
view->SetChannel(Channels.GetByChannelID(event->ChannelID(), true));
|
||||
#endif
|
||||
view->SetEventID(event->EventID());
|
||||
view->SetEvent(event);
|
||||
}
|
||||
@@ -90,7 +100,12 @@ std::string cDetailView::LoadReruns(void) {
|
||||
continue;
|
||||
i++;
|
||||
sstrReruns << *DayDateTime(r->event->StartTime());
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
const cChannel *channel = Channels->GetByChannelID(r->event->ChannelID(), true, true);
|
||||
#else
|
||||
cChannel *channel = Channels.GetByChannelID(r->event->ChannelID(), true, true);
|
||||
#endif
|
||||
if (channel) {
|
||||
sstrReruns << ", " << trVDR("Channel") << " " << channel->Number() << ":";
|
||||
sstrReruns << " " << channel->ShortName(true);
|
||||
|
57
epggrid.c
57
epggrid.c
@@ -33,7 +33,6 @@ void cEpgGrid::SetViewportHeight() {
|
||||
}
|
||||
|
||||
void cEpgGrid::PositionPixmap() {
|
||||
int x0, y0;
|
||||
if (tvguideConfig.displayMode == eVertical) {
|
||||
int x0 = column->getX();
|
||||
int y0 = geoManager.statusHeaderHeight + geoManager.channelHeaderHeight + geoManager.channelGroupsHeight;
|
||||
@@ -41,7 +40,7 @@ void cEpgGrid::PositionPixmap() {
|
||||
y0 += (StartTime() - column->Start())/60*geoManager.minutePixel;
|
||||
}
|
||||
if (!pixmap) {
|
||||
pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, geoManager.colWidth, viewportHeight),
|
||||
pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, geoManager.colWidth, viewportHeight),
|
||||
cRect(0, 0, geoManager.colWidth, Duration()/60*geoManager.minutePixel));
|
||||
} else {
|
||||
pixmap->SetViewPort(cRect(x0, y0, geoManager.colWidth, viewportHeight));
|
||||
@@ -53,7 +52,7 @@ void cEpgGrid::PositionPixmap() {
|
||||
x0 += (StartTime() - column->Start())/60*geoManager.minutePixel;
|
||||
}
|
||||
if (!pixmap) {
|
||||
pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, viewportHeight, geoManager.rowHeight),
|
||||
pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, viewportHeight, geoManager.rowHeight),
|
||||
cRect(0, 0, Duration()/60*geoManager.minutePixel, geoManager.rowHeight));
|
||||
} else {
|
||||
pixmap->SetViewPort(cRect(x0, y0, viewportHeight, geoManager.rowHeight ));
|
||||
@@ -63,17 +62,23 @@ void cEpgGrid::PositionPixmap() {
|
||||
}
|
||||
|
||||
void cEpgGrid::SetTimer() {
|
||||
hasTimer = false;
|
||||
if (tvguideConfig.useRemoteTimers && pRemoteTimers) {
|
||||
RemoteTimers_Event_v1_0 rt;
|
||||
rt.event = event;
|
||||
if (pRemoteTimers->Service("RemoteTimers::GetTimerByEvent-v1.0", &rt))
|
||||
hasTimer = true;
|
||||
else
|
||||
hasTimer = false;
|
||||
#if VDRVERSNUM >= 20301
|
||||
} else {
|
||||
eTimerMatch TimerMatch = tmNone;
|
||||
LOCK_TIMERS_READ;
|
||||
const cTimers *timers = Timers;
|
||||
if (timers->GetMatch(event, &TimerMatch) && (TimerMatch == tmFull))
|
||||
hasTimer = true;
|
||||
#else
|
||||
} else if (column->HasTimer()) {
|
||||
hasTimer = event->HasTimer();
|
||||
} else {
|
||||
hasTimer = false;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,21 +142,41 @@ void cEpgGrid::drawText() {
|
||||
}
|
||||
pixmap->DrawText(cPoint(borderWidth, titleY), *strTitle, colorText, colorTextBack, fontManager.FontGridHorizontal);
|
||||
}
|
||||
if (hasSwitchTimer)
|
||||
if (hasSwitchTimer)
|
||||
drawIcon("Switch", theme.Color(clrButtonYellow));
|
||||
if (hasTimer)
|
||||
drawIcon("REC", theme.Color(clrButtonRed));
|
||||
if (hasTimer) {
|
||||
const cTimer *timer = NULL;
|
||||
#if VDRVERSNUM >= 20301
|
||||
{
|
||||
LOCK_TIMERS_READ;
|
||||
timer = Timers->GetMatch(event);
|
||||
}
|
||||
#else
|
||||
timer = Timers.GetMatch(event);
|
||||
#endif
|
||||
if (timer)
|
||||
#ifdef SWITCHONLYPATCH
|
||||
if (timer->HasFlags(tfSwitchOnly))
|
||||
drawIcon("Switch", theme.Color(clrButtonYellow));
|
||||
else if (timer->HasFlags(tfActive))
|
||||
#else /* SWITCHONLY */
|
||||
if (timer->HasFlags(tfActive))
|
||||
#endif /* SWITCHONLY */
|
||||
drawIcon("REC", theme.Color(clrButtonRed));
|
||||
else
|
||||
drawIcon("REC", theme.Color(clrButtonGreen));
|
||||
}
|
||||
}
|
||||
|
||||
void cEpgGrid::drawIcon(cString iconText, tColor color) {
|
||||
|
||||
|
||||
const cFont *font = (tvguideConfig.displayMode == eVertical)
|
||||
?fontManager.FontGrid
|
||||
:fontManager.FontGridHorizontalSmall;
|
||||
int textWidth = font->Width(*iconText)+2*borderWidth;
|
||||
int textHeight = font->Height()+10;
|
||||
pixmap->DrawRectangle( cRect(Width() - textWidth - borderWidth, Height() - textHeight - borderWidth, textWidth, textHeight), color);
|
||||
pixmap->DrawText(cPoint(Width() - textWidth, Height() - textHeight - borderWidth/2), *iconText, theme.Color(clrFont), color, font);
|
||||
pixmap->DrawText(cPoint(Width() - textWidth, Height() - textHeight - borderWidth/2), *iconText, theme.Color(clrFont), color, font);
|
||||
}
|
||||
|
||||
cString cEpgGrid::getTimeString(void) {
|
||||
@@ -159,11 +184,11 @@ cString cEpgGrid::getTimeString(void) {
|
||||
}
|
||||
|
||||
void cEpgGrid::debug() {
|
||||
esyslog("tvguide epggrid: %s: %s, %s, viewportHeight: %d px, Duration: %d min, active: %d",
|
||||
esyslog("tvguide epggrid: %s: %s, %s, viewportHeight: %d px, Duration: %d min, active: %d",
|
||||
column->Name(),
|
||||
*(event->GetTimeString()),
|
||||
event->Title(),
|
||||
viewportHeight,
|
||||
*(event->GetTimeString()),
|
||||
event->Title(),
|
||||
viewportHeight,
|
||||
event->Duration()/60,
|
||||
active);
|
||||
}
|
||||
|
@@ -8,6 +8,7 @@
|
||||
|
||||
class cEpgGrid : public cGrid {
|
||||
private:
|
||||
const cTimer *timer;
|
||||
const cEvent *event;
|
||||
cTextWrapper *extText;
|
||||
cString timeString;
|
||||
@@ -29,4 +30,4 @@ public:
|
||||
void debug();
|
||||
};
|
||||
|
||||
#endif //__TVGUIDE_EPGGRID_H
|
||||
#endif //__TVGUIDE_EPGGRID_H
|
||||
|
@@ -29,8 +29,6 @@ bool cGeometryManager::SetGeometry(int osdWidth, int osdHeight, bool force) {
|
||||
channelHeaderHeight = tvguideConfig.channelHeaderHeightPercent * osdHeight / 100;
|
||||
timeLineWidth = tvguideConfig.timeLineWidthPercent * osdWidth / 100;
|
||||
timeLineHeight = tvguideConfig.timeLineHeightPercent * osdHeight / 100;
|
||||
clockWidth = tvFrameWidth / 3;
|
||||
clockHeight = timeLineHeight;
|
||||
footerHeight = tvguideConfig.footerHeightPercent * osdHeight / 100;
|
||||
footerY = osdHeight - footerHeight;
|
||||
|
||||
@@ -43,21 +41,25 @@ bool cGeometryManager::SetGeometry(int osdWidth, int osdHeight, bool force) {
|
||||
logoWidth = channelLogoWidth/2 - 15;
|
||||
logoHeight = logoWidth * tvguideConfig.logoHeightRatio / tvguideConfig.logoWidthRatio;
|
||||
timeLineGridWidth = timeLineWidth;
|
||||
timeLineGridHeight = minutePixel*30;
|
||||
timeLineGridHeight = minutePixel * 30;
|
||||
dateVieverWidth = timeLineWidth;
|
||||
dateVieverHeight = channelHeaderHeight + channelGroupsHeight;
|
||||
dateVieverHeight = (channelHeaderHeight + channelGroupsHeight) * 2 / 3;
|
||||
clockWidth = dateVieverWidth;
|
||||
clockHeight = (channelHeaderHeight + channelGroupsHeight) - dateVieverHeight;
|
||||
} else if (tvguideConfig.displayMode == eHorizontal) {
|
||||
colWidth = 0;
|
||||
rowHeight = (osdHeight - statusHeaderHeight - timeLineHeight - footerHeight) / tvguideConfig.channelRows;
|
||||
minutePixel = (osdWidth - channelHeaderWidth - channelGroupsWidth) / tvguideConfig.displayTime;
|
||||
minutePixel = (osdWidth - channelHeaderWidth - channelGroupsWidth) / tvguideConfig.displayHorizontalTime;
|
||||
channelLogoWidth = channelHeaderWidth;
|
||||
channelLogoHeight = rowHeight;
|
||||
logoWidth = channelLogoHeight * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio;
|
||||
logoHeight = channelLogoHeight;
|
||||
timeLineGridWidth = geoManager.minutePixel*30;
|
||||
timeLineGridWidth = geoManager.minutePixel * 30;
|
||||
timeLineGridHeight = geoManager.timeLineHeight;
|
||||
dateVieverWidth = channelHeaderWidth + channelGroupsWidth;
|
||||
dateVieverWidth = (channelHeaderWidth + channelGroupsWidth) * 3 / 5;
|
||||
dateVieverHeight = timeLineHeight;
|
||||
clockWidth = (channelHeaderWidth + channelGroupsWidth) - dateVieverWidth;
|
||||
clockHeight = timeLineHeight;
|
||||
}
|
||||
buttonBorder = footerHeight / 6;
|
||||
buttonWidth = osdWidth / 4 - 2 * buttonBorder;
|
||||
@@ -71,4 +73,4 @@ bool cGeometryManager::SetGeometry(int osdWidth, int osdHeight, bool force) {
|
||||
channelJumpHeight = osdHeight * 20 / 100;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@@ -4,17 +4,17 @@
|
||||
class cGeometryManager {
|
||||
private:
|
||||
public:
|
||||
cGeometryManager(void);
|
||||
~cGeometryManager();
|
||||
bool SetGeometry(int osdWidth, int osdHeight, bool force = false);
|
||||
cGeometryManager(void);
|
||||
~cGeometryManager();
|
||||
bool SetGeometry(int osdWidth, int osdHeight, bool force = false);
|
||||
//Common
|
||||
int osdWidth;
|
||||
int osdHeight;
|
||||
int statusHeaderHeight;
|
||||
int osdWidth;
|
||||
int osdHeight;
|
||||
int statusHeaderHeight;
|
||||
int tvFrameWidth;
|
||||
int headerContentWidth;
|
||||
//ChannelGroups
|
||||
int channelGroupsWidth;
|
||||
int channelGroupsWidth;
|
||||
int channelGroupsHeight;
|
||||
//ContentHeader
|
||||
int channelHeaderWidth;
|
||||
@@ -51,4 +51,4 @@ public:
|
||||
int channelJumpHeight;
|
||||
};
|
||||
|
||||
#endif //__TVGUIDE_GEOMETRYMANAGER_H
|
||||
#endif //__TVGUIDE_GEOMETRYMANAGER_H
|
||||
|
34
grid.h
34
grid.h
@@ -20,39 +20,39 @@ protected:
|
||||
bool hasTimer;
|
||||
bool hasSwitchTimer;
|
||||
bool intersects(cGrid *neighbor);
|
||||
virtual time_t Duration(void) {};
|
||||
virtual time_t Duration(void) { return 0; };
|
||||
virtual void drawText(void) {};
|
||||
bool dummy;
|
||||
public:
|
||||
cGrid(cChannelColumn *c);
|
||||
virtual ~cGrid(void);
|
||||
cChannelColumn *column;
|
||||
virtual void SetViewportHeight() {};
|
||||
virtual void PositionPixmap() {};
|
||||
virtual void SetViewportHeight(void) {};
|
||||
virtual void PositionPixmap(void) {};
|
||||
virtual void setText(void) {};
|
||||
void Draw();
|
||||
void SetDirty() {dirty = true;};
|
||||
void SetActive() {dirty = true; active = true;};
|
||||
void SetInActive() {dirty = true; active = false;};
|
||||
void Draw(void);
|
||||
void SetDirty(void) {dirty = true;};
|
||||
void SetActive(void) {dirty = true; active = true;};
|
||||
void SetInActive(void) {dirty = true; active = false;};
|
||||
void SetColor(bool color) {isColor1 = color;};
|
||||
bool IsColor1() {return isColor1;};
|
||||
bool IsColor1(void) {return isColor1;};
|
||||
bool isFirst(void);
|
||||
virtual const cEvent *GetEvent() {};
|
||||
virtual const cEvent *GetEvent(void) { return NULL; };
|
||||
bool Match(time_t t);
|
||||
virtual time_t StartTime() {};
|
||||
virtual time_t EndTime() {};
|
||||
virtual time_t StartTime(void) { return 0; };
|
||||
virtual time_t EndTime(void) { return 0; };
|
||||
virtual void SetStartTime(time_t start) {};
|
||||
virtual void SetEndTime(time_t end) {};
|
||||
int calcOverlap(cGrid *neighbor);
|
||||
virtual void SetTimer() {};
|
||||
virtual void SetSwitchTimer() {};
|
||||
virtual void SetTimer(void) {};
|
||||
virtual void SetSwitchTimer(void) {};
|
||||
virtual cString getText(void) { return cString("");};
|
||||
virtual cString getTimeString(void) { return cString("");};
|
||||
bool Active(void) { return active; };
|
||||
bool HasTimer() {return hasTimer;};
|
||||
bool HasSwitchTimer() {return hasSwitchTimer;};
|
||||
bool isDummy() { return dummy; };
|
||||
bool HasTimer(void) {return hasTimer;};
|
||||
bool HasSwitchTimer(void) {return hasSwitchTimer;};
|
||||
bool isDummy(void) { return dummy; };
|
||||
virtual void debug() {};
|
||||
};
|
||||
|
||||
#endif //__TVGUIDE_GRID_H
|
||||
#endif //__TVGUIDE_GRID_H
|
||||
|
26
headergrid.c
26
headergrid.c
@@ -44,16 +44,19 @@ void cHeaderGrid::drawChannel(const cChannel *channel) {
|
||||
}
|
||||
}
|
||||
|
||||
// Draw Channel horizontal view
|
||||
|
||||
void cHeaderGrid::drawChannelHorizontal(const cChannel *channel) {
|
||||
int logoWidth = geoManager.logoWidth;
|
||||
int logoX = tvguideConfig.displayChannelName?2:(Width()-logoWidth)/2;
|
||||
int logoX = tvguideConfig.displayChannelName ? 5 : (Width() - logoWidth) / 2;
|
||||
int textX = 5;
|
||||
int textY = (Height() - fontManager.FontChannelHeaderHorizontal->Height())/2;
|
||||
int textY = (Height() - fontManager.FontChannelHeaderHorizontal->Height()) / 2;
|
||||
bool logoFound = false;
|
||||
if (!tvguideConfig.hideChannelLogos) {
|
||||
cImage *logo = imgCache.GetLogo(channel);
|
||||
if (logo) {
|
||||
pixmapLogo->DrawImage(cPoint(logoX, 0), *logo);
|
||||
const int logoheight = logo->Height();
|
||||
pixmapLogo->DrawImage(cPoint(logoX, (Height() - logoheight) / 2), *logo);
|
||||
logoFound = true;
|
||||
}
|
||||
}
|
||||
@@ -61,10 +64,11 @@ void cHeaderGrid::drawChannelHorizontal(const cChannel *channel) {
|
||||
int textWidthMax = Width() - 10;
|
||||
if (!logoFound) {
|
||||
drawText = true;
|
||||
} else if (tvguideConfig.displayChannelName) {
|
||||
}
|
||||
if (tvguideConfig.displayChannelName) {
|
||||
drawText = true;
|
||||
textX += logoWidth;
|
||||
textWidthMax -= logoWidth;
|
||||
textX += logoWidth + 5;
|
||||
textWidthMax -= textX;
|
||||
}
|
||||
if (drawText) {
|
||||
tColor colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent;
|
||||
@@ -74,6 +78,8 @@ void cHeaderGrid::drawChannelHorizontal(const cChannel *channel) {
|
||||
}
|
||||
}
|
||||
|
||||
// Draw Channel vertical view
|
||||
|
||||
void cHeaderGrid::drawChannelVertical(const cChannel *channel) {
|
||||
int logoWidth = geoManager.logoWidth;
|
||||
int logoHeight = geoManager.logoHeight;
|
||||
@@ -82,12 +88,12 @@ void cHeaderGrid::drawChannelVertical(const cChannel *channel) {
|
||||
tw.Set(*headerText, fontManager.FontChannelHeader, geoManager.colWidth - 8);
|
||||
int lines = tw.Lines();
|
||||
int lineHeight = fontManager.FontChannelHeader->Height();
|
||||
int yStart = (geoManager.channelHeaderHeight - lines*lineHeight)/2 + 8;
|
||||
int yStart = (geoManager.channelHeaderHeight - lines * lineHeight) / 2 + 8;
|
||||
bool logoFound = false;
|
||||
if (!tvguideConfig.hideChannelLogos) {
|
||||
cImage *logo = imgCache.GetLogo(channel);
|
||||
if (logo) {
|
||||
pixmapLogo->DrawImage(cPoint((Width() - logoWidth)/2, 4), *logo);
|
||||
pixmapLogo->DrawImage(cPoint((Width() - logoWidth) / 2, 6), *logo);
|
||||
logoFound = true;
|
||||
}
|
||||
}
|
||||
@@ -101,12 +107,12 @@ void cHeaderGrid::drawChannelVertical(const cChannel *channel) {
|
||||
if (!drawText)
|
||||
return;
|
||||
tColor colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent;
|
||||
for (int i=0; i<lines; i++) {
|
||||
for (int i = 0; i < lines; i++) {
|
||||
int textWidth = fontManager.FontChannelHeader->Width(tw.GetLine(i));
|
||||
int xText = (geoManager.colWidth - textWidth) / 2;
|
||||
if (xText < 0)
|
||||
xText = 0;
|
||||
pixmap->DrawText(cPoint(xText, yStart + i*lineHeight), tw.GetLine(i), theme.Color(clrFontHeader), colorTextBack, fontManager.FontChannelHeader);
|
||||
pixmap->DrawText(cPoint(xText, yStart + i * lineHeight), tw.GetLine(i), theme.Color(clrFontHeader), colorTextBack, fontManager.FontChannelHeader);
|
||||
}
|
||||
}
|
||||
|
||||
|
15
imagecache.c
15
imagecache.c
@@ -280,7 +280,12 @@ void cImageCache::CreateLogoCache(void) {
|
||||
return;
|
||||
if (tvguideConfig.numLogosInitial > 0) {
|
||||
int channelsCached = 0;
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
for (const cChannel *channel = Channels->First(); channel; channel = Channels->Next(channel)) {
|
||||
#else
|
||||
for (const cChannel *channel = Channels.First(); channel; channel = Channels.Next(channel)) {
|
||||
#endif
|
||||
if (channelsCached >= tvguideConfig.numLogosInitial)
|
||||
break;
|
||||
if (!channel->GroupSep()) {
|
||||
@@ -346,7 +351,7 @@ cImage *cImageCache::GetLogo(const cChannel *channel) {
|
||||
} else {
|
||||
bool success = LoadLogo(channel);
|
||||
if (success) {
|
||||
if ((tvguideConfig.limitLogoCache) && (logoCache.size() >= tvguideConfig.numLogosMax)) {
|
||||
if ((tvguideConfig.limitLogoCache) && ((int)logoCache.size() >= tvguideConfig.numLogosMax)) {
|
||||
//logo cache is full, don't cache anymore
|
||||
if (tempStaticLogo) {
|
||||
delete tempStaticLogo;
|
||||
@@ -455,7 +460,7 @@ void cImageCache::AddCornersHorizontal(cImage *img, bool active) {
|
||||
}
|
||||
if (!cornerLeft || !cornerRight)
|
||||
return;
|
||||
int maxX = min(cornerWidth, imgWidth);
|
||||
int maxX = std::min(cornerWidth, imgWidth);
|
||||
for (int row = 0; row < cornerHeight; row++) {
|
||||
for (int col = 0; col < maxX; ++col) {
|
||||
img->SetPixel(cPoint(col, row), cornerLeft->GetPixel(cPoint(col, row)));
|
||||
@@ -477,7 +482,7 @@ void cImageCache::AddCornersVertical(cImage *img, bool active) {
|
||||
}
|
||||
if (!cornerHead || !cornerBottom)
|
||||
return;
|
||||
int maxY = min(cornerHeight, imgHeight);
|
||||
int maxY = std::min(cornerHeight, imgHeight);
|
||||
for (int row = 0; row < maxY; row++) {
|
||||
for (int col = 0; col < cornerWidth; ++col) {
|
||||
img->SetPixel(cPoint(col, row), cornerHead->GetPixel(cPoint(col, row)));
|
||||
@@ -522,7 +527,7 @@ void cImageCache::AddCornersGroupHorizontal(cImage *img) {
|
||||
int imgWidth = img->Width();
|
||||
int imgHeight = img->Height();
|
||||
int heightHeadBottom = groupsHead->Height();
|
||||
int maxY = min(heightHeadBottom, imgHeight);
|
||||
int maxY = std::min(heightHeadBottom, imgHeight);
|
||||
for (int row = 0; row < maxY; row++) {
|
||||
for (int col = 0; col < imgWidth; ++col) {
|
||||
img->SetPixel(cPoint(col, row), groupsHead->GetPixel(cPoint(col, row)));
|
||||
@@ -537,7 +542,7 @@ void cImageCache::AddCornersGroupVertical(cImage *img) {
|
||||
int imgWidth = img->Width();
|
||||
int imgHeight = img->Height();
|
||||
int widthLeftRight = groupsLeft->Width();
|
||||
int maxX = min(widthLeftRight, imgWidth);
|
||||
int maxX = std::min(widthLeftRight, imgWidth);
|
||||
for (int row = 0; row < imgHeight; row++) {
|
||||
for (int col = 0; col < maxX; ++col) {
|
||||
img->SetPixel(cPoint(col, row), groupsLeft->GetPixel(cPoint(col, row)));
|
||||
|
@@ -173,7 +173,7 @@ void cImageLoader::CreateGradient(tColor back, tColor blend, int width, int heig
|
||||
for (int x = 0; x < width; x++) {
|
||||
for (int y = 0; y < height; y++) {
|
||||
PixelPacket *pixel = pixels + y * width + x;
|
||||
int opacity = (maxw / width * x + maxh - maxh / height * y) / 2;
|
||||
unsigned int opacity = (maxw / width * x + maxh - maxh / height * y) / 2;
|
||||
pixel->opacity = (opacity <= MaxRGB) ? opacity : MaxRGB;
|
||||
}
|
||||
}
|
||||
@@ -183,4 +183,4 @@ void cImageLoader::CreateGradient(tColor back, tColor blend, int width, int heig
|
||||
imgback.composite(imgblend, 0, 0, OverCompositeOp);
|
||||
|
||||
buffer = imgback;
|
||||
}
|
||||
}
|
||||
|
@@ -145,7 +145,7 @@ void cImageMagickWrapper::CreateGradient(tColor back, tColor blend, int width, i
|
||||
for (int x = 0; x < width; x++) {
|
||||
for (int y = 0; y < height; y++) {
|
||||
PixelPacket *pixel = pixels + y * width + x;
|
||||
int opacity = (maxw / width * x + maxh - maxh / height * y) / 2;
|
||||
unsigned int opacity = (maxw / width * x + maxh - maxh / height * y) / 2;
|
||||
pixel->opacity = (opacity <= MaxRGB) ? opacity : MaxRGB;
|
||||
}
|
||||
}
|
||||
@@ -159,4 +159,4 @@ void cImageMagickWrapper::CreateGradient(tColor back, tColor blend, int width, i
|
||||
|
||||
void cImageMagickWrapper::CreateBackground(tColor back, tColor blend, int width, int height) {
|
||||
CreateGradient(back, blend, width, height, 0.8, 0.8);
|
||||
}
|
||||
}
|
||||
|
33
po/ca_ES.po
33
po/ca_ES.po
@@ -3,7 +3,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-tvguide 0.0.1\n"
|
||||
"Report-Msgid-Bugs-To: <see README>\n"
|
||||
"POT-Creation-Date: 2014-05-10 17:24+0200\n"
|
||||
"POT-Creation-Date: 2019-04-12 14:35+0200\n"
|
||||
"PO-Revision-Date: 2013-09-21 17:49+0200\n"
|
||||
"Last-Translator: My friend <Sampep> Thanks David <Gabychan> <gbonich@gmail.com>\n"
|
||||
"Language-Team: \n"
|
||||
@@ -366,6 +366,9 @@ msgstr "Inicia canal"
|
||||
msgid "Stop Channel"
|
||||
msgstr "Atura canal"
|
||||
|
||||
msgid "Channel Group"
|
||||
msgstr ""
|
||||
|
||||
msgid "Start after"
|
||||
msgstr "Comença després"
|
||||
|
||||
@@ -525,6 +528,12 @@ msgstr "coincidència exacta"
|
||||
msgid "regular expression"
|
||||
msgstr "expressió regular"
|
||||
|
||||
msgid "Interval"
|
||||
msgstr ""
|
||||
|
||||
msgid "only FTA"
|
||||
msgstr ""
|
||||
|
||||
msgid "General Settings"
|
||||
msgstr "Preferències"
|
||||
|
||||
@@ -783,13 +792,19 @@ msgstr ""
|
||||
msgid "Use Remotetimers"
|
||||
msgstr "Utilitza temporitzadors remots"
|
||||
|
||||
msgid "Limit channels in favorites"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use \"What's on now\" in favorites"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use \"What's on next\" in favorites"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use user defined time 1 in favorites"
|
||||
msgid "User defined times in favorites:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use user defined time 1"
|
||||
msgstr ""
|
||||
|
||||
msgid "Description"
|
||||
@@ -798,16 +813,19 @@ msgstr ""
|
||||
msgid "Time"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use user defined time 2 in favorites"
|
||||
msgid "Use user defined time 2"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use user defined time 3 in favorites"
|
||||
msgid "Use user defined time 3"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use user defined time 4 in favorites"
|
||||
msgid "Use user defined time 4"
|
||||
msgstr ""
|
||||
|
||||
msgid "Limit channels in favorites"
|
||||
msgid "Switchtimer:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Switch (x)min before start of the show"
|
||||
msgstr ""
|
||||
|
||||
msgid "Create Log Messages for image loading"
|
||||
@@ -840,6 +858,9 @@ msgstr ""
|
||||
msgid "Recording Menus Icon Cache"
|
||||
msgstr ""
|
||||
|
||||
msgid "A fancy 2d EPG Viewer"
|
||||
msgstr ""
|
||||
|
||||
msgid "No Cast available"
|
||||
msgstr ""
|
||||
|
||||
|
44
po/de_DE.po
Executable file → Normal file
44
po/de_DE.po
Executable file → Normal file
@@ -3,7 +3,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-tvguide 0.0.1\n"
|
||||
"Report-Msgid-Bugs-To: <see README>\n"
|
||||
"POT-Creation-Date: 2014-05-10 17:24+0200\n"
|
||||
"POT-Creation-Date: 2019-04-12 14:35+0200\n"
|
||||
"PO-Revision-Date: 2012-08-25 17:49+0200\n"
|
||||
"Last-Translator: Horst\n"
|
||||
"Language-Team: \n"
|
||||
@@ -363,6 +363,9 @@ msgstr "Startkanal"
|
||||
msgid "Stop Channel"
|
||||
msgstr "Stopkanal"
|
||||
|
||||
msgid "Channel Group"
|
||||
msgstr "Kanalgruppe"
|
||||
|
||||
msgid "Start after"
|
||||
msgstr "Beginn nach"
|
||||
|
||||
@@ -522,6 +525,12 @@ msgstr "exakt"
|
||||
msgid "regular expression"
|
||||
msgstr "Regulärer Ausdruck"
|
||||
|
||||
msgid "Interval"
|
||||
msgstr "Bereich"
|
||||
|
||||
msgid "only FTA"
|
||||
msgstr "ohne PayTV"
|
||||
|
||||
msgid "General Settings"
|
||||
msgstr "Allgemeine Einstellungen"
|
||||
|
||||
@@ -780,14 +789,20 @@ msgstr "Verzeichnis für Sofortaufnahmen"
|
||||
msgid "Use Remotetimers"
|
||||
msgstr "RemoteTimers benutzen"
|
||||
|
||||
msgid "Limit channels in favorites"
|
||||
msgstr "Kanäle in Favoriten beschränken"
|
||||
|
||||
msgid "Use \"What's on now\" in favorites"
|
||||
msgstr "\"Was läuft jetzt\" in Favoriten benutzen"
|
||||
|
||||
msgid "Use \"What's on next\" in favorites"
|
||||
msgstr "\"Was läuft als nächstes\" in Favoriten benutzen"
|
||||
|
||||
msgid "Use user defined time 1 in favorites"
|
||||
msgstr "Benutzerdef. Zeit 1 in Favoriten benutzen"
|
||||
msgid "User defined times in favorites:"
|
||||
msgstr "Nutzer definierte Zeiten in Favoriten:"
|
||||
|
||||
msgid "Use user defined time 1"
|
||||
msgstr "Verw. benutzerdef. Zeit 1"
|
||||
|
||||
msgid "Description"
|
||||
msgstr "Beschreibung"
|
||||
@@ -795,17 +810,20 @@ msgstr "Beschreibung"
|
||||
msgid "Time"
|
||||
msgstr "Zeit"
|
||||
|
||||
msgid "Use user defined time 2 in favorites"
|
||||
msgstr "Benutzerdef. Zeit 2 in Favoriten benutzen"
|
||||
msgid "Use user defined time 2"
|
||||
msgstr "Verw. benutzerdef. Zeit 2"
|
||||
|
||||
msgid "Use user defined time 3 in favorites"
|
||||
msgstr "Benutzerdef. Zeit 3 in Favoriten benutzen"
|
||||
msgid "Use user defined time 3"
|
||||
msgstr "Verw. benutzerdef. Zeit 3"
|
||||
|
||||
msgid "Use user defined time 4 in favorites"
|
||||
msgstr "Benutzerdef. Zeit 4 in Favoriten benutzen"
|
||||
msgid "Use user defined time 4"
|
||||
msgstr "Verw. benutzerdef. Zeit 4"
|
||||
|
||||
msgid "Limit channels in favorites"
|
||||
msgstr "Kanäle in Favoriten beschränken"
|
||||
msgid "Switchtimer:"
|
||||
msgstr "Umschalttimer:"
|
||||
|
||||
msgid "Switch (x)min before start of the show"
|
||||
msgstr "Umschalten (x)min vor der Sendung"
|
||||
|
||||
msgid "Create Log Messages for image loading"
|
||||
msgstr "Log Nachrichten für das Laden der Bilder erzeugen"
|
||||
@@ -837,6 +855,9 @@ msgstr "Kanalgruppen Cache"
|
||||
msgid "Recording Menus Icon Cache"
|
||||
msgstr "Recording Menüs Icon Cache"
|
||||
|
||||
msgid "A fancy 2d EPG Viewer"
|
||||
msgstr "Eine schicke Programm Vorschau"
|
||||
|
||||
msgid "No Cast available"
|
||||
msgstr "Keine Besetzung vorhanden"
|
||||
|
||||
@@ -938,4 +959,3 @@ msgstr "TheMovieDB Popularität"
|
||||
|
||||
msgid "TheMovieDB Vote Average"
|
||||
msgstr "TheMovieDB durchschnittliche Bewertung"
|
||||
|
||||
|
961
po/it_IT.po
Normal file
961
po/it_IT.po
Normal file
@@ -0,0 +1,961 @@
|
||||
# VDR plugin language source file.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-tvguide 0.0.1\n"
|
||||
"Report-Msgid-Bugs-To: <see README>\n"
|
||||
"POT-Creation-Date: 2019-04-12 14:35+0200\n"
|
||||
"PO-Revision-Date: 2012-08-25 17:49+0200\n"
|
||||
"Last-Translator: fiveten_59\n"
|
||||
"Language-Team: \n"
|
||||
"Language: it\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
msgid "Main Program"
|
||||
msgstr "Programma principale"
|
||||
|
||||
msgid "Channel"
|
||||
msgstr "Canale"
|
||||
|
||||
msgid "min"
|
||||
msgstr "min"
|
||||
|
||||
msgid "Reruns of "
|
||||
msgstr "Riavvio di "
|
||||
|
||||
msgid "No reruns found"
|
||||
msgstr "Nessun riavvio trovato"
|
||||
|
||||
msgid "No EPG Information available"
|
||||
msgstr "Nessuna informazione EPG disponibile"
|
||||
|
||||
msgid "Search & Rec"
|
||||
msgstr "Cerca & Registra"
|
||||
|
||||
msgid "Channels back"
|
||||
msgstr "Canale precedente"
|
||||
|
||||
msgid "Channels forward"
|
||||
msgstr "Canale seguente"
|
||||
|
||||
msgid "Switch to Channel"
|
||||
msgstr "Cambia al Canale"
|
||||
|
||||
msgid "Detailed EPG"
|
||||
msgstr "EPG dettagliato"
|
||||
|
||||
msgid "Close detailed EPG"
|
||||
msgstr "Chiudi EPG dettagliato"
|
||||
|
||||
msgid "Favorites"
|
||||
msgstr "Favoriti"
|
||||
|
||||
msgid "images"
|
||||
msgstr "Immagini"
|
||||
|
||||
msgid "root video folder"
|
||||
msgstr "cartella video di root"
|
||||
|
||||
msgid "Transp."
|
||||
msgstr "Transp."
|
||||
|
||||
msgid "Timer Conflict"
|
||||
msgstr "Timer in conflitto"
|
||||
|
||||
msgid "all Channels"
|
||||
msgstr "Tutti i Canali"
|
||||
|
||||
msgid "unknown channel"
|
||||
msgstr "Canale sconosciuto"
|
||||
|
||||
msgid "Duration"
|
||||
msgstr "Durata"
|
||||
|
||||
msgid "recorded at"
|
||||
msgstr "registrato a"
|
||||
|
||||
msgid "from"
|
||||
msgstr "da"
|
||||
|
||||
msgid "Timers for"
|
||||
msgstr "Timers per"
|
||||
|
||||
msgid "Rec"
|
||||
msgstr "Rec"
|
||||
|
||||
msgid "No Timers active"
|
||||
msgstr "Nessun Timer attivo"
|
||||
|
||||
msgid "inactive"
|
||||
msgstr "inattivo"
|
||||
|
||||
msgid "active timers"
|
||||
msgstr "Timers attivi"
|
||||
|
||||
msgid "recordings done"
|
||||
msgstr "registrazione eseguita"
|
||||
|
||||
msgid "What's on now"
|
||||
msgstr "Was läuft jetzt?"
|
||||
|
||||
msgid "What's on next"
|
||||
msgstr "Was läuft als nächstes?"
|
||||
|
||||
msgid "Instant Record"
|
||||
msgstr "Registrazione immediata"
|
||||
|
||||
msgid "Delete Timer"
|
||||
msgstr "Cancella il Timer"
|
||||
|
||||
msgid "Edit Timer"
|
||||
msgstr "Edita il Timer"
|
||||
|
||||
msgid "Timer Timeline"
|
||||
msgstr "Scadenza del Timer"
|
||||
|
||||
msgid "Create Search Timer"
|
||||
msgstr "Crea Search Timer"
|
||||
|
||||
msgid "Search Timers"
|
||||
msgstr "Search Timers"
|
||||
|
||||
msgid "Create Series Timer"
|
||||
msgstr "Crea Series Timer"
|
||||
|
||||
msgid "Create Switch Timer"
|
||||
msgstr "Crea lo Switch Timer"
|
||||
|
||||
msgid "Delete Switch Timer"
|
||||
msgstr "Rimuovi lo Switch Timer"
|
||||
|
||||
msgid "Search"
|
||||
msgstr "Cerca"
|
||||
|
||||
msgid "Check for Timer Conflicts"
|
||||
msgstr "Verifica conflitti del Timer"
|
||||
|
||||
msgid "Search in Recordings"
|
||||
msgstr "Cerca nelle registrazioni"
|
||||
|
||||
msgid "Set Folder for"
|
||||
msgstr "Crea cartella per"
|
||||
|
||||
msgid "Timer created"
|
||||
msgstr "Timer creato"
|
||||
|
||||
msgid "Timer NOT created"
|
||||
msgstr "Timer non creato"
|
||||
|
||||
msgid "OK"
|
||||
msgstr "OK"
|
||||
|
||||
msgid "Timer deleted"
|
||||
msgstr "Timer eliminato"
|
||||
|
||||
msgid "Timer"
|
||||
msgstr "Timer"
|
||||
|
||||
msgid "still recording - really delete?"
|
||||
msgstr "registrazione in corso - vuoi veramente eliminare?"
|
||||
|
||||
msgid "Yes"
|
||||
msgstr "Si"
|
||||
|
||||
msgid "No"
|
||||
msgstr "No"
|
||||
|
||||
msgid "One"
|
||||
msgstr "Uno"
|
||||
|
||||
msgid "detected"
|
||||
msgstr "rilevato"
|
||||
|
||||
msgid "Timer Conflicts"
|
||||
msgstr "Conflitti del Timer"
|
||||
|
||||
msgid "Show conflict"
|
||||
msgstr "Mostra conflitto"
|
||||
|
||||
msgid "timers involved"
|
||||
msgstr "Timers impegnati"
|
||||
|
||||
msgid "Ignore Conflicts"
|
||||
msgstr "Ignora conflitti"
|
||||
|
||||
msgid "Ignore Conflict"
|
||||
msgstr "Ignora conflitto"
|
||||
|
||||
msgid "No Timer Conflicts found"
|
||||
msgstr "Nessun conflitto rilevato nel Timer"
|
||||
|
||||
msgid "Close"
|
||||
msgstr "Chiudere"
|
||||
|
||||
msgid "reruns for"
|
||||
msgstr "riavvii per"
|
||||
|
||||
msgid "rerun for"
|
||||
msgstr "riavvio per"
|
||||
|
||||
msgid "found"
|
||||
msgstr "trovato"
|
||||
|
||||
msgid "Ignore reruns"
|
||||
msgstr "Wiederholungen ignorieren"
|
||||
|
||||
msgid "No reruns found for Event"
|
||||
msgstr "Nessun riavvio trovato per l'evento"
|
||||
|
||||
msgid "Timer for"
|
||||
msgstr "Timer per"
|
||||
|
||||
msgid "replaced by rerun"
|
||||
msgstr "rimosso dal riavvio"
|
||||
|
||||
msgid "Timer Active"
|
||||
msgstr "Timer attivo"
|
||||
|
||||
msgid "Priority"
|
||||
msgstr "Priorità"
|
||||
|
||||
msgid "Lifetime"
|
||||
msgstr "Durata"
|
||||
|
||||
msgid "Day"
|
||||
msgstr "Giorno"
|
||||
|
||||
msgid "Timer start time"
|
||||
msgstr "Ora d'inizio del Timer"
|
||||
|
||||
msgid "Timer stop time"
|
||||
msgstr "Ora finale del Timer"
|
||||
|
||||
msgid "Timer File"
|
||||
msgstr "File del Timer"
|
||||
|
||||
msgid "New Folder"
|
||||
msgstr "Nuova cartella"
|
||||
|
||||
msgid "Save"
|
||||
msgstr "Salva"
|
||||
|
||||
msgid "Cancel"
|
||||
msgstr "Cancella"
|
||||
|
||||
msgid "Create Series Timer based on"
|
||||
msgstr "Crea il Series Timer basato su"
|
||||
|
||||
msgid "Series Timer start time"
|
||||
msgstr "Ora d'avvio del Series Timer"
|
||||
|
||||
msgid "Series Timer stop time"
|
||||
msgstr "Ora di chiusura del Series Timer"
|
||||
|
||||
msgid "Days to record"
|
||||
msgstr "Giorni da registrare"
|
||||
|
||||
msgid "Day to start"
|
||||
msgstr "Giorno d'inizio"
|
||||
|
||||
msgid "Create Timer"
|
||||
msgstr "Crea il Timer"
|
||||
|
||||
msgid "Series Timer created"
|
||||
msgstr "Series Timer creato"
|
||||
|
||||
msgid "Start"
|
||||
msgstr "Avvio"
|
||||
|
||||
msgid "Stop"
|
||||
msgstr "Ferma"
|
||||
|
||||
msgid "Configure Search Timer based on"
|
||||
msgstr "Configura il Search Timer in serie basato su"
|
||||
|
||||
msgid "Search Expression:"
|
||||
msgstr "Cerca espressione:"
|
||||
|
||||
msgid "Continue"
|
||||
msgstr "Continua"
|
||||
|
||||
msgid "Configure Search Timer for Search String"
|
||||
msgstr "Configura il Search Timer basato su Search String"
|
||||
|
||||
msgid "Manually configure Options"
|
||||
msgstr "Configura manualmente le Opzioni"
|
||||
|
||||
msgid "Use Template"
|
||||
msgstr "Utilizza Template"
|
||||
|
||||
msgid "EPGSearch Search Timers"
|
||||
msgstr "EPGSearch Search Timers"
|
||||
|
||||
msgid "No Search Timers Configured"
|
||||
msgstr "Messun Search Timers configurato"
|
||||
|
||||
msgid "Configure Search Timer Options"
|
||||
msgstr "Configura le opzione del Search Timer"
|
||||
|
||||
msgid "Save Search Timer"
|
||||
msgstr "Salva il Search Timer"
|
||||
|
||||
msgid "Search String"
|
||||
msgstr "Suchbegriff"
|
||||
|
||||
msgid "Active"
|
||||
msgstr "Attivo"
|
||||
|
||||
msgid "Search Mode"
|
||||
msgstr "Modalità di ricerca"
|
||||
|
||||
msgid "Use Title"
|
||||
msgstr "Usa Titolo"
|
||||
|
||||
msgid "Use Subtitle"
|
||||
msgstr "Usa Sottotitolo"
|
||||
|
||||
msgid "Use Description"
|
||||
msgstr "Usa Descrizione"
|
||||
|
||||
msgid "Limit Channels"
|
||||
msgstr "Limite Canale"
|
||||
|
||||
msgid "Use Time"
|
||||
msgstr "Utilizza Time"
|
||||
|
||||
msgid "Display advanced Options"
|
||||
msgstr "Mostra Opzioni avanzate"
|
||||
|
||||
msgid "Limit Days of the Week"
|
||||
msgstr "Limite dei giorni della settimana"
|
||||
|
||||
msgid "Time margin for start in minutes"
|
||||
msgstr "Margine di tempo per l'avvio in minuti"
|
||||
|
||||
msgid "Time margin for stop in minutes"
|
||||
msgstr "Margine di tempo per lo stop in minuti"
|
||||
|
||||
msgid "Series Recording"
|
||||
msgstr "Serie di registrazioni"
|
||||
|
||||
msgid "Folder"
|
||||
msgstr "Cartella"
|
||||
|
||||
msgid "Use VPS"
|
||||
msgstr "Utilizza VPS"
|
||||
|
||||
msgid "Avoid Repeats"
|
||||
msgstr "Evita ripetizioni"
|
||||
|
||||
msgid "Use in Favorites"
|
||||
msgstr "Utilizza nei favoriti"
|
||||
|
||||
msgid "Hide advanced Options"
|
||||
msgstr "Nascondi Opzioni avanzate"
|
||||
|
||||
msgid "Display Results for Search Timer"
|
||||
msgstr "Mostra risultati per il Search Timer"
|
||||
|
||||
msgid "Start Channel"
|
||||
msgstr "Avvia il Canale"
|
||||
|
||||
msgid "Stop Channel"
|
||||
msgstr "Ferma il Canale"
|
||||
|
||||
msgid "Channel Group"
|
||||
msgstr ""
|
||||
|
||||
msgid "Start after"
|
||||
msgstr "Avvia dopo"
|
||||
|
||||
msgid "Start before"
|
||||
msgstr "Avvia prima"
|
||||
|
||||
msgid "Select Days"
|
||||
msgstr "Seleziona i giorni"
|
||||
|
||||
msgid "Number of allowed repeats"
|
||||
msgstr "Numero di ripetizioni permesse"
|
||||
|
||||
msgid "Compare Title"
|
||||
msgstr "Confonta Titolo"
|
||||
|
||||
msgid "Compare Subtitle"
|
||||
msgstr "Confonta Sottotitolo"
|
||||
|
||||
msgid "Compare Description"
|
||||
msgstr "Confonta Descrizione"
|
||||
|
||||
msgid "Really delete Search Timer"
|
||||
msgstr "Veramente eliminare il Search Timer"
|
||||
|
||||
msgid "Delete only Search Timer"
|
||||
msgstr "Elimina solo il Search Timer"
|
||||
|
||||
msgid "Delete Search Timer and created Timers"
|
||||
msgstr "Elimina il Search Timer e Timers creati"
|
||||
|
||||
msgid "Search Timer sucessfully created."
|
||||
msgstr "Search Timer creato con successo"
|
||||
|
||||
msgid "Search Timer update initialised"
|
||||
msgstr "Search Timer aggiornato con successo"
|
||||
|
||||
msgid "Search Timer NOT sucessfully created"
|
||||
msgstr "Suchtimer NICHT erfolgreich angelegt"
|
||||
|
||||
msgid "Creating Search Timer"
|
||||
msgstr "Creando il Search Timer"
|
||||
|
||||
msgid "Search Term"
|
||||
msgstr "Suchbegriff"
|
||||
|
||||
msgid "Using Template"
|
||||
msgstr "Template"
|
||||
|
||||
msgid "Use other Template"
|
||||
msgstr "Anderes Template benutzen"
|
||||
|
||||
msgid "search results for Favorite"
|
||||
msgstr "Suchergebnisse für Favorit"
|
||||
|
||||
msgid "search result for Favorite"
|
||||
msgstr "Suchergebnis für Favorit"
|
||||
|
||||
msgid "search results for Search Timer"
|
||||
msgstr "Treffer für Suchtimer"
|
||||
|
||||
msgid "search result for Search Timer"
|
||||
msgstr "Treffer für Suchtimer"
|
||||
|
||||
msgid "Nothing found for Search String"
|
||||
msgstr "Keine Treffer für Suchbegriff"
|
||||
|
||||
msgid "Configure Options for Switchtimer"
|
||||
msgstr "Optionen für Umschalttimer konfigurieren"
|
||||
|
||||
msgid "Minutes before switching"
|
||||
msgstr "Minuten vor umschalten"
|
||||
|
||||
msgid "switch"
|
||||
msgstr "cambio"
|
||||
|
||||
msgid "announce only"
|
||||
msgstr "Segnala solamente"
|
||||
|
||||
msgid "ask for switch"
|
||||
msgstr "chiedi per cambiare"
|
||||
|
||||
msgid "Switch Mode"
|
||||
msgstr "Modalità Switch"
|
||||
|
||||
msgid "Create"
|
||||
msgstr "Creare"
|
||||
|
||||
msgid "Switch Timer sucessfully created"
|
||||
msgstr "Switch Timer creato con successo"
|
||||
|
||||
msgid "Switch Timer NOT sucessfully created"
|
||||
msgstr "Switch Timer NON creato"
|
||||
|
||||
msgid "Switch Timer deleted"
|
||||
msgstr "Switch Timer eliminato"
|
||||
|
||||
msgid "Channel to Search"
|
||||
msgstr "Canale da cercare"
|
||||
|
||||
msgid "Search in title"
|
||||
msgstr "Cerca nel titolo"
|
||||
|
||||
msgid "Search in Subtitle"
|
||||
msgstr "Cerca nel sottotitolo"
|
||||
|
||||
msgid "Search in Description"
|
||||
msgstr "Cerca nella descrizione"
|
||||
|
||||
msgid "Show Search Options"
|
||||
msgstr "Mostra opzioni di ricerca"
|
||||
|
||||
msgid "Perform Search"
|
||||
msgstr "Fai una ricerca"
|
||||
|
||||
msgid "search results for"
|
||||
msgstr "cerca risultati per"
|
||||
|
||||
msgid "search result for"
|
||||
msgstr "cerca risultato per"
|
||||
|
||||
msgid "Adapt Search"
|
||||
msgstr "Adatta la ricerca"
|
||||
|
||||
msgid "Search String has to have at least three letters"
|
||||
msgstr "Search String deve avere almeno tre lettere"
|
||||
|
||||
msgid "Found"
|
||||
msgstr "Trovato"
|
||||
|
||||
msgid "recording"
|
||||
msgstr "registrazione"
|
||||
|
||||
msgid "recordings"
|
||||
msgstr "registrazioni"
|
||||
|
||||
msgid "for"
|
||||
msgstr "per"
|
||||
|
||||
msgid "No recordings found for"
|
||||
msgstr "Nessuna registrazione trovata per"
|
||||
|
||||
msgid "No Favorites available"
|
||||
msgstr "Nessun Favoriti disponibile"
|
||||
|
||||
msgid "whole term must appear"
|
||||
msgstr "vollständiger Ausdruck"
|
||||
|
||||
msgid "all terms must exist"
|
||||
msgstr "tutte le parole devono esistere"
|
||||
|
||||
msgid "one term must exist"
|
||||
msgstr "ein Wort"
|
||||
|
||||
msgid "exact match"
|
||||
msgstr "exakt"
|
||||
|
||||
msgid "regular expression"
|
||||
msgstr "Regulärer Ausdruck"
|
||||
|
||||
msgid "Interval"
|
||||
msgstr ""
|
||||
|
||||
msgid "only FTA"
|
||||
msgstr ""
|
||||
|
||||
msgid "General Settings"
|
||||
msgstr "Allgemeine Einstellungen"
|
||||
|
||||
msgid "Screen Presentation"
|
||||
msgstr "Anzeigeoptionen"
|
||||
|
||||
msgid "Fonts and Fontsizes"
|
||||
msgstr "Schriften und Schriftgrößen"
|
||||
|
||||
msgid "Recording Menus and Favorites"
|
||||
msgstr "Aufzeichnungsmenü und Favoriten"
|
||||
|
||||
msgid "Image Loading and Caching"
|
||||
msgstr "Image Loading und Caching"
|
||||
|
||||
msgid "x channels back / forward"
|
||||
msgstr "x canali precedente / successivo"
|
||||
|
||||
msgid "previous / next channel group"
|
||||
msgstr "precedente / successivo Gruppo Canali"
|
||||
|
||||
msgid "Blue: Channel Switch, Ok: Detailed EPG"
|
||||
msgstr "Blu: Cambio canale, OK: EPG dettagliat"
|
||||
|
||||
msgid "Blue: Detailed EPG, Ok: Channel Switch"
|
||||
msgstr "Blu: EPG dettagliato, OK: Cambio canale"
|
||||
|
||||
msgid "Blue: Favorites / Switch, Ok: Detailed EPG"
|
||||
msgstr "Blau: Favoriten / Umschalten, OK: Det. EPG"
|
||||
|
||||
msgid "Timely Jump"
|
||||
msgstr "Zeitsprung"
|
||||
|
||||
msgid "Jump to specific channel"
|
||||
msgstr "Passa ad uno specifico canale"
|
||||
|
||||
msgid "never"
|
||||
msgstr "mai"
|
||||
|
||||
msgid "if exists"
|
||||
msgstr "se esiste"
|
||||
|
||||
msgid "always"
|
||||
msgstr "sempre"
|
||||
|
||||
msgid "Show Main Menu Entry"
|
||||
msgstr "Hauptmenüeintrag anzeigen"
|
||||
|
||||
msgid "Replace VDR Schedules Menu"
|
||||
msgstr "VDR Programm Menü ersetzen"
|
||||
|
||||
msgid "Use appropriate nOpacity Theme"
|
||||
msgstr "Entsprechendes nOpacity Theme benutzen"
|
||||
|
||||
msgid "Theme"
|
||||
msgstr "Tema"
|
||||
|
||||
msgid "Time to display in minutes"
|
||||
msgstr "Angezeigte Zeitspanne in Minuten"
|
||||
|
||||
msgid "Rounded Corners"
|
||||
msgstr "Angoli arrotondati"
|
||||
|
||||
msgid "Channel Jump Mode (Keys Green / Yellow)"
|
||||
msgstr "Modalità cambio canale (Tasti verde / giallo)"
|
||||
|
||||
msgid "Keys Blue and OK"
|
||||
msgstr "Tasto Blu e OK"
|
||||
|
||||
msgid "Close TVGuide after channel switch"
|
||||
msgstr "Chiudi TVGuide dopo cambio canale"
|
||||
|
||||
msgid "Functionality of numeric Keys"
|
||||
msgstr "Funzionalità dei tasti numerici"
|
||||
|
||||
msgid "Hide last Channel Group"
|
||||
msgstr "Nascondi l'ultimo Gruppo Canali"
|
||||
|
||||
msgid "Big Step (Keys 1 / 3) in hours"
|
||||
msgstr "Piccolo salto (Tasti 1 / 3) in ore"
|
||||
|
||||
msgid "Huge Step (Keys 4 / 6) in hours"
|
||||
msgstr "Gran salto (Tasti 4 / 6) in ore"
|
||||
|
||||
msgid "Time Format (12h/24h)"
|
||||
msgstr "Formato ora (12h/24h)"
|
||||
|
||||
msgid "EPG Window Text Scrolling Speed"
|
||||
msgstr "Velocità di scorrimento della finestra EPG"
|
||||
|
||||
msgid "Display Reruns in detailed EPG View"
|
||||
msgstr "Wiederholungen in der detailierten EPG Ansicht anzeigen"
|
||||
|
||||
msgid "Number of reruns to display"
|
||||
msgstr "Numero di riavvii da visualizzare"
|
||||
|
||||
msgid "Use Subtitle for reruns"
|
||||
msgstr "Untertitel für Wiederholungssuche nutzen"
|
||||
|
||||
msgid "Display Mode"
|
||||
msgstr "Anzeigemodus"
|
||||
|
||||
msgid "Height of Channel Header (Perc. of osd height)"
|
||||
msgstr "Höhe des Kanalheaders (% der OSD Höhe)"
|
||||
|
||||
msgid "Width of Timeline (Perc. of osd width)"
|
||||
msgstr "Breite der Zeitleiste (% der OSD Breite)"
|
||||
|
||||
msgid "Number of Channels to display"
|
||||
msgstr "Anzahl der angezeigten Kanäle"
|
||||
|
||||
msgid "Width of Channel Header (Perc. of osd width)"
|
||||
msgstr "Breite des Kanalheaders (% der OSD Breite)"
|
||||
|
||||
msgid "Height of Timeline (Perc. of osd height)"
|
||||
msgstr "Höhe der Zeitleiste (% der OSD Höhe)"
|
||||
|
||||
msgid "Display time in EPG Grids"
|
||||
msgstr "Zeit in EPG Grids anzeigen"
|
||||
|
||||
msgid "Height of Headers (Status Header and EPG View, Perc. of osd height)"
|
||||
msgstr "Höhe der Header (Status Header und EPG View, % der OSD Höhe)"
|
||||
|
||||
msgid "Height of Footer (Perc. of osd height)"
|
||||
msgstr "Höhe des Footers (% der OSD Höhe)"
|
||||
|
||||
msgid "Display status header"
|
||||
msgstr "Status Header anzeigen"
|
||||
|
||||
msgid "Scale video to upper right corner"
|
||||
msgstr "Video in obere rechte Ecke skalieren"
|
||||
|
||||
msgid "Rounded corners around video frame"
|
||||
msgstr "Abgerundete Ecken um Videofenster"
|
||||
|
||||
msgid "Display Channel Names in Header"
|
||||
msgstr "Kanalnamen im Header anzeigen"
|
||||
|
||||
msgid "Display channel groups"
|
||||
msgstr "Kanalgruppen anzeigen"
|
||||
|
||||
msgid "Height of channel groups (Perc. of osd height)"
|
||||
msgstr "Höhe der Kanalgruppen (% der OSD Höhe)"
|
||||
|
||||
msgid "Width of channel groups (Perc. of osd width)"
|
||||
msgstr "Breite der Kanalgruppen (% der OSD Breite)"
|
||||
|
||||
msgid "Display current time baseline"
|
||||
msgstr "Linie für aktuelle Uhrzeit anzeigen"
|
||||
|
||||
msgid "Show Channel Logos"
|
||||
msgstr "Kanallogos anzeigen"
|
||||
|
||||
msgid "Logo Path used"
|
||||
msgstr "Benutzer Pfad für Kanallogos"
|
||||
|
||||
msgid "Logo Extension"
|
||||
msgstr "Logo Extension"
|
||||
|
||||
msgid "Logo width ratio"
|
||||
msgstr "Logo Breitenverhältnis"
|
||||
|
||||
msgid "Logo height ratio"
|
||||
msgstr "Logo Höhenverhältnis"
|
||||
|
||||
msgid "Text Border in Detailed View (pixel)"
|
||||
msgstr "Rand im detailierten EPG View"
|
||||
|
||||
msgid "Show EPG Images"
|
||||
msgstr "EPG Bilder anzeigen"
|
||||
|
||||
msgid "EPG Images Path used"
|
||||
msgstr "Benutzer EPG Bilder Pfad"
|
||||
|
||||
msgid "EPG Image width"
|
||||
msgstr "Breite der EPG Bilder"
|
||||
|
||||
msgid "EPG Image height"
|
||||
msgstr "Höhe der EPG Bilder"
|
||||
|
||||
msgid "Number of additional EPG Images"
|
||||
msgstr "Anzahl zusätzlicher EPG Bilder"
|
||||
|
||||
msgid "Additional EPG Image width"
|
||||
msgstr "Breite der zus. EPG Bilder"
|
||||
|
||||
msgid "Additional EPG Image height"
|
||||
msgstr "Höhe der zus. EPG Bilder"
|
||||
|
||||
msgid "Font"
|
||||
msgstr "Font"
|
||||
|
||||
msgid "Status Header Font Size"
|
||||
msgstr "Status Header Schriftgröße"
|
||||
|
||||
msgid "Status Header Large Font Size"
|
||||
msgstr "Status Header große Schriftgröße"
|
||||
|
||||
msgid "Detail EPG View Font Size"
|
||||
msgstr "Detailierte EPG Ansicht Schriftgröße"
|
||||
|
||||
msgid "Detail EPG View Header Font Size"
|
||||
msgstr "Detailierte EPG Ansicht Header Schriftgröße"
|
||||
|
||||
msgid "Message Font Size"
|
||||
msgstr "Nachrichten Schriftgröße"
|
||||
|
||||
msgid "Message Large Font Size"
|
||||
msgstr "Nachrichten große Schriftgröße"
|
||||
|
||||
msgid "Button Font Size"
|
||||
msgstr "Button Schriftgröße"
|
||||
|
||||
msgid "Channel Header Font Size"
|
||||
msgstr "Kanal Header Schriftgröße"
|
||||
|
||||
msgid "Channel Groups Font Size"
|
||||
msgstr "Kanalgruppen Schriftgröße"
|
||||
|
||||
msgid "Grid Font Size"
|
||||
msgstr "Grid Schriftgröße"
|
||||
|
||||
msgid "Grid Font Small Size"
|
||||
msgstr "Grid kleine Schriftgröße"
|
||||
|
||||
msgid "Timeline Weekday Font Size"
|
||||
msgstr "Zeitleiste Wochentag Schriftgröße"
|
||||
|
||||
msgid "Timeline Date Font Size"
|
||||
msgstr "Zeitleiste Datum Schriftgröße"
|
||||
|
||||
msgid "Timeline Time Font Size"
|
||||
msgstr "Zeitleiste Zeit Schriftgröße"
|
||||
|
||||
msgid "Search & Recording Menu Font Size"
|
||||
msgstr "Suchen & Aufnehmen Menu Schriftgröße"
|
||||
|
||||
msgid "Search & Recording Menu Small Font Size"
|
||||
msgstr "Suchen & Aufnehmen Menu kleine Schriftgröße"
|
||||
|
||||
msgid "Search & Recording Menu Header Font Size"
|
||||
msgstr "Suchen & Aufnehmen Menu Header Schriftgröße"
|
||||
|
||||
msgid "Always use root video folder"
|
||||
msgstr "Usa sempre la cartella video di root"
|
||||
|
||||
msgid "Select from folder list"
|
||||
msgstr "Scegli dall'elenco cartelle"
|
||||
|
||||
msgid "Use fixed folder"
|
||||
msgstr "Usa cartella fissa"
|
||||
|
||||
msgid "Folder for instant Recordings"
|
||||
msgstr "Cartella per la registrazione immediata"
|
||||
|
||||
msgid "Use Remotetimers"
|
||||
msgstr "Usa Remotetimers"
|
||||
|
||||
msgid "Limit channels in favorites"
|
||||
msgstr "Limite dei canali nei favoriti"
|
||||
|
||||
msgid "Use \"What's on now\" in favorites"
|
||||
msgstr "Usa \"In programma ora\" nei favoriti"
|
||||
|
||||
msgid "Use \"What's on next\" in favorites"
|
||||
msgstr "Usa \"Programma prossimo\" nei favoriti"
|
||||
|
||||
msgid "User defined times in favorites:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use user defined time 1"
|
||||
msgstr "Usa il tempo definito per l'user 1"
|
||||
|
||||
msgid "Description"
|
||||
msgstr "Descrizione"
|
||||
|
||||
msgid "Time"
|
||||
msgstr "Tempo"
|
||||
|
||||
msgid "Use user defined time 2"
|
||||
msgstr "Usa il tempo definito per l'user 2"
|
||||
|
||||
msgid "Use user defined time 3"
|
||||
msgstr "Usa il tempo definito per l'user 3"
|
||||
|
||||
msgid "Use user defined time 4"
|
||||
msgstr "Usa il tempo definito per l'user 4"
|
||||
|
||||
msgid "Switchtimer:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Switch (x)min before start of the show"
|
||||
msgstr ""
|
||||
|
||||
msgid "Create Log Messages for image loading"
|
||||
msgstr "Log Nachrichten für das Laden der Bilder erzeugen"
|
||||
|
||||
msgid "Limit Logo Cache"
|
||||
msgstr "Logo Cash beschränken"
|
||||
|
||||
msgid "Maximal number of logos to cache"
|
||||
msgstr "Maximale Anzahl Logos"
|
||||
|
||||
msgid "Number of logos to cache at start"
|
||||
msgstr "Anzahl der zu cachenden Logos beim Start"
|
||||
|
||||
msgid "Cache Sizes"
|
||||
msgstr "Cache Größe"
|
||||
|
||||
msgid "OSD Element Cache"
|
||||
msgstr "OSD Element Cache"
|
||||
|
||||
msgid "Logo cache"
|
||||
msgstr "Logo Cache"
|
||||
|
||||
msgid "EPG Grid Cache"
|
||||
msgstr "EPG Grid Cache"
|
||||
|
||||
msgid "Channel Groups Cache"
|
||||
msgstr "Cache dei Gruppi Canale"
|
||||
|
||||
msgid "Recording Menus Icon Cache"
|
||||
msgstr "Recording Menüs Icon Cache"
|
||||
|
||||
msgid "A fancy 2d EPG Viewer"
|
||||
msgstr ""
|
||||
|
||||
msgid "No Cast available"
|
||||
msgstr "Nessun cast disponibile"
|
||||
|
||||
msgid "Cast"
|
||||
msgstr "Besetzung"
|
||||
|
||||
msgid "EPG Info"
|
||||
msgstr "EPG Info"
|
||||
|
||||
msgid "Reruns"
|
||||
msgstr "riavvii"
|
||||
|
||||
msgid "Recording Information"
|
||||
msgstr ""
|
||||
|
||||
msgid "Image Galery"
|
||||
msgstr "Bildergalerie"
|
||||
|
||||
msgid "TheTVDB Info"
|
||||
msgstr "TheTVDB Info"
|
||||
|
||||
msgid "TheTVDB Information"
|
||||
msgstr "TheTVDB Information"
|
||||
|
||||
msgid "Episode"
|
||||
msgstr "Episodio"
|
||||
|
||||
msgid "Season"
|
||||
msgstr "Stagione"
|
||||
|
||||
msgid "Episode Overview"
|
||||
msgstr "Episodenüberblick"
|
||||
|
||||
msgid "First aired"
|
||||
msgstr "Erstausstrahlung"
|
||||
|
||||
msgid "Guest Stars"
|
||||
msgstr "Guest Stars"
|
||||
|
||||
msgid "TheMovieDB Rating"
|
||||
msgstr "Voto di TheMovieDB"
|
||||
|
||||
msgid "Series Overview"
|
||||
msgstr "Serienüberblick"
|
||||
|
||||
msgid "Genre"
|
||||
msgstr "Genere"
|
||||
|
||||
msgid "Network"
|
||||
msgstr "Network"
|
||||
|
||||
msgid "Status"
|
||||
msgstr "Status"
|
||||
|
||||
msgid "TheMovieDB Information"
|
||||
msgstr "TheMovieDB Information"
|
||||
|
||||
msgid "Original Title"
|
||||
msgstr "Titolo Originale"
|
||||
|
||||
msgid "Tagline"
|
||||
msgstr "Zusammenfassung"
|
||||
|
||||
msgid "Overview"
|
||||
msgstr "Überblick"
|
||||
|
||||
msgid "yes"
|
||||
msgstr "Si"
|
||||
|
||||
msgid "no"
|
||||
msgstr "No"
|
||||
|
||||
msgid "Adult"
|
||||
msgstr "Per adulti"
|
||||
|
||||
msgid "Collection"
|
||||
msgstr "Kollektion"
|
||||
|
||||
msgid "Budget"
|
||||
msgstr "Budget"
|
||||
|
||||
msgid "Revenue"
|
||||
msgstr "Einnahmen"
|
||||
|
||||
msgid "Homepage"
|
||||
msgstr "Homepage"
|
||||
|
||||
msgid "Release Date"
|
||||
msgstr "Data di rilascio"
|
||||
|
||||
msgid "Runtime"
|
||||
msgstr "Runtime"
|
||||
|
||||
msgid "minutes"
|
||||
msgstr "Minuti"
|
||||
|
||||
msgid "TheMovieDB Popularity"
|
||||
msgstr "TheMovieDB Popularità"
|
||||
|
||||
msgid "TheMovieDB Vote Average"
|
||||
msgstr "Voto medio di TheMovieDB"
|
33
po/ru_RU.po
33
po/ru_RU.po
@@ -3,7 +3,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-tvguide 1.0.0\n"
|
||||
"Report-Msgid-Bugs-To: <see README>\n"
|
||||
"POT-Creation-Date: 2014-05-10 17:24+0200\n"
|
||||
"POT-Creation-Date: 2019-04-12 14:35+0200\n"
|
||||
"PO-Revision-Date: 2013-09-25 17:49+0400\n"
|
||||
"Last-Translator: AmiD, ilya\n"
|
||||
"Language-Team: Russia-Cherepovets(wm.amid@gmail.com)\n"
|
||||
@@ -363,6 +363,9 @@ msgstr "С канала"
|
||||
msgid "Stop Channel"
|
||||
msgstr "По канал"
|
||||
|
||||
msgid "Channel Group"
|
||||
msgstr ""
|
||||
|
||||
msgid "Start after"
|
||||
msgstr "С"
|
||||
|
||||
@@ -522,6 +525,12 @@ msgstr "точное совпадение"
|
||||
msgid "regular expression"
|
||||
msgstr "регулярные выражения"
|
||||
|
||||
msgid "Interval"
|
||||
msgstr ""
|
||||
|
||||
msgid "only FTA"
|
||||
msgstr ""
|
||||
|
||||
msgid "General Settings"
|
||||
msgstr "Основные настройки"
|
||||
|
||||
@@ -780,13 +789,19 @@ msgstr ""
|
||||
msgid "Use Remotetimers"
|
||||
msgstr "RemoteTimers benutzen"
|
||||
|
||||
msgid "Limit channels in favorites"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use \"What's on now\" in favorites"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use \"What's on next\" in favorites"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use user defined time 1 in favorites"
|
||||
msgid "User defined times in favorites:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use user defined time 1"
|
||||
msgstr ""
|
||||
|
||||
msgid "Description"
|
||||
@@ -795,16 +810,19 @@ msgstr ""
|
||||
msgid "Time"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use user defined time 2 in favorites"
|
||||
msgid "Use user defined time 2"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use user defined time 3 in favorites"
|
||||
msgid "Use user defined time 3"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use user defined time 4 in favorites"
|
||||
msgid "Use user defined time 4"
|
||||
msgstr ""
|
||||
|
||||
msgid "Limit channels in favorites"
|
||||
msgid "Switchtimer:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Switch (x)min before start of the show"
|
||||
msgstr ""
|
||||
|
||||
msgid "Create Log Messages for image loading"
|
||||
@@ -837,6 +855,9 @@ msgstr ""
|
||||
msgid "Recording Menus Icon Cache"
|
||||
msgstr ""
|
||||
|
||||
msgid "A fancy 2d EPG Viewer"
|
||||
msgstr ""
|
||||
|
||||
msgid "No Cast available"
|
||||
msgstr ""
|
||||
|
||||
|
33
po/sk_SK.po
33
po/sk_SK.po
@@ -3,7 +3,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-tvguide 1.1.0\n"
|
||||
"Report-Msgid-Bugs-To: <see README>\n"
|
||||
"POT-Creation-Date: 2014-05-10 17:24+0200\n"
|
||||
"POT-Creation-Date: 2019-04-12 14:35+0200\n"
|
||||
"PO-Revision-Date: 2013-09-15 00:12+0100\n"
|
||||
"Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n"
|
||||
"Language-Team: \n"
|
||||
@@ -363,6 +363,9 @@ msgstr "Od kan
|
||||
msgid "Stop Channel"
|
||||
msgstr "Po kan<61>l"
|
||||
|
||||
msgid "Channel Group"
|
||||
msgstr ""
|
||||
|
||||
msgid "Start after"
|
||||
msgstr "Za<5A>iatok po"
|
||||
|
||||
@@ -522,6 +525,12 @@ msgstr "presn
|
||||
msgid "regular expression"
|
||||
msgstr "regul<75>rny v<>raz"
|
||||
|
||||
msgid "Interval"
|
||||
msgstr ""
|
||||
|
||||
msgid "only FTA"
|
||||
msgstr ""
|
||||
|
||||
msgid "General Settings"
|
||||
msgstr "V<>eobecn<63> nastavenia"
|
||||
|
||||
@@ -780,13 +789,19 @@ msgstr ""
|
||||
msgid "Use Remotetimers"
|
||||
msgstr "Pou<6F>i<EFBFBD> vzdialen<65> pl<70>nova<76>"
|
||||
|
||||
msgid "Limit channels in favorites"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use \"What's on now\" in favorites"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use \"What's on next\" in favorites"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use user defined time 1 in favorites"
|
||||
msgid "User defined times in favorites:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use user defined time 1"
|
||||
msgstr ""
|
||||
|
||||
msgid "Description"
|
||||
@@ -795,16 +810,19 @@ msgstr ""
|
||||
msgid "Time"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use user defined time 2 in favorites"
|
||||
msgid "Use user defined time 2"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use user defined time 3 in favorites"
|
||||
msgid "Use user defined time 3"
|
||||
msgstr ""
|
||||
|
||||
msgid "Use user defined time 4 in favorites"
|
||||
msgid "Use user defined time 4"
|
||||
msgstr ""
|
||||
|
||||
msgid "Limit channels in favorites"
|
||||
msgid "Switchtimer:"
|
||||
msgstr ""
|
||||
|
||||
msgid "Switch (x)min before start of the show"
|
||||
msgstr ""
|
||||
|
||||
msgid "Create Log Messages for image loading"
|
||||
@@ -837,6 +855,9 @@ msgstr ""
|
||||
msgid "Recording Menus Icon Cache"
|
||||
msgstr ""
|
||||
|
||||
msgid "A fancy 2d EPG Viewer"
|
||||
msgstr ""
|
||||
|
||||
msgid "No Cast available"
|
||||
msgstr ""
|
||||
|
||||
|
267
recmanager.c
267
recmanager.c
@@ -10,6 +10,7 @@
|
||||
#include "tools.h"
|
||||
#include "switchtimer.h"
|
||||
#include "timerconflict.h"
|
||||
#include <vdr/timers.h>
|
||||
#include "recmanager.h"
|
||||
|
||||
static int CompareRecording(const void *p1, const void *p2) {
|
||||
@@ -42,28 +43,43 @@ bool cRecManager::RefreshRemoteTimers(void) {
|
||||
|
||||
bool cRecManager::CheckEventForTimer(const cEvent *event) {
|
||||
bool hasTimer = false;
|
||||
|
||||
|
||||
if (tvguideConfig.useRemoteTimers && pRemoteTimers) {
|
||||
RemoteTimers_GetMatch_v1_0 rtMatch;
|
||||
rtMatch.event = event;
|
||||
pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch);
|
||||
if (rtMatch.timerMatch == tmFull)
|
||||
hasTimer = true;
|
||||
} else
|
||||
} else {
|
||||
#if VDRVERSNUM >= 20301
|
||||
eTimerMatch TimerMatch = tmNone;
|
||||
LOCK_TIMERS_READ;
|
||||
const cTimers *timers = Timers;
|
||||
if (timers->GetMatch(event, &TimerMatch) && (TimerMatch == tmFull))
|
||||
hasTimer = true;
|
||||
#else
|
||||
hasTimer = event->HasTimer();
|
||||
|
||||
#endif
|
||||
}
|
||||
return hasTimer;
|
||||
}
|
||||
|
||||
cTimer *cRecManager::GetTimerForEvent(const cEvent *event) {
|
||||
cTimer *timer = NULL;
|
||||
const cTimer *cRecManager::GetTimerForEvent(const cEvent *event) {
|
||||
const cTimer *timer = NULL;
|
||||
if (tvguideConfig.useRemoteTimers && pRemoteTimers) {
|
||||
RemoteTimers_GetMatch_v1_0 rtMatch;
|
||||
rtMatch.event = event;
|
||||
pRemoteTimers->Service("RemoteTimers::GetMatch-v1.0", &rtMatch);
|
||||
timer = rtMatch.timer;
|
||||
} else
|
||||
timer = Timers.GetMatch(event);
|
||||
return timer;
|
||||
}
|
||||
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_READ;
|
||||
timer = Timers->GetMatch(event);
|
||||
#else
|
||||
timer = Timers.GetMatch(event);
|
||||
#endif
|
||||
return timer;
|
||||
}
|
||||
|
||||
@@ -79,19 +95,38 @@ cTimer *cRecManager::createTimer(const cEvent *event, std::string path) {
|
||||
|
||||
cTimer *cRecManager::createLocalTimer(const cEvent *event, std::string path) {
|
||||
cTimer *timer = new cTimer(event);
|
||||
#if VDRVERSNUM >= 20301
|
||||
if (Setup.SVDRPPeering && *Setup.SVDRPDefaultHost)
|
||||
((cTimer*)timer)->SetRemote(Setup.SVDRPDefaultHost);
|
||||
LOCK_TIMERS_WRITE;
|
||||
cTimer *t = Timers->GetTimer(timer);
|
||||
#else
|
||||
cTimer *t = Timers.GetTimer(timer);
|
||||
#endif
|
||||
if (t) {
|
||||
t->OnOff();
|
||||
#if VDRVERSNUM >= 20301
|
||||
t->SetEvent(event);
|
||||
#else
|
||||
t->SetEventFromSchedule();
|
||||
#endif
|
||||
delete timer;
|
||||
timer = t;
|
||||
isyslog("timer %s reactivated", *t->ToDescr());
|
||||
} else {
|
||||
#if VDRVERSNUM >= 20301
|
||||
Timers->Add(timer);
|
||||
#else
|
||||
Timers.Add(timer);
|
||||
#endif
|
||||
isyslog("timer %s added (active)", *timer->ToDescr());
|
||||
}
|
||||
SetTimerPath(timer, event, path);
|
||||
#if VDRVERSNUM >= 20301
|
||||
Timers->SetModified();
|
||||
#else
|
||||
Timers.SetModified();
|
||||
#endif
|
||||
return timer;
|
||||
}
|
||||
|
||||
@@ -124,7 +159,7 @@ void cRecManager::SetTimerPath(cTimer *timer, const cEvent *event, std::string p
|
||||
std::string newFileName = epgSearch->handler->Evaluate(recDir, event);
|
||||
if (strchr(newFileName.c_str(), '%') == NULL) // only set directory to new value if all categories could have been replaced
|
||||
timer->SetFile(newFileName.c_str());
|
||||
else
|
||||
else
|
||||
esyslog("tvguide: timer path not set because replacing variable was not successfull: %s", newFileName.c_str());
|
||||
}
|
||||
} else {
|
||||
@@ -148,7 +183,15 @@ void cRecManager::SetTimerPath(cTimer *timer, const cEvent *event, std::string p
|
||||
}
|
||||
|
||||
void cRecManager::DeleteTimer(int timerID) {
|
||||
#if VDRVERSNUM >= 20301
|
||||
cTimer *t;
|
||||
{
|
||||
LOCK_TIMERS_WRITE;
|
||||
t = Timers->Get(timerID);
|
||||
}
|
||||
#else
|
||||
cTimer *t = Timers.Get(timerID);
|
||||
#endif
|
||||
if (!t)
|
||||
return;
|
||||
DeleteTimer(t);
|
||||
@@ -165,21 +208,41 @@ void cRecManager::DeleteTimer(const cEvent *event) {
|
||||
}
|
||||
|
||||
void cRecManager::DeleteLocalTimer(const cEvent *event) {
|
||||
cTimer *t = Timers.GetMatch(event);
|
||||
const cTimer *t;
|
||||
#if VDRVERSNUM >= 20301
|
||||
{
|
||||
LOCK_TIMERS_READ;
|
||||
t = Timers->GetMatch(event);
|
||||
}
|
||||
#else
|
||||
t = Timers.GetMatch(event);
|
||||
#endif
|
||||
if (!t)
|
||||
return;
|
||||
DeleteTimer(t);
|
||||
}
|
||||
|
||||
void cRecManager::DeleteTimer(const cTimer *timer) {
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_WRITE;
|
||||
cTimers* timers = Timers;
|
||||
cTimer* t = timers->GetTimer(timer);
|
||||
#else
|
||||
cTimers* timers = &Timers;
|
||||
cTimer* t = timers->GetTimer((cTimer*)timer);
|
||||
#endif
|
||||
|
||||
void cRecManager::DeleteTimer(cTimer *timer) {
|
||||
if (timer->Recording()) {
|
||||
timer->Skip();
|
||||
if (t->Recording()) {
|
||||
t->Skip();
|
||||
#if VDRVERSNUM >= 20301
|
||||
cRecordControls::Process(timers, time(NULL));
|
||||
#else
|
||||
cRecordControls::Process(time(NULL));
|
||||
}
|
||||
isyslog("timer %s deleted", *timer->ToDescr());
|
||||
Timers.Del(timer, true);
|
||||
Timers.SetModified();
|
||||
#endif
|
||||
}
|
||||
isyslog("timer %s deleted", *t->ToDescr());
|
||||
timers->Del(t, true);
|
||||
timers->SetModified();
|
||||
}
|
||||
|
||||
void cRecManager::DeleteRemoteTimer(const cEvent *event) {
|
||||
@@ -196,10 +259,17 @@ void cRecManager::DeleteRemoteTimer(const cEvent *event) {
|
||||
}
|
||||
}
|
||||
|
||||
void cRecManager::SaveTimer(cTimer *timer, cTimer newTimerSettings) {
|
||||
if (!timer)
|
||||
void cRecManager::SaveTimer(const cTimer *t, cTimer newTimerSettings) {
|
||||
if (!t)
|
||||
return;
|
||||
|
||||
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_WRITE;
|
||||
cTimer *timer = Timers->GetTimer(t);
|
||||
#else
|
||||
cTimer *timer = Timers.GetTimer((cTimer*)t);
|
||||
#endif
|
||||
|
||||
bool active = newTimerSettings.HasFlags(tfActive);
|
||||
int prio = newTimerSettings.Priority();
|
||||
int lifetime = newTimerSettings.Lifetime();
|
||||
@@ -214,13 +284,15 @@ void cRecManager::SaveTimer(cTimer *timer, cTimer newTimerSettings) {
|
||||
timer->SetPriority(prio);
|
||||
timer->SetLifetime(lifetime);
|
||||
timer->SetFile(fileName.c_str());
|
||||
|
||||
|
||||
if (timer->HasFlags(tfActive) && !active)
|
||||
timer->ClrFlags(tfActive);
|
||||
else if (!timer->HasFlags(tfActive) && active)
|
||||
timer->SetFlags(tfActive);
|
||||
|
||||
|
||||
#if VDRVERSNUM < 20300
|
||||
timer->SetEventFromSchedule();
|
||||
#endif
|
||||
if (tvguideConfig.useRemoteTimers && pRemoteTimers) {
|
||||
RemoteTimers_Timer_v1_0 rt;
|
||||
rt.timer = timer;
|
||||
@@ -228,13 +300,22 @@ void cRecManager::SaveTimer(cTimer *timer, cTimer newTimerSettings) {
|
||||
rt.timer = NULL;
|
||||
RefreshRemoteTimers();
|
||||
} else {
|
||||
#if VDRVERSNUM >= 20301
|
||||
Timers->SetModified();
|
||||
#else
|
||||
Timers.SetModified();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool cRecManager::IsRecorded(const cEvent *event) {
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_WRITE;
|
||||
cTimer *timer = Timers->GetMatch(event);
|
||||
#else
|
||||
cTimer *timer = Timers.GetMatch(event);
|
||||
#endif
|
||||
if (!timer)
|
||||
return false;
|
||||
return timer->Recording();
|
||||
@@ -260,7 +341,10 @@ cTVGuideTimerConflicts *cRecManager::CheckTimerConflict(void) {
|
||||
}
|
||||
|
||||
void cRecManager::CreateSeriesTimer(cTimer *seriesTimer) {
|
||||
#if VDRVERSNUM >= 20301
|
||||
#else
|
||||
seriesTimer->SetEventFromSchedule();
|
||||
#endif
|
||||
if (tvguideConfig.useRemoteTimers && pRemoteTimers) {
|
||||
RemoteTimers_Timer_v1_0 rt;
|
||||
rt.timer = seriesTimer;
|
||||
@@ -268,8 +352,15 @@ void cRecManager::CreateSeriesTimer(cTimer *seriesTimer) {
|
||||
isyslog("%s", *rt.errorMsg);
|
||||
RefreshRemoteTimers();
|
||||
} else {
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_WRITE;
|
||||
cTimers* timers = Timers;
|
||||
timers->Add(seriesTimer);
|
||||
timers->SetModified();
|
||||
#else
|
||||
Timers.Add(seriesTimer);
|
||||
Timers.SetModified();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -316,9 +407,16 @@ const cEvent **cRecManager::PerformSearchTimerSearch(std::string epgSearchString
|
||||
numResults = results.size();
|
||||
if (numResults > 0) {
|
||||
searchResults = new const cEvent *[numResults];
|
||||
cSchedulesLock schedulesLock;
|
||||
const cSchedules *schedules;
|
||||
#if VDRVERSNUM >= 20301
|
||||
{
|
||||
LOCK_SCHEDULES_READ;
|
||||
schedules = Schedules;
|
||||
}
|
||||
#else
|
||||
cSchedulesLock schedulesLock;
|
||||
schedules = cSchedules::Schedules(schedulesLock);
|
||||
#endif
|
||||
const cEvent *event = NULL;
|
||||
int index=0;
|
||||
for (std::list<std::string>::iterator it=results.begin(); it != results.end(); ++it) {
|
||||
@@ -328,13 +426,21 @@ const cEvent **cRecManager::PerformSearchTimerSearch(std::string epgSearchString
|
||||
int eventID = atoi(flds[1].c_str());
|
||||
std::string channelID = flds[7];
|
||||
tChannelID chanID = tChannelID::FromString(channelID.c_str());
|
||||
cChannel *channel = Channels.GetByChannelID(chanID);
|
||||
const cChannel *channel;
|
||||
#if VDRVERSNUM >= 20301
|
||||
{
|
||||
LOCK_CHANNELS_READ;
|
||||
channel = Channels->GetByChannelID(chanID);
|
||||
}
|
||||
#else
|
||||
channel = Channels.GetByChannelID(chanID);
|
||||
#endif
|
||||
if (channel) {
|
||||
const cSchedule *Schedule = NULL;
|
||||
Schedule = schedules->GetSchedule(channel);
|
||||
event = Schedule->GetEvent(eventID);
|
||||
if (event) {
|
||||
searchResults[index] = event;
|
||||
searchResults[index] = event;
|
||||
} else
|
||||
return NULL;
|
||||
} else
|
||||
@@ -389,6 +495,22 @@ void cRecManager::GetSearchTimers(std::vector<cTVGuideSearchTimer> *searchTimer)
|
||||
std::sort(searchTimer->begin(), searchTimer->end());
|
||||
}
|
||||
|
||||
void cRecManager::GetChannelGroups(std::vector<std::string> *channelGroups) {
|
||||
if (!epgSearchAvailable) {
|
||||
return;
|
||||
}
|
||||
Epgsearch_services_v1_1 *epgSearch = new Epgsearch_services_v1_1;
|
||||
if (epgSearchPlugin->Service("Epgsearch-services-v1.1", epgSearch)) {
|
||||
std::list<std::string> channelGroupList;
|
||||
channelGroupList = epgSearch->handler->ChanGrpList();
|
||||
|
||||
for (std::list<std::string>::iterator it = channelGroupList.begin(); it != channelGroupList.end(); it++) {
|
||||
channelGroups->push_back(*it);
|
||||
}
|
||||
}
|
||||
std::sort(channelGroups->begin(), channelGroups->end());
|
||||
}
|
||||
|
||||
int cRecManager::CreateSearchTimer(std::string epgSearchString) {
|
||||
int timerID = -1;
|
||||
if (!epgSearchAvailable)
|
||||
@@ -435,24 +557,33 @@ void cRecManager::DeleteSearchTimer(cTVGuideSearchTimer *searchTimer, bool delTi
|
||||
return;
|
||||
int searchTimerID = searchTimer->GetID();
|
||||
if (delTimers) {
|
||||
cTimer *timer = Timers.First();
|
||||
cTimers* timers;
|
||||
#if VDRVERSNUM >= 20301
|
||||
{
|
||||
LOCK_TIMERS_WRITE;
|
||||
timers = Timers;
|
||||
}
|
||||
#else
|
||||
timers = &Timers;
|
||||
#endif
|
||||
cTimer *timer = timers->First();
|
||||
while(timer) {
|
||||
if (!timer->Recording()) {
|
||||
char* searchID = GetAuxValue(timer, "s-id");
|
||||
if (searchID) {
|
||||
if (searchTimerID == atoi(searchID)) {
|
||||
cTimer* timerNext = Timers.Next(timer);
|
||||
cTimer* timerNext = timers->Next(timer);
|
||||
DeleteTimer(timer);
|
||||
timer = timerNext;
|
||||
} else {
|
||||
timer = Timers.Next(timer);
|
||||
timer = timers->Next(timer);
|
||||
}
|
||||
free(searchID);
|
||||
} else {
|
||||
timer = Timers.Next(timer);
|
||||
timer = timers->Next(timer);
|
||||
}
|
||||
} else {
|
||||
timer = Timers.Next(timer);
|
||||
timer = timers->Next(timer);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -464,7 +595,7 @@ void cRecManager::DeleteSearchTimer(cTVGuideSearchTimer *searchTimer, bool delTi
|
||||
} else {
|
||||
esyslog("tvguide: error deleting search timer \"%s\"", searchTimer->SearchString().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cRecManager::UpdateSearchTimers(void) {
|
||||
@@ -475,14 +606,14 @@ void cRecManager::UpdateSearchTimers(void) {
|
||||
}
|
||||
}
|
||||
|
||||
// announceOnly: 0 = switch, 1 = announce only, 2 = ask for switch
|
||||
// switchMode: 0 = switch, 1 = announce only, 2 = ask for switch
|
||||
bool cRecManager::CreateSwitchTimer(const cEvent *event, cSwitchTimer switchTimer) {
|
||||
if (epgSearchAvailable && event) {
|
||||
Epgsearch_switchtimer_v1_0 data;
|
||||
data.event = event;
|
||||
data.mode = 1;
|
||||
data.switchMinsBefore = switchTimer.switchMinsBefore;
|
||||
data.announceOnly = switchTimer.announceOnly;
|
||||
data.announceOnly = switchTimer.switchMode;
|
||||
data.success = false;
|
||||
epgSearchPlugin->Service("Epgsearch-switchtimer-v1.0", &data);
|
||||
cSwitchTimer *t = new cSwitchTimer(event);
|
||||
@@ -505,22 +636,29 @@ void cRecManager::DeleteSwitchTimer(const cEvent *event) {
|
||||
}
|
||||
}
|
||||
|
||||
cRecording **cRecManager::SearchForRecordings(std::string searchString, int &numResults) {
|
||||
|
||||
cRecording **matchingRecordings = NULL;
|
||||
const cRecording **cRecManager::SearchForRecordings(std::string searchString, int &numResults) {
|
||||
|
||||
const cRecording **matchingRecordings = NULL;
|
||||
int num = 0;
|
||||
numResults = 0;
|
||||
|
||||
for (cRecording *recording = Recordings.First(); recording; recording = Recordings.Next(recording)) {
|
||||
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_RECORDINGS_READ;
|
||||
const cRecordings* recordings = Recordings;
|
||||
#else
|
||||
const cRecordings* recordings = &Recordings;
|
||||
#endif
|
||||
|
||||
for (const cRecording *recording = recordings->First(); recording; recording = recordings->Next(recording)) {
|
||||
std::string s1 = recording->Name();
|
||||
std::string s2 = searchString;
|
||||
if (s1.empty() || s2.empty()) continue;
|
||||
|
||||
|
||||
// tolerance for fuzzy searching: 90% of the shorter text length, but at least 1
|
||||
int tolerance = std::max(1, (int)std::min(s1.size(), s2.size()) / 10);
|
||||
int tolerance = std::max(1, (int)std::min(s1.size(), s2.size()) / 10);
|
||||
|
||||
bool match = FindIgnoreCase(s1, s2) >= 0 || FindIgnoreCase(s2, s1) >= 0;
|
||||
|
||||
|
||||
if (!match) {
|
||||
AFUZZY af = { NULL, NULL, NULL, NULL, NULL, NULL, { 0 }, { 0 }, 0, 0, 0, 0, 0, 0 };
|
||||
if (s1.size() > 32) s1 = s1.substr(0, 32);
|
||||
@@ -530,7 +668,7 @@ cRecording **cRecManager::SearchForRecordings(std::string searchString, int &num
|
||||
afuzzy_free(&af);
|
||||
match = (res > 0);
|
||||
}
|
||||
|
||||
|
||||
if (!match) {
|
||||
AFUZZY af = { NULL, NULL, NULL, NULL, NULL, NULL, { 0 }, { 0 }, 0, 0, 0, 0, 0, 0 };
|
||||
if (s2.size() > 32) s2 = s2.substr(0, 32);
|
||||
@@ -540,9 +678,9 @@ cRecording **cRecManager::SearchForRecordings(std::string searchString, int &num
|
||||
afuzzy_free(&af);
|
||||
match = (res > 0);
|
||||
}
|
||||
|
||||
|
||||
if (match) {
|
||||
matchingRecordings = (cRecording **)realloc(matchingRecordings, (num + 1) * sizeof(cRecording *));
|
||||
matchingRecordings = (const cRecording **)realloc(matchingRecordings, (num + 1) * sizeof(cRecording *));
|
||||
matchingRecordings[num++] = recording;
|
||||
}
|
||||
}
|
||||
@@ -563,7 +701,7 @@ const cEvent **cRecManager::LoadReruns(const cEvent *event, int &numResults) {
|
||||
strQuery += "~";
|
||||
if (!isempty(event->ShortText()))
|
||||
strQuery += event->ShortText();
|
||||
data.useSubTitle = true;
|
||||
data.useSubTitle = true;
|
||||
} else {
|
||||
data.useSubTitle = false;
|
||||
}
|
||||
@@ -572,7 +710,7 @@ const cEvent **cRecManager::LoadReruns(const cEvent *event, int &numResults) {
|
||||
data.channelNr = 0;
|
||||
data.useTitle = true;
|
||||
data.useDescription = false;
|
||||
|
||||
|
||||
if (epgSearchPlugin->Service("Epgsearch-searchresults-v1.0", &data)) {
|
||||
cList<Epgsearch_searchresults_v1_0::cServiceSearchResult>* list = data.pResultList;
|
||||
if (!list)
|
||||
@@ -619,10 +757,25 @@ void cRecManager::GetFavorites(std::vector<cTVGuideSearchTimer> *favorites) {
|
||||
|
||||
const cEvent **cRecManager::WhatsOnNow(bool nowOrNext, int &numResults) {
|
||||
std::vector<const cEvent*> tmpResults;
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
LOCK_SCHEDULES_READ;
|
||||
const cSchedules* schedules = Schedules;
|
||||
#else
|
||||
cSchedulesLock schedulesLock;
|
||||
const cSchedules *schedules = cSchedules::Schedules(schedulesLock);
|
||||
#endif
|
||||
const cChannel *startChannel = NULL, *stopChannel = NULL;
|
||||
if (tvguideConfig.favLimitChannels) {
|
||||
#if VDRVERSNUM >= 20301
|
||||
startChannel = Channels->GetByNumber(tvguideConfig.favStartChannel);
|
||||
stopChannel = Channels->GetByNumber(tvguideConfig.favStopChannel);
|
||||
}
|
||||
if (!startChannel)
|
||||
startChannel = Channels->First();
|
||||
|
||||
for (const cChannel *channel = startChannel; channel; channel = Channels->Next(channel)) {
|
||||
#else
|
||||
startChannel = Channels.GetByNumber(tvguideConfig.favStartChannel);
|
||||
stopChannel = Channels.GetByNumber(tvguideConfig.favStopChannel);
|
||||
}
|
||||
@@ -630,6 +783,7 @@ const cEvent **cRecManager::WhatsOnNow(bool nowOrNext, int &numResults) {
|
||||
startChannel = Channels.First();
|
||||
|
||||
for (const cChannel *channel = startChannel; channel; channel = Channels.Next(channel)) {
|
||||
#endif
|
||||
if (channel->GroupSep()) continue;
|
||||
const cSchedule *Schedule = schedules->GetSchedule(channel);
|
||||
if (!Schedule) continue;
|
||||
@@ -648,7 +802,7 @@ const cEvent **cRecManager::WhatsOnNow(bool nowOrNext, int &numResults) {
|
||||
numResults = tmpResults.size();
|
||||
const cEvent **results = new const cEvent *[numResults];
|
||||
for (int i=0; i<numResults; i++) {
|
||||
results[i] = tmpResults[i];
|
||||
results[i] = tmpResults[i];
|
||||
}
|
||||
|
||||
return results;
|
||||
@@ -679,10 +833,26 @@ const cEvent **cRecManager::UserDefinedTime(int userTime, int &numResults) {
|
||||
if (searchTime < now)
|
||||
searchTime += 24*60*60;
|
||||
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
LOCK_SCHEDULES_READ;
|
||||
// const cChannels* channels = Channels;
|
||||
const cSchedules* schedules = Schedules;
|
||||
#else
|
||||
cSchedulesLock schedulesLock;
|
||||
const cSchedules *schedules = cSchedules::Schedules(schedulesLock);
|
||||
#endif
|
||||
const cChannel *startChannel = NULL, *stopChannel = NULL;
|
||||
if (tvguideConfig.favLimitChannels) {
|
||||
#if VDRVERSNUM >= 20301
|
||||
startChannel = Channels->GetByNumber(tvguideConfig.favStartChannel);
|
||||
stopChannel = Channels->GetByNumber(tvguideConfig.favStopChannel);
|
||||
}
|
||||
if (!startChannel)
|
||||
startChannel = Channels->First();
|
||||
|
||||
for (const cChannel *channel = startChannel; channel; channel = Channels->Next(channel)) {
|
||||
#else
|
||||
startChannel = Channels.GetByNumber(tvguideConfig.favStartChannel);
|
||||
stopChannel = Channels.GetByNumber(tvguideConfig.favStopChannel);
|
||||
}
|
||||
@@ -690,6 +860,7 @@ const cEvent **cRecManager::UserDefinedTime(int userTime, int &numResults) {
|
||||
startChannel = Channels.First();
|
||||
|
||||
for (const cChannel *channel = startChannel; channel; channel = Channels.Next(channel)) {
|
||||
#endif
|
||||
if (channel->GroupSep()) continue;
|
||||
const cSchedule *Schedule = schedules->GetSchedule(channel);
|
||||
if (!Schedule) continue;
|
||||
@@ -708,7 +879,7 @@ const cEvent **cRecManager::UserDefinedTime(int userTime, int &numResults) {
|
||||
numResults = tmpResults.size();
|
||||
const cEvent **results = new const cEvent *[numResults];
|
||||
for (int i=0; i<numResults; i++) {
|
||||
results[i] = tmpResults[i];
|
||||
results[i] = tmpResults[i];
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
11
recmanager.h
11
recmanager.h
@@ -28,17 +28,17 @@ public:
|
||||
bool EpgSearchAvailable(void) {return epgSearchAvailable;};
|
||||
bool RefreshRemoteTimers(void);
|
||||
bool CheckEventForTimer(const cEvent *event);
|
||||
cTimer *GetTimerForEvent(const cEvent *event);
|
||||
const cTimer *GetTimerForEvent(const cEvent *event);
|
||||
cTimer *createTimer(const cEvent *event, std::string path = "");
|
||||
cTimer *createLocalTimer(const cEvent *event, std::string path);
|
||||
cTimer *createRemoteTimer(const cEvent *event, std::string path);
|
||||
void SetTimerPath(cTimer *timer, const cEvent *event, std::string path);
|
||||
void DeleteTimer(cTimer *timer);
|
||||
void DeleteTimer(const cTimer *timer);
|
||||
void DeleteTimer(int timerID);
|
||||
void DeleteTimer(const cEvent *event);
|
||||
void DeleteLocalTimer(const cEvent *event);
|
||||
void DeleteRemoteTimer(const cEvent *event);
|
||||
void SaveTimer(cTimer *timer, cTimer newTimerSettings);
|
||||
void SaveTimer(const cTimer *timer, cTimer newTimerSettings);
|
||||
bool IsRecorded(const cEvent *event);
|
||||
cTVGuideTimerConflicts *CheckTimerConflict(void);
|
||||
void CreateSeriesTimer(cTimer *seriesTimer);
|
||||
@@ -46,13 +46,14 @@ public:
|
||||
const cEvent **PerformSearch(Epgsearch_searchresults_v1_0 data, int &numResults);
|
||||
void ReadEPGSearchTemplates(std::vector<TVGuideEPGSearchTemplate> *epgTemplates);
|
||||
void GetSearchTimers(std::vector<cTVGuideSearchTimer> *timers);
|
||||
void GetChannelGroups(std::vector<std::string> *channelGroups);
|
||||
int CreateSearchTimer(std::string epgSearchString);
|
||||
bool SaveSearchTimer(cTVGuideSearchTimer *searchTimer);
|
||||
void DeleteSearchTimer(cTVGuideSearchTimer *searchTimer, bool delTimers);
|
||||
void UpdateSearchTimers(void);
|
||||
bool CreateSwitchTimer(const cEvent *event, cSwitchTimer switchTimer);
|
||||
void DeleteSwitchTimer(const cEvent *event);
|
||||
cRecording **SearchForRecordings(std::string searchString, int &numResults);
|
||||
const cRecording **SearchForRecordings(std::string searchString, int &numResults);
|
||||
const cEvent **LoadReruns(const cEvent *event, int &numResults);
|
||||
void GetFavorites(std::vector<cTVGuideSearchTimer> *favorites);
|
||||
const cEvent **WhatsOnNow(bool nowOrNext, int &numResults);
|
||||
@@ -60,4 +61,4 @@ public:
|
||||
virtual ~cRecManager (void);
|
||||
};
|
||||
|
||||
#endif //__TVGUIDE_RECMMANAGER_H
|
||||
#endif //__TVGUIDE_RECMMANAGER_H
|
||||
|
110
recmenuitem.c
110
recmenuitem.c
@@ -493,7 +493,8 @@ cRecMenuItemSelect::cRecMenuItemSelect(cString text,
|
||||
int initialVal,
|
||||
bool active,
|
||||
int *callback,
|
||||
eRecMenuState action) {
|
||||
eRecMenuState action,
|
||||
bool refresh) {
|
||||
selectable = true;
|
||||
this->text = text;
|
||||
strings = Strings;
|
||||
@@ -504,6 +505,7 @@ cRecMenuItemSelect::cRecMenuItemSelect(cString text,
|
||||
this->currentVal = initialVal;
|
||||
this->active = active;
|
||||
this->callback = callback;
|
||||
this->refresh = refresh;
|
||||
this->action = action;
|
||||
height = 3 * font->Height() / 2;
|
||||
pixmapVal = NULL;
|
||||
@@ -562,7 +564,7 @@ void cRecMenuItemSelect::DrawValue(void) {
|
||||
}
|
||||
|
||||
eRecMenuState cRecMenuItemSelect::ProcessKey(eKeys Key) {
|
||||
int oldValue = currentVal;
|
||||
// int oldValue = currentVal;
|
||||
switch (Key & ~k_Repeat) {
|
||||
case kLeft:
|
||||
currentVal--;
|
||||
@@ -571,14 +573,20 @@ eRecMenuState cRecMenuItemSelect::ProcessKey(eKeys Key) {
|
||||
if (callback)
|
||||
*callback = currentVal;
|
||||
DrawValue();
|
||||
return rmsConsumed;
|
||||
if (refresh)
|
||||
return rmsRefresh;
|
||||
else
|
||||
return rmsConsumed;
|
||||
break;
|
||||
case kRight:
|
||||
currentVal = (currentVal+1)%numValues;
|
||||
if (callback)
|
||||
*callback = currentVal;
|
||||
DrawValue();
|
||||
return rmsConsumed;
|
||||
if (refresh)
|
||||
return rmsRefresh;
|
||||
else
|
||||
return rmsConsumed;
|
||||
break;
|
||||
case kOk:
|
||||
return action;
|
||||
@@ -664,7 +672,7 @@ void cRecMenuItemSelectDirectory::DrawValue(void) {
|
||||
}
|
||||
|
||||
eRecMenuState cRecMenuItemSelectDirectory::ProcessKey(eKeys Key) {
|
||||
int oldValue = currentVal;
|
||||
// int oldValue = currentVal;
|
||||
switch (Key & ~k_Repeat) {
|
||||
case kLeft:
|
||||
currentVal--;
|
||||
@@ -1180,18 +1188,18 @@ eRecMenuState cRecMenuItemText::ProcessKey(eKeys Key) {
|
||||
case kDown|k_Repeat:
|
||||
case kDown:
|
||||
if (InEditMode()) {
|
||||
if (insert && newchar) {
|
||||
// create a new character in insert mode
|
||||
if (lengthUtf8 < length - 1)
|
||||
Insert();
|
||||
}
|
||||
if (uppercase)
|
||||
valueUtf8[pos] = Utf8to(upper, Inc(Utf8to(lower, valueUtf8[pos]), NORMALKEY(Key) == kUp));
|
||||
else
|
||||
valueUtf8[pos] = Inc( valueUtf8[pos], NORMALKEY(Key) == kUp);
|
||||
newchar = false;
|
||||
consumed = true;
|
||||
}
|
||||
if (insert && newchar) {
|
||||
// create a new character in insert mode
|
||||
if (lengthUtf8 < length - 1)
|
||||
Insert();
|
||||
}
|
||||
if (uppercase)
|
||||
valueUtf8[pos] = Utf8to(upper, Inc(Utf8to(lower, valueUtf8[pos]), NORMALKEY(Key) == kUp));
|
||||
else
|
||||
valueUtf8[pos] = Inc( valueUtf8[pos], NORMALKEY(Key) == kUp);
|
||||
newchar = false;
|
||||
consumed = true;
|
||||
}
|
||||
break;
|
||||
case k0|k_Repeat ... k9|k_Repeat:
|
||||
case k0 ... k9: {
|
||||
@@ -1817,7 +1825,12 @@ void cRecMenuItemEvent::Draw(void) {
|
||||
if (!event)
|
||||
return;
|
||||
int logoX = DrawIcons();
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
const cChannel *channel = Channels->GetByChannelID(event->ChannelID());
|
||||
#else
|
||||
const cChannel *channel = Channels.GetByChannelID(event->ChannelID());
|
||||
#endif
|
||||
cString channelName = "";
|
||||
if (channel)
|
||||
channelName = channel->Name();
|
||||
@@ -1826,9 +1839,10 @@ void cRecMenuItemEvent::Draw(void) {
|
||||
if (!tvguideConfig.hideChannelLogos) {
|
||||
if (imgLoader.LoadLogo(channel, logoWidth, height)) {
|
||||
cImage logo = imgLoader.GetImage();
|
||||
pixmapText->DrawImage(cPoint(logoX, 0), logo);
|
||||
logoX += logoWidth + 5;
|
||||
pixmapText->DrawImage(cPoint(logoX, (height - logo.Height()) / 2), logo);
|
||||
// logoX += logoWidth + 5;
|
||||
}
|
||||
logoX += logoWidth + 5;
|
||||
}
|
||||
|
||||
int textX = logoX;
|
||||
@@ -1896,7 +1910,7 @@ void cRecMenuItemEvent::Show(void) {
|
||||
}
|
||||
|
||||
eRecMenuState cRecMenuItemEvent::ProcessKey(eKeys Key) {
|
||||
bool consumed = false;
|
||||
// bool consumed = false;
|
||||
switch (Key & ~k_Repeat) {
|
||||
case kOk:
|
||||
return action;
|
||||
@@ -1913,7 +1927,7 @@ eRecMenuState cRecMenuItemEvent::ProcessKey(eKeys Key) {
|
||||
|
||||
// --- cRecMenuItemChannelChooser -------------------------------------------------------
|
||||
cRecMenuItemChannelChooser::cRecMenuItemChannelChooser(cString text,
|
||||
cChannel *initialChannel,
|
||||
const cChannel *initialChannel,
|
||||
bool active,
|
||||
int *callback,
|
||||
eRecMenuState action) {
|
||||
@@ -1974,9 +1988,9 @@ void cRecMenuItemChannelChooser::DrawValue(void) {
|
||||
int logoWidth = height * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio;
|
||||
int logoX = textX - logoWidth - 10;
|
||||
cImageLoader imgLoader;
|
||||
if (imgLoader.LoadLogo(channel, logoWidth, height)) {
|
||||
if (imgLoader.LoadLogo(channel, logoWidth, height - 10)) {
|
||||
cImage logo = imgLoader.GetImage();
|
||||
pixmapChannel->DrawImage(cPoint(logoX, 0), logo);
|
||||
pixmapChannel->DrawImage(cPoint(logoX, 5), logo);
|
||||
}
|
||||
} else {
|
||||
cString textVal = tr("all Channels");
|
||||
@@ -1998,15 +2012,21 @@ eRecMenuState cRecMenuItemChannelChooser::ProcessKey(eKeys Key) {
|
||||
fresh = true;
|
||||
if (!channel)
|
||||
return rmsConsumed;
|
||||
cChannel *prev = channel;
|
||||
cChannel *firstChannel = Channels.First();
|
||||
const cChannel *prev = channel;
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
const cChannels* channels = Channels;
|
||||
#else
|
||||
const cChannels* channels = &Channels;
|
||||
#endif
|
||||
const cChannel *firstChannel = channels->First();
|
||||
if(firstChannel->GroupSep())
|
||||
firstChannel = Channels.Next(firstChannel);
|
||||
firstChannel = channels->Next(firstChannel);
|
||||
if (prev == firstChannel) {
|
||||
if (!initialChannelSet)
|
||||
channel = NULL;
|
||||
} else {
|
||||
while (prev = Channels.Prev(prev)) {
|
||||
while (prev = channels->Prev(prev)) {
|
||||
if(!prev->GroupSep()) {
|
||||
channel = prev;
|
||||
break;
|
||||
@@ -2024,13 +2044,19 @@ eRecMenuState cRecMenuItemChannelChooser::ProcessKey(eKeys Key) {
|
||||
break; }
|
||||
case kRight: {
|
||||
fresh = true;
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
const cChannels* channels = Channels;
|
||||
#else
|
||||
const cChannels* channels = &Channels;
|
||||
#endif
|
||||
if (!channel) {
|
||||
channel = Channels.First();
|
||||
channel = channels->First();
|
||||
if(channel->GroupSep())
|
||||
channel = Channels.Next(channel);
|
||||
channel = channels->Next(channel);
|
||||
} else {
|
||||
cChannel *next = channel;
|
||||
while (next = Channels.Next(next)) {
|
||||
const cChannel *next = channel;
|
||||
while (next = channels->Next(next)) {
|
||||
if(!next->GroupSep()) {
|
||||
channel = next;
|
||||
break;
|
||||
@@ -2052,7 +2078,12 @@ eRecMenuState cRecMenuItemChannelChooser::ProcessKey(eKeys Key) {
|
||||
fresh = false;
|
||||
}
|
||||
channelNumber = channelNumber * 10 + (Key - k0);
|
||||
cChannel *chanNew = Channels.GetByNumber(channelNumber);
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
const cChannel *chanNew = Channels->GetByNumber(channelNumber);
|
||||
#else
|
||||
const cChannel *chanNew = Channels.GetByNumber(channelNumber);
|
||||
#endif
|
||||
if (chanNew) {
|
||||
channel = chanNew;
|
||||
DrawValue();
|
||||
@@ -2214,7 +2245,7 @@ eRecMenuState cRecMenuItemDayChooser::ProcessKey(eKeys Key) {
|
||||
}
|
||||
|
||||
// --- cRecMenuItemRecording -------------------------------------------------------
|
||||
cRecMenuItemRecording::cRecMenuItemRecording(cRecording *recording, bool active) {
|
||||
cRecMenuItemRecording::cRecMenuItemRecording(const cRecording *recording, bool active) {
|
||||
selectable = true;
|
||||
this->recording = recording;
|
||||
this->active = active;
|
||||
@@ -2242,7 +2273,12 @@ void cRecMenuItemRecording::Draw(void) {
|
||||
if (!recording)
|
||||
return;
|
||||
const cRecordingInfo *recInfo = recording->Info();
|
||||
cChannel *channel = Channels.GetByChannelID(recInfo->ChannelID());
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
const cChannel *channel = Channels->GetByChannelID(recInfo->ChannelID());
|
||||
#else
|
||||
const cChannel *channel = Channels.GetByChannelID(recInfo->ChannelID());
|
||||
#endif
|
||||
cString channelName = tr("unknown channel");
|
||||
if (channel)
|
||||
channelName = channel->Name();
|
||||
@@ -2457,7 +2493,7 @@ void cRecMenuItemTimelineHeader::Show(void) {
|
||||
|
||||
|
||||
// --- cRecMenuItemTimelineTimer -------------------------------------------------------
|
||||
cRecMenuItemTimelineTimer::cRecMenuItemTimelineTimer(cTimer *timer, time_t start, time_t stop, std::vector<cTVGuideTimerConflict*> conflictsToday, cRecMenuItemTimelineHeader *header, bool active) {
|
||||
cRecMenuItemTimelineTimer::cRecMenuItemTimelineTimer(const cTimer *timer, time_t start, time_t stop, std::vector<cTVGuideTimerConflict*> conflictsToday, cRecMenuItemTimelineHeader *header, bool active) {
|
||||
conflicts = conflictsToday;
|
||||
defaultBackground = false;
|
||||
pixmapBack = NULL;
|
||||
@@ -2604,7 +2640,7 @@ void cRecMenuItemTimelineTimer::Show(void) {
|
||||
if (pixmapTimerConflicts) pixmapTimerConflicts->SetLayer(6);
|
||||
}
|
||||
|
||||
cTimer *cRecMenuItemTimelineTimer::GetTimerValue(void) {
|
||||
const cTimer *cRecMenuItemTimelineTimer::GetTimerValue(void) {
|
||||
return timer;
|
||||
}
|
||||
|
||||
@@ -2899,4 +2935,4 @@ eRecMenuState cRecMenuItemFavoriteStatic::ProcessKey(eKeys Key) {
|
||||
break;
|
||||
}
|
||||
return rmsNotConsumed;
|
||||
}
|
||||
}
|
||||
|
@@ -123,7 +123,7 @@ public:
|
||||
virtual bool GetBoolValue(void) { return false; };
|
||||
virtual cString GetStringValue(void) { return cString(""); };
|
||||
virtual const cEvent *GetEventValue(void) { return NULL; };
|
||||
virtual cTimer *GetTimerValue(void) { return NULL; };
|
||||
virtual const cTimer *GetTimerValue(void) { return NULL; };
|
||||
virtual eRecMenuState ProcessKey(eKeys Key) { return rmsNotConsumed; };
|
||||
};
|
||||
|
||||
@@ -247,6 +247,7 @@ private:
|
||||
cString text;
|
||||
int currentVal;
|
||||
int *callback;
|
||||
bool refresh;
|
||||
std::vector<std::string> strings;
|
||||
int numValues;
|
||||
cPixmap *pixmapVal;
|
||||
@@ -257,7 +258,8 @@ public:
|
||||
int initialVal,
|
||||
bool active = false,
|
||||
int *callback = NULL,
|
||||
eRecMenuState action = rmsNotConsumed);
|
||||
eRecMenuState action = rmsNotConsumed,
|
||||
bool refresh = false);
|
||||
virtual ~cRecMenuItemSelect(void);
|
||||
void SetPixmaps(void);
|
||||
void Hide(void);
|
||||
@@ -489,7 +491,7 @@ public:
|
||||
class cRecMenuItemChannelChooser : public cRecMenuItem {
|
||||
private:
|
||||
cString text;
|
||||
cChannel *channel;
|
||||
const cChannel *channel;
|
||||
int channelNumber;
|
||||
int *callback;
|
||||
bool initialChannelSet;
|
||||
@@ -498,7 +500,7 @@ private:
|
||||
void DrawValue(void);
|
||||
public:
|
||||
cRecMenuItemChannelChooser (cString text,
|
||||
cChannel *initialChannel,
|
||||
const cChannel *initialChannel,
|
||||
bool active = false,
|
||||
int *callback = NULL,
|
||||
eRecMenuState action = rmsNotConsumed);
|
||||
@@ -548,10 +550,10 @@ public:
|
||||
// --- cRecMenuItemRecording -------------------------------------------------------
|
||||
class cRecMenuItemRecording : public cRecMenuItem {
|
||||
private:
|
||||
cRecording *recording;
|
||||
const cRecording *recording;
|
||||
cPixmap *pixmapText;
|
||||
public:
|
||||
cRecMenuItemRecording(cRecording *recording, bool active);
|
||||
cRecMenuItemRecording(const cRecording *recording, bool active);
|
||||
virtual ~cRecMenuItemRecording(void);
|
||||
void SetPixmaps(void);
|
||||
void Hide(void);
|
||||
@@ -563,7 +565,7 @@ public:
|
||||
class cRecMenuItemTimelineHeader : public cRecMenuItem {
|
||||
private:
|
||||
time_t day;
|
||||
cTimer *timer;
|
||||
const cTimer *timer;
|
||||
std::vector<cTVGuideTimerConflict*> conflicts;
|
||||
cPixmap *pixmapTimeline;
|
||||
cPixmap *pixmapTimerInfo;
|
||||
@@ -579,7 +581,7 @@ public:
|
||||
virtual ~cRecMenuItemTimelineHeader(void);
|
||||
void SetDay(time_t day) { this->day = day; };
|
||||
void SetPixmaps(void);
|
||||
void SetCurrentTimer(cTimer *timer) { this->timer = timer; };
|
||||
void SetCurrentTimer(const cTimer *timer) { this->timer = timer; };
|
||||
void UnsetCurrentTimer(void) { timer = NULL; };
|
||||
void RefreshTimerDisplay(void);
|
||||
void Hide(void);
|
||||
@@ -590,7 +592,7 @@ public:
|
||||
// --- cRecMenuItemTimelineTimer -------------------------------------------------------
|
||||
class cRecMenuItemTimelineTimer : public cRecMenuItem {
|
||||
private:
|
||||
cTimer *timer;
|
||||
const cTimer *timer;
|
||||
std::vector<cTVGuideTimerConflict*> conflicts;
|
||||
cPixmap *pixmapBack;
|
||||
cPixmap *pixmapTimerConflicts;
|
||||
@@ -605,7 +607,7 @@ private:
|
||||
void DrawTimerConflicts(void);
|
||||
void DrawNoTimerInfo(void);
|
||||
public:
|
||||
cRecMenuItemTimelineTimer(cTimer *timer, time_t start, time_t stop, std::vector<cTVGuideTimerConflict*> conflictsToday, cRecMenuItemTimelineHeader *header, bool active);
|
||||
cRecMenuItemTimelineTimer(const cTimer *timer, time_t start, time_t stop, std::vector<cTVGuideTimerConflict*> conflictsToday, cRecMenuItemTimelineHeader *header, bool active);
|
||||
virtual ~cRecMenuItemTimelineTimer(void);
|
||||
void setActive(void);
|
||||
void setInactive(void);
|
||||
@@ -613,7 +615,7 @@ public:
|
||||
void Hide(void);
|
||||
void Show(void);
|
||||
void Draw(void);
|
||||
cTimer *GetTimerValue(void);
|
||||
const cTimer *GetTimerValue(void);
|
||||
eRecMenuState ProcessKey(eKeys Key);
|
||||
};
|
||||
|
||||
@@ -681,4 +683,4 @@ public:
|
||||
eRecMenuState ProcessKey(eKeys Key);
|
||||
};
|
||||
|
||||
#endif //__TVGUIDE_RECMENUITEM_H
|
||||
#endif //__TVGUIDE_RECMENUITEM_H
|
||||
|
125
recmenumanager.c
125
recmenumanager.c
@@ -1,4 +1,4 @@
|
||||
#include "recmenu.h"
|
||||
#include "recmenu.h"
|
||||
#include "recmenus.h"
|
||||
#include "switchtimer.h"
|
||||
#include "timerconflict.h"
|
||||
@@ -87,8 +87,8 @@ void cRecMenuManager::DeleteBackground(void) {
|
||||
eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
eOSState state = osContinue;
|
||||
switch (nextState) {
|
||||
/***************************************************************************************
|
||||
* INSTANT RECORDING
|
||||
/***************************************************************************************
|
||||
* INSTANT RECORDING
|
||||
****************************************************************************************/
|
||||
case rmsInstantRecord: {
|
||||
//caller: main menu or folder chooser
|
||||
@@ -125,7 +125,12 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
timerIndex = menu->GetTimerConflictIndex();
|
||||
} else break;
|
||||
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex);
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_READ;
|
||||
const cTimer *t = Timers->Get(timerID);
|
||||
#else
|
||||
cTimer *t = Timers.Get(timerID);
|
||||
#endif
|
||||
if (t) {
|
||||
const cEvent *ev = t->Event();
|
||||
if (ev) {
|
||||
@@ -136,6 +141,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
case rmsDeleteTimerConflictMenu: {
|
||||
//caller: cRecMenuTimerConflict
|
||||
//delete timer out of current timer conflict
|
||||
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
|
||||
int timerIndex;
|
||||
if (cRecMenuTimerConflict *menu = dynamic_cast<cRecMenuTimerConflict*>(activeMenu)) {
|
||||
timerIndex = menu->GetTimerConflictIndex();
|
||||
@@ -156,7 +162,12 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
timerIndex = menu->GetTimerConflictIndex();
|
||||
} else break;
|
||||
int timerID = timerConflicts->GetCurrentConflictTimerID(timerIndex);
|
||||
cTimer *timer = Timers.Get(timerID);
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_READ;
|
||||
const cTimer *timer = Timers->Get(timerID);
|
||||
#else
|
||||
const cTimer *timer = Timers.Get(timerID);
|
||||
#endif
|
||||
if (timer) {
|
||||
delete activeMenu;
|
||||
activeMenu = new cRecMenuEditTimer(timer, rmsSaveTimerConflictMenu);
|
||||
@@ -167,7 +178,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
//caller: cRecMenuEditTimer
|
||||
//save timer from current timer conflict
|
||||
cTimer timerModified;
|
||||
cTimer *originalTimer;
|
||||
const cTimer *originalTimer;
|
||||
if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) {
|
||||
timerModified = menu->GetTimer();
|
||||
originalTimer = menu->GetOriginalTimer();
|
||||
@@ -182,6 +193,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
case rmsDeleteTimer:
|
||||
//caller: main menu
|
||||
//delete timer for active event
|
||||
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
|
||||
delete activeMenu;
|
||||
if (recManager->IsRecorded(event)) {
|
||||
activeMenu = new cRecMenuAskDeleteTimer(event);
|
||||
@@ -200,7 +212,15 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
break;
|
||||
case rmsEditTimer: {
|
||||
//edit timer for active event
|
||||
cTimer *timer = recManager->GetTimerForEvent(event);
|
||||
const cTimer *timer;
|
||||
#if VDRVERSNUM >= 20301
|
||||
{
|
||||
LOCK_TIMERS_READ;
|
||||
timer = recManager->GetTimerForEvent(event);
|
||||
}
|
||||
#else
|
||||
timer = recManager->GetTimerForEvent(event);
|
||||
#endif
|
||||
if (timer) {
|
||||
delete activeMenu;
|
||||
activeMenu = new cRecMenuEditTimer(timer, rmsSaveTimer);
|
||||
@@ -211,7 +231,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
//caller: cRecMenuEditTimer
|
||||
//save timer for active event
|
||||
cTimer timerModified;
|
||||
cTimer *originalTimer;
|
||||
const cTimer *originalTimer;
|
||||
if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) {
|
||||
timerModified = menu->GetTimer();
|
||||
originalTimer = menu->GetOriginalTimer();
|
||||
@@ -220,7 +240,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
state = osEnd;
|
||||
Close();
|
||||
break; }
|
||||
/***************************************************************************************
|
||||
/***************************************************************************************
|
||||
* SERIES TIMER
|
||||
****************************************************************************************/
|
||||
case rmsSeriesTimer: {
|
||||
@@ -230,7 +250,12 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
recFolder = menu->GetFolder();
|
||||
}
|
||||
delete activeMenu;
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
const cChannel *channel = Channels->GetByChannelID(event->ChannelID());
|
||||
#else
|
||||
cChannel *channel = Channels.GetByChannelID(event->ChannelID());
|
||||
#endif
|
||||
activeMenu = new cRecMenuSeriesTimer(channel, event, recFolder);
|
||||
activeMenu->Display();
|
||||
break; }
|
||||
@@ -252,8 +277,8 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
activeMenu = new cRecMenuConfirmSeriesTimer(seriesTimer);
|
||||
activeMenu->Display();
|
||||
break; }
|
||||
/**********************************************************************************************
|
||||
* SEARCH TIMER
|
||||
/**********************************************************************************************
|
||||
* SEARCH TIMER
|
||||
***********************************************************************************************/
|
||||
case rmsSearchTimer:
|
||||
//Caller: main menu
|
||||
@@ -277,7 +302,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
delete activeMenu;
|
||||
if (searchString.size() < 4) {
|
||||
activeMenu = new cRecMenuSearchTimer(event);
|
||||
} else {
|
||||
} else {
|
||||
if (!reload) {
|
||||
searchTimer.SetSearchString(searchString);
|
||||
}
|
||||
@@ -286,7 +311,9 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
if (epgSearchTemplates.size() > 0) {
|
||||
activeMenu = new cRecMenuSearchTimerTemplates(searchTimer, epgSearchTemplates);
|
||||
} else {
|
||||
activeMenu = new cRecMenuSearchTimerEdit(searchTimer, false);
|
||||
std::vector<std::string> channelGroups;
|
||||
recManager->GetChannelGroups(&channelGroups);
|
||||
activeMenu = new cRecMenuSearchTimerEdit(searchTimer, false, channelGroups);
|
||||
}
|
||||
}
|
||||
activeMenu->Display();
|
||||
@@ -304,12 +331,14 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
searchTimer = menu->GetSearchTimer();
|
||||
} else if (cRecMenuSearchTimerEdit *menu = dynamic_cast<cRecMenuSearchTimerEdit*>(activeMenu)) {
|
||||
searchTimer = menu->GetSearchTimer();
|
||||
advancedOptions = (nextState == rmsSearchTimerEditAdvanced)?true:false;
|
||||
advancedOptions = (nextState == rmsSearchTimerEditAdvanced) ? true : false;
|
||||
} else if (cRecMenuSearchTimerTemplates *menu = dynamic_cast<cRecMenuSearchTimerTemplates*>(activeMenu)) {
|
||||
searchTimer = menu->GetSearchTimer();
|
||||
} else break;
|
||||
delete activeMenu;
|
||||
activeMenu = new cRecMenuSearchTimerEdit(searchTimer, advancedOptions);
|
||||
std::vector<std::string> channelGroups;
|
||||
recManager->GetChannelGroups(&channelGroups);
|
||||
activeMenu = new cRecMenuSearchTimerEdit(searchTimer, advancedOptions, channelGroups);
|
||||
activeMenu->Display();
|
||||
break; }
|
||||
case rmsSearchTimerTest: {
|
||||
@@ -396,7 +425,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
activeMenu = new cRecMenuSearchTimerDeleteConfirm(searchTimer);
|
||||
activeMenu->Display();
|
||||
break; }
|
||||
case rmsSearchTimerDelete:
|
||||
case rmsSearchTimerDelete:
|
||||
case rmsSearchTimerDeleteWithTimers: {
|
||||
//caller: cRecMenuSearchTimerDeleteConfirm
|
||||
//actually delete searchtimer
|
||||
@@ -424,8 +453,8 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
activeMenu = new cRecMenuSearchConfirmTimer(ev, rmsFavoritesRecordConfirm);
|
||||
activeMenu->Display();
|
||||
break; }
|
||||
/**********************************************************************************************
|
||||
* SWITCH TIMER
|
||||
/**********************************************************************************************
|
||||
* SWITCH TIMER
|
||||
***********************************************************************************************/
|
||||
case rmsSwitchTimer:
|
||||
delete activeMenu;
|
||||
@@ -442,14 +471,14 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
activeMenu = new cRecMenuSwitchTimerConfirm(success);
|
||||
activeMenu->Display();
|
||||
break; }
|
||||
case rmsSwitchTimerDelete:
|
||||
case rmsSwitchTimerDelete:
|
||||
recManager->DeleteSwitchTimer(event);
|
||||
delete activeMenu;
|
||||
activeMenu = new cRecMenuSwitchTimerDelete();
|
||||
activeMenu->Display();
|
||||
break;
|
||||
/**********************************************************************************************
|
||||
* RECORDINGS SEARCH
|
||||
/**********************************************************************************************
|
||||
* RECORDINGS SEARCH
|
||||
***********************************************************************************************/
|
||||
case rmsRecordingSearch: {
|
||||
//caller: main menu or rmsRecordingSearchResult
|
||||
@@ -472,7 +501,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
activeMenu = new cRecMenuRecordingSearch(searchString);
|
||||
} else {
|
||||
int numSearchResults = 0;
|
||||
cRecording **searchResult = recManager->SearchForRecordings(searchString, numSearchResults);
|
||||
const cRecording **searchResult = recManager->SearchForRecordings(searchString, numSearchResults);
|
||||
if (numSearchResults == 0) {
|
||||
activeMenu = new cRecMenuRecordingSearchNotFound(searchString);
|
||||
} else {
|
||||
@@ -481,8 +510,8 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
}
|
||||
activeMenu->Display();
|
||||
break; }
|
||||
/**********************************************************************************************
|
||||
* SEARCH
|
||||
/**********************************************************************************************
|
||||
* SEARCH
|
||||
***********************************************************************************************/
|
||||
case rmsSearch:
|
||||
case rmsSearchWithOptions: {
|
||||
@@ -563,8 +592,8 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
activeMenu->UpdateActiveMenuItem();
|
||||
activeMenu->Show();
|
||||
break;
|
||||
/**********************************************************************************************
|
||||
* CHECK FOR TIMER CONFLICTS
|
||||
/**********************************************************************************************
|
||||
* CHECK FOR TIMER CONFLICTS
|
||||
***********************************************************************************************/
|
||||
case rmsTimerConflicts: {
|
||||
//caller: main menu
|
||||
@@ -606,7 +635,12 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
timerConflict = menu->GetTimerConflictIndex();
|
||||
} else break;
|
||||
int timerID = timerConflicts->GetCurrentConflictTimerID(timerConflict);
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_READ;
|
||||
const cTimer *timer = Timers->Get(timerID);
|
||||
#else
|
||||
cTimer *timer = Timers.Get(timerID);
|
||||
#endif
|
||||
if (timer) {
|
||||
const cEvent *event = timer->Event();
|
||||
if (event) {
|
||||
@@ -648,7 +682,12 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
originalConflictIndex = menu->GetTimerConflictIndex();
|
||||
} else break;
|
||||
int originalTimerID = timerConflicts->GetCurrentConflictTimerID(originalConflictIndex);
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_READ;
|
||||
const cTimer *timerOriginal = Timers->Get(originalTimerID);
|
||||
#else
|
||||
cTimer *timerOriginal = Timers.Get(originalTimerID);
|
||||
#endif
|
||||
if (replace && timerOriginal) {
|
||||
recManager->DeleteTimer(timerOriginal->Event());
|
||||
recManager->createTimer(replace);
|
||||
@@ -661,7 +700,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
activeMenu->Display();
|
||||
}
|
||||
break; }
|
||||
/**********************************************************************************************
|
||||
/**********************************************************************************************
|
||||
* TIMELINE
|
||||
***********************************************************************************************/
|
||||
case rmsTimeline: {
|
||||
@@ -672,9 +711,9 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
delete activeMenu;
|
||||
activeMenu = new cRecMenuTimeline(timerConflicts);
|
||||
activeMenu->Display();
|
||||
break; }
|
||||
break; }
|
||||
case rmsTimelineTimerEdit: {
|
||||
cTimer *timer;
|
||||
const cTimer *timer;
|
||||
if (cRecMenuTimeline *menu = dynamic_cast<cRecMenuTimeline*>(activeMenu)) {
|
||||
timer = menu->GetTimer();
|
||||
} else break;
|
||||
@@ -686,7 +725,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
break;}
|
||||
case rmsTimelineTimerSave: {
|
||||
cTimer timerModified;
|
||||
cTimer *originalTimer;
|
||||
const cTimer *originalTimer;
|
||||
if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) {
|
||||
timerModified = menu->GetTimer();
|
||||
originalTimer = menu->GetOriginalTimer();
|
||||
@@ -701,11 +740,18 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
activeMenu->Display();
|
||||
break; }
|
||||
case rmsTimelineTimerDelete: {
|
||||
cTimer *timer;
|
||||
const cTimer *timer;
|
||||
if (cRecMenuEditTimer *menu = dynamic_cast<cRecMenuEditTimer*>(activeMenu)) {
|
||||
timer = menu->GetOriginalTimer();
|
||||
} else break;
|
||||
recManager->DeleteTimer(timer);
|
||||
#if VDRVERSNUM >= 20301
|
||||
{
|
||||
LOCK_TIMERS_WRITE;
|
||||
recManager->DeleteTimer(Timers->GetTimer(timer));
|
||||
}
|
||||
#else
|
||||
recManager->DeleteTimer(Timers.GetTimer((cTimer*)timer));
|
||||
#endif
|
||||
delete activeMenu;
|
||||
if (timerConflicts) {
|
||||
delete timerConflicts;
|
||||
@@ -714,7 +760,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
activeMenu = new cRecMenuTimeline(timerConflicts);
|
||||
activeMenu->Display();
|
||||
break; }
|
||||
/**********************************************************************************************
|
||||
/**********************************************************************************************
|
||||
* FAVORITES
|
||||
*********************************************************************************************/
|
||||
case rmsFavoritesRecord: {
|
||||
@@ -774,7 +820,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
DisplayFavoriteResults(tvguideConfig.descUser4, result, numResults);
|
||||
break; }
|
||||
|
||||
/**********************************************************************************************
|
||||
/**********************************************************************************************
|
||||
* COMMON
|
||||
*********************************************************************************************/
|
||||
case rmsClose: {
|
||||
@@ -790,7 +836,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
|
||||
state = osContinue;
|
||||
}
|
||||
break; }
|
||||
default:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return state;
|
||||
@@ -818,9 +864,14 @@ void cRecMenuManager::DisplaySearchTimerList(void) {
|
||||
activeMenu->Display();
|
||||
}
|
||||
|
||||
bool cRecMenuManager::DisplayTimerConflict(cTimer *timer) {
|
||||
bool cRecMenuManager::DisplayTimerConflict(const cTimer *timer) {
|
||||
int timerID = 0;
|
||||
for (cTimer *t = Timers.First(); t; t = Timers.Next(t)) {
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_READ;
|
||||
for (const cTimer *t = Timers->First(); t; t = Timers->Next(t)) {
|
||||
#else
|
||||
for (const cTimer *t = Timers.First(); t; t = Timers.Next(t)) {
|
||||
#endif
|
||||
if (t == timer)
|
||||
return DisplayTimerConflict(timerID);
|
||||
timerID++;
|
||||
@@ -890,4 +941,4 @@ eOSState cRecMenuManager::ProcessKey(eKeys Key) {
|
||||
}
|
||||
osdManager.flush();
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
@@ -15,6 +15,7 @@ private:
|
||||
cRecMenu *activeMenuBuffer;
|
||||
cRecMenu *activeMenuBuffer2;
|
||||
const cEvent *event;
|
||||
const cEvent *displayEvent;
|
||||
cRecManager *recManager;
|
||||
cTVGuideTimerConflicts *timerConflicts;
|
||||
cDetailView *detailView;
|
||||
@@ -23,10 +24,11 @@ private:
|
||||
void SetBackground(void);
|
||||
void DeleteBackground(void);
|
||||
void DisplaySearchTimerList(void);
|
||||
bool DisplayTimerConflict(cTimer *timer);
|
||||
bool DisplayTimerConflict(const cTimer *timer);
|
||||
bool DisplayTimerConflict(int timerID);
|
||||
void DisplayDetailedView(const cEvent *ev);
|
||||
void DisplayFavoriteResults(std::string header, const cEvent **result, int numResults);
|
||||
eOSState StateMachine(eRecMenuState nextState);
|
||||
public:
|
||||
cRecMenuManager(void);
|
||||
virtual ~cRecMenuManager(void);
|
||||
@@ -35,8 +37,7 @@ public:
|
||||
void Start(const cEvent *event);
|
||||
void StartFavorites(void);
|
||||
void Close(void);
|
||||
eOSState StateMachine(eRecMenuState nextState);
|
||||
eOSState ProcessKey(eKeys Key);
|
||||
};
|
||||
|
||||
#endif //__TVGUIDE_RECMENUMANAGER_H
|
||||
#endif //__TVGUIDE_RECMENUMANAGER_H
|
||||
|
175
recmenus.c
175
recmenus.c
@@ -6,11 +6,13 @@
|
||||
// --- cRecMenuMain ---------------------------------------------------------
|
||||
cRecMenuMain::cRecMenuMain(bool epgSearchAvailable, bool timerActive, bool switchTimerActive) {
|
||||
eRecMenuState action = rmsInstantRecord;
|
||||
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
|
||||
if (!timerActive) {
|
||||
if (tvguideConfig.instRecFolderMode == eFolderSelect)
|
||||
action = rmsInstantRecordFolder;
|
||||
AddMenuItem(new cRecMenuItemButton(tr("Instant Record"), action, true, false, false, true));
|
||||
} else {
|
||||
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
|
||||
AddMenuItem(new cRecMenuItemButton(tr("Delete Timer"), rmsDeleteTimer, true, false, false, true));
|
||||
AddMenuItem(new cRecMenuItemButton(tr("Edit Timer"), rmsEditTimer, false, false, false, true));
|
||||
}
|
||||
@@ -83,7 +85,7 @@ cRecMenuItem *cRecMenuAskFolder::GetMenuItem(int number) {
|
||||
if (number == 0) {
|
||||
cRecMenuItem *result = new cRecMenuItemButton(tr("root video folder"), rmsInstantRecord, false, false, true);
|
||||
return result;
|
||||
} else if ((number > 0) && (number < folders.size()+1)) {
|
||||
} else if ((number > 0) && (number < (int)folders.size() + 1)) {
|
||||
cRecMenuItem *result = new cRecMenuItemButton(folders[number-1].c_str(), rmsInstantRecord, false, false, true);
|
||||
return result;
|
||||
}
|
||||
@@ -97,7 +99,7 @@ int cRecMenuAskFolder::GetTotalNumMenuItems(void) {
|
||||
std::string cRecMenuAskFolder::GetFolder(void) {
|
||||
std::string folder = "";
|
||||
int folderActive = GetActive();
|
||||
if (folderActive > 0 && folderActive < folders.size() + 1)
|
||||
if (folderActive > 0 && folderActive < (int)folders.size() + 1)
|
||||
folder = folders[folderActive - 1];
|
||||
return folder;
|
||||
}
|
||||
@@ -105,7 +107,12 @@ std::string cRecMenuAskFolder::GetFolder(void) {
|
||||
// --- cRecMenuConfirmTimer ---------------------------------------------------------
|
||||
cRecMenuConfirmTimer::cRecMenuConfirmTimer(const cEvent *event) {
|
||||
SetWidthPercent(50);
|
||||
cString channelName = Channels.GetByChannelID(event->ChannelID())->Name();
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
const cString channelName = Channels->GetByChannelID(event->ChannelID())->Name();
|
||||
#else
|
||||
const cString channelName = Channels.GetByChannelID(event->ChannelID())->Name();
|
||||
#endif
|
||||
cString message;
|
||||
bool eventHasTimer = false;
|
||||
if (tvguideConfig.useRemoteTimers && pRemoteTimers) {
|
||||
@@ -142,8 +149,14 @@ cRecMenuConfirmTimer::cRecMenuConfirmTimer(const cEvent *event) {
|
||||
|
||||
// --- cRecMenuConfirmDeleteTimer ---------------------------------------------------------
|
||||
cRecMenuConfirmDeleteTimer::cRecMenuConfirmDeleteTimer(const cEvent *event) {
|
||||
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
|
||||
SetWidthPercent(50);
|
||||
cString channelName = Channels.GetByChannelID(event->ChannelID())->Name();
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
const cString channelName = Channels->GetByChannelID(event->ChannelID())->Name();
|
||||
#else
|
||||
const cString channelName = Channels.GetByChannelID(event->ChannelID())->Name();
|
||||
#endif
|
||||
cString text = cString::sprintf("%s\n%s\n%s %s - %s\n%s",
|
||||
tr("Timer deleted"),
|
||||
*channelName,
|
||||
@@ -164,8 +177,14 @@ cRecMenuConfirmDeleteTimer::cRecMenuConfirmDeleteTimer(const cEvent *event) {
|
||||
|
||||
// --- cRecMenuAskDeleteTimer ---------------------------------------------------------
|
||||
cRecMenuAskDeleteTimer::cRecMenuAskDeleteTimer(const cEvent *event) {
|
||||
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
|
||||
SetWidthPercent(50);
|
||||
cString channelName = Channels.GetByChannelID(event->ChannelID())->Name();
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
const cString channelName = Channels->GetByChannelID(event->ChannelID())->Name();
|
||||
#else
|
||||
const cString channelName = Channels.GetByChannelID(event->ChannelID())->Name();
|
||||
#endif
|
||||
cString text = cString::sprintf("%s \"%s, %s\" %s",
|
||||
tr("Timer"),
|
||||
*channelName,
|
||||
@@ -228,7 +247,12 @@ cRecMenuTimerConflict::cRecMenuTimerConflict(cTVGuideTimerConflict *conflict) {
|
||||
SetFooter(new cRecMenuItemButton(tr("Ignore Conflict"), rmsIgnoreTimerConflict, false, true));
|
||||
int i=0;
|
||||
for(std::vector<int>::iterator it = conflict->timerIDs.begin(); it != conflict->timerIDs.end(); it++) {
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_READ;
|
||||
const cTimer *timer = Timers->Get(*it);
|
||||
#else
|
||||
const cTimer *timer = Timers.Get(*it);
|
||||
#endif
|
||||
if (timer) {
|
||||
if (!AddMenuItemInitial(new cRecMenuItemTimer( timer,
|
||||
rmsTimerConflictShowInfo,
|
||||
@@ -251,8 +275,13 @@ cRecMenuTimerConflict::cRecMenuTimerConflict(cTVGuideTimerConflict *conflict) {
|
||||
}
|
||||
|
||||
cRecMenuItem *cRecMenuTimerConflict::GetMenuItem(int number) {
|
||||
if ((number >= 0) && (number < conflict->timerIDs.size())) {
|
||||
if ((number >= 0) && (number < (int)conflict->timerIDs.size())) {
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_READ;
|
||||
const cTimer *timer = Timers->Get(conflict->timerIDs[number]);
|
||||
#else
|
||||
const cTimer *timer = Timers.Get(conflict->timerIDs[number]);
|
||||
#endif
|
||||
cRecMenuItem *result = new cRecMenuItemTimer( timer,
|
||||
rmsTimerConflictShowInfo,
|
||||
rmsDeleteTimerConflictMenu,
|
||||
@@ -353,8 +382,14 @@ cRecMenuNoRerunsFound::cRecMenuNoRerunsFound(cString searchString) {
|
||||
// --- cRecMenuConfirmRerunUsed ---------------------------------------------------------
|
||||
cRecMenuConfirmRerunUsed::cRecMenuConfirmRerunUsed(const cEvent *original, const cEvent *replace) {
|
||||
SetWidthPercent(70);
|
||||
cString channelOrig = Channels.GetByChannelID(original->ChannelID())->Name();
|
||||
cString channelReplace = Channels.GetByChannelID(replace->ChannelID())->Name();
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
const cString channelOrig = Channels->GetByChannelID(original->ChannelID())->Name();
|
||||
const cString channelReplace = Channels->GetByChannelID(replace->ChannelID())->Name();
|
||||
#else
|
||||
const cString channelOrig = Channels.GetByChannelID(original->ChannelID())->Name();
|
||||
const cString channelReplace = Channels.GetByChannelID(replace->ChannelID())->Name();
|
||||
#endif
|
||||
cString message1 = tr("Timer for");
|
||||
cString message2 = tr("replaced by rerun");
|
||||
cString text = cString::sprintf("%s\n\"%s\", %s %s, %s\n%s\n\"%s\", %s %s, %s",
|
||||
@@ -378,7 +413,7 @@ cRecMenuConfirmRerunUsed::cRecMenuConfirmRerunUsed(const cEvent *original, const
|
||||
}
|
||||
|
||||
// --- cRecMenuEditTimer ---------------------------------------------------------
|
||||
cRecMenuEditTimer::cRecMenuEditTimer(cTimer *timer, eRecMenuState nextState) {
|
||||
cRecMenuEditTimer::cRecMenuEditTimer(const cTimer *timer, eRecMenuState nextState) {
|
||||
SetWidthPercent(70);
|
||||
if (!timer)
|
||||
return;
|
||||
@@ -435,7 +470,7 @@ cRecMenuEditTimer::cRecMenuEditTimer(cTimer *timer, eRecMenuState nextState) {
|
||||
Arrange();
|
||||
}
|
||||
|
||||
cTimer *cRecMenuEditTimer::GetOriginalTimer(void) {
|
||||
const cTimer *cRecMenuEditTimer::GetOriginalTimer(void) {
|
||||
return originalTimer;
|
||||
}
|
||||
|
||||
@@ -473,7 +508,7 @@ cTimer cRecMenuEditTimer::GetTimer(void) {
|
||||
******************************************************************************************/
|
||||
|
||||
// --- cRecMenuSeriesTimer ---------------------------------------------------------
|
||||
cRecMenuSeriesTimer::cRecMenuSeriesTimer(cChannel *initialChannel, const cEvent *event, std::string folder) {
|
||||
cRecMenuSeriesTimer::cRecMenuSeriesTimer(const cChannel *initialChannel, const cEvent *event, std::string folder) {
|
||||
if (!initialChannel)
|
||||
return;
|
||||
timerActive = true;
|
||||
@@ -492,7 +527,11 @@ cRecMenuSeriesTimer::cRecMenuSeriesTimer(cChannel *initialChannel, const cEvent
|
||||
SetHeader(infoItem);
|
||||
|
||||
AddMenuItem(new cRecMenuItemBool(tr("Timer Active"), timerActive, false, false, &timerActive));
|
||||
#if VDRVERSNUM >= 20301
|
||||
AddMenuItem(new cRecMenuItemChannelChooser(tr("Channel"), initialChannel, false, &channel));
|
||||
#else
|
||||
AddMenuItem(new cRecMenuItemChannelChooser(tr("Channel"), (cChannel*)initialChannel, false, &channel));
|
||||
#endif
|
||||
AddMenuItem(new cRecMenuItemTime(tr("Series Timer start time"), start, false, &start));
|
||||
AddMenuItem(new cRecMenuItemTime(tr("Series Timer stop time"), stop, false, &stop));
|
||||
AddMenuItem(new cRecMenuItemDayChooser(tr("Days to record"), dayOfWeek, false, &dayOfWeek));
|
||||
@@ -508,7 +547,12 @@ cRecMenuSeriesTimer::cRecMenuSeriesTimer(cChannel *initialChannel, const cEvent
|
||||
}
|
||||
|
||||
cTimer *cRecMenuSeriesTimer::GetTimer(void) {
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
const cChannel *chan = Channels->GetByNumber(channel);
|
||||
#else
|
||||
cChannel *chan = Channels.GetByNumber(channel);
|
||||
#endif
|
||||
cTimer *seriesTimer = new cTimer(NULL, NULL, chan);
|
||||
cString fileName = "TITLE EPISODE";
|
||||
if (folder.size() > 0) {
|
||||
@@ -624,7 +668,7 @@ int cRecMenuSearchTimerTemplates::GetTotalNumMenuItems(void) {
|
||||
TVGuideEPGSearchTemplate cRecMenuSearchTimerTemplates::GetTemplate(void) {
|
||||
TVGuideEPGSearchTemplate templ;
|
||||
int tmplActive = GetActive() - 1;
|
||||
if (tmplActive >= 0 && tmplActive < templates.size())
|
||||
if (tmplActive >= 0 && tmplActive < (int)templates.size())
|
||||
templ = templates[tmplActive];
|
||||
return templ;
|
||||
}
|
||||
@@ -678,10 +722,11 @@ int cRecMenuSearchTimers::GetTotalNumMenuItems(void) {
|
||||
}
|
||||
|
||||
// --- cRecMenuSearchTimerEdit ---------------------------------------------------------
|
||||
cRecMenuSearchTimerEdit::cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer, bool advancedOptions) {
|
||||
cRecMenuSearchTimerEdit::cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer, bool advancedOptions, std::vector<std::string> channelGroups) {
|
||||
deleteMenuItems = false;
|
||||
this->advancedOptions = advancedOptions;
|
||||
this->searchTimer = searchTimer;
|
||||
this->channelGroups = channelGroups;
|
||||
strncpy(searchString, searchTimer.SearchString().c_str(), TEXTINPUTLENGTH);
|
||||
timerActive = searchTimer.Active();
|
||||
mode = searchTimer.SearchMode();
|
||||
@@ -691,6 +736,8 @@ cRecMenuSearchTimerEdit::cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer
|
||||
useChannel = searchTimer.UseChannel();
|
||||
startChannel = searchTimer.StartChannel();
|
||||
stopChannel = searchTimer.StopChannel();
|
||||
channelGroup = searchTimer.ChannelGroup();
|
||||
channelgroupIndex = -1;
|
||||
useTime = searchTimer.UseTime();
|
||||
startTime = searchTimer.StartTime();
|
||||
stopTime = searchTimer.StopTime();
|
||||
@@ -736,6 +783,10 @@ cRecMenuSearchTimerEdit::~cRecMenuSearchTimerEdit(void) {
|
||||
delete *it;
|
||||
}
|
||||
useChannelSubMenu.clear();
|
||||
for (std::vector<cRecMenuItem*>::iterator it = useGroupSubMenu.begin(); it != useGroupSubMenu.end(); it++) {
|
||||
delete *it;
|
||||
}
|
||||
useGroupSubMenu.clear();
|
||||
for (std::vector<cRecMenuItem*>::iterator it = useTimeSubMenu.begin(); it != useTimeSubMenu.end(); it++) {
|
||||
delete *it;
|
||||
}
|
||||
@@ -751,22 +802,45 @@ cRecMenuSearchTimerEdit::~cRecMenuSearchTimerEdit(void) {
|
||||
currentMenuItems.clear();
|
||||
}
|
||||
|
||||
int cRecMenuSearchTimerEdit::SplitChannelGroups(std::vector<std::string> *channelGroups, std::vector<std::string> *channelgroups) {
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
for (std::vector<std::string>::iterator it = channelGroups->begin(); it != channelGroups->end(); it++) {
|
||||
std::string a = *it;
|
||||
splitstring s(a.c_str());
|
||||
std::vector<std::string> value = s.split('|', 0);
|
||||
dsyslog ("%s %s %d %s\n", __FILE__, __func__, __LINE__, s.c_str());
|
||||
std::vector<std::string>::iterator ito = value.begin();
|
||||
channelgroups->push_back(*ito);
|
||||
std::string b = *ito;
|
||||
if (b.compare(channelGroup) == 0)
|
||||
j = i;
|
||||
i++;
|
||||
}
|
||||
return j;
|
||||
}
|
||||
|
||||
void cRecMenuSearchTimerEdit::InitMenuItems(void) {
|
||||
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
|
||||
|
||||
useChannelPos = 6;
|
||||
useTimePos = 7;
|
||||
useDayOfWeekPos = 8;
|
||||
avoidRepeatsPos = 14;
|
||||
|
||||
mainMenuItems.push_back(new cRecMenuItemText(tr("Search String"), searchString, TEXTINPUTLENGTH, false, searchString));
|
||||
mainMenuItems.push_back(new cRecMenuItemBool(tr("Active"), timerActive, false, false, &timerActive, rmsSearchTimerSave));
|
||||
std::vector<std::string> searchModes;
|
||||
searchTimer.GetSearchModes(&searchModes);
|
||||
std::vector<std::string> useChannelModes;
|
||||
searchTimer.GetUseChannelModes(&useChannelModes);
|
||||
channelgroupIndex = SplitChannelGroups(&channelGroups, &channelgroups);
|
||||
|
||||
mainMenuItems.push_back(new cRecMenuItemText(tr("Search String"), searchString, TEXTINPUTLENGTH, false, searchString));
|
||||
mainMenuItems.push_back(new cRecMenuItemBool(tr("Active"), timerActive, false, false, &timerActive, rmsSearchTimerSave));
|
||||
mainMenuItems.push_back(new cRecMenuItemSelect(tr("Search Mode"), searchModes, mode, false, &mode, rmsSearchTimerSave));
|
||||
mainMenuItems.push_back(new cRecMenuItemBool(tr("Use Title"), useTitle, false, false, &useTitle, rmsSearchTimerSave));
|
||||
mainMenuItems.push_back(new cRecMenuItemBool(tr("Use Subtitle"), useSubtitle, false, false, &useSubtitle, rmsSearchTimerSave));
|
||||
mainMenuItems.push_back(new cRecMenuItemBool(tr("Use Description"), useDescription, false, false, &useDescription, rmsSearchTimerSave));
|
||||
mainMenuItems.push_back(new cRecMenuItemBool(tr("Limit Channels"), useChannel, true, false, &useChannel, rmsSearchTimerSave));
|
||||
mainMenuItems.push_back(new cRecMenuItemSelect(tr("Limit Channels"), useChannelModes, useChannel, false, &useChannel, rmsSearchTimerSave, true));
|
||||
mainMenuItems.push_back(new cRecMenuItemBool(tr("Use Time"), useTime, true, false, &useTime, rmsSearchTimerSave));
|
||||
if (!advancedOptions) {
|
||||
mainMenuItems.push_back(new cRecMenuItemButton(tr("Display advanced Options"), rmsSearchTimerEditAdvanced, false));
|
||||
@@ -789,8 +863,16 @@ void cRecMenuSearchTimerEdit::InitMenuItems(void) {
|
||||
startChannel = 1;
|
||||
if (stopChannel == 0)
|
||||
stopChannel = 1;
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
useChannelSubMenu.push_back(new cRecMenuItemChannelChooser(tr("Start Channel"), Channels->GetByNumber(startChannel), false, &startChannel, rmsSearchTimerSave));
|
||||
useChannelSubMenu.push_back(new cRecMenuItemChannelChooser(tr("Stop Channel"), Channels->GetByNumber(stopChannel), false, &stopChannel, rmsSearchTimerSave));
|
||||
#else
|
||||
useChannelSubMenu.push_back(new cRecMenuItemChannelChooser(tr("Start Channel"), Channels.GetByNumber(startChannel), false, &startChannel, rmsSearchTimerSave));
|
||||
useChannelSubMenu.push_back(new cRecMenuItemChannelChooser(tr("Stop Channel"), Channels.GetByNumber(stopChannel), false, &stopChannel, rmsSearchTimerSave));
|
||||
#endif
|
||||
|
||||
useGroupSubMenu.push_back(new cRecMenuItemSelect(tr("Channel Group"), channelgroups, channelgroupIndex, false, &channelgroupIndex, rmsSearchTimerSave));
|
||||
|
||||
useTimeSubMenu.push_back(new cRecMenuItemTime(tr("Start after"), startTime, false, &startTime, rmsSearchTimerSave));
|
||||
useTimeSubMenu.push_back(new cRecMenuItemTime(tr("Start before"), stopTime, false, &stopTime, rmsSearchTimerSave));
|
||||
@@ -806,6 +888,7 @@ void cRecMenuSearchTimerEdit::InitMenuItems(void) {
|
||||
|
||||
|
||||
void cRecMenuSearchTimerEdit::CreateMenuItems(void) {
|
||||
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
|
||||
bool reDraw = false;
|
||||
if (GetCurrentNumMenuItems() > 0) {
|
||||
InitMenu(false);
|
||||
@@ -817,15 +900,17 @@ void cRecMenuSearchTimerEdit::CreateMenuItems(void) {
|
||||
|
||||
for (int i = 0; i < numMainMenuItems; i++) {
|
||||
currentMenuItems.push_back(mainMenuItems[i]);
|
||||
if ((i == useChannelPos) && useChannel)
|
||||
if ((i == useChannelPos) && (useChannel == 1))
|
||||
AddSubMenu(&useChannelSubMenu);
|
||||
else if ((i == useChannelPos) && (useChannel == 2) && (channelgroups.size() > 0))
|
||||
AddSubMenu(&useGroupSubMenu);
|
||||
else if ((i == useTimePos) && useTime)
|
||||
AddSubMenu(&useTimeSubMenu);
|
||||
else if (advancedOptions && (i == useDayOfWeekPos) && useDayOfWeek)
|
||||
AddSubMenu(&useDayOfWeekSubMenu);
|
||||
else if (advancedOptions && (i == avoidRepeatsPos) && avoidRepeats)
|
||||
AddSubMenu(&avoidRepeatSubMenu);
|
||||
}
|
||||
}
|
||||
|
||||
int numMenuItemsAll = currentMenuItems.size();
|
||||
int start = GetStartIndex();
|
||||
@@ -851,17 +936,26 @@ void cRecMenuSearchTimerEdit::AddSubMenu(std::vector<cRecMenuItem*> *subMenu) {
|
||||
|
||||
|
||||
cTVGuideSearchTimer cRecMenuSearchTimerEdit::GetSearchTimer(void) {
|
||||
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
|
||||
searchTimer.SetSearchString(searchString);
|
||||
searchTimer.SetActive(timerActive);
|
||||
searchTimer.SetSearchMode(mode);
|
||||
searchTimer.SetUseTitle(useTitle);
|
||||
searchTimer.SetUseSubtitle(useSubtitle);
|
||||
searchTimer.SetUseDesription(useDescription);
|
||||
searchTimer.SetUseChannel(useChannel);
|
||||
if (useChannel) {
|
||||
if (useChannel == 1) {
|
||||
searchTimer.SetStartChannel(startChannel);
|
||||
searchTimer.SetStopChannel(stopChannel);
|
||||
}
|
||||
if (useChannel == 2) {
|
||||
if (channelgroups.size() > 0) {
|
||||
std::string & channelGroup = channelgroups[channelgroupIndex];
|
||||
searchTimer.SetChannelGroup(channelGroup);
|
||||
} else {
|
||||
useChannel = 0;
|
||||
}
|
||||
}
|
||||
searchTimer.SetUseChannel(useChannel);
|
||||
searchTimer.SetUseTime(useTime);
|
||||
if (useTime) {
|
||||
searchTimer.SetStartTime(startTime);
|
||||
@@ -1050,8 +1144,8 @@ cRecMenuSearchTimerNothingFound::cRecMenuSearchTimerNothingFound(std::string sea
|
||||
|
||||
// --- cRecMenuSwitchTimer ---------------------------------------------------------
|
||||
cRecMenuSwitchTimer::cRecMenuSwitchTimer(void) {
|
||||
switchMinsBefore = 2;
|
||||
announceOnly = 0;
|
||||
switchMinsBefore = tvguideConfig.switchMinsBefore;
|
||||
switchMode = tvguideConfig.switchMode;
|
||||
|
||||
SetWidthPercent(60);
|
||||
|
||||
@@ -1061,11 +1155,11 @@ cRecMenuSwitchTimer::cRecMenuSwitchTimer(void) {
|
||||
AddMenuItem(infoItem);
|
||||
|
||||
AddMenuItem(new cRecMenuItemInt(tr("Minutes before switching"), switchMinsBefore, 0, 10, false, &switchMinsBefore));
|
||||
std::vector<std::string> switchModes;
|
||||
switchModes.push_back(tr("switch"));
|
||||
switchModes.push_back(tr("announce only"));
|
||||
switchModes.push_back(tr("ask for switch"));
|
||||
AddMenuItem(new cRecMenuItemSelect(tr("Switch Mode"), switchModes, announceOnly, false, &announceOnly));
|
||||
std::vector<std::string> switchModeItems;
|
||||
switchModeItems.push_back(tr("switch"));
|
||||
switchModeItems.push_back(tr("announce only"));
|
||||
switchModeItems.push_back(tr("ask for switch"));
|
||||
AddMenuItem(new cRecMenuItemSelect(tr("Switch Mode"), switchModeItems, switchMode, false, &switchMode));
|
||||
|
||||
AddMenuItem(new cRecMenuItemButtonYesNo(tr("Create"), tr("Cancel"), rmsSwitchTimerCreate, rmsClose, true));
|
||||
|
||||
@@ -1077,7 +1171,7 @@ cRecMenuSwitchTimer::cRecMenuSwitchTimer(void) {
|
||||
cSwitchTimer cRecMenuSwitchTimer::GetSwitchTimer(void) {
|
||||
cSwitchTimer st;
|
||||
st.switchMinsBefore = switchMinsBefore;
|
||||
st.announceOnly = announceOnly;
|
||||
st.switchMode = switchMode;
|
||||
return st;
|
||||
}
|
||||
|
||||
@@ -1214,7 +1308,12 @@ const cEvent *cRecMenuSearchResults::GetEvent(void) {
|
||||
// --- cRecMenuSearchConfirmTimer ---------------------------------------------------------
|
||||
cRecMenuSearchConfirmTimer::cRecMenuSearchConfirmTimer(const cEvent *event, eRecMenuState nextAction) {
|
||||
SetWidthPercent(50);
|
||||
cString channelName = Channels.GetByChannelID(event->ChannelID())->Name();
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
const cString channelName = Channels->GetByChannelID(event->ChannelID())->Name();
|
||||
#else
|
||||
const cString channelName = Channels.GetByChannelID(event->ChannelID())->Name();
|
||||
#endif
|
||||
cString message = tr("Timer created");
|
||||
cString text = cString::sprintf("%s\n%s\n%s %s - %s\n%s",
|
||||
*message,
|
||||
@@ -1279,7 +1378,7 @@ cRecMenuRecordingSearch::cRecMenuRecordingSearch(std::string search) {
|
||||
}
|
||||
|
||||
// --- cRecMenuRecordingSearchResults ---------------------------------------------------------
|
||||
cRecMenuRecordingSearchResults::cRecMenuRecordingSearchResults(std::string searchString, cRecording **searchResults, int numResults) {
|
||||
cRecMenuRecordingSearchResults::cRecMenuRecordingSearchResults(std::string searchString, const cRecording **searchResults, int numResults) {
|
||||
this->searchString = searchString;
|
||||
this->searchResults = searchResults;
|
||||
SetWidthPercent(80);
|
||||
@@ -1296,8 +1395,8 @@ cRecMenuRecordingSearchResults::cRecMenuRecordingSearchResults(std::string searc
|
||||
cRecMenuItem *buttons = new cRecMenuItemButtonYesNo(tr("Adapt Search"), tr("Close"), rmsRecordingSearch, rmsClose, false);
|
||||
SetFooter(buttons);
|
||||
if (searchResults && (numResults > 0)) {
|
||||
for (int i=0; i<numResults; i++) {
|
||||
if (!AddMenuItemInitial(new cRecMenuItemRecording(searchResults[i], (i==0)?true:false)))
|
||||
for (int i = 0; i < numResults; i++) {
|
||||
if (!AddMenuItemInitial(new cRecMenuItemRecording(searchResults[i], (i == 0) ? true : false)))
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1363,7 +1462,13 @@ void cRecMenuTimeline::SetStartStop(void) {
|
||||
|
||||
void cRecMenuTimeline::GetTimersForDay(void) {
|
||||
timersToday.clear();
|
||||
for (cTimer *t = Timers.First(); t; t = Timers.Next(t)) {
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_READ;
|
||||
// const cTimers* timers = Timers;
|
||||
for (const cTimer *t = Timers->First(); t; t = Timers->Next(t)) {
|
||||
#else
|
||||
for (const cTimer *t = Timers.First(); t; t = Timers.Next(t)) {
|
||||
#endif
|
||||
if (((t->StartTime() > timeStart) && (t->StartTime() <= timeStop)) || ((t->StopTime() > timeStart) && (t->StopTime() <= timeStop))) {
|
||||
timersToday.push_back(t);
|
||||
}
|
||||
@@ -1437,7 +1542,7 @@ void cRecMenuTimeline::ClearMenu(void) {
|
||||
header->UnsetCurrentTimer();
|
||||
}
|
||||
|
||||
cTimer *cRecMenuTimeline::GetTimer(void) {
|
||||
const cTimer *cRecMenuTimeline::GetTimer(void) {
|
||||
if (cRecMenuItemTimelineTimer *activeItem = dynamic_cast<cRecMenuItemTimelineTimer*>(GetActiveMenuItem()))
|
||||
return activeItem->GetTimerValue();
|
||||
return NULL;
|
||||
@@ -1558,4 +1663,4 @@ int cRecMenuFavorites::GetTotalNumMenuItems(void) {
|
||||
cTVGuideSearchTimer cRecMenuFavorites::GetFavorite(void) {
|
||||
cRecMenuItemFavorite *activeItem = dynamic_cast<cRecMenuItemFavorite*>(GetActiveMenuItem());
|
||||
return activeItem->GetFavorite();
|
||||
}
|
||||
}
|
||||
|
33
recmenus.h
33
recmenus.h
@@ -115,7 +115,7 @@ public:
|
||||
// --- cRecMenuEditTimer ---------------------------------------------------------
|
||||
class cRecMenuEditTimer: public cRecMenu {
|
||||
private:
|
||||
cTimer *originalTimer;
|
||||
const cTimer *originalTimer;
|
||||
bool timerActive;
|
||||
time_t day;
|
||||
int start;
|
||||
@@ -124,10 +124,10 @@ private:
|
||||
int lifetime;
|
||||
char folder[TEXTINPUTLENGTH];
|
||||
public:
|
||||
cRecMenuEditTimer(cTimer *timer, eRecMenuState nextState);
|
||||
cRecMenuEditTimer(const cTimer *timer, eRecMenuState nextState);
|
||||
const cTimer *GetOriginalTimer(void);
|
||||
virtual ~cRecMenuEditTimer(void) {};
|
||||
cTimer GetTimer(void);
|
||||
cTimer *GetOriginalTimer(void);
|
||||
};
|
||||
|
||||
/******************************************************************************************
|
||||
@@ -148,7 +148,7 @@ class cRecMenuSeriesTimer: public cRecMenu {
|
||||
int lifetime;
|
||||
void CalculateTimes(const cEvent *event);
|
||||
public:
|
||||
cRecMenuSeriesTimer(cChannel *initialChannel, const cEvent *event, std::string folder);
|
||||
cRecMenuSeriesTimer(const cChannel *initialChannel, const cEvent *event, std::string folder);
|
||||
virtual ~cRecMenuSeriesTimer(void) {};
|
||||
cTimer *GetTimer(void);
|
||||
};
|
||||
@@ -209,8 +209,10 @@ class cRecMenuSearchTimerEdit: public cRecMenu {
|
||||
private:
|
||||
bool advancedOptions;
|
||||
cTVGuideSearchTimer searchTimer;
|
||||
std::vector<std::string> channelGroups;
|
||||
std::vector<cRecMenuItem*> mainMenuItems;
|
||||
std::vector<cRecMenuItem*> useChannelSubMenu;
|
||||
std::vector<cRecMenuItem*> useGroupSubMenu;
|
||||
std::vector<cRecMenuItem*> useTimeSubMenu;
|
||||
std::vector<cRecMenuItem*> useDayOfWeekSubMenu;
|
||||
std::vector<cRecMenuItem*> avoidRepeatSubMenu;
|
||||
@@ -226,9 +228,12 @@ private:
|
||||
bool useTitle;
|
||||
bool useSubtitle;
|
||||
bool useDescription;
|
||||
bool useChannel;
|
||||
int useChannel;
|
||||
int startChannel;
|
||||
int stopChannel;
|
||||
std::string channelGroup;
|
||||
std::vector<std::string> channelgroups;
|
||||
int channelgroupIndex;
|
||||
bool useTime;
|
||||
int startTime;
|
||||
int stopTime;
|
||||
@@ -249,8 +254,9 @@ private:
|
||||
bool useInFavorites;
|
||||
void InitMenuItems(void);
|
||||
void AddSubMenu(std::vector<cRecMenuItem*> *subMenu);
|
||||
int SplitChannelGroups(std::vector<std::string> *channelGroups, std::vector<std::string> *channelgroups);
|
||||
public:
|
||||
cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer, bool advancedOptions);
|
||||
cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer, bool advancedOptions, std::vector<std::string> channelGroups);
|
||||
void CreateMenuItems(void);
|
||||
virtual ~cRecMenuSearchTimerEdit(void);
|
||||
cTVGuideSearchTimer GetSearchTimer(void);
|
||||
@@ -319,7 +325,7 @@ public:
|
||||
class cRecMenuSwitchTimer: public cRecMenu {
|
||||
private:
|
||||
int switchMinsBefore;
|
||||
int announceOnly;
|
||||
int switchMode;
|
||||
public:
|
||||
cRecMenuSwitchTimer(void);
|
||||
virtual ~cRecMenuSwitchTimer(void) {};
|
||||
@@ -412,10 +418,10 @@ public:
|
||||
class cRecMenuRecordingSearchResults: public cRecMenu {
|
||||
private:
|
||||
std::string searchString;
|
||||
cRecording **searchResults;
|
||||
const cRecording **searchResults;
|
||||
int numResults;
|
||||
public:
|
||||
cRecMenuRecordingSearchResults(std::string searchString, cRecording **searchResults, int numResults);
|
||||
cRecMenuRecordingSearchResults(std::string searchString, const cRecording **searchResults, int numResults);
|
||||
cRecMenuItem *GetMenuItem(int number);
|
||||
int GetTotalNumMenuItems(void);
|
||||
virtual ~cRecMenuRecordingSearchResults(void) {
|
||||
@@ -438,7 +444,7 @@ public:
|
||||
// --- cRecMenuTimeline ---------------------------------------------------------
|
||||
class cRecMenuTimeline: public cRecMenu {
|
||||
private:
|
||||
std::vector<cTimer*> timersToday;
|
||||
std::vector<const cTimer*> timersToday;
|
||||
int numTimersToday;
|
||||
time_t today;
|
||||
time_t timeStart;
|
||||
@@ -454,12 +460,11 @@ private:
|
||||
void ClearMenu(void);
|
||||
public:
|
||||
cRecMenuTimeline(cTVGuideTimerConflicts *timerConflicts);
|
||||
virtual ~cRecMenuTimeline(void) {};
|
||||
cRecMenuItem *GetMenuItem(int number);
|
||||
int GetTotalNumMenuItems(void);
|
||||
virtual ~cRecMenuTimeline(void) {
|
||||
};
|
||||
eRecMenuState ProcessKey(eKeys Key);
|
||||
cTimer *GetTimer(void);
|
||||
const cTimer *GetTimer(void);
|
||||
};
|
||||
|
||||
/******************************************************************************************
|
||||
@@ -482,4 +487,4 @@ public:
|
||||
virtual ~cRecMenuFavorites(void);
|
||||
};
|
||||
|
||||
#endif //__TVGUIDE_RECMENUS_H
|
||||
#endif //__TVGUIDE_RECMENUS_H
|
||||
|
115
searchtimer.c
115
searchtimer.c
@@ -16,8 +16,14 @@ cTVGuideSearchTimer::cTVGuideSearchTimer(void) {
|
||||
startTime = 0000;
|
||||
stopTime = 2359;
|
||||
useChannel = false;
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
channelMin = Channels->GetByNumber(cDevice::CurrentChannel());
|
||||
channelMax = Channels->GetByNumber(cDevice::CurrentChannel());
|
||||
#else
|
||||
channelMin = Channels.GetByNumber(cDevice::CurrentChannel());
|
||||
channelMax = Channels.GetByNumber(cDevice::CurrentChannel());
|
||||
#endif
|
||||
channelGroup = "";
|
||||
useCase = false;
|
||||
mode = 0;
|
||||
@@ -204,31 +210,31 @@ bool cTVGuideSearchTimer::Parse(bool readTemplate) {
|
||||
return false;
|
||||
for (int value = 0; value < numValues; value++) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
case 0:
|
||||
if (!readTemplate)
|
||||
ID = atoi(values[value].c_str());
|
||||
break;
|
||||
case 1:
|
||||
case 1:
|
||||
if (!readTemplate) {
|
||||
std::string searchStringMasked = values[value];
|
||||
std::replace(searchStringMasked.begin(), searchStringMasked.end(), '|', ':');
|
||||
searchString = searchStringMasked;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case 2:
|
||||
useTime = atoi(values[value].c_str());
|
||||
break;
|
||||
case 3:
|
||||
if (useTime) {
|
||||
startTime = atoi(values[value].c_str());
|
||||
}
|
||||
break;
|
||||
startTime = atoi(values[value].c_str());
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (useTime) {
|
||||
stopTime = atoi(values[value].c_str());
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
stopTime = atoi(values[value].c_str());
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
useChannel = atoi(values[value].c_str());
|
||||
break;
|
||||
case 6:
|
||||
@@ -236,30 +242,44 @@ bool cTVGuideSearchTimer::Parse(bool readTemplate) {
|
||||
channelMin = NULL;
|
||||
channelMax = NULL;
|
||||
} else if (useChannel == 1) {
|
||||
char *channelMinbuffer = NULL;
|
||||
char *channelMaxbuffer = NULL;
|
||||
int channels = sscanf(values[value].c_str(), "%a[^|]|%a[^|]", &channelMinbuffer, &channelMaxbuffer);
|
||||
channelMin = Channels.GetByChannelID(tChannelID::FromString(channelMinbuffer), true, true);
|
||||
if (!channelMin) {
|
||||
channelMin = channelMax = NULL;
|
||||
useChannel = 0;
|
||||
}
|
||||
if (channels == 1)
|
||||
channelMax = channelMin;
|
||||
else {
|
||||
channelMax = Channels.GetByChannelID(tChannelID::FromString(channelMaxbuffer), true, true);
|
||||
if (!channelMax) {
|
||||
int minNum = 0, maxNum = 0;
|
||||
int fields = sscanf(values[value].c_str(), "%d-%d", &minNum, &maxNum);
|
||||
if (fields == 0) { // stored with ID
|
||||
char *channelMinbuffer = NULL;
|
||||
char *channelMaxbuffer = NULL;
|
||||
int channels = sscanf(values[value].c_str(), "%m[^|]|%m[^|]", &channelMinbuffer, &channelMaxbuffer);
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
channelMin = Channels->GetByChannelID(tChannelID::FromString(channelMinbuffer), true, true);
|
||||
#else
|
||||
channelMin = Channels.GetByChannelID(tChannelID::FromString(channelMinbuffer), true, true);
|
||||
#endif
|
||||
if (!channelMin) {
|
||||
esyslog("ERROR: channel '%s' not defined", channelMinbuffer);
|
||||
channelMin = channelMax = NULL;
|
||||
useChannel = 0;
|
||||
}
|
||||
if (channels == 1)
|
||||
channelMax = channelMin;
|
||||
else {
|
||||
#if VDRVERSNUM >= 20301
|
||||
channelMax = Channels->GetByChannelID(tChannelID::FromString(channelMaxbuffer), true, true);
|
||||
#else
|
||||
channelMax = Channels.GetByChannelID(tChannelID::FromString(channelMaxbuffer), true, true);
|
||||
#endif
|
||||
if (!channelMax) {
|
||||
esyslog("ERROR: channel '%s' not defined", channelMaxbuffer);
|
||||
channelMin = channelMax = NULL;
|
||||
useChannel = 0;
|
||||
}
|
||||
}
|
||||
free(channelMinbuffer);
|
||||
free(channelMaxbuffer);
|
||||
}
|
||||
free(channelMinbuffer);
|
||||
free(channelMaxbuffer);
|
||||
} else if (useChannel == 2) {
|
||||
channelGroup = values[value];
|
||||
}
|
||||
} else if (useChannel == 2)
|
||||
channelGroup = values[value];
|
||||
break;
|
||||
case 7:
|
||||
case 7:
|
||||
useCase = atoi(values[value].c_str());
|
||||
break;
|
||||
case 8:
|
||||
@@ -511,7 +531,12 @@ int cTVGuideSearchTimer::GetNumTimers(void) {
|
||||
int numTimers = 0;
|
||||
if (ID < 0)
|
||||
return numTimers;
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_READ;
|
||||
for (const cTimer *timer = Timers->First(); timer; timer = Timers->Next(timer)) {
|
||||
#else
|
||||
for (cTimer *timer = Timers.First(); timer; timer = Timers.Next(timer)) {
|
||||
#endif
|
||||
char* searchID = GetAuxValue(timer, "s-id");
|
||||
if (!searchID) continue;
|
||||
if (ID == atoi(searchID))
|
||||
@@ -525,7 +550,12 @@ int cTVGuideSearchTimer::GetNumRecordings(void) {
|
||||
int numRecordings = 0;
|
||||
if (ID < 0)
|
||||
return numRecordings;
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_RECORDINGS_READ;
|
||||
for (const cRecording *recording = Recordings->First(); recording; recording = Recordings->Next(recording)) {
|
||||
#else
|
||||
for (cRecording *recording = Recordings.First(); recording; recording = Recordings.Next(recording)) {
|
||||
#endif
|
||||
if (recording->IsEdited())
|
||||
continue;
|
||||
if (!recording->Info())
|
||||
@@ -547,7 +577,6 @@ void cTVGuideSearchTimer::GetSearchModes(std::vector<std::string> *searchModes)
|
||||
searchModes->push_back(tr("regular expression"));
|
||||
}
|
||||
|
||||
|
||||
void cTVGuideSearchTimer::Dump(void) {
|
||||
esyslog("tvguide searchtimer: strTimer: %s", strTimer.c_str());
|
||||
esyslog("tvguide searchtimer: ID: %d", ID);
|
||||
@@ -568,3 +597,29 @@ void cTVGuideSearchTimer::Dump(void) {
|
||||
esyslog("tvguide searchtimer: useDescription: %d", useDescription);
|
||||
}
|
||||
|
||||
void cTVGuideSearchTimer::SetStartChannel(int startChannel)
|
||||
{
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
channelMin = Channels->GetByNumber(startChannel);
|
||||
#else
|
||||
channelMin = Channels.GetByNumber(startChannel);
|
||||
#endif
|
||||
};
|
||||
|
||||
void cTVGuideSearchTimer::SetStopChannel(int stopChannel)
|
||||
{
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
channelMax = Channels->GetByNumber(stopChannel);
|
||||
#else
|
||||
channelMax = Channels.GetByNumber(stopChannel);
|
||||
#endif
|
||||
};
|
||||
|
||||
void cTVGuideSearchTimer::GetUseChannelModes(std::vector<std::string> *useChannelModes) {
|
||||
useChannelModes->push_back(tr("No"));
|
||||
useChannelModes->push_back(tr("Interval"));
|
||||
useChannelModes->push_back(tr("Channel Group"));
|
||||
useChannelModes->push_back(tr("only FTA"));
|
||||
}
|
||||
|
@@ -11,8 +11,13 @@ private:
|
||||
int startTime;
|
||||
int stopTime;
|
||||
int useChannel;
|
||||
#if VDRVERSNUM >= 20301
|
||||
const cChannel *channelMin;
|
||||
const cChannel *channelMax;
|
||||
#else
|
||||
cChannel *channelMin;
|
||||
cChannel *channelMax;
|
||||
#endif
|
||||
std::string channelGroup;
|
||||
int useCase;
|
||||
int mode;
|
||||
@@ -77,9 +82,10 @@ public:
|
||||
bool UseSubtitle(void) { return useSubtitle; };
|
||||
bool UseDescription(void) { return useDescription; };
|
||||
int SearchMode(void) { return mode; };
|
||||
bool UseChannel(void) { return useChannel; };
|
||||
int UseChannel(void) { return useChannel; };
|
||||
int StartChannel(void) { return (channelMin)?channelMin->Number():0; };
|
||||
int StopChannel(void) { return (channelMax)?channelMax->Number():0; };
|
||||
std::string ChannelGroup(void) { return channelGroup; };
|
||||
bool UseTime(void) { return useTime; };
|
||||
int StartTime(void) { return startTime; };
|
||||
int StopTime(void) { return stopTime; };
|
||||
@@ -105,9 +111,10 @@ public:
|
||||
void SetUseTitle(bool useTitle) { this->useTitle = useTitle; };
|
||||
void SetUseSubtitle(bool useSubtitle) { this->useSubtitle = useSubtitle; };
|
||||
void SetUseDesription(bool useDescription) { this->useDescription = useDescription; };
|
||||
void SetUseChannel(bool useChannel) { this->useChannel = useChannel; };
|
||||
void SetStartChannel(int startChannel) { channelMin = Channels.GetByNumber(startChannel); };
|
||||
void SetStopChannel(int stopChannel) { channelMax = Channels.GetByNumber(stopChannel); };
|
||||
void SetUseChannel(int useChannel) { this->useChannel = useChannel; };
|
||||
void SetStartChannel(int startChannel);
|
||||
void SetStopChannel(int stopChannel);
|
||||
void SetChannelGroup(std::string channelGroup) { this->channelGroup = channelGroup; };
|
||||
void SetUseTime(bool useTime) { this->useTime = useTime; };
|
||||
void SetStartTime(int startTime) { this->startTime = startTime; };
|
||||
void SetStopTime(int stopTime) { this->stopTime = stopTime; };
|
||||
@@ -130,6 +137,7 @@ public:
|
||||
int GetNumTimers(void);
|
||||
int GetNumRecordings(void);
|
||||
void GetSearchModes(std::vector<std::string> *searchModes);
|
||||
void GetUseChannelModes(std::vector<std::string> *useChannelModes);
|
||||
void Dump(void);
|
||||
};
|
||||
|
||||
|
@@ -31,172 +31,172 @@ The project's page is at http://winni.vdr-developer.org/epgsearch
|
||||
#include <vdr/osdbase.h>
|
||||
|
||||
// Data structure for service "Epgsearch-search-v1.0"
|
||||
struct Epgsearch_search_v1_0
|
||||
{
|
||||
struct Epgsearch_search_v1_0 {
|
||||
// in
|
||||
char* query; // search term
|
||||
int mode; // search mode (0=phrase, 1=and, 2=or, 3=regular expression)
|
||||
int channelNr; // channel number to search in (0=any)
|
||||
bool useTitle; // search in title
|
||||
bool useSubTitle; // search in subtitle
|
||||
bool useDescription; // search in description
|
||||
char* query; // search term
|
||||
int mode; // search mode (0=phrase, 1=and, 2=or, 3=regular expression)
|
||||
int channelNr; // channel number to search in (0=any)
|
||||
bool useTitle; // search in title
|
||||
bool useSubTitle; // search in subtitle
|
||||
bool useDescription; // search in description
|
||||
// out
|
||||
cOsdMenu* pResultMenu; // pointer to the menu of results
|
||||
cOsdMenu* pResultMenu; // pointer to the menu of results
|
||||
};
|
||||
|
||||
// Data structure for service "Epgsearch-exttimeredit-v1.0"
|
||||
struct Epgsearch_exttimeredit_v1_0
|
||||
{
|
||||
struct Epgsearch_exttimeredit_v1_0 {
|
||||
// in
|
||||
cTimer* timer; // pointer to the timer to edit
|
||||
bool bNew; // flag that indicates, if this is a new timer or an existing one
|
||||
const cEvent* event; // pointer to the event corresponding to this timer (may be NULL)
|
||||
cTimer* timer; // pointer to the timer to edit
|
||||
bool bNew; // flag that indicates, if this is a new timer or an existing one
|
||||
const cEvent* event; // pointer to the event corresponding to this timer (may be NULL)
|
||||
// out
|
||||
cOsdMenu* pTimerMenu; // pointer to the menu of results
|
||||
cOsdMenu* pTimerMenu; // pointer to the menu of results
|
||||
};
|
||||
|
||||
// Data structure for service "Epgsearch-enablesearchtimers-v1.0"
|
||||
struct Epgsearch_enablesearchtimers_v1_0
|
||||
{
|
||||
struct Epgsearch_enablesearchtimers_v1_0 {
|
||||
// in
|
||||
bool enable; // enable search timer thread?
|
||||
bool enable; // enable search timer thread?
|
||||
};
|
||||
|
||||
// Data structure for service "Epgsearch-updatesearchtimers-v1.0"
|
||||
struct Epgsearch_updatesearchtimers_v1_0
|
||||
{
|
||||
struct Epgsearch_updatesearchtimers_v1_0 {
|
||||
// in
|
||||
bool showMessage; // inform via osd when finished?
|
||||
bool showMessage; // inform via osd when finished?
|
||||
};
|
||||
|
||||
// Data structure for service "Epgsearch-osdmessage-v1.0"
|
||||
struct Epgsearch_osdmessage_v1_0
|
||||
{
|
||||
struct Epgsearch_osdmessage_v1_0 {
|
||||
// in
|
||||
char* message; // the message to display
|
||||
eMessageType type;
|
||||
char* message; // the message to display
|
||||
eMessageType type;
|
||||
};
|
||||
|
||||
// Data structure for service "EpgsearchMenu-v1.0"
|
||||
struct EpgSearchMenu_v1_0
|
||||
{
|
||||
struct EpgSearchMenu_v1_0 {
|
||||
// in
|
||||
// out
|
||||
cOsdMenu* Menu; // pointer to the menu
|
||||
cOsdMenu* Menu; // pointer to the menu
|
||||
};
|
||||
|
||||
// Data structure for service "Epgsearch-lastconflictinfo-v1.0"
|
||||
struct Epgsearch_lastconflictinfo_v1_0
|
||||
{
|
||||
struct Epgsearch_lastconflictinfo_v1_0 {
|
||||
// in
|
||||
// out
|
||||
time_t nextConflict; // next conflict date, 0 if none
|
||||
int relevantConflicts; // number of relevant conflicts
|
||||
int totalConflicts; // total number of conflicts
|
||||
time_t nextConflict; // next conflict date, 0 if none
|
||||
int relevantConflicts; // number of relevant conflicts
|
||||
int totalConflicts; // total number of conflicts
|
||||
};
|
||||
|
||||
// Data structure for service "Epgsearch-searchresults-v1.0"
|
||||
struct Epgsearch_searchresults_v1_0
|
||||
{
|
||||
struct Epgsearch_searchresults_v1_0 {
|
||||
// in
|
||||
char* query; // search term
|
||||
int mode; // search mode (0=phrase, 1=and, 2=or, 3=regular expression)
|
||||
int channelNr; // channel number to search in (0=any)
|
||||
bool useTitle; // search in title
|
||||
bool useSubTitle; // search in subtitle
|
||||
bool useDescription; // search in description
|
||||
char* query; // search term
|
||||
int mode; // search mode (0=phrase, 1=and, 2=or, 3=regular expression)
|
||||
int channelNr; // channel number to search in (0=any)
|
||||
bool useTitle; // search in title
|
||||
bool useSubTitle; // search in subtitle
|
||||
bool useDescription; // search in description
|
||||
// out
|
||||
|
||||
class cServiceSearchResult : public cListObject
|
||||
{
|
||||
public:
|
||||
const cEvent* event;
|
||||
cServiceSearchResult(const cEvent* Event) : event(Event) {}
|
||||
};
|
||||
class cServiceSearchResult : public cListObject
|
||||
{
|
||||
public:
|
||||
const cEvent* event;
|
||||
cServiceSearchResult(const cEvent* Event) : event(Event) {}
|
||||
};
|
||||
|
||||
cList<cServiceSearchResult>* pResultList; // pointer to the results
|
||||
cList<cServiceSearchResult>* pResultList; // pointer to the results
|
||||
};
|
||||
|
||||
// Data structure for service "Epgsearch-switchtimer-v1.0"
|
||||
struct Epgsearch_switchtimer_v1_0
|
||||
{
|
||||
struct Epgsearch_switchtimer_v1_0 {
|
||||
// in
|
||||
const cEvent* event;
|
||||
int mode; // mode (0=query existence, 1=add/modify, 2=delete)
|
||||
const cEvent* event;
|
||||
int mode; // mode (0=query existence, 1=add/modify, 2=delete)
|
||||
// in/out
|
||||
int switchMinsBefore;
|
||||
int announceOnly;
|
||||
int switchMinsBefore;
|
||||
int announceOnly;
|
||||
// out
|
||||
bool success; // result
|
||||
bool success; // result
|
||||
};
|
||||
|
||||
// Data structures for service "Epgsearch-services-v1.0"
|
||||
class cServiceHandler
|
||||
{
|
||||
public:
|
||||
virtual std::list<std::string> SearchTimerList() = 0;
|
||||
// returns a list of search timer entries in the same format as used in epgsearch.conf
|
||||
virtual int AddSearchTimer(const std::string&) = 0;
|
||||
// adds a new search timer and returns its ID (-1 on error)
|
||||
virtual bool ModSearchTimer(const std::string&) = 0;
|
||||
// edits an existing search timer and returns success
|
||||
virtual bool DelSearchTimer(int) = 0;
|
||||
// deletes search timer with given ID and returns success
|
||||
virtual std::list<std::string> QuerySearchTimer(int) = 0;
|
||||
// returns the search result of the searchtimer with given ID in the same format as used in SVDRP command 'QRYS' (->MANUAL)
|
||||
virtual std::list<std::string> QuerySearch(std::string) = 0;
|
||||
// returns the search result of the searchtimer with given settings in the same format as used in SVDRP command 'QRYS' (->MANUAL)
|
||||
virtual std::list<std::string> ExtEPGInfoList() = 0;
|
||||
// returns a list of extended EPG categories in the same format as used in epgsearchcats.conf
|
||||
virtual std::list<std::string> ChanGrpList() = 0;
|
||||
// returns a list of channel groups maintained by epgsearch
|
||||
virtual std::list<std::string> BlackList() = 0;
|
||||
// returns a list of blacklists in the same format as used in epgsearchblacklists.conf
|
||||
virtual std::set<std::string> DirectoryList() = 0;
|
||||
// List of all recording directories used in recordings, timers, search timers or in epgsearchdirs.conf
|
||||
virtual ~cServiceHandler() {}
|
||||
// Read a setup value
|
||||
virtual std::string ReadSetupValue(const std::string& entry) = 0;
|
||||
// Write a setup value
|
||||
virtual bool WriteSetupValue(const std::string& entry, const std::string& value) = 0;
|
||||
public:
|
||||
virtual std::list<std::string> SearchTimerList() = 0;
|
||||
// returns a list of search timer entries in the same format as used in epgsearch.conf
|
||||
virtual int AddSearchTimer(const std::string&) = 0;
|
||||
// adds a new search timer and returns its ID (-1 on error)
|
||||
virtual bool ModSearchTimer(const std::string&) = 0;
|
||||
// edits an existing search timer and returns success
|
||||
virtual bool DelSearchTimer(int) = 0;
|
||||
// deletes search timer with given ID and returns success
|
||||
virtual std::list<std::string> QuerySearchTimer(int) = 0;
|
||||
// returns the search result of the searchtimer with given ID in the same format as used in SVDRP command 'QRYS' (->MANUAL)
|
||||
virtual std::list<std::string> QuerySearch(std::string) = 0;
|
||||
// returns the search result of the searchtimer with given settings in the same format as used in SVDRP command 'QRYS' (->MANUAL)
|
||||
virtual std::list<std::string> ExtEPGInfoList() = 0;
|
||||
// returns a list of extended EPG categories in the same format as used in epgsearchcats.conf
|
||||
virtual std::list<std::string> ChanGrpList() = 0;
|
||||
// returns a list of channel groups maintained by epgsearch
|
||||
virtual std::list<std::string> BlackList() = 0;
|
||||
// returns a list of blacklists in the same format as used in epgsearchblacklists.conf
|
||||
virtual std::set<std::string> DirectoryList() = 0;
|
||||
// List of all recording directories used in recordings, timers, search timers or in epgsearchdirs.conf
|
||||
virtual ~cServiceHandler() {}
|
||||
// Read a setup value
|
||||
virtual std::string ReadSetupValue(const std::string& entry) = 0;
|
||||
// Write a setup value
|
||||
virtual bool WriteSetupValue(const std::string& entry, const std::string& value) = 0;
|
||||
};
|
||||
|
||||
struct Epgsearch_services_v1_0
|
||||
{
|
||||
struct Epgsearch_services_v1_0 {
|
||||
// in/out
|
||||
std::auto_ptr<cServiceHandler> handler;
|
||||
#if __cplusplus < 201103L
|
||||
std::auto_ptr<cServiceHandler> handler;
|
||||
#else
|
||||
std::unique_ptr<cServiceHandler> handler;
|
||||
#endif
|
||||
};
|
||||
|
||||
// Data structures for service "Epgsearch-services-v1.1"
|
||||
class cServiceHandler_v1_1 : public cServiceHandler
|
||||
{
|
||||
public:
|
||||
// Get timer conflicts
|
||||
virtual std::list<std::string> TimerConflictList(bool relOnly=false) = 0;
|
||||
// Check if a conflict check is advised
|
||||
virtual bool IsConflictCheckAdvised() = 0;
|
||||
public:
|
||||
// Get timer conflicts
|
||||
virtual std::list<std::string> TimerConflictList(bool relOnly = false) = 0;
|
||||
// Check if a conflict check is advised
|
||||
virtual bool IsConflictCheckAdvised() = 0;
|
||||
};
|
||||
|
||||
struct Epgsearch_services_v1_1
|
||||
{
|
||||
struct Epgsearch_services_v1_1 {
|
||||
// in/out
|
||||
std::auto_ptr<cServiceHandler_v1_1> handler;
|
||||
#if __cplusplus < 201103L
|
||||
std::auto_ptr<cServiceHandler_v1_1> handler;
|
||||
#else
|
||||
std::unique_ptr<cServiceHandler_v1_1> handler;
|
||||
#endif
|
||||
};
|
||||
|
||||
// Data structures for service "Epgsearch-services-v1.2"
|
||||
class cServiceHandler_v1_2 : public cServiceHandler_v1_1
|
||||
{
|
||||
public:
|
||||
// List of all recording directories used in recordings, timers (and optionally search timers or in epgsearchdirs.conf)
|
||||
virtual std::set<std::string> ShortDirectoryList() = 0;
|
||||
// Evaluate an expression against an event
|
||||
virtual std::string Evaluate(const std::string& expr, const cEvent* event) = 0;
|
||||
public:
|
||||
// List of all recording directories used in recordings, timers (and optionally search timers or in epgsearchdirs.conf)
|
||||
virtual std::set<std::string> ShortDirectoryList() = 0;
|
||||
// Evaluate an expression against an event
|
||||
virtual std::string Evaluate(const std::string& expr, const cEvent* event) = 0;
|
||||
};
|
||||
|
||||
struct Epgsearch_services_v1_2
|
||||
{
|
||||
struct Epgsearch_services_v1_2 {
|
||||
// in/out
|
||||
std::auto_ptr<cServiceHandler_v1_2> handler;
|
||||
#if __cplusplus < 201103L
|
||||
std::auto_ptr<cServiceHandler_v1_2> handler;
|
||||
#else
|
||||
std::unique_ptr<cServiceHandler_v1_2> handler;
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
122
setup.c
122
setup.c
@@ -77,6 +77,7 @@ void cTvguideSetup::Store(void) {
|
||||
SetupStore("channelCols", tvguideConfig.channelCols);
|
||||
SetupStore("channelRows", tvguideConfig.channelRows);
|
||||
SetupStore("displayTime", tvguideConfig.displayTime);
|
||||
SetupStore("displayHorizontalTime", tvguideConfig.displayHorizontalTime);
|
||||
SetupStore("bigStepHours", tvguideConfig.bigStepHours);
|
||||
SetupStore("hugeStepHours", tvguideConfig.hugeStepHours);
|
||||
SetupStore("channelJumpMode", tvguideConfig.channelJumpMode);
|
||||
@@ -121,6 +122,8 @@ void cTvguideSetup::Store(void) {
|
||||
SetupStore("favLimitChannels", tvguideConfig.favLimitChannels);
|
||||
SetupStore("favStartChannel", tvguideConfig.favStartChannel);
|
||||
SetupStore("favStopChannel", tvguideConfig.favStopChannel);
|
||||
SetupStore("switchMode", tvguideConfig.switchMode);
|
||||
SetupStore("switchMinsBefore", tvguideConfig.switchMinsBefore);
|
||||
SetupStore("fontIndex", tvguideConfig.fontIndex);
|
||||
SetupStore("FontButtonDelta", tvguideConfig.FontButtonDelta);
|
||||
SetupStore("FontDetailViewDelta", tvguideConfig.FontDetailViewDelta);
|
||||
@@ -153,7 +156,7 @@ void cTvguideSetup::Store(void) {
|
||||
SetupStore("limitLogoCache", tvguideConfig.limitLogoCache);
|
||||
}
|
||||
|
||||
cMenuSetupSubMenu::cMenuSetupSubMenu(const char* Title, cTvguideConfig* data) : cOsdMenu(Title, 30) {
|
||||
cMenuSetupSubMenu::cMenuSetupSubMenu(const char* Title, cTvguideConfig* data) : cOsdMenu(Title, 40) {
|
||||
tmpTvguideConfig = data;
|
||||
indent = " ";
|
||||
}
|
||||
@@ -207,7 +210,11 @@ void cMenuSetupGeneral::Set(void) {
|
||||
if (themes.NumThemes())
|
||||
Add(new cMenuEditStraItem(cString::sprintf("%s%s", *indent, tr("Theme")), &tmpTvguideConfig->themeIndex, themes.NumThemes(), themes.Descriptions()));
|
||||
}
|
||||
Add(new cMenuEditIntItem(tr("Time to display in minutes"), &tmpTvguideConfig->displayTime, 60, 320));
|
||||
if (tmpTvguideConfig->displayMode == eVertical) {
|
||||
Add(new cMenuEditIntItem(tr("Time to display in minutes"), &tmpTvguideConfig->displayTime, 60, 320));
|
||||
} else if (tmpTvguideConfig->displayMode == eHorizontal) {
|
||||
Add(new cMenuEditIntItem(tr("Time to display in minutes"), &tmpTvguideConfig->displayHorizontalTime, 60, 320));
|
||||
}
|
||||
Add(new cMenuEditBoolItem(tr("Rounded Corners"), &tmpTvguideConfig->roundedCorners));
|
||||
|
||||
Add(new cMenuEditStraItem(tr("Channel Jump Mode (Keys Green / Yellow)"), &tmpTvguideConfig->channelJumpMode, 2, jumpMode));
|
||||
@@ -229,11 +236,16 @@ void cMenuSetupGeneral::Set(void) {
|
||||
}
|
||||
|
||||
eOSState cMenuSetupGeneral::ProcessKey(eKeys Key) {
|
||||
bool olduseNopacityTheme = tmpTvguideConfig->useNopacityTheme;
|
||||
bool olddisplayRerunsDetailEPGView = tmpTvguideConfig->displayRerunsDetailEPGView;
|
||||
eOSState state = cOsdMenu::ProcessKey(Key);
|
||||
if (Key == kOk) {
|
||||
state = osBack;
|
||||
} else if (Key != kNone) {
|
||||
Set();
|
||||
if (tmpTvguideConfig->useNopacityTheme != olduseNopacityTheme ||
|
||||
tmpTvguideConfig->displayRerunsDetailEPGView != olddisplayRerunsDetailEPGView) {
|
||||
Set();
|
||||
}
|
||||
}
|
||||
return state;
|
||||
}
|
||||
@@ -310,11 +322,22 @@ void cMenuSetupScreenLayout::Set(void) {
|
||||
}
|
||||
|
||||
eOSState cMenuSetupScreenLayout::ProcessKey(eKeys Key) {
|
||||
int olddisplayMode = tmpTvguideConfig->displayMode;
|
||||
bool olddisplayStatusHeader = tmpTvguideConfig->displayStatusHeader;
|
||||
bool olddisplayChannelGroups = tmpTvguideConfig->displayChannelGroups;
|
||||
int oldhideChannelLogos = tmpTvguideConfig->hideChannelLogos;
|
||||
int oldhideEpgImages = tmpTvguideConfig->hideEpgImages;
|
||||
eOSState state = cOsdMenu::ProcessKey(Key);
|
||||
if (Key == kOk) {
|
||||
state = osBack;
|
||||
} else if (Key != kNone) {
|
||||
Set();
|
||||
if (tmpTvguideConfig->displayMode != olddisplayMode ||
|
||||
tmpTvguideConfig->displayStatusHeader != olddisplayStatusHeader ||
|
||||
tmpTvguideConfig->displayChannelGroups != olddisplayChannelGroups ||
|
||||
tmpTvguideConfig->hideChannelLogos != oldhideChannelLogos ||
|
||||
tmpTvguideConfig->hideEpgImages != oldhideEpgImages) {
|
||||
Set();
|
||||
}
|
||||
}
|
||||
return state;
|
||||
}
|
||||
@@ -378,6 +401,9 @@ cMenuSetupFavorites::cMenuSetupFavorites(cTvguideConfig* data) : cMenuSetupSubM
|
||||
recFolderMode[1] = tr("Select from folder list");
|
||||
recFolderMode[2] = tr("Use fixed folder");
|
||||
strn0cpy(fixedFolder, data->instRecFixedFolder.c_str(), sizeof(fixedFolder));
|
||||
switchModeItems[0] = (tr("switch"));
|
||||
switchModeItems[1] = (tr("announce only"));
|
||||
switchModeItems[2] = (tr("ask for switch"));
|
||||
Set();
|
||||
}
|
||||
|
||||
@@ -392,33 +418,37 @@ void cMenuSetupFavorites::Set(void) {
|
||||
if (pRemoteTimers)
|
||||
Add(new cMenuEditBoolItem(tr("Use Remotetimers"), &tmpTvguideConfig->useRemoteTimers));
|
||||
|
||||
Add(new cMenuEditBoolItem(tr("Use \"What's on now\" in favorites"), &tmpTvguideConfig->favWhatsOnNow));
|
||||
Add(new cMenuEditBoolItem(tr("Use \"What's on next\" in favorites"), &tmpTvguideConfig->favWhatsOnNext));
|
||||
Add(new cMenuEditBoolItem(tr("Use user defined time 1 in favorites"), &tmpTvguideConfig->favUseTime1));
|
||||
if (tmpTvguideConfig->favUseTime1) {
|
||||
Add(new cMenuEditStrItem(cString::sprintf("%s%s", *indent, tr("Description")), description1, sizeof(description1), trVDR(FileNameChars)));
|
||||
Add(new cMenuEditTimeItem(cString::sprintf("%s%s", *indent, tr("Time")), &tmpTvguideConfig->favTime1));
|
||||
}
|
||||
Add(new cMenuEditBoolItem(tr("Use user defined time 2 in favorites"), &tmpTvguideConfig->favUseTime2));
|
||||
if (tmpTvguideConfig->favUseTime2) {
|
||||
Add(new cMenuEditStrItem(cString::sprintf("%s%s", *indent, tr("Description")), description2, sizeof(description2), trVDR(FileNameChars)));
|
||||
Add(new cMenuEditTimeItem(cString::sprintf("%s%s", *indent, tr("Time")), &tmpTvguideConfig->favTime2));
|
||||
}
|
||||
Add(new cMenuEditBoolItem(tr("Use user defined time 3 in favorites"), &tmpTvguideConfig->favUseTime3));
|
||||
if (tmpTvguideConfig->favUseTime3) {
|
||||
Add(new cMenuEditStrItem(cString::sprintf("%s%s", *indent, tr("Description")), description3, sizeof(description3), trVDR(FileNameChars)));
|
||||
Add(new cMenuEditTimeItem(cString::sprintf("%s%s", *indent, tr("Time")), &tmpTvguideConfig->favTime3));
|
||||
}
|
||||
Add(new cMenuEditBoolItem(tr("Use user defined time 4 in favorites"), &tmpTvguideConfig->favUseTime4));
|
||||
if (tmpTvguideConfig->favUseTime4) {
|
||||
Add(new cMenuEditStrItem(cString::sprintf("%s%s", *indent, tr("Description")), description4, sizeof(description4), trVDR(FileNameChars)));
|
||||
Add(new cMenuEditTimeItem(cString::sprintf("%s%s", *indent, tr("Time")), &tmpTvguideConfig->favTime4));
|
||||
}
|
||||
Add(new cMenuEditBoolItem(tr("Limit channels in favorites"), &tmpTvguideConfig->favLimitChannels));
|
||||
if (tmpTvguideConfig->favLimitChannels) {
|
||||
Add(new cMenuEditChanItem(tr("Start Channel"), &tmpTvguideConfig->favStartChannel));
|
||||
Add(new cMenuEditChanItem(tr("Stop Channel"), &tmpTvguideConfig->favStopChannel));
|
||||
}
|
||||
Add(new cMenuEditBoolItem(tr("Use \"What's on now\" in favorites"), &tmpTvguideConfig->favWhatsOnNow));
|
||||
Add(new cMenuEditBoolItem(tr("Use \"What's on next\" in favorites"), &tmpTvguideConfig->favWhatsOnNext));
|
||||
Add(new cOsdItem(tr("User defined times in favorites:"), osUnknown, false));
|
||||
Add(new cMenuEditBoolItem(tr("Use user defined time 1"), &tmpTvguideConfig->favUseTime1));
|
||||
if (tmpTvguideConfig->favUseTime1) {
|
||||
Add(new cMenuEditStrItem(cString::sprintf("%s%s", *indent, tr("Description")), description1, sizeof(description1), trVDR(FileNameChars)));
|
||||
Add(new cMenuEditTimeItem(cString::sprintf("%s%s", *indent, tr("Time")), &tmpTvguideConfig->favTime1));
|
||||
}
|
||||
Add(new cMenuEditBoolItem(tr("Use user defined time 2"), &tmpTvguideConfig->favUseTime2));
|
||||
if (tmpTvguideConfig->favUseTime2) {
|
||||
Add(new cMenuEditStrItem(cString::sprintf("%s%s", *indent, tr("Description")), description2, sizeof(description2), trVDR(FileNameChars)));
|
||||
Add(new cMenuEditTimeItem(cString::sprintf("%s%s", *indent, tr("Time")), &tmpTvguideConfig->favTime2));
|
||||
}
|
||||
Add(new cMenuEditBoolItem(tr("Use user defined time 3"), &tmpTvguideConfig->favUseTime3));
|
||||
if (tmpTvguideConfig->favUseTime3) {
|
||||
Add(new cMenuEditStrItem(cString::sprintf("%s%s", *indent, tr("Description")), description3, sizeof(description3), trVDR(FileNameChars)));
|
||||
Add(new cMenuEditTimeItem(cString::sprintf("%s%s", *indent, tr("Time")), &tmpTvguideConfig->favTime3));
|
||||
}
|
||||
Add(new cMenuEditBoolItem(tr("Use user defined time 4"), &tmpTvguideConfig->favUseTime4));
|
||||
if (tmpTvguideConfig->favUseTime4) {
|
||||
Add(new cMenuEditStrItem(cString::sprintf("%s%s", *indent, tr("Description")), description4, sizeof(description4), trVDR(FileNameChars)));
|
||||
Add(new cMenuEditTimeItem(cString::sprintf("%s%s", *indent, tr("Time")), &tmpTvguideConfig->favTime4));
|
||||
}
|
||||
Add(new cOsdItem(tr("Switchtimer:"), osUnknown, false));
|
||||
Add(new cMenuEditStraItem(tr("Switch Mode"), &tmpTvguideConfig->switchMode, 3, switchModeItems));
|
||||
Add(new cMenuEditIntItem(tr("Switch (x)min before start of the show"), &tmpTvguideConfig->switchMinsBefore, 0, 10));
|
||||
|
||||
|
||||
SetCurrent(Get(currentItem));
|
||||
@@ -426,32 +456,42 @@ void cMenuSetupFavorites::Set(void) {
|
||||
}
|
||||
|
||||
eOSState cMenuSetupFavorites::ProcessKey(eKeys Key) {
|
||||
|
||||
int tmpFavUseTime1 = tmpTvguideConfig->favUseTime1;
|
||||
int tmpFavUseTime2 = tmpTvguideConfig->favUseTime2;
|
||||
int tmpFavUseTime3 = tmpTvguideConfig->favUseTime3;
|
||||
int tmpFavUseTime4 = tmpTvguideConfig->favUseTime4;
|
||||
int tmpFavLimitChannels = tmpTvguideConfig->favLimitChannels;
|
||||
int tmpFolderMode = tmpTvguideConfig->instRecFolderMode;
|
||||
|
||||
eOSState state = cOsdMenu::ProcessKey(Key);
|
||||
if (Key == kOk) {
|
||||
tmpTvguideConfig->descUser1 = description1;
|
||||
tmpTvguideConfig->descUser2 = description2;
|
||||
tmpTvguideConfig->descUser3 = description3;
|
||||
tmpTvguideConfig->descUser4 = description4;
|
||||
tmpTvguideConfig->instRecFixedFolder = fixedFolder;
|
||||
} else if ((Key == kLeft)||(Key == kRight)) {
|
||||
if ((tmpFavUseTime1 != tmpTvguideConfig->favUseTime1) ||
|
||||
(tmpFavUseTime2 != tmpTvguideConfig->favUseTime2) ||
|
||||
(tmpFavUseTime3 != tmpTvguideConfig->favUseTime3) ||
|
||||
(tmpFavUseTime4 != tmpTvguideConfig->favUseTime4) ||
|
||||
(tmpFavLimitChannels != tmpTvguideConfig->favLimitChannels) ||
|
||||
(tmpFolderMode != tmpTvguideConfig->instRecFolderMode) )
|
||||
Set();
|
||||
|
||||
if ((tmpFavUseTime1 != tmpTvguideConfig->favUseTime1) ||
|
||||
(tmpFavUseTime2 != tmpTvguideConfig->favUseTime2) ||
|
||||
(tmpFavUseTime3 != tmpTvguideConfig->favUseTime3) ||
|
||||
(tmpFavUseTime4 != tmpTvguideConfig->favUseTime4) ||
|
||||
(tmpFavLimitChannels != tmpTvguideConfig->favLimitChannels) ||
|
||||
(tmpFolderMode != tmpTvguideConfig->instRecFolderMode) ) {
|
||||
Set();
|
||||
Display();
|
||||
}
|
||||
|
||||
if (state == osUnknown) {
|
||||
switch (Key) {
|
||||
case kOk: {
|
||||
tmpTvguideConfig->descUser1 = cString::sprintf("%s", description1);
|
||||
tmpTvguideConfig->descUser2 = cString::sprintf("%s", description2);
|
||||
tmpTvguideConfig->descUser3 = cString::sprintf("%s", description3);
|
||||
tmpTvguideConfig->descUser4 = cString::sprintf("%s", description4);
|
||||
return osBack; }
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
|
||||
//-----Image Caching-------------------------------------------------------------------------------------------------------------
|
||||
cMenuSetupImageCache::cMenuSetupImageCache(cTvguideConfig* data) : cMenuSetupSubMenu(tr("Image Loading and Caching"), data) {
|
||||
Set();
|
||||
|
3
setup.h
3
setup.h
@@ -68,6 +68,7 @@ class cMenuSetupFavorites : public cMenuSetupSubMenu {
|
||||
char description3[256];
|
||||
char description4[256];
|
||||
const char * recFolderMode[3];
|
||||
const char * switchModeItems[3];
|
||||
char fixedFolder[256];
|
||||
void Set(void);
|
||||
virtual eOSState ProcessKey(eKeys Key);
|
||||
@@ -82,4 +83,4 @@ class cMenuSetupImageCache : public cMenuSetupSubMenu {
|
||||
cMenuSetupImageCache(cTvguideConfig *data);
|
||||
};
|
||||
|
||||
#endif //__TVGUIDE_SETUP_H
|
||||
#endif //__TVGUIDE_SETUP_H
|
||||
|
@@ -57,7 +57,8 @@ void cStatusHeader::ScaleVideo(void) {
|
||||
|
||||
void cStatusHeader::DrawInfoText(cGrid *grid) {
|
||||
int border = 10;
|
||||
int textWidth = width - 2 * border - geoManager.clockWidth - 2;
|
||||
int textWidth = 0;
|
||||
textWidth = width - 2 * border;
|
||||
tColor colorTextBack = (tvguideConfig.style == eStyleFlat)?color:clrTransparent;
|
||||
pixmapText->Fill(clrTransparent);
|
||||
int x = border;
|
||||
@@ -82,7 +83,7 @@ void cStatusHeader::DrawInfoText(cGrid *grid) {
|
||||
int lineHeight = fontManager.FontStatusHeader->Height();
|
||||
int textLines = description.Lines();
|
||||
int maxLines = heightText / lineHeight;
|
||||
int lines = min(textLines, maxLines);
|
||||
int lines = std::min(textLines, maxLines);
|
||||
for (int i = 0; i < lines-1; i++) {
|
||||
pixmapText->DrawText(cPoint(x,y), description.GetLine(i), theme.Color(clrFont), colorTextBack, fontManager.FontStatusHeader);
|
||||
y += lineHeight;
|
||||
@@ -104,11 +105,11 @@ int cStatusHeader::DrawPoster(const cEvent *event, int x, int y, int height, int
|
||||
ScraperGetPoster posterScraper2Vdr;
|
||||
int posterWidth = 0;
|
||||
int posterHeight = 0;
|
||||
static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr");
|
||||
if (pScraper2Vdr) {
|
||||
static cPlugin *pScraper = GetScraperPlugin();
|
||||
if (pScraper) {
|
||||
posterScraper2Vdr.event = event;
|
||||
posterScraper2Vdr.recording = NULL;
|
||||
if (pScraper2Vdr->Service("GetPoster", &posterScraper2Vdr)) {
|
||||
if (pScraper->Service("GetPoster", &posterScraper2Vdr)) {
|
||||
hasPoster = true;
|
||||
int posterWidthOrig = posterScraper2Vdr.poster.width;
|
||||
int posterHeightOrig = posterScraper2Vdr.poster.height;
|
||||
@@ -139,4 +140,4 @@ void cStatusHeader::DecorateVideoFrame(void) {
|
||||
pixmapTVFrame->DrawEllipse(cRect(frame, height - radius - frame, radius, radius), theme.Color(clrBackgroundOSD), -3);
|
||||
pixmapTVFrame->DrawRectangle(cRect(0, height - frame, tvFrameWidth, frame), theme.Color(clrBackgroundOSD));
|
||||
pixmapTVFrame->DrawEllipse(cRect(tvFrameWidth - radius - frame, height - radius - frame, radius, radius), theme.Color(clrBackgroundOSD), -4);
|
||||
}
|
||||
}
|
||||
|
@@ -6,13 +6,15 @@ cSwitchTimers SwitchTimers;
|
||||
cSwitchTimer::cSwitchTimer(void) {
|
||||
eventID = 0;
|
||||
startTime = 0;
|
||||
switchMinsBefore = 2;
|
||||
announceOnly = 0;
|
||||
switchMinsBefore = tvguideConfig.switchMinsBefore;
|
||||
switchMode = tvguideConfig.switchMode;
|
||||
}
|
||||
|
||||
cSwitchTimer::cSwitchTimer(const cEvent* Event) {
|
||||
eventID = 0;
|
||||
startTime = 0;
|
||||
// switchMinsBefore = tvguideConfig.switchMinsBefore;
|
||||
// switchModes = tvguideConfig.switchModes;
|
||||
if (Event) {
|
||||
eventID = Event->EventID();
|
||||
channelID = Event->ChannelID();
|
||||
|
@@ -2,6 +2,7 @@
|
||||
#define __TVGUIDE_SWITCHTIMER_H
|
||||
|
||||
#include <vdr/plugin.h>
|
||||
#include "config.h"
|
||||
|
||||
class cSwitchTimer : public cListObject {
|
||||
public:
|
||||
@@ -9,7 +10,19 @@ public:
|
||||
time_t startTime;
|
||||
tChannelID channelID;
|
||||
int switchMinsBefore;
|
||||
int announceOnly;
|
||||
int switchMode;
|
||||
#if VDRVERSNUM >= 20305
|
||||
cSwitchTimer(const cSwitchTimer &SwitchTimer) { *this = SwitchTimer; };
|
||||
cSwitchTimer& operator= (const cSwitchTimer &SwitchTimer)
|
||||
{
|
||||
this->eventID = SwitchTimer.eventID;
|
||||
this->startTime = SwitchTimer.startTime;
|
||||
this->channelID = SwitchTimer.channelID;
|
||||
this->switchMinsBefore = SwitchTimer.switchMinsBefore;
|
||||
this->switchMode = SwitchTimer.switchMode;
|
||||
return *this;
|
||||
};
|
||||
#endif
|
||||
cSwitchTimer(void);
|
||||
cSwitchTimer(const cEvent* Event);
|
||||
bool Parse(const char *s);
|
||||
|
50
timeline.c
50
timeline.c
@@ -5,7 +5,7 @@ cTimeLine::cTimeLine(cMyTime *myTime) {
|
||||
this->myTime = myTime;
|
||||
if (tvguideConfig.displayMode == eVertical) {
|
||||
dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(0,
|
||||
geoManager.statusHeaderHeight,
|
||||
geoManager.statusHeaderHeight + geoManager.clockHeight,
|
||||
geoManager.dateVieverWidth,
|
||||
geoManager.dateVieverHeight)));
|
||||
timeline = osdManager.requestPixmap(2, cRect(0,
|
||||
@@ -21,7 +21,7 @@ cTimeLine::cTimeLine(cMyTime *myTime) {
|
||||
geoManager.osdWidth,
|
||||
geoManager.timeLineGridHeight));
|
||||
} else if (tvguideConfig.displayMode == eHorizontal) {
|
||||
dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(0,
|
||||
dateViewer = new cStyledPixmap(osdManager.requestPixmap(1, cRect(geoManager.clockWidth,
|
||||
geoManager.statusHeaderHeight,
|
||||
geoManager.dateVieverWidth,
|
||||
geoManager.dateVieverHeight)));
|
||||
@@ -39,13 +39,16 @@ cTimeLine::cTimeLine(cMyTime *myTime) {
|
||||
geoManager.timeLineHeight + tvguideConfig.channelRows * geoManager.rowHeight));
|
||||
}
|
||||
timeBase->Fill(clrTransparent);
|
||||
int clockY = 10;
|
||||
int clockY;
|
||||
int clockX;
|
||||
if (tvguideConfig.scaleVideo) {
|
||||
clockX = geoManager.osdWidth - geoManager.tvFrameWidth - geoManager.clockWidth - 4;
|
||||
} else {
|
||||
clockX = geoManager.osdWidth - geoManager.clockWidth - 10;
|
||||
}
|
||||
if (tvguideConfig.displayMode == eVertical) {
|
||||
clockY = geoManager.statusHeaderHeight;
|
||||
clockX = 0;
|
||||
}
|
||||
else {
|
||||
clockY = geoManager.statusHeaderHeight;
|
||||
clockX = 0;
|
||||
}
|
||||
clock = new cStyledPixmap(osdManager.requestPixmap(3, cRect(clockX,
|
||||
clockY,
|
||||
geoManager.clockWidth,
|
||||
@@ -56,7 +59,7 @@ cTimeLine::~cTimeLine(void) {
|
||||
delete dateViewer;
|
||||
osdManager.releasePixmap(timeline);
|
||||
if (clock)
|
||||
delete clock;
|
||||
delete clock;
|
||||
}
|
||||
|
||||
void cTimeLine::drawDateViewer() {
|
||||
@@ -74,19 +77,21 @@ void cTimeLine::drawDateViewer() {
|
||||
else
|
||||
dateViewer->Fill(clrTransparent);
|
||||
}
|
||||
tColor colorFont = theme.Color(clrFont);
|
||||
tColor colorFontBack = (tvguideConfig.style == eStyleFlat)?theme.Color(clrHeader):clrTransparent;
|
||||
tColor colorFont = theme.Color(clrButtonYellow);
|
||||
tColor colorFontBack = (tvguideConfig.style == eStyleFlat) ? theme.Color(clrHeader) : clrTransparent;
|
||||
|
||||
if (tvguideConfig.displayMode == eVertical) {
|
||||
int textHeight = fontManager.FontTimeLineWeekday->Height();
|
||||
int textHeightWeekday = fontManager.FontTimeLineWeekday->Height();
|
||||
int textHeightDate = fontManager.FontTimeLineDate->Height();
|
||||
int weekdayWidth = fontManager.FontTimeLineWeekday->Width(*weekDay);
|
||||
int dateWidth = fontManager.FontTimeLineDate->Width(*date);
|
||||
dateViewer->DrawText(cPoint((geoManager.timeLineWidth-weekdayWidth)/2, (geoManager.channelHeaderHeight + geoManager.channelGroupsHeight -2*textHeight)/2), *weekDay, colorFont, colorFontBack, fontManager.FontTimeLineWeekday);
|
||||
dateViewer->DrawText(cPoint((geoManager.timeLineWidth-dateWidth)/2, (geoManager.channelHeaderHeight + geoManager.channelGroupsHeight -2*textHeight)/2 + textHeight + 5), *date, colorFont, colorFontBack, fontManager.FontTimeLineDate);
|
||||
int y = ((geoManager.dateVieverHeight - textHeightWeekday - textHeightDate) / 2);
|
||||
dateViewer->DrawText(cPoint((geoManager.timeLineWidth - weekdayWidth) / 2, y), *weekDay, colorFont, colorFontBack, fontManager.FontTimeLineWeekday);
|
||||
dateViewer->DrawText(cPoint((geoManager.timeLineWidth - dateWidth) / 2, y + textHeightWeekday), *date, colorFont, colorFontBack, fontManager.FontTimeLineDate);
|
||||
} else if (tvguideConfig.displayMode == eHorizontal) {
|
||||
cString strDate = cString::sprintf("%s %s", *weekDay, *date);
|
||||
int x = (dateViewer->Width() - fontManager.FontTimeLineDateHorizontal->Width(*strDate))/2;
|
||||
int y = (dateViewer->Height() - fontManager.FontTimeLineDateHorizontal->Height())/2;
|
||||
int x = ((dateViewer->Width() - fontManager.FontTimeLineDateHorizontal->Width(*strDate)) / 2);
|
||||
int y = ((dateViewer->Height() - fontManager.FontTimeLineDateHorizontal->Height()) / 2);
|
||||
dateViewer->DrawText(cPoint(x, y), *strDate, colorFont, colorFontBack, fontManager.FontTimeLineDateHorizontal);
|
||||
}
|
||||
}
|
||||
@@ -259,18 +264,19 @@ void cTimeLine::setTimeline() {
|
||||
}
|
||||
|
||||
void cTimeLine::drawClock() {
|
||||
clock->Fill(clrTransparent);
|
||||
if (tvguideConfig.displayMode == eVertical)
|
||||
clock->Fill(clrTransparent);
|
||||
cString currentTime = myTime->GetCurrentTime();
|
||||
const cFont *font = (tvguideConfig.displayMode == eVertical)?fontManager.FontTimeLineTime:fontManager.FontTimeLineTimeHorizontal;
|
||||
int textHeight = font->Height();
|
||||
int clockTextWidth = font->Width(*currentTime);
|
||||
tColor colorFontBack = (tvguideConfig.style == eStyleFlat)?theme.Color(clrHeader):clrTransparent;
|
||||
if (tvguideConfig.style == eStyleGraphical) {
|
||||
clock->drawBackgroundGraphical(bgClock);
|
||||
clock->drawBackgroundGraphical(bgClock);
|
||||
} else {
|
||||
clock->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending));
|
||||
clock->drawBackground();
|
||||
clock->drawBorder();
|
||||
clock->setColor(theme.Color(clrHeader), theme.Color(clrHeaderBlending));
|
||||
clock->drawBackground();
|
||||
clock->drawBorder();
|
||||
}
|
||||
clock->DrawText(cPoint((geoManager.clockWidth-clockTextWidth)/2, (geoManager.clockHeight-textHeight)/2), *currentTime, theme.Color(clrFont), colorFontBack, font);
|
||||
}
|
||||
}
|
||||
|
358
timerconflict.c
358
timerconflict.c
@@ -1,177 +1,181 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <vdr/timers.h>
|
||||
#include "tools.h"
|
||||
#include "timer.h"
|
||||
#include "timerconflict.h"
|
||||
|
||||
cTVGuideTimerConflict::cTVGuideTimerConflict(void) {
|
||||
time = 0;
|
||||
timeStart = 0;
|
||||
timeStop = 0;
|
||||
overlapStart = 0;
|
||||
overlapStop = 0;
|
||||
percentPossible = 0;
|
||||
timerID = 0;
|
||||
}
|
||||
|
||||
cTVGuideTimerConflict::~cTVGuideTimerConflict(void) {
|
||||
|
||||
}
|
||||
|
||||
bool cTVGuideTimerConflict::timerInvolved(int involvedID) {
|
||||
int numConflicts = timerIDs.size();
|
||||
for (int i=0; i<numConflicts; i++) {
|
||||
if (timerIDs[i] == involvedID)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// --- cTVGuideTimerConflicts------------------------------------
|
||||
|
||||
cTVGuideTimerConflicts::cTVGuideTimerConflicts(void) {
|
||||
numConflicts = 0;
|
||||
currentConflict = -1;
|
||||
}
|
||||
|
||||
cTVGuideTimerConflicts::~cTVGuideTimerConflicts(void) {
|
||||
for(std::vector<cTVGuideTimerConflict*>::const_iterator it = conflicts.begin(); it != conflicts.end(); it++) {
|
||||
cTVGuideTimerConflict *conf = *it;
|
||||
delete conf;
|
||||
}
|
||||
conflicts.clear();
|
||||
}
|
||||
|
||||
void cTVGuideTimerConflicts::AddConflict(std::string epgSearchConflictLine) {
|
||||
/* TIMERCONFLICT FORMAT:
|
||||
The result list looks like this for example when we have 2 timer conflicts at one time:
|
||||
1190232780:152|30|50#152#45:45|10|50#152#45
|
||||
'1190232780' is the time of the conflict in seconds since 1970-01-01.
|
||||
It's followed by list of timers that have a conflict at this time:
|
||||
'152|30|50#1 int editTimer(cTimer *timer, bool active, int prio, int start, int stop);
|
||||
52#45' is the description of the first conflicting timer. Here:
|
||||
'152' is VDR's timer id of this timer as returned from VDR's LSTT command
|
||||
'30' is the percentage of recording that would be done (0...100)
|
||||
'50#152#45' is the list of concurrent timers at this conflict
|
||||
'45|10|50#152#45' describes the next conflict
|
||||
*/
|
||||
cTVGuideTimerConflict *conflict = new cTVGuideTimerConflict();
|
||||
splitstring s(epgSearchConflictLine.c_str());
|
||||
std::vector<std::string> flds = s.split(':');
|
||||
if (flds.size() < 2)
|
||||
return;
|
||||
conflict->time = atoi(flds[0].c_str());
|
||||
splitstring s2(flds[1].c_str());
|
||||
std::vector<std::string> flds2 = s2.split('|');
|
||||
if (flds2.size() < 3)
|
||||
return;
|
||||
conflict->timerID = atoi(flds2[0].c_str());
|
||||
conflict->percentPossible = atoi(flds2[1].c_str());
|
||||
splitstring s3(flds2[2].c_str());
|
||||
std::vector<std::string> flds3 = s3.split('#');
|
||||
std::vector<int> timerIDs;
|
||||
for (int k = 0; k < flds3.size(); k++) {
|
||||
timerIDs.push_back(atoi(flds3[k].c_str()) - 1);
|
||||
}
|
||||
conflict->timerIDs = timerIDs;
|
||||
conflicts.push_back(conflict);
|
||||
}
|
||||
|
||||
void cTVGuideTimerConflicts::CalculateConflicts(void) {
|
||||
numConflicts = conflicts.size();
|
||||
time_t startTime = 0;
|
||||
time_t endTime = 0;
|
||||
for (int i=0; i < numConflicts; i++) {
|
||||
cTimeInterval *unionSet = NULL;
|
||||
int numTimers = conflicts[i]->timerIDs.size();
|
||||
for (int j=0; j < numTimers; j++) {
|
||||
const cTimer *timer = Timers.Get(conflicts[i]->timerIDs[j]);
|
||||
if (timer) {
|
||||
if (!unionSet) {
|
||||
unionSet = new cTimeInterval(timer->StartTime(), timer->StopTime());
|
||||
} else {
|
||||
cTimeInterval *timerInterval = new cTimeInterval(timer->StartTime(), timer->StopTime());
|
||||
cTimeInterval *newUnion = unionSet->Union(timerInterval);
|
||||
delete unionSet;
|
||||
delete timerInterval;
|
||||
unionSet = newUnion;
|
||||
}
|
||||
}
|
||||
}
|
||||
conflicts[i]->timeStart = unionSet->Start();
|
||||
conflicts[i]->timeStop = unionSet->Stop();
|
||||
delete unionSet;
|
||||
|
||||
cTimeInterval *intersect = NULL;
|
||||
for (int j=0; j < numTimers; j++) {
|
||||
const cTimer *timer = Timers.Get(conflicts[i]->timerIDs[j]);
|
||||
if (timer) {
|
||||
if (!intersect) {
|
||||
intersect = new cTimeInterval(timer->StartTime(), timer->StopTime());
|
||||
} else {
|
||||
cTimeInterval *timerInterval = new cTimeInterval(timer->StartTime(), timer->StopTime());
|
||||
cTimeInterval *newIntersect = intersect->Intersect(timerInterval);
|
||||
if (newIntersect) {
|
||||
delete intersect;
|
||||
intersect = newIntersect;
|
||||
}
|
||||
delete timerInterval;
|
||||
}
|
||||
}
|
||||
}
|
||||
conflicts[i]->overlapStart = intersect->Start();
|
||||
conflicts[i]->overlapStop = intersect->Stop();
|
||||
delete intersect;
|
||||
}
|
||||
}
|
||||
|
||||
cTVGuideTimerConflict *cTVGuideTimerConflicts::GetCurrentConflict(void) {
|
||||
if (currentConflict < 0)
|
||||
return NULL;
|
||||
if (currentConflict > (numConflicts-1))
|
||||
return NULL;
|
||||
return conflicts[currentConflict];
|
||||
}
|
||||
|
||||
int cTVGuideTimerConflicts::GetCurrentConflictTimerID(int timerIndex) {
|
||||
if (currentConflict < 0)
|
||||
return -1;
|
||||
if (currentConflict > (numConflicts-1))
|
||||
return -1;
|
||||
int numTimersInConflict = conflicts[currentConflict]->timerIDs.size();
|
||||
if (timerIndex > (numTimersInConflict - 1))
|
||||
return -1;
|
||||
return conflicts[currentConflict]->timerIDs[timerIndex];
|
||||
}
|
||||
|
||||
int cTVGuideTimerConflicts::GetCorrespondingConflict(int timerID) {
|
||||
int conflictIndex = -1;
|
||||
if (numConflicts > 0) {
|
||||
for (int i=0; i<numConflicts; i++) {
|
||||
if (conflicts[i]->timerInvolved(timerID)) {
|
||||
conflictIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return conflictIndex;
|
||||
}
|
||||
|
||||
cTVGuideTimerConflict *cTVGuideTimerConflicts::GetConflict(int conflictIndex) {
|
||||
if (conflictIndex < 0)
|
||||
return NULL;
|
||||
if (conflictIndex > (numConflicts-1))
|
||||
return NULL;
|
||||
return conflicts[conflictIndex];
|
||||
}
|
||||
|
||||
std::vector<cTVGuideTimerConflict*> cTVGuideTimerConflicts::GetConflictsBetween(time_t start, time_t stop) {
|
||||
std::vector<cTVGuideTimerConflict*> conflictsFound;
|
||||
for (int i=0; i < numConflicts; i++) {
|
||||
if ((conflicts[i]->timeStart > start) && (conflicts[i]->timeStart < stop)||
|
||||
(conflicts[i]->timeStop > start) && (conflicts[i]->timeStop < stop))
|
||||
conflictsFound.push_back(conflicts[i]);
|
||||
}
|
||||
return conflictsFound;
|
||||
}
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <vdr/timers.h>
|
||||
#include "tools.h"
|
||||
#include "timer.h"
|
||||
#include "timerconflict.h"
|
||||
|
||||
cTVGuideTimerConflict::cTVGuideTimerConflict(void) {
|
||||
time = 0;
|
||||
timeStart = 0;
|
||||
timeStop = 0;
|
||||
overlapStart = 0;
|
||||
overlapStop = 0;
|
||||
percentPossible = 0;
|
||||
timerID = 0;
|
||||
}
|
||||
|
||||
cTVGuideTimerConflict::~cTVGuideTimerConflict(void) {
|
||||
|
||||
}
|
||||
|
||||
bool cTVGuideTimerConflict::timerInvolved(int involvedID) {
|
||||
int numConflicts = timerIDs.size();
|
||||
for (int i=0; i<numConflicts; i++) {
|
||||
if (timerIDs[i] == involvedID)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// --- cTVGuideTimerConflicts------------------------------------
|
||||
|
||||
cTVGuideTimerConflicts::cTVGuideTimerConflicts(void) {
|
||||
numConflicts = 0;
|
||||
currentConflict = -1;
|
||||
}
|
||||
|
||||
cTVGuideTimerConflicts::~cTVGuideTimerConflicts(void) {
|
||||
for(std::vector<cTVGuideTimerConflict*>::const_iterator it = conflicts.begin(); it != conflicts.end(); it++) {
|
||||
cTVGuideTimerConflict *conf = *it;
|
||||
delete conf;
|
||||
}
|
||||
conflicts.clear();
|
||||
}
|
||||
|
||||
void cTVGuideTimerConflicts::AddConflict(std::string epgSearchConflictLine) {
|
||||
/* TIMERCONFLICT FORMAT:
|
||||
The result list looks like this for example when we have 2 timer conflicts at one time:
|
||||
1190232780:152|30|50#152#45:45|10|50#152#45
|
||||
'1190232780' is the time of the conflict in seconds since 1970-01-01.
|
||||
It's followed by list of timers that have a conflict at this time:
|
||||
'152|30|50#1 int editTimer(cTimer *timer, bool active, int prio, int start, int stop);
|
||||
52#45' is the description of the first conflicting timer. Here:
|
||||
'152' is VDR's timer id of this timer as returned from VDR's LSTT command
|
||||
'30' is the percentage of recording that would be done (0...100)
|
||||
'50#152#45' is the list of concurrent timers at this conflict
|
||||
'45|10|50#152#45' describes the next conflict
|
||||
*/
|
||||
cTVGuideTimerConflict *conflict = new cTVGuideTimerConflict();
|
||||
splitstring s(epgSearchConflictLine.c_str());
|
||||
std::vector<std::string> flds = s.split(':');
|
||||
if (flds.size() < 2)
|
||||
return;
|
||||
conflict->time = atoi(flds[0].c_str());
|
||||
splitstring s2(flds[1].c_str());
|
||||
std::vector<std::string> flds2 = s2.split('|');
|
||||
if (flds2.size() < 3)
|
||||
return;
|
||||
conflict->timerID = atoi(flds2[0].c_str());
|
||||
conflict->percentPossible = atoi(flds2[1].c_str());
|
||||
splitstring s3(flds2[2].c_str());
|
||||
std::vector<std::string> flds3 = s3.split('#');
|
||||
std::vector<int> timerIDs;
|
||||
for (int k = 0; k < (int)flds3.size(); k++) {
|
||||
timerIDs.push_back(atoi(flds3[k].c_str()) - 1);
|
||||
}
|
||||
conflict->timerIDs = timerIDs;
|
||||
conflicts.push_back(conflict);
|
||||
}
|
||||
|
||||
void cTVGuideTimerConflicts::CalculateConflicts(void) {
|
||||
numConflicts = conflicts.size();
|
||||
for (int i=0; i < numConflicts; i++) {
|
||||
cTimeInterval *unionSet = NULL;
|
||||
int numTimers = conflicts[i]->timerIDs.size();
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_READ;
|
||||
const cTimers* timers = Timers;
|
||||
#else
|
||||
const cTimers* timers = &Timers;
|
||||
#endif
|
||||
for (int j=0; j < numTimers; j++) {
|
||||
const cTimer *timer = timers->Get(conflicts[i]->timerIDs[j]);
|
||||
if (timer) {
|
||||
if (!unionSet) {
|
||||
unionSet = new cTimeInterval(timer->StartTime(), timer->StopTime());
|
||||
} else {
|
||||
cTimeInterval *timerInterval = new cTimeInterval(timer->StartTime(), timer->StopTime());
|
||||
cTimeInterval *newUnion = unionSet->Union(timerInterval);
|
||||
delete unionSet;
|
||||
delete timerInterval;
|
||||
unionSet = newUnion;
|
||||
}
|
||||
}
|
||||
}
|
||||
conflicts[i]->timeStart = unionSet->Start();
|
||||
conflicts[i]->timeStop = unionSet->Stop();
|
||||
delete unionSet;
|
||||
|
||||
cTimeInterval *intersect = NULL;
|
||||
for (int j=0; j < numTimers; j++) {
|
||||
const cTimer *timer = timers->Get(conflicts[i]->timerIDs[j]);
|
||||
if (timer) {
|
||||
if (!intersect) {
|
||||
intersect = new cTimeInterval(timer->StartTime(), timer->StopTime());
|
||||
} else {
|
||||
cTimeInterval *timerInterval = new cTimeInterval(timer->StartTime(), timer->StopTime());
|
||||
cTimeInterval *newIntersect = intersect->Intersect(timerInterval);
|
||||
if (newIntersect) {
|
||||
delete intersect;
|
||||
intersect = newIntersect;
|
||||
}
|
||||
delete timerInterval;
|
||||
}
|
||||
}
|
||||
}
|
||||
conflicts[i]->overlapStart = intersect->Start();
|
||||
conflicts[i]->overlapStop = intersect->Stop();
|
||||
delete intersect;
|
||||
}
|
||||
}
|
||||
|
||||
cTVGuideTimerConflict *cTVGuideTimerConflicts::GetCurrentConflict(void) {
|
||||
if (currentConflict < 0)
|
||||
return NULL;
|
||||
if (currentConflict > (numConflicts-1))
|
||||
return NULL;
|
||||
return conflicts[currentConflict];
|
||||
}
|
||||
|
||||
int cTVGuideTimerConflicts::GetCurrentConflictTimerID(int timerIndex) {
|
||||
if (currentConflict < 0)
|
||||
return -1;
|
||||
if (currentConflict > (numConflicts-1))
|
||||
return -1;
|
||||
int numTimersInConflict = conflicts[currentConflict]->timerIDs.size();
|
||||
if (timerIndex > (numTimersInConflict - 1))
|
||||
return -1;
|
||||
return conflicts[currentConflict]->timerIDs[timerIndex];
|
||||
}
|
||||
|
||||
int cTVGuideTimerConflicts::GetCorrespondingConflict(int timerID) {
|
||||
int conflictIndex = -1;
|
||||
if (numConflicts > 0) {
|
||||
for (int i=0; i<numConflicts; i++) {
|
||||
if (conflicts[i]->timerInvolved(timerID)) {
|
||||
conflictIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return conflictIndex;
|
||||
}
|
||||
|
||||
cTVGuideTimerConflict *cTVGuideTimerConflicts::GetConflict(int conflictIndex) {
|
||||
if (conflictIndex < 0)
|
||||
return NULL;
|
||||
if (conflictIndex > (numConflicts-1))
|
||||
return NULL;
|
||||
return conflicts[conflictIndex];
|
||||
}
|
||||
|
||||
std::vector<cTVGuideTimerConflict*> cTVGuideTimerConflicts::GetConflictsBetween(time_t start, time_t stop) {
|
||||
std::vector<cTVGuideTimerConflict*> conflictsFound;
|
||||
for (int i=0; i < numConflicts; i++) {
|
||||
if ((conflicts[i]->timeStart > start) && (conflicts[i]->timeStart < stop)||
|
||||
(conflicts[i]->timeStop > start) && (conflicts[i]->timeStop < stop))
|
||||
conflictsFound.push_back(conflicts[i]);
|
||||
}
|
||||
return conflictsFound;
|
||||
}
|
||||
|
@@ -1,38 +1,38 @@
|
||||
#ifndef __TVGUIDE_TIMERCONFLICT_H
|
||||
#define __TVGUIDE_TIMERCONFLICT_H
|
||||
|
||||
class cTVGuideTimerConflict {
|
||||
public:
|
||||
cTVGuideTimerConflict(void);
|
||||
virtual ~cTVGuideTimerConflict(void);
|
||||
time_t time;
|
||||
time_t timeStart;
|
||||
time_t timeStop;
|
||||
time_t overlapStart;
|
||||
time_t overlapStop;
|
||||
int percentPossible;
|
||||
int timerID;
|
||||
std::vector<int> timerIDs;
|
||||
bool timerInvolved(int involvedID);
|
||||
};
|
||||
|
||||
class cTVGuideTimerConflicts {
|
||||
private:
|
||||
std::vector<cTVGuideTimerConflict*> conflicts;
|
||||
int numConflicts;
|
||||
int currentConflict;
|
||||
public:
|
||||
cTVGuideTimerConflicts(void);
|
||||
virtual ~cTVGuideTimerConflicts(void);
|
||||
void AddConflict(std::string epgSearchConflictLine);
|
||||
void CalculateConflicts(void);
|
||||
int NumConflicts(void) {return numConflicts; };
|
||||
void SetCurrentConflict(int current) { currentConflict = current; };
|
||||
cTVGuideTimerConflict *GetCurrentConflict(void);
|
||||
int GetCurrentConflictTimerID(int timerIndex);
|
||||
int GetCorrespondingConflict(int timerID);
|
||||
cTVGuideTimerConflict *GetConflict(int conflictIndex);
|
||||
std::vector<cTVGuideTimerConflict*> GetConflictsBetween(time_t start, time_t stop);
|
||||
};
|
||||
|
||||
#endif //__TVGUIDE_RECMMANAGER_H
|
||||
#ifndef __TVGUIDE_TIMERCONFLICT_H
|
||||
#define __TVGUIDE_TIMERCONFLICT_H
|
||||
|
||||
class cTVGuideTimerConflict {
|
||||
public:
|
||||
cTVGuideTimerConflict(void);
|
||||
virtual ~cTVGuideTimerConflict(void);
|
||||
time_t time;
|
||||
time_t timeStart;
|
||||
time_t timeStop;
|
||||
time_t overlapStart;
|
||||
time_t overlapStop;
|
||||
int percentPossible;
|
||||
int timerID;
|
||||
std::vector<int> timerIDs;
|
||||
bool timerInvolved(int involvedID);
|
||||
};
|
||||
|
||||
class cTVGuideTimerConflicts {
|
||||
private:
|
||||
std::vector<cTVGuideTimerConflict*> conflicts;
|
||||
int numConflicts;
|
||||
int currentConflict;
|
||||
public:
|
||||
cTVGuideTimerConflicts(void);
|
||||
virtual ~cTVGuideTimerConflicts(void);
|
||||
void AddConflict(std::string epgSearchConflictLine);
|
||||
void CalculateConflicts(void);
|
||||
int NumConflicts(void) {return numConflicts; };
|
||||
void SetCurrentConflict(int current) { currentConflict = current; };
|
||||
cTVGuideTimerConflict *GetCurrentConflict(void);
|
||||
int GetCurrentConflictTimerID(int timerIndex);
|
||||
int GetCorrespondingConflict(int timerID);
|
||||
cTVGuideTimerConflict *GetConflict(int conflictIndex);
|
||||
std::vector<cTVGuideTimerConflict*> GetConflictsBetween(time_t start, time_t stop);
|
||||
};
|
||||
|
||||
#endif //__TVGUIDE_RECMMANAGER_H
|
||||
|
956
tools.c
956
tools.c
@@ -1,474 +1,482 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
#include <algorithm>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <vdr/osd.h>
|
||||
#include <vdr/plugin.h>
|
||||
#include "services/epgsearch.h"
|
||||
|
||||
#include "tools.h"
|
||||
|
||||
/****************************************************************************************
|
||||
* CUTTEXT
|
||||
****************************************************************************************/
|
||||
std::string CutText(std::string text, int width, const cFont *font) {
|
||||
if (width <= font->Size())
|
||||
return text.c_str();
|
||||
if (font->Width(text.c_str()) < width)
|
||||
return text.c_str();
|
||||
cTextWrapper twText;
|
||||
twText.Set(text.c_str(), font, width);
|
||||
std::string cuttedTextNative = twText.GetLine(0);
|
||||
std::stringstream sstrText;
|
||||
sstrText << cuttedTextNative << "...";
|
||||
std::string cuttedText = sstrText.str();
|
||||
int actWidth = font->Width(cuttedText.c_str());
|
||||
if (actWidth > width) {
|
||||
int overlap = actWidth - width;
|
||||
int charWidth = font->Width(".");
|
||||
if (charWidth == 0)
|
||||
charWidth = 1;
|
||||
int cutChars = overlap / charWidth;
|
||||
if (cutChars > 0) {
|
||||
cuttedTextNative = cuttedTextNative.substr(0, cuttedTextNative.length() - cutChars);
|
||||
std::stringstream sstrText2;
|
||||
sstrText2 << cuttedTextNative << "...";
|
||||
cuttedText = sstrText2.str();
|
||||
}
|
||||
}
|
||||
return cuttedText;
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
* StrToLowerCase
|
||||
****************************************************************************************/
|
||||
std::string StrToLowerCase(std::string str) {
|
||||
std::string lowerCase = str;
|
||||
const int length = lowerCase.length();
|
||||
for(int i=0; i < length; ++i) {
|
||||
lowerCase[i] = std::tolower(lowerCase[i]);
|
||||
}
|
||||
return lowerCase;
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
* GetDirectoryFromTimer
|
||||
****************************************************************************************/
|
||||
std::string GetDirectoryFromTimer(std::string file) {
|
||||
std::string dir = "";
|
||||
size_t found = file.find_last_of('~');
|
||||
if (found != std::string::npos) {
|
||||
dir = file.substr(0, found);
|
||||
}
|
||||
return dir;
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
* GetDirectoryFromTimer
|
||||
****************************************************************************************/
|
||||
void ReadRecordingDirectories(std::vector<std::string> *folders, cList<cNestedItem> *rootFolders, cString path) {
|
||||
cPlugin *epgSearchPlugin = NULL;
|
||||
epgSearchPlugin = cPluginManager::GetPlugin("epgsearch");
|
||||
if (epgSearchPlugin) {
|
||||
Epgsearch_services_v1_0 *epgSearch = new Epgsearch_services_v1_0;
|
||||
if (epgSearchPlugin->Service("Epgsearch-services-v1.0", epgSearch)) {
|
||||
std::set<std::string> epgSearchDirs = epgSearch->handler->DirectoryList();
|
||||
std::set<std::string>::iterator it;
|
||||
for (it = epgSearchDirs.begin(); it != epgSearchDirs.end(); it++) {
|
||||
std::string newFolder = *it;
|
||||
std::replace(newFolder.begin(), newFolder.end(), '/', '~');
|
||||
folders->push_back(newFolder);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
cList<cNestedItem> *foldersLevel = NULL;
|
||||
if (rootFolders) {
|
||||
foldersLevel = rootFolders;
|
||||
} else {
|
||||
foldersLevel = &Folders;
|
||||
}
|
||||
for (cNestedItem *folder = foldersLevel->First(); folder; folder = foldersLevel->Next(folder)) {
|
||||
std::string strFolder = *cString::sprintf("%s%s", *path, folder->Text());
|
||||
std::replace(strFolder.begin(), strFolder.end(), '/', '~');
|
||||
folders->push_back(strFolder);
|
||||
cList<cNestedItem> *subItems = folder->SubItems();
|
||||
if (subItems) {
|
||||
std::string strFolder2 = *cString::sprintf("%s%s", *path, folder->Text());
|
||||
std::replace(strFolder2.begin(), strFolder2.end(), '/', '~');
|
||||
ReadRecordingDirectories(folders, subItems, strFolder2.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************************
|
||||
* DrawRoundedCorners
|
||||
****************************************************************************************/
|
||||
void DrawRoundedCorners(cPixmap *p, int posX, int posY, int width, int height, int radius, int borderWidth, tColor borderColor) {
|
||||
if( height > 2*radius) {
|
||||
p->DrawEllipse(cRect(posX, posY, radius, radius), borderColor, -2);
|
||||
p->DrawEllipse(cRect(posX - borderWidth, posY - borderWidth, radius, radius), clrTransparent, -2);
|
||||
|
||||
p->DrawEllipse(cRect(posX+width - radius, posY, radius, radius), borderColor, -1);
|
||||
p->DrawEllipse(cRect(posX+width - radius + borderWidth, posY - borderWidth, radius, radius), clrTransparent, -1);
|
||||
|
||||
p->DrawEllipse(cRect(posX, posY + height - radius, radius, radius), borderColor, -3);
|
||||
p->DrawEllipse(cRect(posX - borderWidth, posY + height - radius + borderWidth, radius, radius), clrTransparent, -3);
|
||||
|
||||
p->DrawEllipse(cRect(posX + width - radius, posY + height - radius, radius, radius), borderColor, -4);
|
||||
p->DrawEllipse(cRect(posX + width - radius + borderWidth, posY + height - radius + borderWidth, radius, radius), clrTransparent, -4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************************
|
||||
* SPLTSTRING
|
||||
****************************************************************************************/
|
||||
// split: receives a char delimiter; returns a vector of strings
|
||||
// By default ignores repeated delimiters, unless argument rep == 1.
|
||||
std::vector<std::string>& splitstring::split(char delim, int rep) {
|
||||
if (!flds.empty()) flds.clear(); // empty vector if necessary
|
||||
std::string work = data();
|
||||
std::string buf = "";
|
||||
int i = 0;
|
||||
while (i < work.length()) {
|
||||
if (work[i] != delim)
|
||||
buf += work[i];
|
||||
else if (rep == 1) {
|
||||
flds.push_back(buf);
|
||||
buf = "";
|
||||
} else if (buf.length() > 0) {
|
||||
flds.push_back(buf);
|
||||
buf = "";
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (!buf.empty())
|
||||
flds.push_back(buf);
|
||||
return flds;
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
* FINDIGNORECASE
|
||||
****************************************************************************************/
|
||||
int FindIgnoreCase(const std::string& expr, const std::string& query)
|
||||
{
|
||||
const char *p = expr.c_str();
|
||||
const char *r = strcasestr(p, query.c_str());
|
||||
|
||||
if (!r)
|
||||
return -1;
|
||||
return r - p;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************************
|
||||
* GetAuxValue
|
||||
****************************************************************************************/
|
||||
char* GetAuxValue(const char* aux, const char* name) {
|
||||
if (isempty(aux))
|
||||
return NULL;
|
||||
|
||||
char* descr = strdup(aux);
|
||||
char* beginaux = strstr(descr, "<epgsearch>");
|
||||
char* endaux = strstr(descr, "</epgsearch>");
|
||||
if (!beginaux || !endaux) {
|
||||
free(descr);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
beginaux += 11; // strlen("<epgsearch>");
|
||||
endaux[0] = 0;
|
||||
memmove(descr, beginaux, endaux - beginaux + 1);
|
||||
|
||||
if (strcmp(name, "epgsearch") == 0)
|
||||
return descr; // full aux
|
||||
|
||||
int namelen = strlen(name);
|
||||
char catname[100] = "";
|
||||
catname[0] = '<';
|
||||
memcpy(catname + 1, name, namelen);
|
||||
catname[1 + namelen] = '>';
|
||||
catname[2 + namelen] = 0;
|
||||
|
||||
char* cat = strcasestr(descr, catname);
|
||||
if (!cat) {
|
||||
free(descr);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cat += namelen + 2;
|
||||
char* end = strstr(cat, "</");
|
||||
if (!end) {
|
||||
free(descr);
|
||||
return NULL;
|
||||
}
|
||||
end[0] = 0;
|
||||
|
||||
int catlen = end - cat + 1;
|
||||
char* value = (char *) malloc(catlen);
|
||||
memcpy(value, cat, catlen);
|
||||
|
||||
free(descr);
|
||||
return value;
|
||||
}
|
||||
|
||||
char* GetAuxValue(const cRecording *recording, const char* name) {
|
||||
if (!recording || !recording->Info())
|
||||
return NULL;
|
||||
return GetAuxValue(recording->Info()->Aux(), name);
|
||||
}
|
||||
|
||||
char* GetAuxValue(const cTimer *timer, const char* name) {
|
||||
if (!timer || !timer->Aux())
|
||||
return NULL;
|
||||
return GetAuxValue(timer->Aux(), name);
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
* FUZZYSEARCH
|
||||
****************************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
FUNCTION afuzzy_init()
|
||||
Initialization of the fuzzy search routine. This applies to the consequent
|
||||
calls of the afuzzy_CheckRTR (whole string matching) and afuzzy_CheckSUB
|
||||
(substring match) routines. afuzzy_init() should be called for each
|
||||
new pattern or error length. The search is case sensitive
|
||||
|
||||
ARGUMENTS:
|
||||
p Pattern
|
||||
kerr Number of possible errors. Shouldn't exceed pattern length
|
||||
UseFilter Use agrep filter algorithm that speeds up search.
|
||||
fuzzy pointer to the structure that will be later passes to Check*
|
||||
(the first 6 elements should be NULLs for the first call)
|
||||
|
||||
RETURN VALUE:
|
||||
none
|
||||
|
||||
ALGORITHM
|
||||
see. the article on agrep algorithms.
|
||||
The only change is accounting transpositions as one edit operation .
|
||||
******************************************************************************/
|
||||
void afuzzy_init(const char *p, int kerr, int UseFilter, AFUZZY *fuzzy)
|
||||
{
|
||||
int cnt, p_len, i, j, l, d, m, dd;
|
||||
char PatFilter[sizeof(Uint)*8 + 1];
|
||||
|
||||
fuzzy->k = kerr;
|
||||
m = strlen(p);
|
||||
fuzzy->FilterSet = 0;
|
||||
memset(fuzzy->Map, 0 , sizeof(fuzzy->Map) );
|
||||
|
||||
if (fuzzy->S)
|
||||
free(fuzzy->S);
|
||||
if (fuzzy->R)
|
||||
free(fuzzy->R);
|
||||
if (fuzzy->R1)
|
||||
free(fuzzy->R1);
|
||||
if (fuzzy->RP)
|
||||
free(fuzzy->RP);
|
||||
if (fuzzy->RI)
|
||||
free(fuzzy->RI);
|
||||
if (fuzzy->FilterS)
|
||||
free(fuzzy->FilterS);
|
||||
|
||||
fuzzy->FilterS = NULL;
|
||||
fuzzy->S = (Uint *)calloc(m + 1, sizeof(Uint));
|
||||
fuzzy->R = (Uint *)calloc(fuzzy->k + 1, sizeof(Uint));
|
||||
fuzzy->R1 = (Uint *)calloc(fuzzy->k + 1, sizeof(Uint));
|
||||
fuzzy->RI = (Uint *)calloc(fuzzy->k + 1, sizeof(Uint));
|
||||
fuzzy->RP = (Uint *)calloc(fuzzy->k + 1, sizeof(Uint));
|
||||
|
||||
for (i = 0, cnt = 0; i < m; i++)
|
||||
{
|
||||
l = fuzzy->Map[(unsigned char)p[i]];
|
||||
if (!l)
|
||||
{
|
||||
l = fuzzy->Map[(unsigned char)p[i]] = ++cnt;
|
||||
fuzzy->S[l] = 0;
|
||||
}
|
||||
fuzzy->S[l] |= 1 << i;
|
||||
}
|
||||
|
||||
|
||||
for (d = 0; d <= fuzzy->k; d++)
|
||||
fuzzy->RI[d] = (1 << d) - 1;
|
||||
|
||||
fuzzy->mask_ok = (1 << (m - 1));
|
||||
fuzzy->r_size = sizeof(Uint) * (fuzzy->k + 1);
|
||||
p_len = m;
|
||||
|
||||
if (p_len > (int) sizeof(Uint)*8)
|
||||
p_len = (int) sizeof(Uint)*8;
|
||||
|
||||
/* If k is zero then no filter is needed! */
|
||||
if (fuzzy->k && (p_len >= 2*(fuzzy->k + 1)) )
|
||||
{
|
||||
if (UseFilter)
|
||||
{
|
||||
fuzzy->FilterSet = 1;
|
||||
memset(fuzzy->FilterMap, 0 , sizeof(fuzzy->FilterMap) );
|
||||
fuzzy->FilterS = (Uint *)calloc(m + 1, sizeof(Uint));
|
||||
|
||||
/* Not let's fill the interleaved pattern */
|
||||
dd = p_len / (fuzzy->k + 1);
|
||||
p_len = dd * (fuzzy->k + 1);
|
||||
|
||||
for (i = 0, cnt = 0; i < dd; i++)
|
||||
for (j = 0; j < fuzzy->k + 1; j++, cnt++)
|
||||
PatFilter[cnt] = (unsigned char)p[j*dd + i];
|
||||
PatFilter[p_len] = 0;
|
||||
|
||||
for (i = 0, cnt = 0; i < p_len; i++)
|
||||
{
|
||||
l = fuzzy->FilterMap[(unsigned char)PatFilter[i]];
|
||||
if (!l)
|
||||
{
|
||||
l = fuzzy->FilterMap[(unsigned char)PatFilter[i]] = ++cnt;
|
||||
fuzzy->FilterS[l] = 0;
|
||||
}
|
||||
fuzzy->FilterS[l] |= 1 << i;
|
||||
}
|
||||
fuzzy->filter_ok = 0;
|
||||
for (i = p_len - fuzzy->k - 1; i <= p_len - 1; i++) /* k+1 times */
|
||||
fuzzy->filter_ok |= 1 << i;
|
||||
|
||||
/* k+1 first bits set to 1 */
|
||||
fuzzy->filter_shift = (1 << (fuzzy->k + 2)) - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
FUNCTION afuzzy_free()
|
||||
Cleaning up after previous afuzzy_init() call.
|
||||
|
||||
ARGUMENTS:
|
||||
fuzzy pointer to the afuzzy parameters structure
|
||||
|
||||
RETURN VALUE:
|
||||
none
|
||||
******************************************************************************/
|
||||
void afuzzy_free(AFUZZY *fuzzy)
|
||||
{
|
||||
if (fuzzy->S)
|
||||
{
|
||||
free(fuzzy->S);
|
||||
fuzzy->S = NULL;
|
||||
}
|
||||
if (fuzzy->R)
|
||||
{
|
||||
free(fuzzy->R);
|
||||
fuzzy->R = NULL;
|
||||
}
|
||||
if (fuzzy->R1)
|
||||
{
|
||||
free(fuzzy->R1);
|
||||
fuzzy->R1 = NULL;
|
||||
}
|
||||
if (fuzzy->RP)
|
||||
{
|
||||
free(fuzzy->RP);
|
||||
fuzzy->RP = NULL;
|
||||
}
|
||||
if (fuzzy->RI)
|
||||
{
|
||||
free(fuzzy->RI);
|
||||
fuzzy->RI = NULL;
|
||||
}
|
||||
if (fuzzy->FilterS)
|
||||
{
|
||||
free(fuzzy->FilterS);
|
||||
fuzzy->FilterS = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
FUNCTION afuzzy_CheckSUB()
|
||||
Perform a fuzzy pattern substring matching. afuzzy_init() should be
|
||||
called previously to initialize the pattern and error length.
|
||||
Positive result means that some part of the string given matches the
|
||||
pattern with no more than afuzzy->k errors (1 error = 1 letter
|
||||
replacement or transposition)
|
||||
|
||||
ARGUMENTS:
|
||||
t the string to test
|
||||
fuzzy pointer to the afuzzy parameters structure
|
||||
|
||||
RETURN VALUE:
|
||||
0 - no match
|
||||
> 0 - strings match
|
||||
|
||||
ALGORITHM
|
||||
????????????????
|
||||
******************************************************************************/
|
||||
int afuzzy_checkSUB(const char *t, AFUZZY *fuzzy)
|
||||
{
|
||||
register char c;
|
||||
register int j, d;
|
||||
|
||||
/* For eficciency this case should be little bit optimized */
|
||||
if (!fuzzy->k)
|
||||
{
|
||||
Uint R = 0, R1;
|
||||
|
||||
for (j = 0; (c = t[j]) != '\0'; j++)
|
||||
{
|
||||
R1 = ( ((R<<1) | 1) & fuzzy->S[fuzzy->Map[(unsigned char)c]]);
|
||||
R = R1;
|
||||
|
||||
if (R1 & fuzzy->mask_ok)
|
||||
return 1;
|
||||
} /* end for (register int j = 0 ... */
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (fuzzy->FilterSet && !afuzzy_checkFLT(t, fuzzy))
|
||||
return 0;
|
||||
|
||||
memcpy(fuzzy->R, fuzzy->RI, fuzzy->r_size); /* R = RI */
|
||||
|
||||
for (j = 0; (c = t[j]); j++)
|
||||
{
|
||||
for (d = 0; d <= fuzzy->k; d++)
|
||||
{
|
||||
fuzzy->R1[d] = (((fuzzy->R[d]<<1) | 1) &
|
||||
fuzzy->S[fuzzy->Map[(unsigned char)c]]);
|
||||
if (d > 0)
|
||||
fuzzy->R1[d] |= ((fuzzy->R[d-1] | fuzzy->R1[d-1])<<1) | 1 |
|
||||
fuzzy->R[d-1];
|
||||
}
|
||||
if (fuzzy->R1[fuzzy->k] & fuzzy->mask_ok)
|
||||
return j;
|
||||
|
||||
memcpy(fuzzy->R, fuzzy->R1, fuzzy->r_size);
|
||||
|
||||
} /* end for (register int j = 0 ... */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int afuzzy_checkFLT(const char *t, AFUZZY *fuzzy)
|
||||
{
|
||||
register Uint FilterR = 0;
|
||||
register Uint FilterR1;
|
||||
register int j;
|
||||
|
||||
for (j = 0; t[j] != '\0'; j++)
|
||||
{
|
||||
FilterR1 = ( ((FilterR<<(fuzzy->k+1)) | fuzzy->filter_shift) &
|
||||
fuzzy->FilterS[fuzzy->FilterMap[(unsigned char)t[j]]]);
|
||||
if (FilterR1 & fuzzy->filter_ok)
|
||||
return 1;
|
||||
FilterR = FilterR1;
|
||||
} /* end for (register int j = 0 ... */
|
||||
|
||||
return 0;
|
||||
}
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
#include <algorithm>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <vdr/osd.h>
|
||||
#include <vdr/plugin.h>
|
||||
#include <vdr/skins.h>
|
||||
#include "services/epgsearch.h"
|
||||
|
||||
#include "tools.h"
|
||||
|
||||
cPlugin *GetScraperPlugin(void) {
|
||||
static cPlugin *pScraper = cPluginManager::GetPlugin("scraper2vdr");
|
||||
if( !pScraper ) // if it doesn't exit, try tvscraper
|
||||
pScraper = cPluginManager::GetPlugin("tvscraper");
|
||||
return pScraper;
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
* CUTTEXT
|
||||
****************************************************************************************/
|
||||
std::string CutText(std::string text, int width, const cFont *font) {
|
||||
if (width <= font->Size())
|
||||
return text.c_str();
|
||||
if (font->Width(text.c_str()) < width)
|
||||
return text.c_str();
|
||||
cTextWrapper twText;
|
||||
twText.Set(text.c_str(), font, width);
|
||||
std::string cuttedTextNative = twText.GetLine(0);
|
||||
std::stringstream sstrText;
|
||||
sstrText << cuttedTextNative << "...";
|
||||
std::string cuttedText = sstrText.str();
|
||||
int actWidth = font->Width(cuttedText.c_str());
|
||||
if (actWidth > width) {
|
||||
int overlap = actWidth - width;
|
||||
int charWidth = font->Width(".");
|
||||
if (charWidth == 0)
|
||||
charWidth = 1;
|
||||
int cutChars = overlap / charWidth;
|
||||
if (cutChars > 0) {
|
||||
cuttedTextNative = cuttedTextNative.substr(0, cuttedTextNative.length() - cutChars);
|
||||
std::stringstream sstrText2;
|
||||
sstrText2 << cuttedTextNative << "...";
|
||||
cuttedText = sstrText2.str();
|
||||
}
|
||||
}
|
||||
return cuttedText;
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
* StrToLowerCase
|
||||
****************************************************************************************/
|
||||
std::string StrToLowerCase(std::string str) {
|
||||
std::string lowerCase = str;
|
||||
const int length = lowerCase.length();
|
||||
for(int i=0; i < length; ++i) {
|
||||
lowerCase[i] = std::tolower(lowerCase[i]);
|
||||
}
|
||||
return lowerCase;
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
* GetDirectoryFromTimer
|
||||
****************************************************************************************/
|
||||
std::string GetDirectoryFromTimer(std::string file) {
|
||||
std::string dir = "";
|
||||
size_t found = file.find_last_of('~');
|
||||
if (found != std::string::npos) {
|
||||
dir = file.substr(0, found);
|
||||
}
|
||||
return dir;
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
* GetDirectoryFromTimer
|
||||
****************************************************************************************/
|
||||
void ReadRecordingDirectories(std::vector<std::string> *folders, cList<cNestedItem> *rootFolders, cString path) {
|
||||
cPlugin *epgSearchPlugin = NULL;
|
||||
epgSearchPlugin = cPluginManager::GetPlugin("epgsearch");
|
||||
if (epgSearchPlugin) {
|
||||
Epgsearch_services_v1_0 *epgSearch = new Epgsearch_services_v1_0;
|
||||
if (epgSearchPlugin->Service("Epgsearch-services-v1.0", epgSearch)) {
|
||||
std::set<std::string> epgSearchDirs = epgSearch->handler->DirectoryList();
|
||||
std::set<std::string>::iterator it;
|
||||
for (it = epgSearchDirs.begin(); it != epgSearchDirs.end(); it++) {
|
||||
std::string newFolder = *it;
|
||||
std::replace(newFolder.begin(), newFolder.end(), '/', '~');
|
||||
folders->push_back(newFolder);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
cList<cNestedItem> *foldersLevel = NULL;
|
||||
if (rootFolders) {
|
||||
foldersLevel = rootFolders;
|
||||
} else {
|
||||
foldersLevel = &Folders;
|
||||
}
|
||||
for (cNestedItem *folder = foldersLevel->First(); folder; folder = foldersLevel->Next(folder)) {
|
||||
std::string strFolder = *cString::sprintf("%s%s", *path, folder->Text());
|
||||
std::replace(strFolder.begin(), strFolder.end(), '/', '~');
|
||||
folders->push_back(strFolder);
|
||||
cList<cNestedItem> *subItems = folder->SubItems();
|
||||
if (subItems) {
|
||||
std::string strFolder2 = *cString::sprintf("%s%s", *path, folder->Text());
|
||||
std::replace(strFolder2.begin(), strFolder2.end(), '/', '~');
|
||||
ReadRecordingDirectories(folders, subItems, strFolder2.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************************
|
||||
* DrawRoundedCorners
|
||||
****************************************************************************************/
|
||||
void DrawRoundedCorners(cPixmap *p, int posX, int posY, int width, int height, int radius, int borderWidth, tColor borderColor) {
|
||||
if( height > 2*radius) {
|
||||
p->DrawEllipse(cRect(posX, posY, radius, radius), borderColor, -2);
|
||||
p->DrawEllipse(cRect(posX - borderWidth, posY - borderWidth, radius, radius), clrTransparent, -2);
|
||||
|
||||
p->DrawEllipse(cRect(posX+width - radius, posY, radius, radius), borderColor, -1);
|
||||
p->DrawEllipse(cRect(posX+width - radius + borderWidth, posY - borderWidth, radius, radius), clrTransparent, -1);
|
||||
|
||||
p->DrawEllipse(cRect(posX, posY + height - radius, radius, radius), borderColor, -3);
|
||||
p->DrawEllipse(cRect(posX - borderWidth, posY + height - radius + borderWidth, radius, radius), clrTransparent, -3);
|
||||
|
||||
p->DrawEllipse(cRect(posX + width - radius, posY + height - radius, radius, radius), borderColor, -4);
|
||||
p->DrawEllipse(cRect(posX + width - radius + borderWidth, posY + height - radius + borderWidth, radius, radius), clrTransparent, -4);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************************
|
||||
* SPLTSTRING
|
||||
****************************************************************************************/
|
||||
// split: receives a char delimiter; returns a vector of strings
|
||||
// By default ignores repeated delimiters, unless argument rep == 1.
|
||||
std::vector<std::string>& splitstring::split(char delim, int rep) {
|
||||
if (!flds.empty()) flds.clear(); // empty vector if necessary
|
||||
std::string work = data();
|
||||
std::string buf = "";
|
||||
int i = 0;
|
||||
while (i < (int)work.length()) {
|
||||
if (work[i] != delim)
|
||||
buf += work[i];
|
||||
else if (rep == 1) {
|
||||
flds.push_back(buf);
|
||||
buf = "";
|
||||
} else if (buf.length() > 0) {
|
||||
flds.push_back(buf);
|
||||
buf = "";
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (!buf.empty())
|
||||
flds.push_back(buf);
|
||||
return flds;
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
* FINDIGNORECASE
|
||||
****************************************************************************************/
|
||||
int FindIgnoreCase(const std::string& expr, const std::string& query)
|
||||
{
|
||||
const char *p = expr.c_str();
|
||||
const char *r = strcasestr(p, query.c_str());
|
||||
|
||||
if (!r)
|
||||
return -1;
|
||||
return r - p;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************************
|
||||
* GetAuxValue
|
||||
****************************************************************************************/
|
||||
char* GetAuxValue(const char* aux, const char* name) {
|
||||
if (isempty(aux))
|
||||
return NULL;
|
||||
|
||||
char* descr = strdup(aux);
|
||||
char* beginaux = strstr(descr, "<epgsearch>");
|
||||
char* endaux = strstr(descr, "</epgsearch>");
|
||||
if (!beginaux || !endaux) {
|
||||
free(descr);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
beginaux += 11; // strlen("<epgsearch>");
|
||||
endaux[0] = 0;
|
||||
memmove(descr, beginaux, endaux - beginaux + 1);
|
||||
|
||||
if (strcmp(name, "epgsearch") == 0)
|
||||
return descr; // full aux
|
||||
|
||||
int namelen = strlen(name);
|
||||
char catname[100] = "";
|
||||
catname[0] = '<';
|
||||
memcpy(catname + 1, name, namelen);
|
||||
catname[1 + namelen] = '>';
|
||||
catname[2 + namelen] = 0;
|
||||
|
||||
char* cat = strcasestr(descr, catname);
|
||||
if (!cat) {
|
||||
free(descr);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cat += namelen + 2;
|
||||
char* end = strstr(cat, "</");
|
||||
if (!end) {
|
||||
free(descr);
|
||||
return NULL;
|
||||
}
|
||||
end[0] = 0;
|
||||
|
||||
int catlen = end - cat + 1;
|
||||
char* value = (char *) malloc(catlen);
|
||||
memcpy(value, cat, catlen);
|
||||
|
||||
free(descr);
|
||||
return value;
|
||||
}
|
||||
|
||||
char* GetAuxValue(const cRecording *recording, const char* name) {
|
||||
if (!recording || !recording->Info())
|
||||
return NULL;
|
||||
return GetAuxValue(recording->Info()->Aux(), name);
|
||||
}
|
||||
|
||||
char* GetAuxValue(const cTimer *timer, const char* name) {
|
||||
if (!timer || !timer->Aux())
|
||||
return NULL;
|
||||
return GetAuxValue(timer->Aux(), name);
|
||||
}
|
||||
|
||||
/****************************************************************************************
|
||||
* FUZZYSEARCH
|
||||
****************************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
FUNCTION afuzzy_init()
|
||||
Initialization of the fuzzy search routine. This applies to the consequent
|
||||
calls of the afuzzy_CheckRTR (whole string matching) and afuzzy_CheckSUB
|
||||
(substring match) routines. afuzzy_init() should be called for each
|
||||
new pattern or error length. The search is case sensitive
|
||||
|
||||
ARGUMENTS:
|
||||
p Pattern
|
||||
kerr Number of possible errors. Shouldn't exceed pattern length
|
||||
UseFilter Use agrep filter algorithm that speeds up search.
|
||||
fuzzy pointer to the structure that will be later passes to Check*
|
||||
(the first 6 elements should be NULLs for the first call)
|
||||
|
||||
RETURN VALUE:
|
||||
none
|
||||
|
||||
ALGORITHM
|
||||
see. the article on agrep algorithms.
|
||||
The only change is accounting transpositions as one edit operation .
|
||||
******************************************************************************/
|
||||
void afuzzy_init(const char *p, int kerr, int UseFilter, AFUZZY *fuzzy)
|
||||
{
|
||||
int cnt, p_len, i, j, l, d, m, dd;
|
||||
char PatFilter[sizeof(Uint)*8 + 1];
|
||||
|
||||
fuzzy->k = kerr;
|
||||
m = strlen(p);
|
||||
fuzzy->FilterSet = 0;
|
||||
memset(fuzzy->Map, 0 , sizeof(fuzzy->Map) );
|
||||
|
||||
if (fuzzy->S)
|
||||
free(fuzzy->S);
|
||||
if (fuzzy->R)
|
||||
free(fuzzy->R);
|
||||
if (fuzzy->R1)
|
||||
free(fuzzy->R1);
|
||||
if (fuzzy->RP)
|
||||
free(fuzzy->RP);
|
||||
if (fuzzy->RI)
|
||||
free(fuzzy->RI);
|
||||
if (fuzzy->FilterS)
|
||||
free(fuzzy->FilterS);
|
||||
|
||||
fuzzy->FilterS = NULL;
|
||||
fuzzy->S = (Uint *)calloc(m + 1, sizeof(Uint));
|
||||
fuzzy->R = (Uint *)calloc(fuzzy->k + 1, sizeof(Uint));
|
||||
fuzzy->R1 = (Uint *)calloc(fuzzy->k + 1, sizeof(Uint));
|
||||
fuzzy->RI = (Uint *)calloc(fuzzy->k + 1, sizeof(Uint));
|
||||
fuzzy->RP = (Uint *)calloc(fuzzy->k + 1, sizeof(Uint));
|
||||
|
||||
for (i = 0, cnt = 0; i < m; i++)
|
||||
{
|
||||
l = fuzzy->Map[(unsigned char)p[i]];
|
||||
if (!l)
|
||||
{
|
||||
l = fuzzy->Map[(unsigned char)p[i]] = ++cnt;
|
||||
fuzzy->S[l] = 0;
|
||||
}
|
||||
fuzzy->S[l] |= 1 << i;
|
||||
}
|
||||
|
||||
|
||||
for (d = 0; d <= fuzzy->k; d++)
|
||||
fuzzy->RI[d] = (1 << d) - 1;
|
||||
|
||||
fuzzy->mask_ok = (1 << (m - 1));
|
||||
fuzzy->r_size = sizeof(Uint) * (fuzzy->k + 1);
|
||||
p_len = m;
|
||||
|
||||
if (p_len > (int) sizeof(Uint)*8)
|
||||
p_len = (int) sizeof(Uint)*8;
|
||||
|
||||
/* If k is zero then no filter is needed! */
|
||||
if (fuzzy->k && (p_len >= 2*(fuzzy->k + 1)) )
|
||||
{
|
||||
if (UseFilter)
|
||||
{
|
||||
fuzzy->FilterSet = 1;
|
||||
memset(fuzzy->FilterMap, 0 , sizeof(fuzzy->FilterMap) );
|
||||
fuzzy->FilterS = (Uint *)calloc(m + 1, sizeof(Uint));
|
||||
|
||||
/* Not let's fill the interleaved pattern */
|
||||
dd = p_len / (fuzzy->k + 1);
|
||||
p_len = dd * (fuzzy->k + 1);
|
||||
|
||||
for (i = 0, cnt = 0; i < dd; i++)
|
||||
for (j = 0; j < fuzzy->k + 1; j++, cnt++)
|
||||
PatFilter[cnt] = (unsigned char)p[j*dd + i];
|
||||
PatFilter[p_len] = 0;
|
||||
|
||||
for (i = 0, cnt = 0; i < p_len; i++)
|
||||
{
|
||||
l = fuzzy->FilterMap[(unsigned char)PatFilter[i]];
|
||||
if (!l)
|
||||
{
|
||||
l = fuzzy->FilterMap[(unsigned char)PatFilter[i]] = ++cnt;
|
||||
fuzzy->FilterS[l] = 0;
|
||||
}
|
||||
fuzzy->FilterS[l] |= 1 << i;
|
||||
}
|
||||
fuzzy->filter_ok = 0;
|
||||
for (i = p_len - fuzzy->k - 1; i <= p_len - 1; i++) /* k+1 times */
|
||||
fuzzy->filter_ok |= 1 << i;
|
||||
|
||||
/* k+1 first bits set to 1 */
|
||||
fuzzy->filter_shift = (1 << (fuzzy->k + 2)) - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
FUNCTION afuzzy_free()
|
||||
Cleaning up after previous afuzzy_init() call.
|
||||
|
||||
ARGUMENTS:
|
||||
fuzzy pointer to the afuzzy parameters structure
|
||||
|
||||
RETURN VALUE:
|
||||
none
|
||||
******************************************************************************/
|
||||
void afuzzy_free(AFUZZY *fuzzy)
|
||||
{
|
||||
if (fuzzy->S)
|
||||
{
|
||||
free(fuzzy->S);
|
||||
fuzzy->S = NULL;
|
||||
}
|
||||
if (fuzzy->R)
|
||||
{
|
||||
free(fuzzy->R);
|
||||
fuzzy->R = NULL;
|
||||
}
|
||||
if (fuzzy->R1)
|
||||
{
|
||||
free(fuzzy->R1);
|
||||
fuzzy->R1 = NULL;
|
||||
}
|
||||
if (fuzzy->RP)
|
||||
{
|
||||
free(fuzzy->RP);
|
||||
fuzzy->RP = NULL;
|
||||
}
|
||||
if (fuzzy->RI)
|
||||
{
|
||||
free(fuzzy->RI);
|
||||
fuzzy->RI = NULL;
|
||||
}
|
||||
if (fuzzy->FilterS)
|
||||
{
|
||||
free(fuzzy->FilterS);
|
||||
fuzzy->FilterS = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
FUNCTION afuzzy_CheckSUB()
|
||||
Perform a fuzzy pattern substring matching. afuzzy_init() should be
|
||||
called previously to initialize the pattern and error length.
|
||||
Positive result means that some part of the string given matches the
|
||||
pattern with no more than afuzzy->k errors (1 error = 1 letter
|
||||
replacement or transposition)
|
||||
|
||||
ARGUMENTS:
|
||||
t the string to test
|
||||
fuzzy pointer to the afuzzy parameters structure
|
||||
|
||||
RETURN VALUE:
|
||||
0 - no match
|
||||
> 0 - strings match
|
||||
|
||||
ALGORITHM
|
||||
????????????????
|
||||
******************************************************************************/
|
||||
int afuzzy_checkSUB(const char *t, AFUZZY *fuzzy)
|
||||
{
|
||||
register char c;
|
||||
register int j, d;
|
||||
|
||||
/* For eficciency this case should be little bit optimized */
|
||||
if (!fuzzy->k)
|
||||
{
|
||||
Uint R = 0, R1;
|
||||
|
||||
for (j = 0; (c = t[j]) != '\0'; j++)
|
||||
{
|
||||
R1 = ( ((R<<1) | 1) & fuzzy->S[fuzzy->Map[(unsigned char)c]]);
|
||||
R = R1;
|
||||
|
||||
if (R1 & fuzzy->mask_ok)
|
||||
return 1;
|
||||
} /* end for (register int j = 0 ... */
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (fuzzy->FilterSet && !afuzzy_checkFLT(t, fuzzy))
|
||||
return 0;
|
||||
|
||||
memcpy(fuzzy->R, fuzzy->RI, fuzzy->r_size); /* R = RI */
|
||||
|
||||
for (j = 0; (c = t[j]); j++)
|
||||
{
|
||||
for (d = 0; d <= fuzzy->k; d++)
|
||||
{
|
||||
fuzzy->R1[d] = (((fuzzy->R[d]<<1) | 1) &
|
||||
fuzzy->S[fuzzy->Map[(unsigned char)c]]);
|
||||
if (d > 0)
|
||||
fuzzy->R1[d] |= ((fuzzy->R[d-1] | fuzzy->R1[d-1])<<1) | 1 |
|
||||
fuzzy->R[d-1];
|
||||
}
|
||||
if (fuzzy->R1[fuzzy->k] & fuzzy->mask_ok)
|
||||
return j;
|
||||
|
||||
memcpy(fuzzy->R, fuzzy->R1, fuzzy->r_size);
|
||||
|
||||
} /* end for (register int j = 0 ... */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int afuzzy_checkFLT(const char *t, AFUZZY *fuzzy)
|
||||
{
|
||||
register Uint FilterR = 0;
|
||||
register Uint FilterR1;
|
||||
register int j;
|
||||
|
||||
for (j = 0; t[j] != '\0'; j++)
|
||||
{
|
||||
FilterR1 = ( ((FilterR<<(fuzzy->k+1)) | fuzzy->filter_shift) &
|
||||
fuzzy->FilterS[fuzzy->FilterMap[(unsigned char)t[j]]]);
|
||||
if (FilterR1 & fuzzy->filter_ok)
|
||||
return 1;
|
||||
FilterR = FilterR1;
|
||||
} /* end for (register int j = 0 ... */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
139
tools.h
139
tools.h
@@ -1,68 +1,71 @@
|
||||
#ifndef __TVGUIDETOOLS_H
|
||||
#define __TVGUIDETOOLS_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <vdr/font.h>
|
||||
#include <vdr/recording.h>
|
||||
|
||||
std::string CutText(std::string text, int width, const cFont *font);
|
||||
std::string StrToLowerCase(std::string str);
|
||||
std::string GetDirectoryFromTimer(std::string file);
|
||||
void ReadRecordingDirectories(std::vector<std::string> *folders, cList<cNestedItem> *rootFolders, cString path);
|
||||
void DrawRoundedCorners(cPixmap *p, int posX, int posY, int width, int height, int radius, int borderWidth, tColor borderColor);
|
||||
|
||||
class splitstring : public std::string {
|
||||
std::vector<std::string> flds;
|
||||
public:
|
||||
splitstring(const char *s) : std::string(s) { };
|
||||
std::vector<std::string>& split(char delim, int rep=0);
|
||||
};
|
||||
|
||||
int FindIgnoreCase(const std::string& expr, const std::string& query);
|
||||
|
||||
char* GetAuxValue(const char* aux, const char* name);
|
||||
char* GetAuxValue(const cRecording *recording, const char* name);
|
||||
char* GetAuxValue(const cTimer* timer, const char* name);
|
||||
|
||||
#ifndef _AFUZZY_H
|
||||
#define _AFUZZY_H
|
||||
|
||||
// source from:
|
||||
/*
|
||||
Leonid Boitsov 2002. (itman@narod.ru)
|
||||
C version of Stas Namin.
|
||||
This code is a GPL software and is distributed under GNU
|
||||
public licence without any warranty.
|
||||
*/
|
||||
|
||||
typedef unsigned int Uint;
|
||||
|
||||
#define MaxPatSize (sizeof(Uint) * 8)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Uint *R,
|
||||
*R1,
|
||||
*RP,
|
||||
*S,
|
||||
*RI;
|
||||
Uint *FilterS;
|
||||
|
||||
int Map[256];
|
||||
int FilterMap[256];
|
||||
int k;
|
||||
Uint mask_ok;
|
||||
Uint filter_ok;
|
||||
Uint filter_shift;
|
||||
int r_size;
|
||||
int FilterSet;
|
||||
} AFUZZY;
|
||||
|
||||
void afuzzy_init(const char *p, int kerr, int UseFilter, AFUZZY *fuzzy);
|
||||
void afuzzy_free(AFUZZY *fuzzy);
|
||||
int afuzzy_checkSUB(const char *t, AFUZZY *fuzzy);
|
||||
static int afuzzy_checkFLT(const char *t, AFUZZY *fuzzy);
|
||||
#endif
|
||||
|
||||
#endif // __TVGUIDETOOLS_H
|
||||
#ifndef __TVGUIDETOOLS_H
|
||||
#define __TVGUIDETOOLS_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <vdr/font.h>
|
||||
#include <vdr/recording.h>
|
||||
#include <vdr/plugin.h>
|
||||
|
||||
cPlugin *GetScraperPlugin(void);
|
||||
|
||||
std::string CutText(std::string text, int width, const cFont *font);
|
||||
std::string StrToLowerCase(std::string str);
|
||||
std::string GetDirectoryFromTimer(std::string file);
|
||||
void ReadRecordingDirectories(std::vector<std::string> *folders, cList<cNestedItem> *rootFolders, cString path);
|
||||
void DrawRoundedCorners(cPixmap *p, int posX, int posY, int width, int height, int radius, int borderWidth, tColor borderColor);
|
||||
|
||||
class splitstring : public std::string {
|
||||
std::vector<std::string> flds;
|
||||
public:
|
||||
splitstring(const char *s) : std::string(s) { };
|
||||
std::vector<std::string>& split(char delim, int rep=0);
|
||||
};
|
||||
|
||||
int FindIgnoreCase(const std::string& expr, const std::string& query);
|
||||
|
||||
char* GetAuxValue(const char* aux, const char* name);
|
||||
char* GetAuxValue(const cRecording *recording, const char* name);
|
||||
char* GetAuxValue(const cTimer* timer, const char* name);
|
||||
|
||||
#ifndef _AFUZZY_H
|
||||
#define _AFUZZY_H
|
||||
|
||||
// source from:
|
||||
/*
|
||||
Leonid Boitsov 2002. (itman@narod.ru)
|
||||
C version of Stas Namin.
|
||||
This code is a GPL software and is distributed under GNU
|
||||
public licence without any warranty.
|
||||
*/
|
||||
|
||||
typedef unsigned int Uint;
|
||||
|
||||
#define MaxPatSize (sizeof(Uint) * 8)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Uint *R,
|
||||
*R1,
|
||||
*RP,
|
||||
*S,
|
||||
*RI;
|
||||
Uint *FilterS;
|
||||
|
||||
int Map[256];
|
||||
int FilterMap[256];
|
||||
int k;
|
||||
Uint mask_ok;
|
||||
Uint filter_ok;
|
||||
Uint filter_shift;
|
||||
int r_size;
|
||||
int FilterSet;
|
||||
} AFUZZY;
|
||||
|
||||
void afuzzy_init(const char *p, int kerr, int UseFilter, AFUZZY *fuzzy);
|
||||
void afuzzy_free(AFUZZY *fuzzy);
|
||||
int afuzzy_checkSUB(const char *t, AFUZZY *fuzzy);
|
||||
int afuzzy_checkFLT(const char *t, AFUZZY *fuzzy);
|
||||
#endif
|
||||
|
||||
#endif // __TVGUIDETOOLS_H
|
||||
|
@@ -26,8 +26,8 @@
|
||||
#error "VDR-2.0.0 API version or greater is required!"
|
||||
#endif
|
||||
|
||||
static const char *VERSION = "1.2.2";
|
||||
static const char *DESCRIPTION = "A fancy 2d EPG Viewer";
|
||||
static const char *VERSION = "1.2.6";
|
||||
static const char *DESCRIPTION = tr("A fancy 2d EPG Viewer");
|
||||
static const char *MAINMENUENTRY = "Tvguide";
|
||||
|
||||
class cPluginTvguide : public cPlugin {
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
cPluginTvguide(void);
|
||||
virtual ~cPluginTvguide();
|
||||
virtual const char *Version(void) { return VERSION; }
|
||||
virtual const char *Description(void) { return DESCRIPTION; }
|
||||
virtual const char *Description(void) { return tr(DESCRIPTION); }
|
||||
virtual const char *CommandLineHelp(void);
|
||||
virtual bool ProcessArgs(int argc, char *argv[]);
|
||||
virtual bool Initialize(void);
|
||||
|
83
tvguideosd.c
83
tvguideosd.c
@@ -73,11 +73,22 @@ void cTvGuideOsd::Show(void) {
|
||||
|
||||
void cTvGuideOsd::drawOsd() {
|
||||
cPixmap::Lock();
|
||||
cChannel *startChannel = Channels.GetByNumber(cDevice::CurrentChannel());
|
||||
int numBack = tvguideConfig.numGrids / 2;
|
||||
int offset = 0;
|
||||
const cChannel *newStartChannel = startChannel;
|
||||
const cChannel *newStartChannel;
|
||||
#if VDRVERSNUM >= 20301
|
||||
{
|
||||
LOCK_CHANNELS_READ;
|
||||
const cChannel *startChannel = Channels->GetByNumber(cDevice::CurrentChannel());
|
||||
#else
|
||||
cChannel *startChannel = Channels.GetByNumber(cDevice::CurrentChannel());
|
||||
#endif
|
||||
newStartChannel = startChannel;
|
||||
#if VDRVERSNUM >= 20301
|
||||
for (; newStartChannel ; newStartChannel = Channels->Prev(newStartChannel)) {
|
||||
#else
|
||||
for (; newStartChannel ; newStartChannel = Channels.Prev(newStartChannel)) {
|
||||
#endif
|
||||
if (newStartChannel && !newStartChannel->GroupSep()) {
|
||||
offset++;
|
||||
}
|
||||
@@ -85,7 +96,12 @@ void cTvGuideOsd::drawOsd() {
|
||||
break;
|
||||
}
|
||||
if (!newStartChannel)
|
||||
#if VDRVERSNUM >= 20301
|
||||
newStartChannel = Channels->First();
|
||||
} //LOCK_CHANNELS_READ
|
||||
#else
|
||||
newStartChannel = Channels.First();
|
||||
#endif
|
||||
offset--;
|
||||
if (offset < 0)
|
||||
offset = 0;
|
||||
@@ -122,7 +138,16 @@ void cTvGuideOsd::readChannels(const cChannel *channelStart) {
|
||||
columns.Clear();
|
||||
if (!channelStart)
|
||||
return;
|
||||
for (const cChannel *channel = channelStart; channel; channel = Channels.Next(channel)) {
|
||||
#if VDRVERSNUM >= 20301
|
||||
const cChannels *channels;
|
||||
{
|
||||
LOCK_CHANNELS_READ;
|
||||
channels = Channels;
|
||||
}
|
||||
#else
|
||||
cChannels *channels = &Channels;
|
||||
#endif
|
||||
for (const cChannel *channel = channelStart; channel; channel = channels->Next(channel)) {
|
||||
if (!channel->GroupSep()) {
|
||||
if (channelGroups->IsInLastGroup(channel)) {
|
||||
break;
|
||||
@@ -144,7 +169,7 @@ void cTvGuideOsd::readChannels(const cChannel *channelStart) {
|
||||
int numCurrent = columns.Count();
|
||||
int numBack = tvguideConfig.numGrids - numCurrent;
|
||||
int newChannelNumber = columns.First()->getChannel()->Number() - numBack;
|
||||
const cChannel *newStart = Channels.GetByNumber(newChannelNumber);
|
||||
const cChannel *newStart = channels->GetByNumber(newChannelNumber);
|
||||
readChannels(newStart);
|
||||
}
|
||||
}
|
||||
@@ -213,7 +238,13 @@ void cTvGuideOsd::channelForward() {
|
||||
bool colAdded = false;
|
||||
if (!colRight) {
|
||||
const cChannel *channelRight = activeGrid->column->getChannel();
|
||||
#if VDRVERSNUM >= 20301
|
||||
{
|
||||
LOCK_CHANNELS_READ;
|
||||
while (channelRight = Channels->Next(channelRight)) {
|
||||
#else
|
||||
while (channelRight = Channels.Next(channelRight)) {
|
||||
#endif
|
||||
if (!channelRight->GroupSep()) {
|
||||
if (channelGroups->IsInLastGroup(channelRight)) {
|
||||
break;
|
||||
@@ -227,6 +258,9 @@ void cTvGuideOsd::channelForward() {
|
||||
}
|
||||
}
|
||||
}
|
||||
#if VDRVERSNUM >= 20301
|
||||
} //LOCK_CHANNELS_READ
|
||||
#endif
|
||||
if (colRight) {
|
||||
colAdded = true;
|
||||
if (columns.Count() == tvguideConfig.numGrids) {
|
||||
@@ -263,7 +297,13 @@ void cTvGuideOsd::channelBack() {
|
||||
bool colAdded = false;
|
||||
if (!colLeft) {
|
||||
const cChannel *channelLeft = activeGrid->column->getChannel();
|
||||
#if VDRVERSNUM >= 20301
|
||||
{
|
||||
LOCK_CHANNELS_READ;
|
||||
while (channelLeft = Channels->Prev(channelLeft)) {
|
||||
#else
|
||||
while (channelLeft = Channels.Prev(channelLeft)) {
|
||||
#endif
|
||||
if (!channelLeft->GroupSep()) {
|
||||
colLeft = new cChannelColumn(0, channelLeft, myTime);
|
||||
if (colLeft->readGrids()) {
|
||||
@@ -274,6 +314,9 @@ void cTvGuideOsd::channelBack() {
|
||||
}
|
||||
}
|
||||
}
|
||||
#if VDRVERSNUM >= 20301
|
||||
} //LOCK_CHANNELS_READ
|
||||
#endif
|
||||
if (colLeft) {
|
||||
colAdded = true;
|
||||
if (columns.Count() == tvguideConfig.numGrids) {
|
||||
@@ -434,11 +477,21 @@ void cTvGuideOsd::processKeyGreen() {
|
||||
if (tvguideConfig.channelJumpMode == eGroupJump) {
|
||||
int prevNum = channelGroups->GetPrevGroupChannelNumber(currentChannel);
|
||||
if (prevNum) {
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
prev = Channels->GetByNumber(prevNum);
|
||||
#else
|
||||
prev = Channels.GetByNumber(prevNum);
|
||||
#endif
|
||||
}
|
||||
} else if (tvguideConfig.channelJumpMode == eNumJump) {
|
||||
int i = tvguideConfig.jumpChannels + 1;
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
for (const cChannel *channel = firstChannel; channel; channel = Channels->Prev(channel)) {
|
||||
#else
|
||||
for (const cChannel *channel = firstChannel; channel; channel = Channels.Prev(channel)) {
|
||||
#endif
|
||||
if (!channel->GroupSep()) {
|
||||
prev = channel;
|
||||
i--;
|
||||
@@ -470,11 +523,21 @@ void cTvGuideOsd::processKeyYellow() {
|
||||
if (tvguideConfig.channelJumpMode == eGroupJump) {
|
||||
int nextNum = channelGroups->GetNextGroupChannelNumber(currentChannel);
|
||||
if (nextNum) {
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
next = Channels->GetByNumber(nextNum);
|
||||
#else
|
||||
next = Channels.GetByNumber(nextNum);
|
||||
#endif
|
||||
}
|
||||
} else if (tvguideConfig.channelJumpMode == eNumJump) {
|
||||
int i=0;
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_CHANNELS_READ;
|
||||
for (const cChannel *channel = firstChannel; channel; channel = Channels->Next(channel)) {
|
||||
#else
|
||||
for (const cChannel *channel = firstChannel; channel; channel = Channels.Next(channel)) {
|
||||
#endif
|
||||
if (channelGroups->IsInLastGroup(channel)) {
|
||||
break;
|
||||
}
|
||||
@@ -625,7 +688,15 @@ void cTvGuideOsd::CheckTimeout(void) {
|
||||
int newChannelNum = channelJumper->GetChannel();
|
||||
delete channelJumper;
|
||||
channelJumper = NULL;
|
||||
const cChannel *newChannel = Channels.GetByNumber(newChannelNum);
|
||||
const cChannel *newChannel;
|
||||
#if VDRVERSNUM >= 20301
|
||||
{
|
||||
LOCK_CHANNELS_READ;
|
||||
newChannel = Channels->GetByNumber(newChannelNum);
|
||||
}
|
||||
#else
|
||||
newChannel = Channels.GetByNumber(newChannelNum);
|
||||
#endif
|
||||
if (newChannel) {
|
||||
readChannels(newChannel);
|
||||
if (columns.Count() > 0) {
|
||||
@@ -710,7 +781,7 @@ eOSState cTvGuideOsd::ProcessKey(eKeys Key) {
|
||||
void cTvGuideOsd::dump() {
|
||||
esyslog("tvguide: ------Dumping Content---------");
|
||||
activeGrid->debug();
|
||||
int i=1;
|
||||
// int i=1;
|
||||
for (cChannelColumn *col = columns.First(); col; col = columns.Next(col)) {
|
||||
col->dumpGrids();
|
||||
}
|
||||
|
60
view.c
60
view.c
@@ -1,4 +1,5 @@
|
||||
#include "detailview.h"
|
||||
#include "switchtimer.h"
|
||||
|
||||
/********************************************************************************************
|
||||
* cView
|
||||
@@ -106,7 +107,8 @@ void cView::DrawHeader(void) {
|
||||
cImageLoader imgLoader;
|
||||
if (imgLoader.LoadLogo(channel, logoWidth, logoHeight)) {
|
||||
cImage logo = imgLoader.GetImage();
|
||||
pixmapHeaderLogo->DrawImage(cPoint(border/2, (headerHeight - logoHeight)/2), logo);
|
||||
const int logoheight = logo.Height();
|
||||
pixmapHeaderLogo->DrawImage(cPoint(border / 2, ((headerHeight - logoHeight) / 2 + (logoHeight - logoheight) / 2)), logo);
|
||||
xText += logoWidth + border / 2;
|
||||
}
|
||||
}
|
||||
@@ -119,10 +121,10 @@ void cView::DrawHeader(void) {
|
||||
pixmapHeader->DrawText(cPoint(xText, yTitle), CutText(title, textWidthMax, fontHeaderLarge).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeaderLarge);
|
||||
pixmapHeader->DrawText(cPoint(xText, ySubtitle), CutText(subTitle, textWidthMax, fontHeader).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeader);
|
||||
//REC Icon
|
||||
eTimerMatch timerMatch=tmNone;
|
||||
cTimer *ti;
|
||||
eTimerMatch timerMatch = tmNone;
|
||||
if (!event)
|
||||
return;
|
||||
const cTimer *ti;
|
||||
if (tvguideConfig.useRemoteTimers && pRemoteTimers) {
|
||||
RemoteTimers_GetMatch_v1_0 rtMatch;
|
||||
rtMatch.event = event;
|
||||
@@ -130,16 +132,30 @@ void cView::DrawHeader(void) {
|
||||
timerMatch = (eTimerMatch)rtMatch.timerMatch;
|
||||
ti = rtMatch.timer;
|
||||
} else {
|
||||
ti=Timers.GetMatch(event, &timerMatch);
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_READ;
|
||||
ti = Timers->GetMatch(event, &timerMatch);
|
||||
#else
|
||||
ti = Timers.GetMatch(event, &timerMatch);
|
||||
#endif
|
||||
}
|
||||
if (timerMatch == tmFull) {
|
||||
cString recIconText(" REC ");
|
||||
int widthIcon = fontManager.FontDetailHeader->Width(*recIconText);
|
||||
int height = fontManager.FontDetailHeader->Height()+10;
|
||||
int posX = headerWidth - widthIcon - 20;
|
||||
int posY = 20;
|
||||
pixmapHeader->DrawRectangle( cRect(posX, posY, widthIcon, height), theme.Color(clrButtonRed));
|
||||
pixmapHeader->DrawText(cPoint(posX, posY+5), *recIconText, theme.Color(clrFont), theme.Color(clrButtonRed), fontManager.FontDetailHeader);
|
||||
bool hasSwitchTimer = SwitchTimers.EventInSwitchList(event);
|
||||
if (hasSwitchTimer || (ti && timerMatch == tmFull)) {
|
||||
tColor iconColor;
|
||||
bool switchOnly = false;
|
||||
bool timerActive = ti && ti->HasFlags(tfActive);
|
||||
cString recIconText;
|
||||
#ifdef SWITCHONLYPATCH
|
||||
switchOnly = ti && ti->HasFlags(tfSwitchOnly);
|
||||
#endif
|
||||
(hasSwitchTimer || switchOnly) ? recIconText = "Switch" : recIconText = " REC ";
|
||||
iconColor = (hasSwitchTimer || switchOnly) ? theme.Color(clrButtonYellow) : timerActive ? theme.Color(clrButtonRed) : theme.Color(clrButtonGreen);
|
||||
int widthIcon = fontManager.FontDetailHeader->Width(*recIconText) + 10;
|
||||
int height = fontManager.FontDetailHeader->Height() + 10;
|
||||
int posX = headerWidth - widthIcon - 25;
|
||||
int posY = ySubtitle - 5;
|
||||
pixmapHeader->DrawRectangle( cRect(posX, posY, widthIcon, height), iconColor);
|
||||
pixmapHeader->DrawText(cPoint(posX + 5, posY + 5), *recIconText, theme.Color(clrFont), iconColor, fontManager.FontDetailHeader);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -273,7 +289,7 @@ void cView::CreateFloatingTextWrapper(cTextWrapper *twNarrow, cTextWrapper *twFu
|
||||
std::stringstream sstrTextTall;
|
||||
std::stringstream sstrTextFull;
|
||||
|
||||
for (int i=0; i<flds.size(); i++) {
|
||||
for (int i = 0; i < (int)flds.size(); i++) {
|
||||
if (!flds[i].size()) {
|
||||
//empty line
|
||||
linesDrawn++;
|
||||
@@ -347,7 +363,7 @@ void cView::DrawActors(std::vector<cActor> *actors) {
|
||||
int y = 2 * border + fontHeaderLarge->Height();
|
||||
if (!Running())
|
||||
return;
|
||||
cImageLoader imgLoader;
|
||||
cImageLoader imgLoader;
|
||||
int actor = 0;
|
||||
for (int row = 0; row < picLines; row++) {
|
||||
for (int col = 0; col < picsPerLine; col++) {
|
||||
@@ -465,7 +481,7 @@ bool cView::KeyUp(void) {
|
||||
if (!scrollable)
|
||||
return false;
|
||||
int aktHeight = pixmapContent->DrawPort().Point().Y();
|
||||
int lineHeight = font->Height();
|
||||
// int lineHeight = font->Height();
|
||||
if (aktHeight >= 0) {
|
||||
return false;
|
||||
}
|
||||
@@ -631,12 +647,12 @@ cSeriesView::~cSeriesView(void) {
|
||||
}
|
||||
|
||||
void cSeriesView::LoadMedia(void) {
|
||||
static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr");
|
||||
if (!pScraper2Vdr || seriesId < 1)
|
||||
static cPlugin *pScraper = GetScraperPlugin();
|
||||
if (!pScraper || seriesId < 1)
|
||||
return;
|
||||
series.seriesId = seriesId;
|
||||
series.episodeId = episodeId;
|
||||
pScraper2Vdr->Service("GetSeries", &series);
|
||||
pScraper->Service("GetSeries", &series);
|
||||
}
|
||||
|
||||
void cSeriesView::SetTabs(void) {
|
||||
@@ -853,11 +869,11 @@ cMovieView::~cMovieView(void) {
|
||||
}
|
||||
|
||||
void cMovieView::LoadMedia(void) {
|
||||
static cPlugin *pScraper2Vdr = cPluginManager::GetPlugin("scraper2vdr");
|
||||
if (!pScraper2Vdr || movieId < 1)
|
||||
static cPlugin *pScraper = GetScraperPlugin();
|
||||
if (!pScraper || movieId < 1)
|
||||
return;
|
||||
movie.movieId = movieId;
|
||||
pScraper2Vdr->Service("GetMovie", &movie);
|
||||
pScraper->Service("GetMovie", &movie);
|
||||
}
|
||||
|
||||
void cMovieView::SetTabs(void) {
|
||||
@@ -1043,4 +1059,4 @@ void cMovieView::Action(void) {
|
||||
}
|
||||
DrawScrollbar();
|
||||
osdManager.flush();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user