LDFLAGS = -Wall -static
LIBS = -lpthread -lrt
-OBJECTS += wwss.o main.o threadp.o remotemvp.o ledmvp.o mtdmvp.o videomvp.o audiomvp.o osdmvp.o surfacemvp.o wjpegcomplex.o vmedialist.o vcolourtuner.o vmediaview.o vvideomedia.o
+OBJECTS += wwss.o main.o threadp.o remotemvp.o ledmvp.o mtdmvp.o videomvp.o audiomvp.o osdmvp.o \
+ surfacemvp.o fonts/helvB24.o fonts/helvB18.o wjpegcomplex.o vmedialist.o vcolourtuner.o \
+ audioplayer.o demuxeraudio.o \
+ vmediaview.o vvideomedia.o imagereader.o media.o mediaoptions.o mediaplayer.o serialize.o \
+ localmediafile.o playermedia.o demuxermedia.o mediafile.o
TIOBJECT = ticonfig.o
CROSSLIBS = ../jpeg/jpeg-6b/libjpeg.a
INCLUDES = -I../jpeg/jpeg-6b -DVOMP_PLATTFORM_MVP
*/
#include "colour.h"
-
+#include "defines.h"
DrawStyle DrawStyle::BLACK(0, 0, 0);
DrawStyle DrawStyle::RED(255, 0, 0);
DrawStyle DrawStyle::DARKGREY(100, 100, 100);
DrawStyle DrawStyle::BLUE(0, 0, 255);
DrawStyle DrawStyle::YELLOW(255, 255, 0);
-DrawStyle DrawStyle::VIDEOBLUE(0, 0, 150);
DrawStyle DrawStyle::VIEWBACKGROUND(0, 0, 100);
DrawStyle DrawStyle::VIEWTRANSPARENTBACKGROUND(0, 0, 100, 128);
DrawStyle DrawStyle::TABVIEWBACKGROUND(0, 0, 120);
DrawStyle DrawStyle::TITLEBARBACKGROUND(0, 0, 200);
DrawStyle DrawStyle::SELECTHIGHLIGHT(240, 250, 80);
+DrawStyle DrawStyle::LIVETVSYMBOLS(240, 250, 80);
DrawStyle DrawStyle::SELECTDARKHIGHLIGHT(120, 125, 40);
+DrawStyle DrawStyle::SELECTBACKGROUND(0, 0, 100);
+DrawStyle DrawStyle::PROGRESSBAR(255, 255, 255);
DrawStyle DrawStyle::LIGHTTEXT(255, 255, 255);
DrawStyle DrawStyle::DARKTEXT(0, 0, 100);
DrawStyle DrawStyle::DANGER(200, 0, 0);
+DrawStyle DrawStyle::OSDBACKGROUND(0,0,0,128);
DrawStyle DrawStyle::BUTTONBACKGROUND(0, 0, 200);
DrawStyle DrawStyle::PROGRAMMEB(80, 80, 240); // two colours used as alterating backgrounds for individual programmes in EPG
DrawStyle DrawStyle::PROGRAMMEA(40, 40, 120); // TODO fit epg style (colours) in with rest of application
DrawStyle DrawStyle::NOPROGRAMME(180, 180, 180); // no programme details colour
+DrawStyle DrawStyle::WALLPAPER(0xFF000000);
+
+
+enum SkinNames{
+#ifdef GRADIENT_DRAWING
+ NoopacityInspired,
+ ClassicEnhanced,
+#endif
+ Classic,
+ MaxSkins
+};
+
+const char *skinnames[]={
+#ifdef GRADIENT_DRAWING
+"Noopacity inspired",
+"VompClassic Enhanced",
+#endif
+ "VompClassic"
+};
+
+ const char* *SkinFactory::getSkinNames()
+ {
+
+ return skinnames;
+ }
+
+
+int SkinFactory::getNumberofSkins()
+{
+ return MaxSkins;
+}
+
-void SkinFactory::InitDefaultSkin()
+void InitDefaultSkin()
{
/*
Real colours
DrawStyle::GREEN=DrawStyle(0, 255, 0);
DrawStyle::BLUE=DrawStyle(0, 0, 255);
DrawStyle::YELLOW=DrawStyle(255, 255, 0);
- DrawStyle::VIDEOBLUE=DrawStyle(0, 0, 150);
+ DrawStyle::WALLPAPER=DrawStyle(0, 0, 150);
DrawStyle::VIEWBACKGROUND=DrawStyle(0, 0, 100);
+ DrawStyle::SELECTBACKGROUND=DrawStyle(0, 0, 100);
DrawStyle::VIEWTRANSPARENTBACKGROUND=DrawStyle(0, 0, 100, 128);
DrawStyle::TABVIEWBACKGROUND=DrawStyle(0, 0, 120);
DrawStyle::TITLEBARBACKGROUND=DrawStyle(0, 0, 200);
+ DrawStyle::LIVETVSYMBOLS=DrawStyle(240, 250, 80);
DrawStyle::SELECTHIGHLIGHT=DrawStyle(240, 250, 80);
DrawStyle::SELECTDARKHIGHLIGHT=DrawStyle(120, 125, 40);
- DrawStyle::LIGHTTEXT=DrawStyle(255, 255, 255);
+ DrawStyle::PROGRESSBAR=DrawStyle::LIGHTTEXT=DrawStyle(255, 255, 255);
DrawStyle::DARKTEXT=DrawStyle(0, 0, 100);
DrawStyle::DANGER=DrawStyle(200, 0, 0);
DrawStyle::BUTTONBACKGROUND=DrawStyle(0, 0, 200);
+ DrawStyle::OSDBACKGROUND=DrawStyle(0,0,0,128);
DrawStyle::PROGRAMMEB=DrawStyle(80, 80, 240); // two colours used as alterating backgrounds for individual programmes in EPG
DrawStyle::PROGRAMMEA=DrawStyle(40, 40, 120); // TODO fit epg style (colours) in with rest of application
DrawStyle::NOPROGRAMME=DrawStyle(180, 180, 180); // no programme details colour
+
/*
Silly colours
*/
}
-void SkinFactory::InitEnhancedSkin()
+void InitEnhancedSkin()
{
/*
Real colours
DrawStyle::DARKGREY.y2=1.0;
- DrawStyle::VIDEOBLUE=DrawStyle(0, 0, 150);
+ DrawStyle::WALLPAPER=DrawStyle(0, 0, 150);
DrawStyle::VIEWBACKGROUND=DrawStyle(0, 0, 100);
DrawStyle::VIEWBACKGROUND.grad_col[0]=Colour(0,0,160);
DrawStyle::SELECTHIGHLIGHT.x2=0.0;
DrawStyle::SELECTHIGHLIGHT.y2=1.0;
+ DrawStyle::LIVETVSYMBOLS = DrawStyle::SELECTHIGHLIGHT;
+
DrawStyle::SELECTDARKHIGHLIGHT=DrawStyle(60, 65, 20);
DrawStyle::SELECTDARKHIGHLIGHT.grad_col[0]=DrawStyle(120, 125, 40);
DrawStyle::SELECTDARKHIGHLIGHT.x2=0.0;
DrawStyle::SELECTDARKHIGHLIGHT.y2=1.0;
+ DrawStyle::SELECTBACKGROUND=DrawStyle(0, 0, 100);
+ DrawStyle::SELECTBACKGROUND.grad_col[0]=Colour(0,0,160);
+ DrawStyle::SELECTBACKGROUND.num_colors=1;
+ DrawStyle::SELECTBACKGROUND.ft=DrawStyle::GradientLinear;
+ DrawStyle::SELECTBACKGROUND.x1=0.0;
+ DrawStyle::SELECTBACKGROUND.y1=0.0;
+ DrawStyle::SELECTBACKGROUND.x2=0.0;
+ DrawStyle::SELECTBACKGROUND.y2=1.0;
+
DrawStyle::LIGHTTEXT=DrawStyle(255, 255, 255);
DrawStyle::LIGHTTEXT.grad_col[0]=DrawStyle(150, 150, 150);
DrawStyle::LIGHTTEXT.num_colors=1;
DrawStyle::LIGHTTEXT.y1=0.0;
DrawStyle::LIGHTTEXT.x2=0.0;
DrawStyle::LIGHTTEXT.y2=1.0;
+ DrawStyle::PROGRESSBAR=DrawStyle::LIGHTTEXT;
DrawStyle::DARKTEXT=DrawStyle(0, 0, 100);
DrawStyle::DANGER=DrawStyle(200, 0, 0);
DrawStyle::BUTTONBACKGROUND.x2=0.0;
DrawStyle::BUTTONBACKGROUND.y2=1.0;
+ DrawStyle::OSDBACKGROUND=DrawStyle(0,0,0,128);
+
DrawStyle::PROGRAMMEB=DrawStyle(40, 40, 120); // two colours used as alterating backgrounds for individual programmes in EPG
DrawStyle::PROGRAMMEB.grad_col[0]=DrawStyle(80, 80, 240);
DrawStyle::NOPROGRAMME.y2=1.0;
+
+
/*
Silly colours
Colour Colour::BUTTONBACKGROUND(255, 255, 255);
*/
}
+
+void InitNoopacityInspiredSkin()
+{
+ /*
+Real colours
+ */
+ DrawStyle::BLACK=DrawStyle(0, 0, 0);
+ DrawStyle::RED=DrawStyle(0x99BB0000);
+ DrawStyle::GREY=DrawStyle(0xFE777777);
+ DrawStyle::DARKGREY=DrawStyle(0x7D000000);
+ DrawStyle::GREEN=DrawStyle(0x9900BB00);
+ DrawStyle::BLUE=DrawStyle(0x990000BB);
+ DrawStyle::YELLOW=DrawStyle(0x99BBBB00);
+ DrawStyle::VIEWBACKGROUND=DrawStyle(0xB012273f);
+ DrawStyle::VIEWTRANSPARENTBACKGROUND=DrawStyle(0x99242A38);
+ DrawStyle::OSDBACKGROUND=DrawStyle(0xB012273f);
+ DrawStyle::TABVIEWBACKGROUND=DrawStyle(0x99242A38);
+
+ DrawStyle::LIVETVSYMBOLS=DrawStyle(0xFF9a9a9a);
+ DrawStyle::PROGRESSBAR=DrawStyle(0xFFC6D590);
+
+
+
+ DrawStyle::SELECTHIGHLIGHT=DrawStyle(0xFF999999);
+ DrawStyle::SELECTHIGHLIGHT.grad_col[0]=DrawStyle(0xFFa4fd15);
+ DrawStyle::SELECTHIGHLIGHT.grad_col[1]=DrawStyle(0xFFa4fd15);
+ DrawStyle::SELECTHIGHLIGHT.grad_col[2]=DrawStyle(0x7D000000);
+ DrawStyle::SELECTHIGHLIGHT.grad_pos[0]=0.3;
+ DrawStyle::SELECTHIGHLIGHT.grad_pos[1]=0.9;
+ DrawStyle::SELECTHIGHLIGHT.num_colors=3;
+ DrawStyle::SELECTHIGHLIGHT.ft=DrawStyle::GradientLinear;
+ DrawStyle::SELECTHIGHLIGHT.x1=0.0;
+ DrawStyle::SELECTHIGHLIGHT.y1=0.2;
+ DrawStyle::SELECTHIGHLIGHT.x2=1.1;
+ DrawStyle::SELECTHIGHLIGHT.y2=0.8;
+
+
+ DrawStyle::SELECTDARKHIGHLIGHT=DrawStyle(0xFD999999);
+ DrawStyle::SELECTDARKHIGHLIGHT.grad_col[0]=DrawStyle(0xFF7bbd0f);
+ DrawStyle::SELECTDARKHIGHLIGHT.grad_col[1]=DrawStyle(0xFF7bbd0f);
+ DrawStyle::SELECTDARKHIGHLIGHT.grad_col[2]=DrawStyle(0x7D000000);
+ DrawStyle::SELECTDARKHIGHLIGHT.grad_pos[0]=0.3;
+ DrawStyle::SELECTDARKHIGHLIGHT.grad_pos[1]=0.9;
+ DrawStyle::SELECTDARKHIGHLIGHT.num_colors=3;
+ DrawStyle::SELECTDARKHIGHLIGHT.ft=DrawStyle::GradientLinear;
+ DrawStyle::SELECTDARKHIGHLIGHT.x1=0.0;
+ DrawStyle::SELECTDARKHIGHLIGHT.y1=0.2;
+ DrawStyle::SELECTDARKHIGHLIGHT.x2=1.1;
+ DrawStyle::SELECTDARKHIGHLIGHT.y2=0.8;
+
+
+ DrawStyle::SELECTBACKGROUND=DrawStyle(0xFE999999);
+ DrawStyle::SELECTBACKGROUND.grad_col[0]=DrawStyle(0xFF353b50);
+ DrawStyle::SELECTBACKGROUND.grad_col[1]=DrawStyle(0xFF353b50);
+ DrawStyle::SELECTBACKGROUND.grad_col[2]=DrawStyle(0x7D000000);
+ DrawStyle::SELECTBACKGROUND.grad_pos[0]=0.3;
+ DrawStyle::SELECTBACKGROUND.grad_pos[1]=0.9;
+ DrawStyle::SELECTBACKGROUND.num_colors=3;
+ DrawStyle::SELECTBACKGROUND.ft=DrawStyle::GradientLinear;
+ DrawStyle::SELECTBACKGROUND.x1=0.0;
+ DrawStyle::SELECTBACKGROUND.y1=0.2;
+ DrawStyle::SELECTBACKGROUND.x2=1.1;
+ DrawStyle::SELECTBACKGROUND.y2=0.8;
+
+ DrawStyle::TITLEBARBACKGROUND=DrawStyle::SELECTBACKGROUND;
+
+ DrawStyle::LIGHTTEXT=DrawStyle(0xFFFFFFFF);
+ DrawStyle::DARKTEXT=DrawStyle(0xFF363636);
+ DrawStyle::DANGER=DrawStyle(200, 0, 0);
+ DrawStyle::BUTTONBACKGROUND=DrawStyle::SELECTBACKGROUND;
+ // two colours used as alterating backgrounds for individual programmes in EPG
+ DrawStyle::PROGRAMMEB=DrawStyle::SELECTBACKGROUND;
+
+
+
+ DrawStyle::PROGRAMMEA=DrawStyle(0x7D000000);
+ DrawStyle::PROGRAMMEA.grad_col[0]=DrawStyle(0xFF353b50);
+ DrawStyle::PROGRAMMEA.grad_col[1]=DrawStyle(0xFF353b50);
+ DrawStyle::PROGRAMMEA.grad_col[2]=DrawStyle(0xFE999999);
+ DrawStyle::PROGRAMMEA.grad_pos[0]=0.3;
+ DrawStyle::PROGRAMMEA.grad_pos[1]=0.9;
+ DrawStyle::PROGRAMMEA.num_colors=3;
+ DrawStyle::PROGRAMMEA.ft=DrawStyle::GradientLinear;
+ DrawStyle::PROGRAMMEA.x1=0.0;
+ DrawStyle::PROGRAMMEA.y1=0.2;
+ DrawStyle::PROGRAMMEA.x2=1.0;
+ DrawStyle::PROGRAMMEA.y2=0.8;
+
+
+ DrawStyle::NOPROGRAMME=DrawStyle(0xFF353b50); // no programme details colour
+
+ DrawStyle::WALLPAPER=DrawStyle(0x00000000); // two colours used as alternating backgrounds for individual programmes in EPG
+ DrawStyle::WALLPAPER.grad_col[0]=DrawStyle(0x0012273f);
+ DrawStyle::WALLPAPER.num_colors=1;
+ DrawStyle::WALLPAPER.ft=DrawStyle::GradientLinear;
+ DrawStyle::WALLPAPER.x1=0.0;
+ DrawStyle::WALLPAPER.y1=0.0;
+ DrawStyle::WALLPAPER.x2=0.0;
+ DrawStyle::WALLPAPER.y2=1.0;
+
+ /*
+Silly colours
+
+Colour Colour::VIDEOBLUE(250, 0, 0);
+Colour Colour::VIEWBACKGROUND(100, 0, 100);
+Colour Colour::TITLEBARBACKGROUND(100, 0, 200);
+Colour Colour::SELECTHIGHLIGHT(240, 250, 180);
+Colour Colour::LIGHTTEXT(255, 0, 255);
+Colour Colour::DARKTEXT(0, 0, 255);
+Colour Colour::DANGER(200, 200, 0);
+Colour Colour::BUTTONBACKGROUND(255, 255, 255);
+ */
+}
+
+bool SkinFactory::InitSkin(int n)
+{
+ switch(n)
+ {
+ default:
+ case Classic: InitDefaultSkin(); break;
+#ifdef GRADIENT_DRAWING
+ case ClassicEnhanced: InitEnhancedSkin(); break;
+ case NoopacityInspired: InitNoopacityInspiredSkin(); break;
+#endif
+ };
+ return true;
+}
+
Colour(int Tred, int Tgreen, int Tblue, int Talpha)
{ red = Tred; green = Tgreen; blue = Tblue; alpha = Talpha; }
+ Colour(unsigned int color)
+ {
+ red = (color & 0x00ff0000)>>16;
+ green = (color & 0x0000ff00)>>8;
+ blue = (color & 0x000000ff);
+ alpha = (color & 0xff000000)>>24;
+ }
+
void set(int Tred, int Tgreen, int Tblue)
{ red = Tred; green = Tgreen; blue = Tblue; alpha = 255; }
DrawStyle(int Tred, int Tgreen, int Tblue, int Talpha)
{ red = Tred; green = Tgreen; blue = Tblue; alpha = Talpha; ft=Color;ct=Global;}
+ DrawStyle(unsigned int color)
+ {
+ red = (color & 0x00ff0000)>>16;
+ green = (color & 0x0000ff00)>>8;
+ blue = (color & 0x000000ff);
+ alpha = (color & 0xff000000)>>24;
+ ft=Color;ct=Global;
+ }
enum FillType {
Color,
static DrawStyle BLUE;
static DrawStyle GREY;
static DrawStyle DARKGREY;
- static DrawStyle VIDEOBLUE;
static DrawStyle VIEWBACKGROUND;
static DrawStyle VIEWTRANSPARENTBACKGROUND;
+ static DrawStyle LIVETVSYMBOLS;
+ static DrawStyle PROGRESSBAR;
+ static DrawStyle OSDBACKGROUND;
static DrawStyle TABVIEWBACKGROUND;
static DrawStyle TITLEBARBACKGROUND;
+ static DrawStyle SELECTBACKGROUND;
static DrawStyle SELECTHIGHLIGHT;
static DrawStyle SELECTDARKHIGHLIGHT;
static DrawStyle LIGHTTEXT;
static DrawStyle PROGRAMMEA;
static DrawStyle PROGRAMMEB;
static DrawStyle NOPROGRAMME;
+ static DrawStyle WALLPAPER; // this one is special, if transparent it means picture
};
class SkinFactory {
public:
- static void InitDefaultSkin();
- static void InitEnhancedSkin();
+ static int getNumberofSkins();
+ static const char* *getSkinNames();
+ static bool InitSkin(int n);
};
#endif
connLost = NULL;
crashed = false;
server = NULL;
+ wallpaper = wallpaper_pict = NULL;
}
Command::~Command()
initted = 0;
return 0;
}
-#ifdef GRADIENT_DRAWING
- SkinFactory::InitEnhancedSkin();
-#else
- SkinFactory::InitDefaultSkin();
-#endif
+
+ SkinFactory::InitSkin(0);
#ifndef WIN32
pthread_mutex_init(&masterLock, NULL);
void Command::doWallpaper()
{
- Video* video = Video::getInstance();
+ Video* video = Video::getInstance();
- // Blue background
- Boxx* bbg = new Boxx();
- bbg->setSize(video->getScreenWidth(), video->getScreenHeight());
- bbg->createBuffer();
- bbg->fillColour(DrawStyle::VIDEOBLUE);
- boxstack->add(bbg);
- boxstack->update(bbg);
- boxstack->remove(bbg);
+ // Blue background
+ Boxx* bbg = new Boxx();
+ bbg->setSize(video->getScreenWidth(), video->getScreenHeight());
+ bbg->createBuffer();
+ bbg->fillColour(DrawStyle::WALLPAPER);
+ boxstack->add(bbg);
+ boxstack->update(bbg);
+ boxstack->remove(bbg);
- // Wallpaper
- WJpeg* wallpaperj = new WJpegTYPE();
- wallpaperj->setSize(video->getScreenWidth(), video->getScreenHeight());
- wallpaperj->createBuffer();
+ // Wallpaper
+ wallpaper = new Boxx();
+ wallpaper->setSize(video->getScreenWidth(), video->getScreenHeight());
+ wallpaper->createBuffer();
+ wallpaper ->setBackgroundColour(DrawStyle::WALLPAPER);
- if (video->getFormat() == Video::PAL)
- {
- logger->log("Command", Log::DEBUG, "PAL wallpaper selected");
+
+
+
+ wallpaper_pict = new WJpegTYPE();
+ wallpaper_pict->setSize(video->getScreenWidth(), video->getScreenHeight());
+
+
+ if (video->getFormat() == Video::PAL)
+ {
+ logger->log("Command", Log::DEBUG, "PAL wallpaper selected");
#ifndef _MIPS_ARCH
- wallpaperj->init("/wallpaperPAL.jpg");
+ wallpaper_pict->init("/wallpaperPAL.jpg");
#else
- wallpaperj->init("wallpaperPAL.jpg");
+ wallpaper_pict->init("wallpaperPAL.jpg");
#endif
- }
- else
- {
- logger->log("Command", Log::DEBUG, "NTSC wallpaper selected");
- wallpaperj->init("/wallpaperNTSC.jpg");
- }
- wallpaperj->draw();
+ }
+ else
+ {
+ logger->log("Command", Log::DEBUG, "NTSC wallpaper selected");
+ wallpaper_pict->init("/wallpaperNTSC.jpg");
+ }
+ if (DrawStyle::WALLPAPER.alpha) {
+ wallpaper_pict->setVisible(true);
+ } else {
+ wallpaper_pict->setVisible(false);
+ }
+ wallpaper->add(wallpaper_pict);
+ wallpaper->draw();
+
+ boxstack->add(wallpaper);
+ boxstack->update(wallpaper);
+
- boxstack->add(wallpaperj);
- boxstack->update(wallpaperj);
- wallpaper = wallpaperj;
}
void Command::run()
}
if (config) delete[] config;
+ config = vdr->configLoad("Advanced", "Skin Name");
+ if (config) {
+ const char **skinnames=SkinFactory::getSkinNames();
+ for (int i=0;i<SkinFactory::getNumberofSkins();i++) {
+ if (!STRCASECMP(config, skinnames[i])) {
+ SkinFactory::InitSkin(i);
+ break;
+ }
+ }
+ delete[] config;
+ if (wallpaper && wallpaper_pict) {
+ if (DrawStyle::WALLPAPER.alpha) {
+ wallpaper_pict->setVisible(true);
+ } else {
+ wallpaper_pict->setVisible(false);
+ }
+ wallpaper->draw();
+ boxstack->update(wallpaper);
+ }
+
+ } else {
+ SkinFactory::InitSkin(0);
+ }
+
// See if config says to override video format (PAL/NTSC)
config = vdr->configLoad("General", "Override Video Format");
if (config)
logger->log("Command", Log::DEBUG, "Switching to NTSC_J");
video->init(Video::NTSC_J);
}
+ delete[] config;
+
#ifndef __ANDROID__
//we do not init twice
osd->init((char*)("/dev/stbgfx"));
class BoxStack;
class Log;
class VInfo;
+class WJpeg;
class Command : public MessageQueue
{
BoxStack* boxstack;
Remote* remote;
Boxx* wallpaper;
+ WJpeg* wallpaper_pict;
VInfo* connLost;
bool crashed;
char* server;
vradiorec.o vaudioselector.o vscreensaver.o vopts.o \
wselectlist.o wjpeg.o wsymbol.o wbutton.o wtextbox.o \
woptionpane.o woptionbox.o wremoteconfig.o wtabbar.o \
- fonts/helvB24.o fonts/helvB18.o \
remote.o led.o mtd.o osd.o surface.o \
- media.o vpicturebanner.o \
- audioplayer.o demuxeraudio.o abstractoption.o \
+ vpicturebanner.o \
+ abstractoption.o \
eventdispatcher.o vdrrequestpacket.o vdrresponsepacket.o \
vvideolivetv.o vsleeptimer.o \
playerlivetv.o playerliveradio.o \
wprogressbar.o \
bitmap.o dvbsubtitles.o \
- imagereader.o mediaoptions.o mediaplayer.o \
- serialize.o localmediafile.o playermedia.o \
- demuxermedia.o tfeed.o vteletextview.o teletextdecodervbiebu.o \
- teletxt/txtfont.o mediafile.o movieinfo.o seriesinfo.o wmovieview.o wseriesview.o tvmedia.o wtvmedia.o\
+ tfeed.o vteletextview.o teletextdecodervbiebu.o \
+ teletxt/txtfont.o movieinfo.o seriesinfo.o wmovieview.o wseriesview.o tvmedia.o wtvmedia.o\
wpictureview.o
uint32_t back_image_ptr;
bcm_backres=vc_dispmanx_resource_create(VC_IMAGE_RGBX32,16,16,&back_image_ptr);
unsigned int color[16*16];
+ DrawStyle bg=DrawStyle::WALLPAPER;
+ if (bg.ft!=DrawStyle::GradientLinear) {
+ bg.grad_col[0]=bg;
+ }
//memset(color,0xFF,sizeof(unsigned int)*4*8);
for (int j=0;j<16;j++) {
- int help=j;
+ int helpr=(((15-j)*bg.red)+(j*bg.grad_col[0].red))/15;
+ int helpb=(((15-j)*bg.blue)+(j*bg.grad_col[0].blue))/15;
+ int helpg=(((15-j)*bg.green)+(j*bg.grad_col[0].green))/15;
//unsigned int cur_col=help | (help<< 8) | (help<< 16) | (0xFF<< 24);
- unsigned int cur_col=help *3 | (help<< (8+2)) | (help<< (16+2)) | (0xFF<< (24));
+ unsigned int cur_col=helpr | (helpg<< (8)) | (helpb<< (16)) | (0xFF<< (24));
for (int i=0;i<16;i++) {
color[i+16*j]=cur_col;
}
void OsdOpenVG::InternalRendering(){
vgmutex.Lock();
+ Colour bg=DrawStyle::WALLPAPER;
float colclear[]={1.f,1.0f,1.f,1.f};
+ if (bg.alpha==0) colclear[3]=0.f;
vgSetfv(VG_CLEAR_COLOR,4,colclear);
vgClear(0,0,BACKBUFFER_WIDTH,BACKBUFFER_HEIGHT);
vgSeti(VG_BLEND_MODE, VG_BLEND_SRC);
Surface* Surface::screen = NULL;
+#ifndef GRADIENT_DRAWING
osd_font_t* Surface::font = &font_helvB18;
+#endif
Surface::Surface(int id)
{
{
return drawText(text, x, y, 2000, c);
}
-
+#ifndef GRADIENT_DRAWING
int Surface::drawText(const char* text, int x, int y, int width, const DrawStyle& c)
{
int h, n, i;
{
return font->spacing;
}
+#endif
wchar_t Surface::getWChar(const char* str, unsigned int *length)
{
#include "teletextdecodervbiebu.h"
+#ifndef GRADIENT_DRAWING
// Font stuff
typedef struct bogl_font {
//extern osd_font_t font_CaslonRoman_1_25;
//extern osd_font_t font_helvB24;
extern osd_font_t font_helvB18;
+#endif
class Bitmap;
class DisplayRegion;
virtual ~Surface();
static Surface* getScreen();
- virtual int getFontHeight();
- virtual float getCharWidth(wchar_t c);
virtual wchar_t getWChar(const char* str, unsigned int *length);
+#ifdef GRADIENT_DRAWING
+ virtual int getFontHeight()=0;
+ virtual float getCharWidth(wchar_t c)=0;
+ virtual int drawText(const char* text, int x, int y, const DrawStyle& c)=0;
+ virtual int drawText(const char* text, int x, int y, int width, const DrawStyle& c)=0;
+ virtual int drawTextRJ(const char* text, int x, int y, const DrawStyle& c)=0;
+ virtual int drawTextCentre(const char* text, int x, int y, const DrawStyle& c)=0;
+#else
+ //May be move this stuff to a new Basis class surface pixel
+ virtual int getFontHeight();
+ virtual float getCharWidth(wchar_t c);
virtual int drawText(const char* text, int x, int y, const DrawStyle& c);
virtual int drawText(const char* text, int x, int y, int width, const DrawStyle& c);
virtual int drawTextRJ(const char* text, int x, int y, const DrawStyle& c);
virtual int drawTextCentre(const char* text, int x, int y, const DrawStyle& c);
+#endif
virtual void drawJpeg(const char *fileName,int x, int y,int *width, int *height) {}
protected:
static Surface* screen;
+#ifndef GRADIENT_DRAWING
static osd_font_t* font;
+#endif
virtual void drawPixel(int x, int y, unsigned int c, bool fastdraw=false)=0; // deprecated preparation for vector based drawing, only allowed to be called inside implementation
#include "vdrrequestpacket.h"
#include "vdrresponsepacket.h"
#include "command.h"
+#ifdef VOMP_MEDIAPLAYER
#include "media.h"
#include "mediaprovider.h"
#include "mediaproviderids.h"
+#endif
#include "vdrcommand.h"
#include "video.h"
#include "osd.h"
#define VOMP_PROTOCOLL_VERSION 0x00000302
VDR* VDR::instance = NULL;
+#ifdef VOMP_MEDIAPLAYER
//prepare a request
//will create a request package from a command variable and fill this
//caller has to destroy buffer
return 0;
}
-
+#endif
VDR::VDR()
{
channelNumberWidth = 1;
doVDRShutdown = false;
TEMP_SINGLE_VDR_PR = NULL;
+#ifdef VOMP_MEDIAPLAYER
providerId=MPROVIDERID_VDR;
subRange=MPROVIDERRANGE_VDR;
MediaPlayerRegister::getInstance()->registerMediaProvider(this,MPROVIDERID_VDR,MPROVIDERRANGE_VDR);
+#endif
}
VDR::~VDR()
return ;
}
-
+#ifdef VOMP_MEDIAPLAYER
MediaList * VDR::getRootList() {
return getMediaList(NULL);
}
return (flags != 0)?-1:0;
}
-
+#endif
int VDR::deleteTimer(RecTimer* delTimer)
#include "defines.h"
#include "rectimer.h"
#include "mark.h"
+#ifdef VOMP_MEDIAPLAYER
#include "mediaprovider.h"
+#endif
#include "eventdispatcher.h"
#include "i18n.h"
#include "log.h"
class Channel;
class VDR_RequestPacket;
class VDR_ResponsePacket;
+#ifdef VOMP_MEDIAPLAYER
class SerializeBuffer;
+#endif
class MovieInfo;
class SeriesInfo;
StreamReceiver* streamReceiver;
};
-class VDR : public Thread_TYPE, public EventDispatcher, public MediaProvider, public ExternLogger
+class VDR : public Thread_TYPE,
+public EventDispatcher,
+#ifdef VOMP_MEDIAPLAYER
+public MediaProvider,
+#endif
+public ExternLogger
{
public:
bool LogExtern(const char* buffer);
bool setCharset(int charset); // 1 latin 2 UTF-8
-
+#ifdef VOMP_MEDIAPLAYER
/**
* the MediaProvider functions
*
unsigned char ** buffer);
virtual int getMediaInfo(ULONG channel, struct MediaInfo * result);
virtual int closeMediaChannel(ULONG channel);
+#endif
//TV Scraper support
void getScraperEventType(char * fileName, int & movieID, int & seriesID, int & episodeID);
ULONG channelNumberWidth;
VDR_PacketReceiver* TEMP_SINGLE_VDR_PR;
-
+#ifdef VOMP_MEDIAPLAYER
ULONG providerId;
ULONG subRange;
SerializeBuffer * doRequestResponse(SerializeBuffer *in,int cmd);
+#endif
protected:
// Thread
const static ULONG VDR_LOADTVMEDIAEVENTTHUMB = 44;
const static ULONG VDR_LOADCHANNELLOGO = 45;
const static ULONG VDR_SHUTDOWN = 666;
-
+#ifdef VOMP_MEDIAPLAYER
class VDR_Command : public SerializableList {
public:
VDR_Command(const ULONG cmd) {
};
-
+#endif
#endif
Channel * chan=(*chanList)[ sl.getCurrentOptionData()];
channelNumber = chan->number;
}
+ UINT listIndex;
+ unsigned int chanlistsize=chanList->size();
+ Channel *chan;
+ for(listIndex = 0; listIndex < chanlistsize; listIndex++)
+ {
+ chan = (*chanList)[listIndex];
+ if (chan->number == channelNumber) break;
+ }
- VEpg* vepg = new VEpg(videolive, channelNumber, chanList);
+ VEpg* vepg = new VEpg(videolive, listIndex, chanList);
vepg->draw();
boxstack->add(vepg);
boxstack->update(vepg);
wop->addOptionLine(option);
}
+ int numskins=SkinFactory::getNumberofSkins();
+ if (numskins>1) {
+ option = new Option(20, "Skin Name (needs restart)", "Advanced", "Skin Name", Option::TYPE_KEYED_TEXT, numskins, 0, 0,
+ SkinFactory::getSkinNames(),SkinFactory::getSkinNames());
+ options.push_back(option);
+ wop->addOptionLine(option);
+ }
+
#ifdef ADVANCED_MENUES
option = new Option(19, "Advanced Menu", "General", "Menu type",Option::TYPE_TEXT, 2, 0, 0, options19);
options.push_back(option);
}
break;
}
+ case 20:
+ {
+ SkinFactory::InitSkin(options[i]->userSetChoice);
+ Log::getInstance()->log("Options", Log::DEBUG, "Init Skin %d",options[i]->userSetChoice);
+ break;
+ }
}
}
else
#include "vepgsummary.h"
#include "vepglistadvanced.h"
+#include <sstream>
+
VVideoLiveTV::VVideoLiveTV(ChannelList* tchanList, ULONG initialChannelNumber, VChannelList* tvchannelList)
-: osdBack(0, 0, 0, 128)
{
vdr = VDR::getInstance();
boxstack = BoxStack::getInstance();
}
osdposterbanner.setPosition(20,20);
- osdposterbanner.setBackgroundColour(osdBack);
+ osdposterbanner.setBackgroundColour(DrawStyle::OSDBACKGROUND);
osdposterbanner.setSize(video->getScreenWidth()*4/10,video->getScreenHeight()*4/10);
osdposterbanner.setVisible(false);
add(&osdposterbanner);
- osd.setBackgroundColour(osdBack);
+ osd.setBackgroundColour(DrawStyle::OSDBACKGROUND);
osd.setPosition(0, video->getScreenHeight() - 150);
osd.setSize(video->getScreenWidth(), 150);
osd.setVisible(false);
int channellogomove=0;
if (osdv) {
- osdChannelLogo.setBackgroundColour(osdBack);
+ osdChannelLogo.setBackgroundColour(DrawStyle::OSDBACKGROUND);
osdChannelLogo.setPosition(30,5);
osdChannelLogo.setSize(60,60);
osdChannelLogo.setTVMedia(info, WTVMedia::ZoomVertical);
channellogomove=30-5;
}
- clock.setBackgroundColour(osdBack);
+ clock.setBackgroundColour(DrawStyle::OSDBACKGROUND);
clock.setPosition(osd.getWidth() - 100, 4);
clock.setSize(90, 30);
osd.add(&clock);
- osdChanNum.setBackgroundColour(osdBack);
+ osdChanNum.setBackgroundColour(DrawStyle::OSDBACKGROUND);
osdChanNum.setPosition(60+channellogomove, 4);
osdChanNum.setSize((numberWidth*10) + 22, getFontHeight()+5); // 10 px = width of number chars in font
osd.add(&osdChanNum);
- osdChanName.setBackgroundColour(osdBack);
+ osdChanName.setBackgroundColour(DrawStyle::OSDBACKGROUND);
osdChanName.setPosition(osdChanNum.getX2() + 10, 4);
osdChanName.setSize(300, 30);
osd.add(&osdChanName);
boxBlue.setSize(18, 16);
osd.add(&boxBlue);
- textRed.setBackgroundColour(osdBack);
+ textRed.setBackgroundColour(DrawStyle::OSDBACKGROUND);
textRed.setPosition(boxRed.getX2(), 98);
textRed.setSize(boxGreen.getX() - boxRed.getX2(), 30);
textRed.setText(tr("Summary"));
if (streamType == VDR::VIDEO)
{
- textGreen.setBackgroundColour(osdBack);
+ textGreen.setBackgroundColour(DrawStyle::OSDBACKGROUND);
textGreen.setPosition(boxGreen.getX2(), 98);
textGreen.setSize(boxYellow.getX() - boxGreen.getX2(), 30);
textGreen.setText(tr("Audio"));
osd.add(&textGreen);
}
- textYellow.setBackgroundColour(osdBack);
+ textYellow.setBackgroundColour(DrawStyle::OSDBACKGROUND);
textYellow.setPosition(boxYellow.getX2(), 98);
textYellow.setSize(boxBlue.getX() - boxYellow.getX2(), 30);
textYellow.setText(tr("Teletext"));
osd.add(&textYellow);
- textBlue.setBackgroundColour(osdBack);
+ textBlue.setBackgroundColour(DrawStyle::OSDBACKGROUND);
textBlue.setPosition(boxBlue.getX2(), 98);
textBlue.setSize(osd.getX2() - boxBlue.getX2(), 30);
textBlue.setText(tr("EPG"));
osd.add(&textBlue);
- sl.setBackgroundColour(osdBack);
+ sl.setBackgroundColour(DrawStyle::OSDBACKGROUND);
sl.setPosition(90, 36);
sl.setSize(480, 58);
- sl.setNoLoop();
osd.add(&sl);
- // Summary Box
- summary.setBackgroundColour(osdBack);
- summary.setPosition(0, video->getScreenHeight() - 300);
- summary.setSize(video->getScreenWidth(), 150);
- summary.setVisible(false);
- add(&summary);
-
- textSummary.setBackgroundColour(osdBack);
- textSummary.setPosition(40, 10);
- textSummary.setSize(video->getScreenWidth() - 80, 130);
- textSummary.setParaMode(true);
- summary.add(&textSummary);
-
- summaryBlackLine.setBackgroundColour(DrawStyle::BLACK);
- summaryBlackLine.setPosition(0, summary.getHeight() - 4);
- summaryBlackLine.setSize(summary.getWidth(), 4);
- summary.add(&summaryBlackLine);
sAspectRatio.setPosition(osd.getWidth() - 90, 40);
- sAspectRatio.nextColour = DrawStyle::SELECTHIGHLIGHT;
+ sAspectRatio.nextColour = DrawStyle::LIVETVSYMBOLS;
sAspectRatio.setVisible(false);
osd.add(&sAspectRatio);
osd.add(&bufferBar);
sAudioChannels.setPosition(osd.getWidth() - 130, 40);
- sAudioChannels.nextColour = DrawStyle::SELECTHIGHLIGHT;
+ sAudioChannels.nextColour = DrawStyle::LIVETVSYMBOLS;
sAudioChannels.setVisible(false);
osd.add(&sAudioChannels);
- textUnavailable.setBackgroundColour(osdBack);
+ textUnavailable.setBackgroundColour(DrawStyle::OSDBACKGROUND);
textUnavailable.setPosition(60, 30);
textUnavailable.setSize(osd.getWidth() - 120, 30);
textUnavailable.setText(tr("Channel Unavailable"));
textUnavailable.setVisible(false);
add(&textUnavailable);
- // FIXME painful
- Region r1 = summary.getRegionR();
- Region r2 = osd.getRegionR();
- osdSummaryRegion = r1 + r2;
vdisplay.mode=Fullscreen;
vdisplay.fallbackMode=Fullscreen;
delete eventList;
}
- sl.clear();
}
int VVideoLiveTV::handleCommand(int command)
{
if (osd.getVisible())
{
- if (down) sl.down();
- else sl.up();
sl.draw();
displayOSD(false);
vr->draw();
boxstack->add(vr);
boxstack->update(vr);
-/*
- if (summary.getVisible())
- {
- summary.setVisible(false);
- draw();
- boxstack->update(this, summary.getRegion());
- Timers::getInstance()->setTimerD(this, 1, 8); // Restart a timer to get rid of osd
- return;
- }
- summary.setVisible(true);
-
- if (osd.getVisible())
- {
- Timers::getInstance()->cancelTimer(this, 1);
- displayOSD(false);
- }
- else
- {
- displayOSD(true);
- }*/
}
void VVideoLiveTV::doKey(int command)
vas = new VAudioSelector(this, (*chanList)[currentChannelIndex], ((PlayerLiveTV*)player)->getCurrentAudioChannel(),
subtitleType,subtitleChannel,NULL);
- vas->setBackgroundColour(osdBack);
+ vas->setBackgroundColour(DrawStyle::OSDBACKGROUND);
vas->setPosition(0, osd.getScreenY() - vas->getHeight());
vas->draw();
// make vas != null and displayOSD will not set a timer or do any boxstack update
- summary.setVisible(false);
if (osd.getVisible()) displayOSD(false);
else displayOSD(true);
draw();
if (!eventList)
{
- sl.addOption(tr("No channel data available"), 0, 1);
+ sl.setText(tr("No channel data available"));
}
else
{
struct tm* btime;
Event* event;
int eventListSize = eventList->size();
+ std::stringstream string;
for(int i = 0; i < eventListSize; i++)
{
event = (*eventList)[i];
strftime(tempString2, 299, "%H:%M ", btime);
#endif
SNPRINTF(tempString, 299, "%s %s", tempString2, event->title);
-
- sl.addOption(tempString, (ULONG)event, (i==0));
+ string << tempString << "\n";
}
+ sl.setText(string.str().c_str());
}
}
-void VVideoLiveTV::setSummaryData()
-{
- // If osd is not being displayed, sl will be filled with now, current channel
- // If the display was already on, sl will have programme to show summary for, not necessarily current channel and now
- Event* selectedEvent = (Event*)sl.getCurrentOptionData();
-
- if (!selectedEvent)
- {
- Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "No summary");
- textSummary.setText(tr("No summary available"));
- }
- else
- {
- Log::getInstance()->log("VVideoLiveTV", Log::DEBUG, "Summary: %s", selectedEvent->description);
- textSummary.setText(selectedEvent->description);
- }
-}
+
void VVideoLiveTV::displayOSD(bool newNowNextData)
{
Region toupdate;
- if (summary.getVisible())
- {
- setSummaryData();
- summary.draw();
- toupdate=osdSummaryRegion;
- }
- else
- {
- toupdate=*osd.getRegion();
- }
+
+ toupdate=*osd.getRegion();
+
if (osdposterbanner.getVisible()) {
boxstack->update(this);
bool setTimer = true;
if (vas) setTimer = false;
- if (summary.getVisible()) setTimer = false;
if (textUnavailable.getVisible()) setTimer = false;
if (setTimer) Timers::getInstance()->setTimerD(this, 1, 4);
void VVideoLiveTV::clearScreen()
{
- if (!summary.getVisible()) Timers::getInstance()->cancelTimer(this, 1);
+ Timers::getInstance()->cancelTimer(this, 1);
textUnavailable.setVisible(false);
osd.setVisible(false);
- summary.setVisible(false);
osdposterbanner.setVisible(false);
okTriggeredOSD = false;
WTextbox clock;
WTextbox osdChanNum;
WTextbox osdChanName;
- WSelectList sl;
+ WTextbox sl;
+
Boxx boxRed;
Boxx boxGreen;
Boxx boxYellow;
WTVMedia radioChannelLogo;
WTVMedia osdChannelLogo;
- Boxx summary;
- WTextbox textSummary;
- Boxx summaryBlackLine;
- DrawStyle osdBack;
- Region osdSummaryRegion;
+
bool okTriggeredOSD;
void VWelcome::drawClock()
{
// Blank the area first
+#ifndef GRADIENT_DRAWING
rectangle(area.w - 60, 0, 60, 30, titleBarColour);
-
+#endif
char timeString[20];
time_t t;
time(&t);
void VWelcome::timercall(int clientReference)
{
+#ifndef GRADIENT_DRAWING
drawClock();
+#else
+ draw();
+#endif
boxstack->update(this, &clockRegion);
}
rectangle(area.w - 2, 0, 2, area.h, DrawStyle::LIGHTTEXT); // right
int progressWidth = (int)((area.w - 4) * (float)percent / 100);
- rectangle(2, 2, progressWidth, area.h - 4, DrawStyle::SELECTHIGHLIGHT);
+ rectangle(2, 2, progressWidth, area.h - 4, DrawStyle::PROGRESSBAR);
}
if (i == selectedOption && showseloption)
{
- rectangle(0, ypos, area.w, fontHeight * linesPerOption, darkseloption ? DrawStyle::SELECTDARKHIGHLIGHT: DrawStyle::SELECTHIGHLIGHT);
+ rectangle(0, ypos, area.w, fontHeight * linesPerOption-1, darkseloption ? DrawStyle::SELECTDARKHIGHLIGHT: DrawStyle::SELECTHIGHLIGHT);
drawOptionLine(options[i].text, 5, ypos, area.w - 5, DrawStyle::DARKTEXT, options[i].pict);
}
else
{
+ rectangle(0, ypos, area.w, fontHeight * linesPerOption-1, DrawStyle::SELECTBACKGROUND);
- drawOptionLine(options[i].text, 5, ypos, area.w - 5, DrawStyle::LIGHTTEXT, options[i].pict);
+ drawOptionLine(options[i].text, 5, ypos, area.w - 5, DrawStyle::LIGHTTEXT, options[i].pict);
}
ypos += ySeperation;
}
{
buttonBarActive = true;
visiblePane = 0;
- setBackgroundColour(DrawStyle::VIEWBACKGROUND);
+ setBackgroundColour(DrawStyle::TABVIEWBACKGROUND);
symbolLeft.setPosition(0, 4);
symbolLeft.nextColour = DrawStyle::BUTTONBACKGROUND;