Rename channelcolumn to channelepg

This commit is contained in:
kamel5 2019-07-11 12:06:18 +02:00
parent 81759f95cb
commit 3ed46bd881
10 changed files with 59 additions and 59 deletions

View File

@ -1,7 +1,7 @@
#include "channelcolumn.h" #include "channelepg.h"
#include "dummygrid.h" #include "dummygrid.h"
cChannelColumn::cChannelColumn(int num, const cChannel *channel, cMyTime *myTime) { cChannelEpg::cChannelEpg(int num, const cChannel *channel, cMyTime *myTime) {
this->channel = channel; this->channel = channel;
this->num = num; this->num = num;
this->myTime = myTime; this->myTime = myTime;
@ -15,7 +15,7 @@ cChannelColumn::cChannelColumn(int num, const cChannel *channel, cMyTime *myTime
header = NULL; header = NULL;
} }
cChannelColumn::~cChannelColumn(void) { cChannelEpg::~cChannelEpg(void) {
if (header) if (header)
delete header; delete header;
grids.Clear(); grids.Clear();
@ -24,21 +24,21 @@ cChannelColumn::~cChannelColumn(void) {
#endif #endif
} }
void cChannelColumn::clearGrids() { void cChannelEpg::clearGrids() {
grids.Clear(); grids.Clear();
} }
void cChannelColumn::createHeader() { void cChannelEpg::createHeader() {
header = new cHeaderGrid(); header = new cHeaderGrid();
header->createBackground(num); header->createBackground(num);
header->drawChannel(channel); header->drawChannel(channel);
} }
void cChannelColumn::drawHeader() { void cChannelEpg::drawHeader() {
header->setPosition(num); header->setPosition(num);
} }
bool cChannelColumn::readGrids() { bool cChannelEpg::readGrids() {
#if VDRVERSNUM >= 20301 #if VDRVERSNUM >= 20301
const cSchedules* schedules; const cSchedules* schedules;
{ {
@ -114,7 +114,7 @@ bool cChannelColumn::readGrids() {
return false; return false;
} }
void cChannelColumn::drawGrids() { void cChannelEpg::drawGrids() {
for (cGrid *grid = grids.First(); grid; grid = grids.Next(grid)) { for (cGrid *grid = grids.First(); grid; grid = grids.Next(grid)) {
grid->SetViewportHeight(); grid->SetViewportHeight();
grid->PositionPixmap(); grid->PositionPixmap();
@ -122,15 +122,15 @@ void cChannelColumn::drawGrids() {
} }
} }
int cChannelColumn::getX() { int cChannelEpg::getX() {
return geoManager.timeLineWidth + num*geoManager.colWidth; return geoManager.timeLineWidth + num*geoManager.colWidth;
} }
int cChannelColumn::getY() { int cChannelEpg::getY() {
return geoManager.statusHeaderHeight + geoManager.timeLineHeight + num*geoManager.rowHeight; return geoManager.statusHeaderHeight + geoManager.timeLineHeight + num*geoManager.rowHeight;
} }
cGrid * cChannelColumn::getActive() { cGrid * cChannelEpg::getActive() {
cMyTime t; cMyTime t;
t.Now(); t.Now();
for (cGrid *grid = grids.First(); grid; grid = grids.Next(grid)) { for (cGrid *grid = grids.First(); grid; grid = grids.Next(grid)) {
@ -140,7 +140,7 @@ cGrid * cChannelColumn::getActive() {
return grids.First(); return grids.First();
} }
cGrid * cChannelColumn::getNext(cGrid *activeGrid) { cGrid * cChannelEpg::getNext(cGrid *activeGrid) {
if (activeGrid == NULL) if (activeGrid == NULL)
return NULL; return NULL;
cGrid *next = grids.Next(activeGrid); cGrid *next = grids.Next(activeGrid);
@ -149,7 +149,7 @@ cGrid * cChannelColumn::getNext(cGrid *activeGrid) {
return NULL; return NULL;
} }
cGrid * cChannelColumn::getPrev(cGrid *activeGrid) { cGrid * cChannelEpg::getPrev(cGrid *activeGrid) {
if (activeGrid == NULL) if (activeGrid == NULL)
return NULL; return NULL;
cGrid *prev = grids.Prev(activeGrid); cGrid *prev = grids.Prev(activeGrid);
@ -158,7 +158,7 @@ cGrid * cChannelColumn::getPrev(cGrid *activeGrid) {
return NULL; return NULL;
} }
cGrid * cChannelColumn::getNeighbor(cGrid *activeGrid) { cGrid * cChannelEpg::getNeighbor(cGrid *activeGrid) {
if (!activeGrid) if (!activeGrid)
return NULL; return NULL;
cGrid *neighbor = NULL; cGrid *neighbor = NULL;
@ -184,13 +184,13 @@ cGrid * cChannelColumn::getNeighbor(cGrid *activeGrid) {
return neighbor; return neighbor;
} }
bool cChannelColumn::isFirst(cGrid *grid) { bool cChannelEpg::isFirst(cGrid *grid) {
if (grid == grids.First()) if (grid == grids.First())
return true; return true;
return false; return false;
} }
void cChannelColumn::AddNewGridsAtStart() { void cChannelEpg::AddNewGridsAtStart() {
cGrid *firstGrid = NULL; cGrid *firstGrid = NULL;
firstGrid = grids.First(); firstGrid = grids.First();
if (firstGrid == NULL) if (firstGrid == NULL)
@ -246,7 +246,7 @@ void cChannelColumn::AddNewGridsAtStart() {
} }
} }
void cChannelColumn::AddNewGridsAtEnd() { void cChannelEpg::AddNewGridsAtEnd() {
cGrid *lastGrid = NULL; cGrid *lastGrid = NULL;
lastGrid = grids.Last(); lastGrid = grids.Last();
if (lastGrid == NULL) if (lastGrid == NULL)
@ -301,7 +301,7 @@ void cChannelColumn::AddNewGridsAtEnd() {
} }
} }
void cChannelColumn::ClearOutdatedStart() { void cChannelEpg::ClearOutdatedStart() {
cGrid *firstGrid = NULL; cGrid *firstGrid = NULL;
while (true) { while (true) {
firstGrid = grids.First(); firstGrid = grids.First();
@ -325,7 +325,7 @@ void cChannelColumn::ClearOutdatedStart() {
} }
} }
void cChannelColumn::ClearOutdatedEnd() { void cChannelEpg::ClearOutdatedEnd() {
cGrid *lastGrid = NULL; cGrid *lastGrid = NULL;
while (true) { while (true) {
lastGrid = grids.Last(); lastGrid = grids.Last();
@ -349,7 +349,7 @@ void cChannelColumn::ClearOutdatedEnd() {
} }
} }
cGrid *cChannelColumn::addEpgGrid(const cEvent *event, cGrid *firstGrid, bool color) { cGrid *cChannelEpg::addEpgGrid(const cEvent *event, cGrid *firstGrid, bool color) {
cGrid *grid = new cEpgGrid(this, event); cGrid *grid = new cEpgGrid(this, event);
grid->setText(); grid->setText();
grid->SetColor(color); grid->SetColor(color);
@ -360,7 +360,7 @@ cGrid *cChannelColumn::addEpgGrid(const cEvent *event, cGrid *firstGrid, bool co
return grid; return grid;
} }
cGrid *cChannelColumn::addDummyGrid(time_t start, time_t end, cGrid *firstGrid, bool color) { cGrid *cChannelEpg::addDummyGrid(time_t start, time_t end, cGrid *firstGrid, bool color) {
cGrid *dummy = new cDummyGrid(this, start, end); cGrid *dummy = new cDummyGrid(this, start, end);
dummy->setText(); dummy->setText();
dummy->SetColor(color); dummy->SetColor(color);
@ -371,7 +371,7 @@ cGrid *cChannelColumn::addDummyGrid(time_t start, time_t end, cGrid *firstGrid,
return dummy; return dummy;
} }
void cChannelColumn::SetTimers() { void cChannelEpg::SetTimers() {
#if VDRVERSNUM < 20301 #if VDRVERSNUM < 20301
hasTimer = channel->HasTimer(); hasTimer = channel->HasTimer();
#endif #endif
@ -389,7 +389,7 @@ void cChannelColumn::SetTimers() {
} }
} }
void cChannelColumn::dumpGrids() { void cChannelEpg::dumpGrids() {
esyslog("tvguide: ------Channel %s %d: %d entires ---------", channel->Name(), num, grids.Count()); esyslog("tvguide: ------Channel %s %d: %d entires ---------", channel->Name(), num, grids.Count());
int i=1; int i=1;
for (cGrid *grid = grids.First(); grid; grid = grids.Next(grid)) { for (cGrid *grid = grids.First(); grid; grid = grids.Next(grid)) {

View File

@ -1,5 +1,5 @@
#ifndef __TVGUIDE_CHANNELCOLUMN_H #ifndef __TVGUIDE_CHANNELEPG_H
#define __TVGUIDE_CHANNELCOLUMN_H #define __TVGUIDE_CHANNELEPG_H
#include <vdr/tools.h> #include <vdr/tools.h>
#include "grid.h" #include "grid.h"
@ -11,9 +11,9 @@ class cGrid;
class cEpgGrid; class cEpgGrid;
class cHeaderGrid; class cHeaderGrid;
// --- cChannelColumn ------------------------------------------------------------- // --- cChannelEpg -------------------------------------------------------------
class cChannelColumn : public cListObject, public cStyledPixmap { class cChannelEpg : public cListObject, public cStyledPixmap {
private: private:
cMyTime *myTime; cMyTime *myTime;
int num; int num;
@ -30,8 +30,8 @@ private:
cGrid *addEpgGrid(const cEvent *event, cGrid *firstGrid, bool color); cGrid *addEpgGrid(const cEvent *event, cGrid *firstGrid, bool color);
cGrid *addDummyGrid(time_t start, time_t end, cGrid *firstGrid, bool color); cGrid *addDummyGrid(time_t start, time_t end, cGrid *firstGrid, bool color);
public: public:
cChannelColumn(int num, const cChannel *channel, cMyTime *myTime); cChannelEpg(int num, const cChannel *channel, cMyTime *myTime);
virtual ~cChannelColumn(void); virtual ~cChannelEpg(void);
void createHeader(); void createHeader();
void drawHeader(); void drawHeader();
bool readGrids(); bool readGrids();
@ -66,4 +66,4 @@ public:
void dumpGrids(); void dumpGrids();
}; };
#endif //__TVGUIDE_CHANNELCOLUMN_H #endif //__TVGUIDE_CHANNELEPG_H

View File

@ -1,6 +1,6 @@
#include "dummygrid.h" #include "dummygrid.h"
cDummyGrid::cDummyGrid(cChannelColumn *c, time_t start, time_t end) : cGrid(c) { cDummyGrid::cDummyGrid(cChannelEpg *c, time_t start, time_t end) : cGrid(c) {
this->start = start; this->start = start;
this->end = end; this->end = end;
strText = tr("No EPG Information available"); strText = tr("No EPG Information available");

View File

@ -2,7 +2,7 @@
#define __TVGUIDE_DUMMYGRID_H #define __TVGUIDE_DUMMYGRID_H
#include "grid.h" #include "grid.h"
#include "channelcolumn.h" #include "channelepg.h"
// --- cDummyGrid ------------------------------------------------------------- // --- cDummyGrid -------------------------------------------------------------
@ -14,7 +14,7 @@ private:
void drawText(); void drawText();
time_t Duration(void); time_t Duration(void);
public: public:
cDummyGrid(cChannelColumn *c, time_t start, time_t end); cDummyGrid(cChannelEpg *c, time_t start, time_t end);
virtual ~cDummyGrid(void); virtual ~cDummyGrid(void);
void SetViewportHeight(); void SetViewportHeight();
void PositionPixmap(); void PositionPixmap();

View File

@ -1,9 +1,9 @@
#include "services/remotetimers.h" #include "services/remotetimers.h"
#include "channelcolumn.h" #include "channelepg.h"
#include "tools.h" #include "tools.h"
#include "epggrid.h" #include "epggrid.h"
cEpgGrid::cEpgGrid(cChannelColumn *c, const cEvent *event) : cGrid(c) { cEpgGrid::cEpgGrid(cChannelEpg *c, const cEvent *event) : cGrid(c) {
this->event = event; this->event = event;
extText = new cTextWrapper(); extText = new cTextWrapper();
hasTimer = false; hasTimer = false;

View File

@ -16,7 +16,7 @@ private:
void drawIcon(cString iconText, tColor color); void drawIcon(cString iconText, tColor color);
time_t Duration(void) { return event->Duration(); }; time_t Duration(void) { return event->Duration(); };
public: public:
cEpgGrid(cChannelColumn *c, const cEvent *event); cEpgGrid(cChannelEpg *c, const cEvent *event);
virtual ~cEpgGrid(void); virtual ~cEpgGrid(void);
void SetViewportHeight(); void SetViewportHeight();
void PositionPixmap(); void PositionPixmap();

4
grid.c
View File

@ -1,7 +1,7 @@
#include "channelcolumn.h" #include "channelepg.h"
#include "grid.h" #include "grid.h"
cGrid::cGrid(cChannelColumn *c) { cGrid::cGrid(cChannelEpg *c) {
this->column = c; this->column = c;
text = new cTextWrapper(); text = new cTextWrapper();
dirty = true; dirty = true;

6
grid.h
View File

@ -4,7 +4,7 @@
#include <vdr/tools.h> #include <vdr/tools.h>
#include "styledpixmap.h" #include "styledpixmap.h"
class cChannelColumn; class cChannelEpg;
// --- cEpgGrid ------------------------------------------------------------- // --- cEpgGrid -------------------------------------------------------------
@ -24,9 +24,9 @@ protected:
virtual void drawText(void) {}; virtual void drawText(void) {};
bool dummy; bool dummy;
public: public:
cGrid(cChannelColumn *c); cGrid(cChannelEpg *c);
virtual ~cGrid(void); virtual ~cGrid(void);
cChannelColumn *column; cChannelEpg *column;
virtual void SetViewportHeight(void) {}; virtual void SetViewportHeight(void) {};
virtual void PositionPixmap(void) {}; virtual void PositionPixmap(void) {};
virtual void setText(void) {}; virtual void setText(void) {};

View File

@ -152,7 +152,7 @@ void cTvGuideOsd::readChannels(const cChannel *channelStart) {
if (channelGroups->IsInLastGroup(channel)) { if (channelGroups->IsInLastGroup(channel)) {
break; break;
} }
cChannelColumn *column = new cChannelColumn(i, channel, myTime); cChannelEpg *column = new cChannelEpg(i, channel, myTime);
if (column->readGrids()) { if (column->readGrids()) {
columns.Add(column); columns.Add(column);
i++; i++;
@ -189,7 +189,7 @@ void cTvGuideOsd::drawGridsChannelJump(int offset) {
if (config.displayChannelGroups) { if (config.displayChannelGroups) {
channelGroups->DrawChannelGroups(columns.First()->getChannel(), columns.Last()->getChannel()); channelGroups->DrawChannelGroups(columns.First()->getChannel(), columns.Last()->getChannel());
} }
for (cChannelColumn *column = columns.First(); column; column = columns.Next(column)) { for (cChannelEpg *column = columns.First(); column; column = columns.Next(column)) {
column->createHeader(); column->createHeader();
column->drawGrids(); column->drawGrids();
} }
@ -198,13 +198,13 @@ void cTvGuideOsd::drawGridsChannelJump(int offset) {
void cTvGuideOsd::drawGridsTimeJump() { void cTvGuideOsd::drawGridsTimeJump() {
if (columns.Count() == 0) if (columns.Count() == 0)
return; return;
cChannelColumn *colActive = NULL; cChannelEpg *colActive = NULL;
if (activeGrid) { if (activeGrid) {
colActive = activeGrid->column; colActive = activeGrid->column;
} else { } else {
colActive = columns.First(); colActive = columns.First();
} }
for (cChannelColumn *column = columns.First(); column; column = columns.Next(column)) { for (cChannelEpg *column = columns.First(); column; column = columns.Next(column)) {
column->clearGrids(); column->clearGrids();
column->readGrids(); column->readGrids();
column->drawGrids(); column->drawGrids();
@ -234,7 +234,7 @@ void cTvGuideOsd::setNextActiveGrid(cGrid *next) {
} }
void cTvGuideOsd::channelForward() { void cTvGuideOsd::channelForward() {
cChannelColumn *colRight = columns.Next(activeGrid->column); cChannelEpg *colRight = columns.Next(activeGrid->column);
bool colAdded = false; bool colAdded = false;
if (!colRight) { if (!colRight) {
const cChannel *channelRight = activeGrid->column->getChannel(); const cChannel *channelRight = activeGrid->column->getChannel();
@ -252,7 +252,7 @@ void cTvGuideOsd::channelForward() {
if (channelGroups->IsInLastGroup(channelRight)) { if (channelGroups->IsInLastGroup(channelRight)) {
break; break;
} }
colRight = new cChannelColumn(config.numGrids - 1, channelRight, myTime); colRight = new cChannelEpg(config.numGrids - 1, channelRight, myTime);
if (colRight->readGrids()) { if (colRight->readGrids()) {
break; break;
} else { } else {
@ -264,10 +264,10 @@ void cTvGuideOsd::channelForward() {
if (colRight) { if (colRight) {
colAdded = true; colAdded = true;
if (columns.Count() == config.numGrids) { if (columns.Count() == config.numGrids) {
cChannelColumn *cFirst = columns.First(); cChannelEpg *cFirst = columns.First();
columns.Del(cFirst); columns.Del(cFirst);
} }
for (cChannelColumn *column = columns.First(); column; column = columns.Next(column)) { for (cChannelEpg *column = columns.First(); column; column = columns.Next(column)) {
column->SetNum(column->GetNum() - 1); column->SetNum(column->GetNum() - 1);
column->drawHeader(); column->drawHeader();
column->drawGrids(); column->drawGrids();
@ -293,7 +293,7 @@ void cTvGuideOsd::channelForward() {
} }
void cTvGuideOsd::channelBack() { void cTvGuideOsd::channelBack() {
cChannelColumn *colLeft = columns.Prev(activeGrid->column); cChannelEpg *colLeft = columns.Prev(activeGrid->column);
bool colAdded = false; bool colAdded = false;
if (!colLeft) { if (!colLeft) {
const cChannel *channelLeft = activeGrid->column->getChannel(); const cChannel *channelLeft = activeGrid->column->getChannel();
@ -308,7 +308,7 @@ void cTvGuideOsd::channelBack() {
#endif #endif
while (channelLeft = channels->Prev(channelLeft)) { while (channelLeft = channels->Prev(channelLeft)) {
if (!channelLeft->GroupSep()) { if (!channelLeft->GroupSep()) {
colLeft = new cChannelColumn(0, channelLeft, myTime); colLeft = new cChannelEpg(0, channelLeft, myTime);
if (colLeft->readGrids()) { if (colLeft->readGrids()) {
break; break;
} else { } else {
@ -320,10 +320,10 @@ void cTvGuideOsd::channelBack() {
if (colLeft) { if (colLeft) {
colAdded = true; colAdded = true;
if (columns.Count() == config.numGrids) { if (columns.Count() == config.numGrids) {
cChannelColumn *cLast = columns.Last(); cChannelEpg *cLast = columns.Last();
columns.Del(cLast); columns.Del(cLast);
} }
for (cChannelColumn *column = columns.First(); column; column = columns.Next(column)) { for (cChannelEpg *column = columns.First(); column; column = columns.Next(column)) {
column->SetNum(column->GetNum() + 1); column->SetNum(column->GetNum() + 1);
column->drawHeader(); column->drawHeader();
column->drawGrids(); column->drawGrids();
@ -375,7 +375,7 @@ void cTvGuideOsd::ScrollForward() {
timeLine->drawDateViewer(); timeLine->drawDateViewer();
timeLine->drawClock(); timeLine->drawClock();
timeLine->setTimeline(); timeLine->setTimeline();
for (cChannelColumn *column = columns.First(); column; column = columns.Next(column)) { for (cChannelEpg *column = columns.First(); column; column = columns.Next(column)) {
column->AddNewGridsAtEnd(); column->AddNewGridsAtEnd();
column->ClearOutdatedStart(); column->ClearOutdatedStart();
column->drawGrids(); column->drawGrids();
@ -410,7 +410,7 @@ void cTvGuideOsd::ScrollBack() {
timeLine->drawDateViewer(); timeLine->drawDateViewer();
timeLine->drawClock(); timeLine->drawClock();
timeLine->setTimeline(); timeLine->setTimeline();
for (cChannelColumn *column = columns.First(); column; column = columns.Next(column)) { for (cChannelEpg *column = columns.First(); column; column = columns.Next(column)) {
column->AddNewGridsAtStart(); column->AddNewGridsAtStart();
column->ClearOutdatedEnd(); column->ClearOutdatedEnd();
column->drawGrids(); column->drawGrids();
@ -708,7 +708,7 @@ void cTvGuideOsd::CheckTimeout(void) {
} }
void cTvGuideOsd::SetTimers() { void cTvGuideOsd::SetTimers() {
for (cChannelColumn *column = columns.First(); column; column = columns.Next(column)) { for (cChannelEpg *column = columns.First(); column; column = columns.Next(column)) {
column->SetTimers(); column->SetTimers();
} }
} }
@ -782,7 +782,7 @@ void cTvGuideOsd::dump() {
esyslog("tvguide: ------Dumping Content---------"); esyslog("tvguide: ------Dumping Content---------");
activeGrid->debug(); activeGrid->debug();
// int i=1; // int i=1;
for (cChannelColumn *col = columns.First(); col; col = columns.Next(col)) { for (cChannelEpg *col = columns.First(); col; col = columns.Next(col)) {
col->dumpGrids(); col->dumpGrids();
} }
} }

View File

@ -3,7 +3,7 @@
#include "timer.h" #include "timer.h"
#include "grid.h" #include "grid.h"
#include "channelcolumn.h" #include "channelepg.h"
#include "statusheader.h" #include "statusheader.h"
#include "detailview.h" #include "detailview.h"
#include "timeline.h" #include "timeline.h"
@ -17,7 +17,7 @@
class cTvGuideOsd : public cOsdObject { class cTvGuideOsd : public cOsdObject {
private: private:
cMyTime *myTime; cMyTime *myTime;
cList<cChannelColumn> columns; cList<cChannelEpg> columns;
cGrid *activeGrid; cGrid *activeGrid;
cStatusHeader *statusHeader; cStatusHeader *statusHeader;
cDetailView *detailView; cDetailView *detailView;