- epgplus: formatting code using astyle; some manual code nicenings

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2021-12-14 11:11:26 +01:00
committed by Thilo Graf
parent 359463a1fa
commit 2b6ffbe947
2 changed files with 244 additions and 241 deletions

View File

@@ -70,10 +70,10 @@ int EpgPlus::channelsTableWidth = 0;
int EpgPlus::entryFontSize = 0; int EpgPlus::entryFontSize = 0;
int EpgPlus::channelNumberOffset = 0; int EpgPlus::channelNumberOffset = 0;
/* negative size means "screen width in percent" */ // negative size means "screen width in percent"
static EpgPlus::SizeSetting sizeSettingTable[] = static EpgPlus::SizeSetting sizeSettingTable[] =
{ {
{ EpgPlus::EPGPlus_channelentry_width, -15 }, /* 15 percent of screen width */ { EpgPlus::EPGPlus_channelentry_width, -15 },
{ EpgPlus::EPGPlus_separationline_thickness, 1 } { EpgPlus::EPGPlus_separationline_thickness, 1 }
}; };
@@ -247,7 +247,7 @@ void EpgPlus::TimeLine::paintMark(time_t _startTime, int pduration, int px, int
// paint new mark // paint new mark
CProgressBar pbbar = CProgressBar(px, this->y + this->font->getHeight(), pwidth, this->font->getHeight()); CProgressBar pbbar = CProgressBar(px, this->y + this->font->getHeight(), pwidth, this->font->getHeight());
pbbar.setActiveColor(COL_MENUCONTENTSELECTED_PLUS_0); //pbbar.setActiveColor(COL_MENUCONTENTSELECTED_PLUS_0);
pbbar.setType(CProgressBar::PB_TIMESCALE); pbbar.setType(CProgressBar::PB_TIMESCALE);
time_t currentTime; time_t currentTime;
@@ -375,7 +375,8 @@ void EpgPlus::ChannelEventEntry::paint(bool pisSelected, bool toggleColor)
if (pisSelected) if (pisSelected)
{ {
if (this->channelEvent.description.empty()) if (this->channelEvent.description.empty())
{ // dummy channel event {
// dummy channel event
this->timeLine->clearMark(); this->timeLine->clearMark();
} }
else else
@@ -593,7 +594,7 @@ int EpgPlus::Footer::getUsedHeight()
void EpgPlus::Footer::paintEventDetails(const std::string &description, const std::string &info1) void EpgPlus::Footer::paintEventDetails(const std::string &description, const std::string &info1)
{ {
int yPos = this->y; int yPos = this->y;
int frame_thickness = 2; int frame_thickness = 1;
// clear the whole footer // clear the whole footer
this->frameBuffer->paintBoxRel(this->x + OFFSET_SHADOW, yPos + OFFSET_SHADOW, this->width, this->getUsedHeight(), COL_SHADOW_PLUS_0, RADIUS_LARGE); this->frameBuffer->paintBoxRel(this->x + OFFSET_SHADOW, yPos + OFFSET_SHADOW, this->width, this->getUsedHeight(), COL_SHADOW_PLUS_0, RADIUS_LARGE);
@@ -697,7 +698,8 @@ void EpgPlus::createChannelEntries(int selectedChannelEntryIndex)
//if (0x2bc000b004b7ULL == (channel->getChannelID() & 0xFFFFFFFFFFFFULL)) printf("*** Check1 event %s event start %ld this start %ld\n", It->description.c_str(), It->startTime, (this->startTime + this->duration)); //if (0x2bc000b004b7ULL == (channel->getChannelID() & 0xFFFFFFFFFFFFULL)) printf("*** Check1 event %s event start %ld this start %ld\n", It->description.c_str(), It->startTime, (this->startTime + this->duration));
if (!(It->startTime < (this->startTime + this->duration))) if (!(It->startTime < (this->startTime + this->duration)))
continue; continue;
if ((lastIt == channelEventList.end()) || (lastIt->startTime != It->startTime)) { if ((lastIt == channelEventList.end()) || (lastIt->startTime != It->startTime))
{
int startTimeDiff = It->startTime - this->startTime; int startTimeDiff = It->startTime - this->startTime;
int endTimeDiff = this->startTime + time_t (this->duration) - It->startTime - time_t (It->duration); int endTimeDiff = this->startTime + time_t (this->duration) - It->startTime - time_t (It->duration);
//if (0x2bc000b004b7ULL == (channel->getChannelID() & 0xFFFFFFFFFFFFULL)) printf("*** Check event %s\n", It->description.c_str()); //if (0x2bc000b004b7ULL == (channel->getChannelID() & 0xFFFFFFFFFFFFULL)) printf("*** Check event %s\n", It->description.c_str());
@@ -1408,7 +1410,8 @@ void EpgPlus::hide()
this->header->head = NULL; this->header->head = NULL;
} }
if (this->selectedChannelEntry && this->selectedChannelEntry->detailsLine) { if (this->selectedChannelEntry && this->selectedChannelEntry->detailsLine)
{
this->selectedChannelEntry->detailsLine->kill(); this->selectedChannelEntry->detailsLine->kill();
delete this->selectedChannelEntry->detailsLine; delete this->selectedChannelEntry->detailsLine;
this->selectedChannelEntry->detailsLine = NULL; this->selectedChannelEntry->detailsLine = NULL;

View File

@@ -37,7 +37,7 @@ struct button_label;
class EpgPlus class EpgPlus
{ {
//// types, inner classes // types, inner classes
public: public:
enum SizeSettingID enum SizeSettingID
{ {
@@ -70,7 +70,8 @@ class EpgPlus
{ {
private: private:
CComponentsChannelLogo *logo; CComponentsChannelLogo *logo;
//// construction / destruction
// construction / destruction
public: public:
Header(CFrameBuffer *frameBuffer, Header(CFrameBuffer *frameBuffer,
int x, int x,
@@ -79,7 +80,7 @@ class EpgPlus
~Header(); ~Header();
//// methods // methods
public: public:
static void init(); static void init();
@@ -89,7 +90,7 @@ class EpgPlus
static int getUsedHeight(); static int getUsedHeight();
//// attributes // attributes
public: public:
CFrameBuffer *frameBuffer; CFrameBuffer *frameBuffer;
@@ -101,10 +102,9 @@ class EpgPlus
CComponentsHeader *head; CComponentsHeader *head;
}; };
class TimeLine class TimeLine
{ {
//// construction / destruction // construction / destruction
public: public:
TimeLine(CFrameBuffer *frameBuffer, TimeLine(CFrameBuffer *frameBuffer,
int x, int x,
@@ -115,7 +115,7 @@ class EpgPlus
~TimeLine(); ~TimeLine();
//// methods // methods
public: public:
static void init(); static void init();
@@ -129,7 +129,7 @@ class EpgPlus
static int getUsedHeight(); static int getUsedHeight();
//// attributes // attributes
public: public:
CFrameBuffer *frameBuffer; CFrameBuffer *frameBuffer;
@@ -148,7 +148,7 @@ class EpgPlus
class ChannelEventEntry class ChannelEventEntry
{ {
//// construction / destruction // construction / destruction
public: public:
ChannelEventEntry(const CChannelEvent *channelEvent, ChannelEventEntry(const CChannelEvent *channelEvent,
CFrameBuffer *frameBuffer, CFrameBuffer *frameBuffer,
@@ -160,7 +160,7 @@ class EpgPlus
~ChannelEventEntry(); ~ChannelEventEntry();
//// methods // methods
public: public:
static void init(); static void init();
@@ -170,7 +170,7 @@ class EpgPlus
static int getUsedHeight(); static int getUsedHeight();
//// attributes // attributes
public: public:
CChannelEvent channelEvent; CChannelEvent channelEvent;
@@ -190,7 +190,7 @@ class EpgPlus
class ChannelEntry class ChannelEntry
{ {
//// construction / destruction // construction / destruction
public: public:
ChannelEntry(const CZapitChannel *channel, ChannelEntry(const CZapitChannel *channel,
int index, int index,
@@ -204,7 +204,7 @@ class EpgPlus
~ChannelEntry(); ~ChannelEntry();
//// methods // methods
public: public:
static void init(); static void init();
@@ -212,7 +212,7 @@ class EpgPlus
static int getUsedHeight(); static int getUsedHeight();
//// attributes // attributes
public: public:
const CZapitChannel *channel; const CZapitChannel *channel;
std::string displayNumber; std::string displayNumber;
@@ -239,7 +239,7 @@ class EpgPlus
class Footer class Footer
{ {
//// construction / destruction // construction / destruction
public: public:
Footer(CFrameBuffer *frameBuffer, Footer(CFrameBuffer *frameBuffer,
int x, int x,
@@ -249,7 +249,7 @@ class EpgPlus
~Footer(); ~Footer();
//// methods // methods
public: public:
static void init(); static void init();
@@ -261,7 +261,7 @@ class EpgPlus
static int getUsedHeight(); static int getUsedHeight();
//// attributes // attributes
public: public:
CFrameBuffer *frameBuffer; CFrameBuffer *frameBuffer;
@@ -385,12 +385,12 @@ class EpgPlus
friend class EpgPlus::MenuOptionChooserSwitchSwapMode; friend class EpgPlus::MenuOptionChooserSwitchSwapMode;
friend class EpgPlus::MenuOptionChooserSwitchViewMode; friend class EpgPlus::MenuOptionChooserSwitchViewMode;
//// construction / destruction // construction / destruction
public: public:
EpgPlus(); EpgPlus();
~EpgPlus(); ~EpgPlus();
//// methods // methods
public: public:
void init(); void init();
void free(); void free();
@@ -407,7 +407,7 @@ class EpgPlus
void paintChannelEntry(int position); void paintChannelEntry(int position);
void hide(); void hide();
//// properties // properties
private: private:
CFrameBuffer *frameBuffer; CFrameBuffer *frameBuffer;