diff options
author | louis <louis.braun@gmx.de> | 2013-01-13 13:52:30 +0100 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2013-01-13 13:52:30 +0100 |
commit | 478029d0e15955cdd13b78e039e325841e7dd6ac (patch) | |
tree | f765514488f96acbc2529008cd78c5505ddf3fde | |
parent | 8d2689ab08be6da1465506534cd4e35bf81888d2 (diff) | |
download | skin-nopacity-478029d0e15955cdd13b78e039e325841e7dd6ac.tar.gz skin-nopacity-478029d0e15955cdd13b78e039e325841e7dd6ac.tar.bz2 |
Changed channel info icons in DisplayChannel
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | displaychannel.c | 95 | ||||
-rw-r--r-- | displaychannel.h | 5 | ||||
-rw-r--r-- | icons/channelsymbols.png | bin | 0 -> 4414 bytes | |||
-rw-r--r-- | timers.c | 117 | ||||
-rw-r--r-- | timers.h | 33 |
6 files changed, 209 insertions, 43 deletions
@@ -99,3 +99,5 @@ Version 0.0.6 - Fixed showing current show as rerun in epg detail view - Added some recording information (channel, size, cutted size, format, est. bitrate) in detailed recording view +- Added channel logos in main menu timers list +- Changed channel info icons in DisplayChannel diff --git a/displaychannel.c b/displaychannel.c index 01eeee9..5245599 100644 --- a/displaychannel.c +++ b/displaychannel.c @@ -1,9 +1,5 @@ #include "symbols/audio.xpm" #include "symbols/dolbydigital.xpm" -#include "symbols/encrypted.xpm" -#include "symbols/radio.xpm" -#include "symbols/recording.xpm" -#include "symbols/teletext.xpm" #include "displaychannel.h" @@ -48,7 +44,9 @@ cNopacityDisplayChannel::~cNopacityDisplayChannel() { } if (pixmapScreenResolution) osd->DestroyPixmap(pixmapScreenResolution); + osd->DestroyPixmap(pixmapFooter); osd->DestroyPixmap(pixmapStreamInfo); + osd->DestroyPixmap(pixmapStreamInfoBack); if (config.displaySignalStrength && showSignal) { osd->DestroyPixmap(pixmapSignalStrength); osd->DestroyPixmap(pixmapSignalQuality); @@ -65,13 +63,6 @@ cNopacityDisplayChannel::~cNopacityDisplayChannel() { delete osd; } -cBitmap cNopacityDisplayChannel::bmTeletext(teletext_xpm); -cBitmap cNopacityDisplayChannel::bmRadio(radio_xpm); -cBitmap cNopacityDisplayChannel::bmAudio(audio_xpm); -cBitmap cNopacityDisplayChannel::bmDolbyDigital(dolbydigital_xpm); -cBitmap cNopacityDisplayChannel::bmEncrypted(encrypted_xpm); -cBitmap cNopacityDisplayChannel::bmRecording(recording_xpm); - void cNopacityDisplayChannel::SetGeometry(void) { height = cOsd::OsdHeight() * config.channelHeight / 100; int top = cOsd::OsdTop() + cOsd::OsdHeight() - height - config.channelBorderBottom; @@ -90,6 +81,9 @@ void cNopacityDisplayChannel::SetGeometry(void) { epgInfoHeight = height - channelInfoHeight - streamInfoHeight - progressBarHeight; epgInfoLineHeight = epgInfoHeight / 4; streamInfoY = channelInfoHeight + progressBarHeight + epgInfoHeight; + iconSize = config.statusIconSize; + iconsWidth = 5*iconSize; + } void cNopacityDisplayChannel::CreatePixmaps(void) { @@ -107,7 +101,9 @@ void cNopacityDisplayChannel::CreatePixmaps(void) { pixmapChannelInfo = osd->CreatePixmap(2, cRect(infoX, channelInfoY, channelInfoWidth, channelInfoHeight)); pixmapDate = osd->CreatePixmap(2, cRect(infoX + channelInfoWidth, channelInfoY, dateWidth, channelInfoHeight)); - pixmapStreamInfo = osd->CreatePixmap(2, cRect(infoX, streamInfoY, infoWidth, streamInfoHeight)); + pixmapFooter = osd->CreatePixmap(2, cRect(infoX, streamInfoY, infoWidth, streamInfoHeight)); + pixmapStreamInfo = osd->CreatePixmap(4, cRect(infoX + (infoWidth - iconsWidth - config.resolutionIconSize - 35), height - iconSize - 10, iconsWidth, iconSize)); + pixmapStreamInfoBack = osd->CreatePixmap(3, cRect(infoX + (infoWidth - iconsWidth - config.resolutionIconSize - 35), height - iconSize - 10, iconsWidth, iconSize)); pixmapLogo = osd->CreatePixmap(1, cRect(0, 0, config.logoWidth + 2 * config.logoBorder, height)); if (config.channelFadeTime) { @@ -116,7 +112,9 @@ void cNopacityDisplayChannel::CreatePixmaps(void) { pixmapChannelInfo->SetAlpha(0); pixmapDate->SetAlpha(0); pixmapLogo->SetAlpha(0); + pixmapFooter->SetAlpha(0); pixmapStreamInfo->SetAlpha(0); + pixmapStreamInfoBack->SetAlpha(0); if (withInfo) { pixmapBackgroundMiddle->SetAlpha(0); pixmapProgressBar->SetAlpha(0); @@ -149,11 +147,16 @@ void cNopacityDisplayChannel::DrawBackground(void){ pixmapBackgroundBottom->DrawEllipse(cRect(0, streamInfoHeight/2, streamInfoHeight/2, streamInfoHeight/2), clrTransparent, -3); pixmapBackgroundBottom->DrawEllipse(cRect(infoWidth - streamInfoHeight/2, streamInfoHeight/2, streamInfoHeight/2, streamInfoHeight/2), clrTransparent, -4); - pixmapChannelInfo->Fill(clrTransparent); pixmapDate->Fill(clrTransparent); pixmapLogo->Fill(clrTransparent); + pixmapFooter->Fill(clrTransparent); pixmapStreamInfo->Fill(clrTransparent); + cImageLoader imgLoader; + if (imgLoader.LoadIcon("channelsymbols", iconsWidth, iconSize)) { + pixmapStreamInfo->DrawImage(cPoint(0, 0), imgLoader.GetImage()); + } + } void cNopacityDisplayChannel::DrawDate(void) { @@ -170,39 +173,45 @@ void cNopacityDisplayChannel::DrawDate(void) { } void cNopacityDisplayChannel::DrawIcons(const cChannel *Channel) { - int spacing = 10; - int x = infoWidth - config.resolutionIconSize - 3*spacing; - int y = 0; - isRadioChannel = ((!Channel->Vpid())&&(Channel->Apid(0)))?true:false; + pixmapStreamInfoBack->Fill(clrTransparent); + + int backX = 5; + int backY = 5; + + tColor colVT = Theme.Color(clrChannelSymbolOff); + if (Channel->Vpid() && Channel->Tpid()) { + colVT = Theme.Color(clrChannelSymbolOn); + } + pixmapStreamInfoBack->DrawRectangle(cRect(backX, backY, iconSize-10, iconSize-10), colVT); - bool rec = cRecordControls::Active(); - x -= bmRecording.Width() + spacing; - y = (streamInfoHeight - bmRecording.Height()) / 2; - pixmapStreamInfo->DrawBitmap(cPoint(x,y), bmRecording, Theme.Color(rec ? clrChannelRecActive : clrChannelSymbolOff), clrTransparent); + backX += iconSize; + tColor colStereo = Theme.Color(clrChannelSymbolOff); + if (Channel->Apid(1)) { + colStereo = Theme.Color(clrChannelSymbolOn); + } + pixmapStreamInfoBack->DrawRectangle(cRect(backX, backY, iconSize-10, iconSize-10), colStereo); - x -= bmEncrypted.Width() + spacing; - y = (streamInfoHeight - bmEncrypted.Height()) / 2; - pixmapStreamInfo->DrawBitmap(cPoint(x,y), bmEncrypted, Theme.Color(Channel->Ca() ? clrChannelSymbolOn : clrChannelSymbolOff), clrTransparent); + backX += iconSize; + tColor colDolby = Theme.Color(clrChannelSymbolOff); + if (Channel->Dpid(0)) { + colDolby = Theme.Color(clrChannelSymbolOn); + } + pixmapStreamInfoBack->DrawRectangle(cRect(backX, backY, iconSize-10, iconSize-10), colDolby); - x -= bmDolbyDigital.Width() + spacing; - y = (streamInfoHeight - bmDolbyDigital.Height()) / 2; - pixmapStreamInfo->DrawBitmap(cPoint(x,y), bmDolbyDigital, Theme.Color(Channel->Dpid(0) ? clrChannelSymbolOn : clrChannelSymbolOff), clrTransparent); - - x -= bmAudio.Width() + spacing; - y = (streamInfoHeight - bmAudio.Height()) / 2; - pixmapStreamInfo->DrawBitmap(cPoint(x,y), bmAudio, Theme.Color(Channel->Apid(1) ? clrChannelSymbolOn : clrChannelSymbolOff), clrTransparent); - - if (Channel->Vpid()) { - x -= bmTeletext.Width() + spacing; - y = (streamInfoHeight - bmTeletext.Height()) / 2; - pixmapStreamInfo->DrawBitmap(cPoint(x,y), bmTeletext, Theme.Color(Channel->Tpid() ? clrChannelSymbolOn : clrChannelSymbolOff), clrTransparent); - } else if (Channel->Apid(0)) { - x -= bmRadio.Width() + spacing; - y = (streamInfoHeight - bmTeletext.Height()) / 2; - pixmapStreamInfo->DrawBitmap(cPoint(x,y), bmRadio, Theme.Color(clrChannelSymbolOn), clrTransparent); + backX += iconSize; + tColor colCrypted = Theme.Color(clrChannelSymbolOff); + if (Channel->Ca()) { + colCrypted = Theme.Color(clrChannelSymbolOn); } - + pixmapStreamInfoBack->DrawRectangle(cRect(backX, backY, iconSize-10, iconSize-10), colCrypted); + + backX += iconSize; + tColor colRecording = Theme.Color(clrChannelSymbolOff); + if (cRecordControls::Active()) { + colRecording = Theme.Color(clrChannelRecActive); + } + pixmapStreamInfoBack->DrawRectangle(cRect(backX, backY, iconSize-10, iconSize-10), colRecording); } void cNopacityDisplayChannel::DrawScreenResolution(void) { @@ -528,7 +537,9 @@ void cNopacityDisplayChannel::Action(void) { pixmapProgressBar->SetAlpha(Alpha); pixmapEPGInfo->SetAlpha(Alpha); } + pixmapFooter->SetAlpha(Alpha); pixmapStreamInfo->SetAlpha(Alpha); + pixmapStreamInfoBack->SetAlpha(Alpha); if (pixmapScreenResolution) pixmapScreenResolution->SetAlpha(Alpha); if (config.displaySignalStrength && showSignal) { @@ -547,4 +558,4 @@ void cNopacityDisplayChannel::Action(void) { break; } } -}
\ No newline at end of file +} diff --git a/displaychannel.h b/displaychannel.h index c228d70..ffe66a2 100644 --- a/displaychannel.h +++ b/displaychannel.h @@ -29,7 +29,9 @@ private: cPixmap *pixmapLogo; cPixmap *pixmapProgressBar; cPixmap *pixmapEPGInfo; + cPixmap *pixmapFooter; cPixmap *pixmapStreamInfo; + cPixmap *pixmapStreamInfoBack; cPixmap *pixmapSignalStrength; cPixmap *pixmapSignalQuality; cPixmap *pixmapSignalMeter; @@ -46,6 +48,8 @@ private: int epgInfoLineHeight; int streamInfoHeight; int streamInfoY; + int iconSize; + int iconsWidth; int signalWidth, signalHeight, signalX; cFont *fontHeader; cFont *fontDate; @@ -64,7 +68,6 @@ private: void DrawScreenResolution(void); void DrawSignalMeter(void); void DrawSignal(void); - static cBitmap bmTeletext, bmRadio, bmAudio, bmDolbyDigital, bmEncrypted, bmRecording; public: cNopacityDisplayChannel(bool WithInfo); virtual ~cNopacityDisplayChannel(); diff --git a/icons/channelsymbols.png b/icons/channelsymbols.png Binary files differnew file mode 100644 index 0000000..5d78bf1 --- /dev/null +++ b/icons/channelsymbols.png diff --git a/timers.c b/timers.c new file mode 100644 index 0000000..1e51851 --- /dev/null +++ b/timers.c @@ -0,0 +1,117 @@ +#include "timers.h"
+
+cNopacityTimer::cNopacityTimer(cOsd *osd, const cTimer *timer, const cFont *font, const cFont *fontLarge) {
+ this->osd = osd;
+ this->timer = timer;
+ this->font = font;
+ this->fontLarge = fontLarge;
+}
+
+cNopacityTimer::~cNopacityTimer(void) {
+ osd->DestroyPixmap(pixmap);
+ osd->DestroyPixmap(pixmapLogo);
+}
+
+void cNopacityTimer::SetGeometry(int width, int y) {
+ this->width = width;
+ this->y = y;
+}
+
+void cNopacityTimer::SetAlpha(int alpha) {
+ pixmap->SetAlpha(alpha);
+ pixmapLogo->SetAlpha(alpha);
+}
+
+void cNopacityTimer::Show(void) {
+ pixmap->SetLayer(2);
+ pixmapLogo->SetLayer(3);
+}
+
+void cNopacityTimer::Hide(void) {
+ pixmap->SetLayer(-1);
+ pixmapLogo->SetLayer(-1);
+}
+
+void cNopacityTimer::CreateDate(void) {
+ if (timer->Recording()) {
+ Date = cString::sprintf("-%s", *TimeString(timer->StopTime()));
+ } else {
+ time_t Now = time(NULL);
+ cString Today = WeekDayName(Now);
+ cString Time = TimeString(timer->StartTime());
+ cString Day = WeekDayName(timer->StartTime());
+ if (timer->StartTime() > Now + 6 * SECSINDAY)
+ Date = DayDateTime(timer->StartTime());
+ else if (strcmp(Day, Today) != 0)
+ Date = cString::sprintf("%s %s", *Day, *Time);
+ else
+ Date = Time;
+ if (timer->Flags() & tfVps)
+ Date = cString::sprintf("VPS %s", *Date);
+ }
+}
+
+void cNopacityTimer::CreateShowName(void) {
+ const cEvent *Event = timer->Event();
+ cString title("");
+ if (Event) {
+ title = Event->Title();
+ }
+ showName.Set(*title, font, width-10);
+}
+
+void cNopacityTimer::CalculateHeight(int space) {
+ int numLines = showName.Lines() + 1;
+ int lineHeight = font->Height();
+ height = config.timersLogoHeight + numLines * lineHeight + 2*space;
+}
+
+void cNopacityTimer::CreatePixmaps(int x) {
+ pixmap = osd->CreatePixmap(2, cRect(x, y, width, height));
+ pixmapLogo = osd->CreatePixmap(3, cRect(x, y, width, height));
+}
+
+void cNopacityTimer::Render(void) {
+ DrawLogo();
+ cImageLoader imgLoader;
+ if (timer->Recording()) {
+ pixmap->Fill(Theme.Color(clrDiskAlert));
+ imgLoader.DrawBackground(Theme.Color(clrDiskAlert), Theme.Color(clrMenuItemHigh), width-2, height-2);
+ pixmap->DrawImage(cPoint(1,1), imgLoader.GetImage());
+ } else {
+ pixmap->Fill(Theme.Color(clrMenuBorder));
+ imgLoader.DrawBackground(Theme.Color(clrMenuItemHighBlend), Theme.Color(clrMenuItemHigh), width-2, height-2);
+ pixmap->DrawImage(cPoint(1,1), imgLoader.GetImage());
+ }
+
+ pixmap->DrawText(cPoint(5, config.timersLogoHeight), *Date, Theme.Color(clrMenuFontTimersHeader), clrTransparent, fontLarge);
+
+ int lineHeight = font->Height();
+ int yStart = config.timersLogoHeight + lineHeight + 3;
+ int numLines = showName.Lines();
+ for (int line=0; line<numLines; line++)
+ pixmap->DrawText(cPoint(5, yStart+line*(lineHeight-2)), showName.GetLine(line), Theme.Color(clrMenuFontTimers), clrTransparent, font);
+
+}
+
+void cNopacityTimer::DrawLogo(void) {
+ pixmapLogo->Fill(clrTransparent);
+ int logoWidth = config.timersLogoWidth;
+ int logoHeight = config.timersLogoHeight;
+ const cChannel *Channel = timer->Channel();
+ if (Channel && Channel->Name()) {
+ cImageLoader imgLoader;
+ if (imgLoader.LoadLogo(Channel->Name(), logoWidth, logoHeight)) {
+ pixmapLogo->DrawImage(cPoint((width - logoWidth)/2, 1), imgLoader.GetImage());
+ } else {
+ cTextWrapper channel;
+ channel.Set(Channel->Name(), font, logoWidth);
+ int lines = channel.Lines();
+ int lineHeight = font->Height();
+ int y = 1;
+ for (int line = 0; line < lines; line++) {
+ pixmapLogo->DrawText(cPoint((logoWidth - font->Width(channel.GetLine(line)))/2, y+lineHeight*line), channel.GetLine(line), Theme.Color(clrMenuFontMenuItemHigh), clrTransparent, font);
+ }
+ }
+ }
+}
\ No newline at end of file diff --git a/timers.h b/timers.h new file mode 100644 index 0000000..197722f --- /dev/null +++ b/timers.h @@ -0,0 +1,33 @@ +#ifndef __NOPACITY_TIMERS_H
+#define __NOPACITY_TIMERS_H
+
+class cNopacityTimer : public cListObject {
+ private:
+ cOsd *osd;
+ cPixmap *pixmap;
+ cPixmap *pixmapLogo;
+ const cTimer *timer;
+ const cFont *font;
+ const cFont *fontLarge;
+ int width;
+ int height;
+ int y;
+ cString Date;
+ cTextWrapper showName;
+ void DrawLogo(void);
+ public:
+ cNopacityTimer(cOsd *osd, const cTimer *timer, const cFont *font, const cFont *fontLarge);
+ virtual ~cNopacityTimer(void);
+ void SetGeometry(int width, int y);
+ void CreateDate(void);
+ void CreateShowName(void);
+ void CalculateHeight(int space);
+ void CreatePixmaps(int x);
+ void SetAlpha(int alpha);
+ void Show(void);
+ void Hide(void);
+ int GetHeight(void) {return pixmap->ViewPort().Height();}
+ void Render(void);
+};
+
+#endif //__NOPACITY_TIMERS_H
|