File: epgsearchcfg.c

package info (click to toggle)
vdr-plugin-epgsearch 1.0.1~beta3-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,764 kB
  • ctags: 2,316
  • sloc: ansic: 23,300; perl: 1,330; sh: 608; makefile: 193
file content (139 lines) | stat: -rw-r--r-- 3,905 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/*                                                                  -*- c++ -*-
Copyright (C) 2004-2013 Christian Wieninger

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html

The author can be reached at cwieninger@gmx.de

The project's page is at http://winni.vdr-developer.org/epgsearch
*/

#include "epgsearchcfg.h"
#include "epgsearchtools.h"

cEPGSearchConfig EPGSearchConfig;

cEPGSearchConfig::cEPGSearchConfig(void)
{
  hidemenu          = 0;
  redkeymode	    = 0;
  bluekeymode       = 1;
  showProgress      = 1;
  showChannelNr     = 0;
  useSearchTimers   = 0;
  UpdateIntervall   = 30;
#if APIVERSNUM >= 10715
  SVDRPPort         = 6419;
#else
  SVDRPPort         = 2001;
#endif
  timeShiftValue    = 30;
  toggleGreenYellow = 1;
  StartMenu         = 0;
  DefPriority       = Setup.DefaultPriority;
  DefLifetime       = Setup.DefaultLifetime;
  DefMarginStart    = Setup.MarginStart;
  DefMarginStop     = Setup.MarginStop;
  checkTimerConflictsAfterUpdate = 0;
  checkMinPriority = 0;
  checkMinDuration = 0;
  checkMaxDays = 14;
  ignorePayTV     = 0;
  useExternalSVDRP = 0;
  ignorePrimary = 0;
  strcpy(defrecdir,"");
  useVDRTimerEditMenu = 0;
  showChannelGroups = 0;
  showDaySeparators = 0;
  showEmptyChannels = 0;
  DefSearchTemplateID = -1;
  addSubtitleToTimer = addSubtitleSmart;
  strcpy(mainmenuentry, "");
  WarEagle = 0;
  showRadioChannels = 1;
  onePressTimerCreation = 1;
  conflictCheckIntervall = 30;
  conflictCheckWithinLimit = 60;
  conflictCheckIntervall2 = 15;
  checkTimerConflAfterTimerProg = 0;
  checkTimerConflOnRecording = 0;
  showFavoritesMenu = 0;
  FavoritesMenuTimespan = 24;
  useOkForSwitch = 0;
  strcpy(MailAddress, "");
  strcpy(MailAddressTo, "");
  strcpy(MailServer, "");
  MailUseAuth = 0;
  strcpy(MailAuthUser, "");
  strcpy(MailAuthPass, "");
  strcpy(LastMailConflicts, "");
  mailViaScript = 1;
  manualTimerCheckDefault = 0;
  noAnnounceWhileReplay = 0;
  TimerProgRepeat = 0;
  maxChannelMenuNow = 0;
  noConflMsgWhileReplay = 0;
  sendMailOnSearchtimerHours = 0;
  lastMailOnSearchtimerAt = 0;
  checkEPGHours = 6;
  checkEPGWarnByOSD = 1;
  checkEPGWarnByMail = 0;
  checkEPGchannelGroupNr = -1;
  strcpy(conflCheckCmd, "");
  ReplaceOrgSchedule = 0;
  sendMailOnSearchtimers = 0;
  sendMailOnConflicts = 0;
}

int cShowMode::Compare(const cListObject &ListObject) const
{
    cShowMode *p = (cShowMode *)&ListObject;
    if (EPGSearchConfig.showFavoritesMenu == 1)
    {
	if (mode == showFavorites)
	{
	    if (p->mode <= showNext) return 1;
	    else return -1;
	}
	if (p->mode == showFavorites)
	{
	    if (mode <= showNext) return -1;
	    else return 1;
	}
    }
    if (EPGSearchConfig.showFavoritesMenu == 2)
    {
	if (mode == showFavorites && p->mode != showFavorites) return 1;
	if (p->mode == showFavorites && mode != showFavorites) return -1;
    }
    if (EPGSearchConfig.showFavoritesMenu == 3)
    {
	if (mode == showFavorites)
	{
	    if (p->mode < showNext) return 1;
	    else return -1;
	}
	if (p->mode == showFavorites)
	{
	    if (mode < showNext) return -1;
	    else return 1;
	}
    }
    if (mode > showNext && p->mode > showNext)
	return seekTime - p->seekTime;
    else
	return mode - p->mode;
}