Bug #2260 » zappilot-0.0.5-vdr-2.3.1-porting.diff
| a/zappilotosd.c 2015-10-22 18:39:36.000000000 +0200 | ||
|---|---|---|
|
void cZappilotOsd::DisplayChannel(const cChannel *Channel)
|
||
|
{
|
||
|
int BufSize = 255;
|
||
|
int BufSize = 1020;
|
||
|
if (Channel)
|
||
|
{
|
||
|
if (Channel->GroupSep())
|
||
| ... | ... | |
|
titleFollowingInfo = NULL;
|
||
|
subtitlePresentInfo = NULL;
|
||
|
subtitleFollowingInfo = NULL;
|
||
|
cSchedulesLock SchedulesLock;
|
||
|
const cSchedules *Schedules = cSchedules::Schedules(SchedulesLock);
|
||
|
LOCK_SCHEDULES_READ;
|
||
|
LOCK_CHANNELS_READ;
|
||
|
if (Schedules)
|
||
|
{
|
||
|
const cSchedule *Schedule = Schedules->GetSchedule(Channels.GetByNumber(PilotChannelNumber)->GetChannelID());
|
||
|
const cSchedule *Schedule = Schedules->GetSchedule(Channels->GetByNumber(PilotChannelNumber)->GetChannelID());
|
||
|
if (Schedule)
|
||
|
{
|
||
|
// Get Present event
|
||
| ... | ... | |
|
void cZappilotOsd::Show()
|
||
|
{
|
||
|
// find the actual current
|
||
|
cChannel *Channel = Channels.GetByNumber(cDevice::PrimaryDevice()->CurrentChannel());
|
||
|
currentChannel = Channels.GetByNumber(cDevice::PrimaryDevice()->CurrentChannel());
|
||
|
LOCK_CHANNELS_READ;
|
||
|
const cChannel *Channel = Channels->GetByNumber(cDevice::PrimaryDevice()->CurrentChannel());
|
||
|
currentChannel = Channel;
|
||
|
if (Channel)
|
||
|
{
|
||
|
PilotChannelNumber = Channel->Number();
|
||
| ... | ... | |
|
case k1 ... k9:
|
||
|
if (number >= 0)
|
||
|
{
|
||
|
if (number > Channels.MaxNumber())
|
||
|
LOCK_CHANNELS_READ;
|
||
|
if (number > Channels->MaxNumber())
|
||
|
number = Key - k0;
|
||
|
else
|
||
|
number = number * 10 + Key - k0;
|
||
|
if (number > 0)
|
||
|
{
|
||
|
cChannel *channel = Channels.GetByNumber(number);
|
||
|
const cChannel *channel = Channels->GetByNumber(number);
|
||
|
if (channel)
|
||
|
{
|
||
|
PilotChannelNumber = channel->Number();
|
||
| ... | ... | |
|
if (config.fastbrowse)
|
||
|
{
|
||
|
CursorDown();
|
||
|
cChannel *channel = Channels.GetByNumber(PilotChannelNumber);
|
||
|
LOCK_CHANNELS_READ;
|
||
|
const cChannel *channel = Channels->GetByNumber(PilotChannelNumber);
|
||
|
if (channel)
|
||
|
group = channel->Index()-1;
|
||
|
break;
|
||
| ... | ... | |
|
if (config.fastbrowse)
|
||
|
{
|
||
|
CursorUp();
|
||
|
cChannel *channel = Channels.GetByNumber(PilotChannelNumber);
|
||
|
LOCK_CHANNELS_READ;
|
||
|
const cChannel *channel = Channels->GetByNumber(PilotChannelNumber);
|
||
|
if (channel)
|
||
|
group = channel->Index()-1;
|
||
|
break;
|
||
| ... | ... | |
|
{
|
||
|
if (group < 0)
|
||
|
{
|
||
|
cChannel *channel = Channels.GetByNumber(PilotChannelNumber);
|
||
|
LOCK_CHANNELS_READ;
|
||
|
const cChannel *channel = Channels->GetByNumber(PilotChannelNumber);
|
||
|
if (channel)
|
||
|
group = channel->Index();
|
||
|
}
|
||
| ... | ... | |
|
int SaveGroup = group;
|
||
|
if (NORMALKEY(Key) == kRight)
|
||
|
{
|
||
|
group = Channels.GetNextGroup(group);
|
||
|
LOCK_CHANNELS_READ;
|
||
|
group = Channels->GetNextGroup(group);
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
group = Channels.GetPrevGroup(group < 1 ? 1 : group);
|
||
|
LOCK_CHANNELS_READ;
|
||
|
group = Channels->GetPrevGroup(group < 1 ? 1 : group);
|
||
|
}
|
||
|
if (group < 0)
|
||
|
group = SaveGroup;
|
||
|
cChannel *channel = Channels.Get(group);
|
||
|
LOCK_CHANNELS_READ;
|
||
|
const cChannel *channel = Channels->Get(group);
|
||
|
if (channel)
|
||
|
{
|
||
|
//DisplayChannel(channel);
|
||
| ... | ... | |
|
else
|
||
|
{
|
||
|
CursorUp();
|
||
|
cChannel *channel = Channels.GetByNumber(PilotChannelNumber);
|
||
|
LOCK_CHANNELS_READ;
|
||
|
const cChannel *channel = Channels->GetByNumber(PilotChannelNumber);
|
||
|
if (channel)
|
||
|
group = channel->Index()-1;
|
||
|
break;
|
||
| ... | ... | |
|
else
|
||
|
{
|
||
|
CursorDown();
|
||
|
cChannel *channel = Channels.GetByNumber(PilotChannelNumber);
|
||
|
LOCK_CHANNELS_READ;
|
||
|
const cChannel *channel = Channels->GetByNumber(PilotChannelNumber);
|
||
|
if (channel)
|
||
|
group = channel->Index()-1;
|
||
|
group = channel->Index()-1;
|
||
|
break;
|
||
|
}
|
||
|
case kNone:
|
||
|
if (number && (int)cTimeMs::Now() - lastTime > 1000)
|
||
|
{
|
||
|
if (Channels.GetByNumber(number))
|
||
|
LOCK_CHANNELS_READ;
|
||
|
if (Channels->GetByNumber(number))
|
||
|
{
|
||
|
PilotChannelNumber = number;
|
||
|
lastTime = cTimeMs::Now();
|
||
|
number = 0;
|
||
|
cChannel *channel = Channels.GetByNumber(PilotChannelNumber);
|
||
|
const cChannel *channel = Channels->GetByNumber(PilotChannelNumber);
|
||
|
if (channel)
|
||
|
group = channel->Index()-1;
|
||
|
}
|
||
| ... | ... | |
|
{
|
||
|
if (group < 0)
|
||
|
{
|
||
|
cChannel *channel = Channels.GetByNumber(PilotChannelNumber);
|
||
|
LOCK_CHANNELS_READ;
|
||
|
const cChannel *channel = Channels->GetByNumber(PilotChannelNumber);
|
||
|
if (channel)
|
||
|
group = channel->Index();
|
||
|
}
|
||
| ... | ... | |
|
int SaveGroup = group;
|
||
|
if (NORMALKEY(Key) == kBlue)
|
||
|
{
|
||
|
group = Channels.GetNextGroup(group);
|
||
|
LOCK_CHANNELS_READ;
|
||
|
group = Channels->GetNextGroup(group);
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
group = Channels.GetPrevGroup(group < 1 ? 1 : group);
|
||
|
LOCK_CHANNELS_READ;
|
||
|
group = Channels->GetPrevGroup(group < 1 ? 1 : group);
|
||
|
}
|
||
|
if (group < 0)
|
||
|
group = SaveGroup;
|
||
|
cChannel *channel = Channels.Get(group);
|
||
|
LOCK_CHANNELS_READ;
|
||
|
const cChannel *channel = Channels->Get(group);
|
||
|
if (channel)
|
||
|
{
|
||
|
//DisplayChannel(channel);
|
||
| ... | ... | |
|
void cZappilotOsd::CursorUp()
|
||
|
{
|
||
|
int n = PilotChannelNumber + 1;
|
||
|
cChannel *channel;
|
||
|
channel = Channels.GetByNumber(n, 1);
|
||
|
LOCK_CHANNELS_READ;
|
||
|
const cChannel *channel = Channels->GetByNumber(n, 1);
|
||
|
if (channel)
|
||
|
{
|
||
|
n = channel->Number();
|
||
| ... | ... | |
|
void cZappilotOsd::CursorDown()
|
||
|
{
|
||
|
int n = PilotChannelNumber - 1;
|
||
|
cChannel *channel;
|
||
|
channel = Channels.GetByNumber(n, -1);
|
||
|
LOCK_CHANNELS_READ;
|
||
|
const cChannel *channel = Channels->GetByNumber(n, -1);
|
||
|
if (channel)
|
||
|
{
|
||
|
n = channel->Number();
|
||
| ... | ... | |
|
void cZappilotOsd::CursorOK()
|
||
|
{
|
||
|
DrawMenu(0,2);
|
||
|
if (currentChannel != Channels.GetByNumber(PilotChannelNumber))
|
||
|
LOCK_CHANNELS_READ;
|
||
|
const cChannel* chan = Channels->GetByNumber(PilotChannelNumber);
|
||
|
if (currentChannel != chan)
|
||
|
{
|
||
|
cChannel *Channel = Channels.GetByNumber(PilotChannelNumber);
|
||
|
LOCK_CHANNELS_READ;
|
||
|
const cChannel *Channel = Channels->GetByNumber(PilotChannelNumber);
|
||
|
if (Channel)
|
||
|
{
|
||
|
cDevice::PrimaryDevice()->SwitchChannel(Channel, true);
|
||
| ... | ... | |
|
displayTimer = NULL;
|
||
|
displayChannel = Skins.Current()->DisplayChannel(true);
|
||
|
}
|
||
|
cChannel *channel = Channels.GetByNumber(PilotChannelNumber);
|
||
|
LOCK_CHANNELS_READ;
|
||
|
const cChannel *channel = Channels->GetByNumber(PilotChannelNumber);
|
||
|
if (!isempty(titlePresentInfo))
|
||
|
{
|
||
| ... | ... | |
|
displayEvent = NULL;
|
||
|
}
|
||
|
displayEvent = new cMenuEvent(Present,false,true);
|
||
|
LOCK_TIMERS_READ;
|
||
|
LOCK_CHANNELS_READ;
|
||
|
displayEvent = new cMenuEvent(Timers, Channels, Present,false,true);
|
||
|
displayEvent->Display();
|
||
|
}
|
||
|
void cZappilotOsd::DisplayTimer()
|
||
|
{
|
||
|
|
||
|
if (displayChannel)
|
||
|
{
|
||
|
delete displayChannel;
|
||
| ... | ... | |
|
displayEvent = NULL;
|
||
|
}
|
||
|
LOCK_TIMERS_WRITE;
|
||
|
cTimer *timer = new cTimer(Present);
|
||
|
cTimer *t = Timers.GetTimer(timer);
|
||
|
cTimer *t = Timers->GetMatch(Present);
|
||
|
if (t)
|
||
|
{
|
||
|
delete timer;
|
||
|
timer = t;
|
||
|
}
|
||
|
displayTimer=new cMenuEditTimer(timer, !t);
|
||
|
displayTimer->Display();
|
||
|
}
|
||
| a/zappilotosd.h 2015-10-22 18:40:02.000000000 +0200 | ||
|---|---|---|
|
int offset;
|
||
|
int lines;
|
||
|
int type;
|
||
|
cChannel* currentChannel;
|
||
|
const cChannel* currentChannel;
|
||
|
public:
|
||
|
cZappilotOsd(void);
|
||