LDFLAGS = -Wall -static\r
LIBS = -lpthread -lrt\r
\r
-OBJECTS += wwss.o main.o threadp.o remotemvp.o ledmvp.o mtdmvp.o videomvp.o audiomvp.o osdmvp.o surfacemvp.o vmedialist.o vcolourtuner.o vmediaview.o vvideomedia.o mediafile.o \r
+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 mediafile.o \r
TIOBJECT = ticonfig.o\r
CROSSLIBS = ../jpeg/jpeg-6b/libjpeg.a\r
INCLUDES = -I../jpeg/jpeg-6b -DVOMP_PLATTFORM_MVP \r
#define OsdStartDev "/dev/stbgfx"\r
#define Audio_TYPE AudioMVP\r
#define Video_TYPE VideoMVP\r
+ #define Surface_TYPE SurfaceMVP //deprecated\r
#define DEFAULT_TCP_WINDOWSIZENR 1 /*=2048*/\r
#define PAL_WSS\r
#define MVP_REMOTE_TYPES\r
\r
+ #define VOMP_MEDIAPLAYER\r
#define VOMP_LINUX_CLOCK CLOCK_REALTIME\r
#endif\r
\r
#define OsdStartDev ""\r
#define Audio_TYPE AudioNMT\r
#define Video_TYPE VideoNMT\r
+ #define Surface_TYPE SurfaceDirectFB //deprecated\r
#define DEFAULT_TCP_WINDOWSIZENR 1 /*=2048*/\r
\r
#define VOMP_LINUX_CLOCK CLOCK_REALTIME\r
return fdOsd;
}
-Surface * OsdMvp::createNewSurface();{
- return (Surface*)new SurfaceMVP();
+Surface * OsdMVP::createNewSurface()
+{
+ return (Surface*)new SurfaceMVP();
}
-
int OsdMVP::init(void* device)
{
if (initted) return 0;
{\r
friend class Wwss; // classes that need surface access, their usage is forbidden for vector based\r
friend class WJpegComplex;// implementations of osd\r
+ friend class VColourTuner;
public:\r
Surface(int id = 0);\r
virtual ~Surface();\r
\r
void drawHorzLine(int x1, int x2, int y, const DrawStyle& c);\r
void drawVertLine(int x, int y1, int y2, const DrawStyle& c);\r
- void drawBitmap(int x, int y, const Bitmap& bm);\r
+ void drawBitmap(int x, int y, const Bitmap& bm, const DisplayRegion& region);\r
int updateToScreen(int sx, int sy, int w, int h, int dx, int dy);\r
void readPixel(int x, int y, unsigned char* r, unsigned char* g, unsigned char* b);\r
void screenShot(const char* fileName);\r
#include "i18n.h"\r
#include "log.h"\r
#include "mediaoptions.h"\r
+
+#ifdef VOMP_PLATTFORM_MVP
+#include "surfacemvp.h"
+#endif
+
\r
#define PICTUREFILE "/colourtest.jpg"\r
\r
int bw=50;\r
int bh=50;\r
int picx=picture.getX();\r
- Colour bc=Colour(140,140,140);\r
+ DrawStyle bc=DrawStyle(140,140,140);\r
fillColour(bc);\r
- bc=Colour(255,255,255);\r
- drawText(tr("Colour Tuning"), x+20, y+5, Colour::LIGHTTEXT);\r
- drawBox(x, y+50, bw, bh, Colour::RED);\r
- drawBox(x, y+130, bw, bh, Colour::GREEN);\r
- drawBox(x, y+190, bw, bh, Colour::BLUE);\r
+ bc=DrawStyle(255,255,255);\r
+ drawText(tr("Colour Tuning"), x+20, y+5, DrawStyle::LIGHTTEXT);\r
+ drawBox(x, y+50, bw, bh, DrawStyle::RED);\r
+ drawBox(x, y+130, bw, bh, DrawStyle::GREEN);\r
+ drawBox(x, y+190, bw, bh, DrawStyle::BLUE);\r
drawBox(x, y+270, bw, bh, bc);\r
sprintf(valbuf,"%03d%%",vrfactor);\r
- drawText(valbuf,x+bw+x,y+50, Colour::LIGHTTEXT);\r
- drawText("<1 2>",x+bw+x,y+74, Colour::LIGHTTEXT);\r
+ drawText(valbuf,x+bw+x,y+50, DrawStyle::LIGHTTEXT);\r
+ drawText("<1 2>",x+bw+x,y+74, DrawStyle::LIGHTTEXT);\r
sprintf(valbuf,"%03d%%",vgfactor);\r
- drawText(valbuf,x+bw+x,y+120, Colour::LIGHTTEXT);\r
- drawText("<4 5>",x+bw+x,y+144, Colour::LIGHTTEXT);\r
+ drawText(valbuf,x+bw+x,y+120, DrawStyle::LIGHTTEXT);\r
+ drawText("<4 5>",x+bw+x,y+144, DrawStyle::LIGHTTEXT);\r
sprintf(valbuf,"%03d%%",vbfactor);\r
- drawText(valbuf,x+bw+x,y+190, Colour::LIGHTTEXT);\r
- drawText("<7 8>",x+bw+x,y+214, Colour::LIGHTTEXT);\r
+ drawText(valbuf,x+bw+x,y+190, DrawStyle::LIGHTTEXT);\r
+ drawText("<7 8>",x+bw+x,y+214, DrawStyle::LIGHTTEXT);\r
sprintf(valbuf,"%03d%%",(vbfactor+vgfactor+vrfactor)/3);\r
- drawText(valbuf,x+bw+x,y+270, Colour::LIGHTTEXT);\r
- drawText("<3 6>",x+bw+x,y+294, Colour::LIGHTTEXT);\r
- drawText("9 norm",x+bw+x,y+318, Colour::LIGHTTEXT);\r
- drawText(tr("OK to save, BACK to cancel"), x+20, area.h - 50, Colour::LIGHTTEXT);\r
+ drawText(valbuf,x+bw+x,y+270, DrawStyle::LIGHTTEXT);\r
+ drawText("<3 6>",x+bw+x,y+294, DrawStyle::LIGHTTEXT);\r
+ drawText("9 norm",x+bw+x,y+318, DrawStyle::LIGHTTEXT);\r
+ drawText(tr("OK to save, BACK to cancel"), x+20, area.h - 50, DrawStyle::LIGHTTEXT);\r
if (drawPicture) {\r
hasChanged=false;\r
picture.init(PICTUREFILE);\r
}\r
int picy=picture.getY();\r
int pich=picture.getHeight();\r
- if (hasChanged) drawText(tr("0 to draw picture"), picx+30, picy+pich+10, Colour::LIGHTTEXT);\r
+ if (hasChanged) drawText(tr("0 to draw picture"), picx+30, picy+pich+10, DrawStyle::LIGHTTEXT);\r
}\r
\r
int VColourTuner::handleCommand(int command)\r
//amount in +/- %
void updateFactor(int color, int amount);
//draw a box with the picture drawing function
- void drawBox(int x, int y, int w, int h, Colour &c);
+ void drawBox(int x, int y, int w, int h, DrawStyle &c);
static int rfactor;
static int bfactor;
static int gfactor;
int vgfactor;
bool drawPicture;
bool hasChanged;
- WJpeg picture;
+ WJpegTYPE picture;
};
setPosition(70, 35);
setTitleBarOn(1);
- setTitleBarColour(Colour::TITLEBARBACKGROUND);
+ setTitleBarColour(DrawStyle::TITLEBARBACKGROUND);
sl.setPosition(10, 30 + 5);
sl.setSize(area.w - 20, area.h - 30 - 15 - 30);
{
sl.setVisible(false);
TBBoxx::draw();
- drawText(tr("Loading..."), 240, 180, Colour::LIGHTTEXT);
+ drawText(tr("Loading..."), 240, 180, DrawStyle::LIGHTTEXT);
}
else
{
// Box b;
// b.setSurfaceOffset(220, 385);
// b.setDimensions(160, 25);
-// b.fillColour(Colour::VIEWBACKGROUND);
-// b.drawText(showing, 0, 0, Colour::LIGHTTEXT);
+// b.fillColour(DrawStyle::VIEWBACKGROUND);
+// b.drawText(showing, 0, 0, DrawStyle::LIGHTTEXT);
- rectangle(200, 384, 18, 16, Colour::VIDEOBLUE);
- rectangle(220, 385, 220+160, 385+25, Colour::VIEWBACKGROUND);
- drawText(strmode, 220, 385, Colour::LIGHTTEXT);
- drawText(showing, 280, 385, Colour::LIGHTTEXT);
+ rectangle(200, 384, 18, 16, DrawStyle::VIDEOBLUE);
+ rectangle(220, 385, 220+160, 385+25, DrawStyle::VIEWBACKGROUND);
+ drawText(strmode, 220, 385, DrawStyle::LIGHTTEXT);
+ drawText(showing, 280, 385, DrawStyle::LIGHTTEXT);
if (sl.getCurrentOptionData() != 0) Log::getInstance()->log("VMediaList",Log::DEBUG,"selected %s",((Media *)sl.getCurrentOptionData())->getDisplayName());
}
\r
#define DRAWING_THREAD\r
\r
-Colour VMediaView::pictureBack=Colour(140,140,140);\r
-Colour VMediaView::infoBack=Colour(110,110,110);\r
-Colour VMediaView::audioBannerBack=Colour(110,110,110,20);\r
+DrawStyle VMediaView::pictureBack=DrawStyle(140,140,140);\r
+DrawStyle VMediaView::infoBack=DrawStyle(110,110,110);\r
+DrawStyle VMediaView::audioBannerBack=DrawStyle(110,110,110,20);\r
//the jpeg reader\r
\r
//how long do we wait for a single picture chunk\r
VPreader * _reader;\r
WJpegComplex::JpegControl *_ctl;\r
Surface *_sfc;\r
- Colour _colour;\r
+ DrawStyle _colour;\r
bool _interrupted;\r
public:\r
DrawingThread(VMediaView *parent) {\r
bool isRunning() {\r
return (threadIsActive()!=0);\r
}\r
- bool start(WJpeg::JpegControl *ctl,Surface *sfc,VPreader *reader,Colour &c) {\r
+ bool start(WJpegComplex::JpegControl *ctl,Surface *sfc,VPreader *reader,DrawStyle &c) {\r
if (isRunning()) {\r
return false;\r
}\r
protected:\r
virtual void threadMethod() {\r
Log::getInstance()->log("DrawingThread",Log::DEBUG,"started");\r
- bool rt=WJpeg::drawJpeg(_ctl,_sfc,_reader,_colour);\r
+ bool rt=WJpegComplex::drawJpeg(_ctl,_sfc,_reader,_colour);\r
_reader=NULL;\r
if (! _interrupted) {\r
Message* m = new Message(); \r
Log::getInstance()->log("VMediaView::draw", Log::DEBUG, "pictureError=%s,p=%p", pictureError,this);\r
\r
if (pictureShowing ) fillColour(pictureBack);\r
- else fillColour(Colour::BLACK);\r
+ else fillColour(DrawStyle::BLACK);\r
if (pictureError) {\r
- drawText(pictureError,100,area.h/2,Colour::LIGHTTEXT);\r
+ drawText(pictureError,100,area.h/2,DrawStyle::LIGHTTEXT);\r
return;\r
}\r
}\r
case Remote::DF_UP:\r
case Remote::UP:\r
case Remote::SKIPBACK:\r
- rotate=WJpegCmplex::ROT_0;\r
+ rotate=WJpegComplex::ROT_0;\r
showPicture(VMediaList::MV_PREV,slideshow,true);\r
rt= 2;\r
break;\r
case Remote::RED:\r
switch(rotate) {\r
case WJpegComplex::ROT_0:\r
- rotate=WJpeg::ROT_90;\r
+ rotate=WJpegComplex::ROT_90;\r
break;\r
case WJpegComplex::ROT_90:\r
rotate=WJpegComplex::ROT_180;\r
case Remote::BLUE:\r
switch (cropmode) {\r
case WJpegComplex::CROP:\r
- cropmode=WJpeg::LETTER;\r
+ cropmode=WJpegComplex::LETTER;\r
break;\r
case WJpegComplex::LETTER:\r
- cropmode=WJpeg::CROPPERCENT;\r
+ cropmode=WJpegComplex::CROPPERCENT;\r
break;\r
default:\r
cropmode=WJpegComplex::CROP;\r
len=strlen(first)+3;\r
}\r
else {\r
- playerInfo=getPlayer()->getID3Info();drawText(tr("Loading"),5,3,Colour::LIGHTTEXT);\r
+ playerInfo=getPlayer()->getID3Info();drawText(tr("Loading"),5,3,DrawStyle::LIGHTTEXT);\r
len=strlen(currentAudio->getDisplayName())+strlen(pl)+30+strlen(parent->getDirname(MEDIA_TYPE_AUDIO))+Media::TIMEBUFLEN+110;\r
if (playerInfo) {\r
for (UINT i=0;i<strlen(playerInfo);i++) \r
//now the real drawing functions\r
info->draw();\r
//title\r
- info->rectangle(0, 0, info->getWidth(), 30, Colour::TITLEBARBACKGROUND);\r
- info->drawText(title, 5, 5, Colour::LIGHTTEXT);\r
- info->drawPara(buf,5,32,Colour::LIGHTTEXT);\r
+ info->rectangle(0, 0, info->getWidth(), 30, DrawStyle::TITLEBARBACKGROUND);\r
+ info->drawText(title, 5, 5, DrawStyle::LIGHTTEXT);\r
+ info->drawPara(buf,5,32,DrawStyle::LIGHTTEXT);\r
delete [] buf;\r
if (! audioError) {\r
WSymbol w;\r
info->TEMPADD(&w);\r
int x=10;\r
int ybottom=info->getHeight();\r
- info->rectangle(0, ybottom - barRegion.h, info->getWidth(), barRegion.h, Colour::TITLEBARBACKGROUND);\r
+ info->rectangle(0, ybottom - barRegion.h, info->getWidth(), barRegion.h, DrawStyle::TITLEBARBACKGROUND);\r
bool drawSymbol=true;\r
switch(getPlayer()->getState()) {\r
case AudioPlayer::S_PAUSE:\r
}\r
else {\r
//stop symbol\r
- info->rectangle(x, ybottom - 23, 18, 16, Colour::LIGHTTEXT);\r
+ info->rectangle(x, ybottom - 23, 18, 16, DrawStyle::LIGHTTEXT);\r
}\r
x+=30;\r
drawAudioClocks();\r
if (! info || ! audioEnabled) return;\r
Log::getInstance()->log("VMediaView::drawAudioClocks", Log::DEBUG, "");\r
//draw clocks and bar\r
- info->rectangle(clocksRegion, Colour::TITLEBARBACKGROUND);\r
+ info->rectangle(clocksRegion, DrawStyle::TITLEBARBACKGROUND);\r
\r
time_t currentSec = (time_t)(getPlayer()->getCurrentTimes());\r
time_t lengthSec=(time_t)(getPlayer()->getSonglen());\r
//Log::getInstance()->log("VMediaView", Log::DEBUG, buffer);\r
}\r
\r
- info->drawText(buffer, clocksRegion.x, clocksRegion.y, Colour::LIGHTTEXT);\r
+ info->drawText(buffer, clocksRegion.x, clocksRegion.y, DrawStyle::LIGHTTEXT);\r
\r
// Draw progress bar\r
int progBarXbase = 0;\r
int barlen=250;\r
\r
- info->rectangle(barRegion.x + progBarXbase, barRegion.y + 3, barlen+10, 24, Colour::LIGHTTEXT);\r
+ info->rectangle(barRegion.x + progBarXbase, barRegion.y + 3, barlen+10, 24, DrawStyle::LIGHTTEXT);\r
info->rectangle(barRegion.x + progBarXbase + 2, barRegion.y + 5, barlen+6, 20, barBlue);\r
\r
if (currentSec > lengthSec) currentSec=lengthSec;\r
\r
// Draw yellow portion\r
int progressWidth = (barlen+2) * currentSec / lengthSec;\r
- info->rectangle(barRegion.x + progBarXbase + 4, barRegion.y + 7, progressWidth, 16, Colour::SELECTHIGHLIGHT);\r
+ info->rectangle(barRegion.x + progBarXbase + 4, barRegion.y + 7, progressWidth, 16, DrawStyle::SELECTHIGHLIGHT);\r
\r
}\r
\r
audioBanner->setTitleBarOn(0);\r
audioBanner->setDropThrough();\r
if ( ! currentAudio || ! currentAudio->getDisplayName() || audioError) {\r
- audioBanner->drawText(tr("AudioPlayer - not playing"),5,3,Colour::LIGHTTEXT);\r
+ audioBanner->drawText(tr("AudioPlayer - not playing"),5,3,DrawStyle::LIGHTTEXT);\r
}\r
else {\r
char * buf=new char[strlen(currentAudio->getDisplayName())+50];\r
SNPRINTF(buf,50,"%s %s",tr("AudioPlayer"),currentAudio->getDisplayName());\r
- audioBanner->drawText(buf,5,3,Colour::LIGHTTEXT);\r
+ audioBanner->drawText(buf,5,3,DrawStyle::LIGHTTEXT);\r
delete buf;\r
}\r
BoxStack::getInstance()->add(audioBanner);\r
#include "vmedialist.h"
#include "colour.h"
#include "wjpeg.h"
+#include "wjpegcomplex.h"
#include "imagereader.h"
#define TESTCOLOURS
WJpegComplex::Rotation rotate;
WJpegComplex::ScaleMode cropmode;
VInfo * info;
- static Colour pictureBack;
- static Colour infoBack;
- static Colour audioBannerBack;
+ static DrawStyle pictureBack;
+ static DrawStyle infoBack;
+ static DrawStyle audioBannerBack;
int currentScale;
MediaOptions *options;
WJpegComplex::JpegControl ctl;
bool justPlaying;
Region barRegion;
Region clocksRegion;
- Colour barBlue;
+ DrawStyle barBlue;
//retrigger info on events?
bool retriggerAudioInfo;
VInfo *audioBanner;
};\r
\r
\r
-#if !defined(WIN32) || !defined(__ANDROID)\r
-#define WJpegTYPE WJpegSimple\r
-#include "wjpegsimple.h"\r
-#else\r
+#if defined(VOMP_PLATTFORM_MVP) //Complex jpegs only on mvp\r
#define WJpegTYPE WJpegComplex\r
#include "wjpegcomplex.h"\r
+#else\r
+#define WJpegTYPE WJpegSimple\r
+#include "wjpegsimple.h"\r
#endif\r
\r
#endif\r
//a struct to store user data for the jpeg decompressor\r
class jpegUserData{\r
public:\r
- WJpeg::JpegControl * ctl;\r
+ WJpegComplex::JpegControl * ctl;\r
JpegReader *reader;\r
jpegUserData() {\r
ctl=NULL;\r
ud=(jpegUserData *)(mysrc->userdata);\r
switch(orient) {\r
case 3:\r
- ud->ctl->exifRotation=WJpeg::ROT_180;\r
+ ud->ctl->exifRotation=WJpegComplex::ROT_180;\r
break;\r
case 6:\r
- ud->ctl->exifRotation=WJpeg::ROT_90;\r
+ ud->ctl->exifRotation=WJpegComplex::ROT_90;\r
break;\r
case 8:\r
- ud->ctl->exifRotation=WJpeg::ROT_270;\r
+ ud->ctl->exifRotation=WJpegComplex::ROT_270;\r
break;\r
}\r
\r
SNPRINTF(errbuf,200,"jpeg reader not initialized");\r
}\r
if (! ok) {\r
- drawTextCentre(tr("Jpeg ERROR"), 240, 170, Colour::LIGHTTEXT);\r
- if (errbuf[0] != 0) drawTextCentre(errbuf,240,200, Colour::LIGHTTEXT);\r
- if (ctl.error[0] != 0) drawTextCentre(ctl.error,240,230, Colour::LIGHTTEXT);\r
+ drawTextCentre(tr("Jpeg ERROR"), 240, 170, DrawStyle::LIGHTTEXT);\r
+ if (errbuf[0] != 0) drawTextCentre(errbuf,240,200, DrawStyle::LIGHTTEXT);\r
+ if (ctl.error[0] != 0) drawTextCentre(ctl.error,240,230, DrawStyle::LIGHTTEXT);\r
}\r
}\r
\r
\r
#ifndef __ANDROID__\r
\r
-bool WJpegComplex::drawJpeg(JpegControl * ctl,Surface * sfc,JpegReader *rdr, Colour & backgroundColour) {\r
+bool WJpegComplex::drawJpeg(JpegControl * ctl,Surface * sfc,JpegReader *rdr, DrawStyle & backgroundColour) {\r
Log* logger = Log::getInstance();\r
if (! rdr || ! sfc) {\r
logger->log("BJpeg", Log::ERR, "JPEG error rdr=NULL or sfc=NULL");\r
picturew, pictureh,xpos,ypos,jpegwidth,jpegheight,(int)ctl->finalRotation*90);\r
\r
//fill the background\r
- sfc->fillblt(ctl->area.x,ctl->area.y,ctl->area.w,ctl->area.h,backgroundColour.rgba());\r
+ sfc->fillblt(ctl->area.x,ctl->area.y,ctl->area.w,ctl->area.h,backgroundColour);\r
\r
//line len in bytes (3 bytes per Pixel) - for buffer (can be bigger then surface)\r
int linelen=jpegwidth*3;\r
\r
int rowsread = 0;\r
\r
- Colour c;\r
+ DrawStyle c;\r
sfc->startFastDraw();//Tell the surface, that we will draw a lot of pixel,\r
//so that performance, can be optimized\r
logger->log("BJpeg", Log::DEBUG, "start drawing ");\r
\r
\r
#else\r
-bool WJpegComplex::drawJpeg(JpegControl * ctl,Surface * sfc,JpegReader *rdr, Colour & backgroundColour) {\r
+bool WJpegComplex::drawJpeg(JpegControl * ctl,Surface * sfc,JpegReader *rdr, DrawStyle & backgroundColour) {\r
return true;\r
}\r
#endif\r
//the reader has to be initialized before\r
//calling this function does not need a WJpeg being instantiated\r
//it simply draws into the surface\r
- bool static drawJpeg(JpegControl * control, Surface* sfc, JpegReader *rdr, Colour & backgroundColour);\r
+ bool static drawJpeg(JpegControl * control, Surface* sfc, JpegReader *rdr, DrawStyle & backgroundColour);\r
\r
private:\r
//our drawPixel with considers rotation\r