Log::getInstance()->log("Boxx", Log::ERR, "Remove child box called, child %p not found", oldChild);
}
+bool Boxx::overlapsVisibleChilds(Region & r)
+{
+ for(vector<Boxx*>::iterator i = children.begin(); i != children.end(); i++)
+ {
+ if ((*i)->getVisible() && r.intersects((*i)->getRegionR()))
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
void Boxx::setParent(Boxx* newParent)
{
parent = newParent;
textPos = 0;
ypos = y;
+ Region tester;
+ tester.h = lineHeight;
+
+ bool haschildren = true;
+ if ( children.size() == 0) haschildren = false;
while(1)
{
linePos = 0;
lineWidth = 0;
+ tester.y=ypos;
while(1)
{
printLine = 0;
break;
}
thisCharWidth = charWidth(cur_char);
- if ((lineWidth + thisCharWidth) > (int)(area.w - (2 * paraMargin)))
+ tester.x = lineWidth;
+ tester.w = thisCharWidth + 10;
+
+ if ((lineWidth + thisCharWidth) > (int)(area.w - (2 * paraMargin))
+ || (haschildren && overlapsVisibleChilds(tester)))
{
// this character would break the right margin
if (cur_char == ' ')
void setParent(Boxx*);
void blt(Region& r);
+ bool overlapsVisibleChilds(Region & r);
static const int paraMargin = 10;
UINT paraVSpace;
-
// Get TV aspect ratio
config = vdr->configLoad("TV", "Aspect");
}
+ // Set recording list type
+
+ advmenues=false;
+#ifdef ADVANCED_MENUES
+ config = vdr->configLoad("Advanced", "Menu type");
+
+ if (config)
+ {
+ if (!STRCASECMP(config, "Advanced"))
+ {
+ logger->log("Command", Log::INFO, "Switching to Advanced menu");
+ advmenues=true;
+
+ }
+ else
+ {
+ logger->log("Command", Log::INFO, "Switching to Classic menu");
+ advmenues=false;
+ }
+ delete[] config;
+ }
+ else
+ {
+ logger->log("Command", Log::INFO, "Config General/menu type not found");
+ advmenues=true;
+ }
+#endif
+
config = vdr->configLoad("Advanced", "Disable WOL");
if (config)
{
void sig1();
void connectionLost();
+ void setAdvMenues(bool adv) {advmenues=adv;};
+ bool advMenues() { return advmenues;};
+
private:
void handleCommand(int);
void doStandby();
VInfo* connLost;
bool crashed;
char* server;
+
+ bool advmenues;
UDP udp;
#define TV_NORM_SWITCHABLE
#define HANDLE_VT_SWITCHING
#define GRADIENT_DRAWING
+ #define ADVANCED_MENUES // This is for special HD versions of our menus
#define PICTURE_DECODER_MAGICK
#define PICTURE_DECODER_OMX
player.o playerradio.o vfeed.o afeed.o \
demuxer.o demuxervdr.o demuxerts.o stream.o \
region.o colour.o boxstack.o boxx.o tbboxx.o \
- vinfo.o vquestion.o vrecordinglist.o vrecording.o \
+ vinfo.o vquestion.o vrecordinglist.o vrecordinglistclassic.o vrecordinglistadvanced.o vrecording.o \
vmute.o vvolume.o vtimerlist.o vtimeredit.o vrecordingmenu.o \
vchannellist.o vwelcome.o vvideorec.o vepgsettimer.o \
vchannelselect.o vserverselect.o vconnect.o vepg.o vrecmove.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 \
+ teletxt/txtfont.o mediafile.o movieinfo.o seriesinfo.o wmovieview.o wseriesview.o tvmedia.o wtvmedia.o\
wpictureview.o
LoadIndex index=0;
if (tvmedias_load.find(tvmedia)==tvmedias_load.end())
{
- index=VDR::getInstance()->loadTVMedia(tvmedia);
+ switch (tvmedia.getType()) {
+ case 3:
+ index=VDR::getInstance()->loadTVMediaRecThumb(tvmedia);
+ break;
+ default:
+ index=VDR::getInstance()->loadTVMedia(tvmedia);
+ break;
+ }
+
tvmedias_load[tvmedia]=index;
tvmedias_load_inv[index]=tvmedia;
} else {
movieInfo = NULL;
seriesInfo = NULL;
+ movieID = 0;
+ seriesID =0;
vdr->getScraperEventType(fileName, movieID, seriesID, episodeID);
Log::getInstance()->log("Recording", Log::DEBUG, "Got Scraper EventType %d %d %d",
bool overlappedBy(Region& doesthisOverlap);
// Region subtract(Region& other);
Region operator + (Region& other);
+ inline bool intersects(Region test) {
+ return !((test.x+test.w) < x || (x + w) < test.x
+ || (test.y+test.h) < y || (y+h) < test.y);
+ }
+
UINT x2();
UINT y2();
type_pict=-1; // 0 full info, 1 poster, 2 poster banner, 3 poster thumb
container=-1; // indices the dataelements with picture in movieinfo or seriesinfo
container_member=-1; // index into the container
+ primary_name="";
}
-
TVMediaInfo::TVMediaInfo(const TVMediaInfo& info)
{
type=info.type; // movie or series
type_pict=info.type_pict; // 0 full info, 1 poster, 2 poster banner, 3 poster thumb
container=info.container; // indices the dataelements with picture in movieinfo or seriesinfo
container_member=info.container_member; // index into the container
+ primary_name=info.primary_name;
}
secondary_id=si->episode.episodeid; //0 or episode id
}
+void TVMediaInfo::setPosterThumb(const char* recname)
+{
+ type=3;
+ primary_name=recname;
+}
+
bool operator<(const TVMediaInfo& rhs, const TVMediaInfo& lhs)
{
if (rhs.type==lhs.type) {
if (rhs.secondary_id==lhs.secondary_id) {
if (rhs.type_pict==lhs.type_pict) {
if (rhs.container==lhs.container) {
- return rhs.container_member<lhs.container_member;
+ if (rhs.primary_name== lhs.primary_name) {
+ return rhs.container_member < lhs.container_member;
+ } else {
+ return rhs.primary_name < lhs.primary_name;
+ }
} else {
return rhs.container<lhs.container;
}
return rhs.primary_id<lhs.primary_id;
}
+
} else {
return rhs.type < lhs.type;
}
}
+
+bool operator==(const TVMediaInfo& rhs, const TVMediaInfo& lhs)
+{
+ return (rhs.type==lhs.type) && (rhs.primary_id==lhs.primary_id) &&
+ (rhs.secondary_id==lhs.secondary_id) && (rhs.type_pict==lhs.type_pict) &&
+ (rhs.container==lhs.container) && (rhs.primary_name== lhs.primary_name)
+ && (rhs.container_member == lhs.container_member);
+}
TVMediaInfo(const TVMediaInfo& info);
friend bool operator<(const TVMediaInfo& rhs, const TVMediaInfo& lhs);
+ friend bool operator==(const TVMediaInfo& rhs, const TVMediaInfo& lhs);
void setSeasonThumb() { type_pict=2; container=0; container_member=0;};
void setPosterThumb() { type_pict=1; container=0; container_member=0;};
void setElement(int cont,int memb) { type_pict=0; container=cont; container_member=memb;};
void setMovieInfo(const MovieInfo * mi);
void setSeriesInfo(const SeriesInfo * si);
+ void setPosterThumb(const char* recname);
+ int getType() {return type;};
private:
- int type; // movie or series
+ int type; // movie or series or unknown recording
int primary_id; //movie or series_id
int secondary_id; //0 or episode id
int type_pict; // 0 full info, 1 poster thumb, 2 season thumb
int container; // indices the dataelements with picture in movieinfo or seriesinfo
int container_member; // index into the container
+ std::string primary_name;
};
struct TVMedia
edRegister(vdrpr);
+ VDR_ResponsePacket* vresp = RequestResponse(&vrp);
+ //if (vresp->noResponse()) { delete vresp; return -1; }
+ delete vresp;
+
+ return vrp.getSerial();
+}
+
+ULONG VDR::loadTVMediaRecThumb(TVMediaInfo & media)
+{
+
+ VDR_RequestPacket vrp;
+
+ if (!vrp.init(VDR_LOADTVMEDIARECTHUMB, false, 0)) return -1;
+ if (!vrp.addString(media.primary_name.c_str())) return NULL;
+
+ VDR_PacketReceiver* vdrpr = new VDR_PacketReceiver();
+ vdrpr->receiverChannel = VDR::CHANNEL_TVMEDIA;
+ vdrpr->streamID = vrp.getSerial();
+ vdrpr->streamReceiver = NULL;
+ edRegister(vdrpr);
+
+
VDR_ResponsePacket* vresp = RequestResponse(&vrp);
//if (vresp->noResponse()) { delete vresp; return -1; }
delete vresp;
MovieInfo *getScraperMovieInfo(int movieID);
SeriesInfo *getScraperSeriesInfo(int seriesID, int episodeID);
ULONG loadTVMedia(TVMediaInfo& tvmedia);
+ ULONG loadTVMediaRecThumb(TVMediaInfo& tvmedia);
void invalidateTVMedia(ULONG loadindex);
const static ULONG VDR_GETSCRAPERMOVIEINFO = 39;
const static ULONG VDR_GETSCRAPERSERIESINFO = 40;
const static ULONG VDR_LOADTVMEDIA = 41;
+const static ULONG VDR_LOADTVMEDIARECTHUMB = 42;
const static ULONG VDR_SHUTDOWN = 666;
class VDR_Command : public SerializableList {
static const char* options13[] = {"Auto","1024", "2048", "4096", "8192", "16384", "32768", "65536"};
static const char* options14[] = {"No", "Yes"};
static const char* options18[] = {"Off", "On"};
+#ifdef ADVANCED_MENUES
+ static const char* options19[] = { "Advanced","Classic"};
+#endif
// Get list of languages from VDR and construct options table
LangCode = VDR::getInstance()->getLanguageList();
options2 = new const char*[LangCode.size()];
options.push_back(option);
wop->addOptionLine(option);
-
UINT suppconn = Video::getInstance()->getSupportedFormats();
if (suppconn) {
int defaultch = 0;
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);
+ wop->addOptionLine(option);
+#endif
+
Remote::getInstance()->addOptionsToPanes(2,&options,wop);
Video::getInstance()->addOptionsToPanes(2,&options,wop);
Audio::getInstance()->addOptionsToPanes(2,&options,wop);
}
break;
}
+ case 19:
+ {
+ if (options[i]->userSetChoice == 1)
+ {
+ Log::getInstance()->log("Options", Log::DEBUG, "Setting classic menu");
+ Command::getInstance()->setAdvMenues(false);
+ }
+ else
+ {
+ Log::getInstance()->log("Options", Log::DEBUG, "Setting advanced menu");
+ Command::getInstance()->setAdvMenues(true);
+ }
+ break;
+ }
}
}
else
recman = NULL;
loading = true;
- setSize(570, 420);
- createBuffer();
- if (Video::getInstance()->getFormat() == Video::PAL)
- {
- setPosition(80, 70);
- }
- else
- {
- setPosition(70, 35);
- }
-
- setTitleBarOn(1);
- setTitleBarColour(DrawStyle::TITLEBARBACKGROUND);
-
- sl.setPosition(10, 30 + 5);
- sl.setSize(area.w - 20, area.h - 30 - 15 - 30);
- add(&sl);
}
VRecordingList::~VRecordingList()
delete recman;
}
-void VRecordingList::drawData(bool doIndexPop)
-{
- int saveIndex = sl.getCurrentOption();
- int saveTop = sl.getTopOption();
- sl.clear();
- sl.addColumn(0);
- sl.addColumn(102);
- sl.addColumn(118);
-
- int first = 1;
-
- char tempA[300]; // FIXME this is guesswork!
- char tempB[300]; // FIXME
- struct tm* btime;
-
- Directory* currentSubDir;
- DirectoryList::iterator i;
- DirectoryList* dirList = recman->getDirectories();
- for (i = dirList->begin(); i != dirList->end(); i++)
- {
- currentSubDir = *i;
- SNPRINTF(tempA, 299, tr("<dir> %lu/%lu\t \t%s"), currentSubDir->getNumNewRecordings(), currentSubDir->getNumRecordings(), currentSubDir->name);
- currentSubDir->index = sl.addOption(tempA, 0, first);
- first = 0;
- }
- // FIXME convert the whole program to time_t's
-
- Recording* currentRec;
- RecordingList::iterator j;
- RecordingList* recList = recman->getRecordings();
- for (j = recList->begin(); j != recList->end(); j++)
- {
- currentRec = *j;
- time_t recStartTime = (time_t)currentRec->getStartTime();
- btime = localtime(&recStartTime);
-//NMT does not like this too!
- //#ifndef _MSC_VER
-// strftime(tempA, 299, "%0d/%0m %0H:%0M ", btime);
-//#else
- strftime(tempA, 299, "%d/%m %H:%M ", btime);
-//#endif
- sprintf(tempB, "%s\t%c\t%s", tempA, (currentRec->getNew() ? '*': ' '), currentRec->getProgName());
-
- currentRec->index = sl.addOption(tempB, 0, first);
- first = 0;
- }
-
- if (doIndexPop)
- {
- sl.hintSetCurrent(slIndexStack.top());
- slIndexStack.pop();
- }
- else
- {
- sl.hintSetCurrent(saveIndex);
- sl.hintSetTop(saveTop);
- }
- sl.draw();
- doShowingBar();
-}
-
-void VRecordingList::draw(bool doIndexPop)
-{
- if (!loading)
- {
- if (recman->isSubDir())
- {
- char title[300];
- SNPRINTF(title, 299, tr("Recordings - %s"), recman->getCurDirName());
- setTitleText(title, 364);
- }
- else
- {
- setTitleText(tr("Recordings"));
- }
- }
-
- TBBoxx::draw();
-
- if (loading)
- {
- drawText(tr("Loading..."), 240, 180, DrawStyle::LIGHTTEXT);
- }
- else
- {
- char freeSpace[50];
- int gigFree = recman->getFreeSpace() / 1024;
- SNPRINTF(freeSpace, 49, tr("%lu%% used, %iGB free"), recman->getUsedPercent(), gigFree);
- drawTextRJ(freeSpace, 560, 5, DrawStyle::LIGHTTEXT);
- // Symbols
-
- WSymbol w;
- TEMPADD(&w);
- w.nextSymbol = WSymbol::UP;
- w.setPosition(20, 385);
- w.draw();
- w.nextSymbol = WSymbol::DOWN;
- w.setPosition(50, 385);
- w.draw();
- w.nextSymbol = WSymbol::SKIPBACK;
- w.setPosition(85, 385);
- w.draw();
- w.nextSymbol = WSymbol::SKIPFORWARD;
- w.setPosition(115, 385);
- w.draw();
- w.nextSymbol = WSymbol::PLAY;
- w.setPosition(150, 385);
- w.draw();
- drawTextRJ(tr("[ok] = menu"), 560, 385, DrawStyle::LIGHTTEXT);
-
- // All static stuff done
- drawData(doIndexPop);
- }
-}
-
-void VRecordingList::doShowingBar()
-{
- int topOption = sl.getTopOption() + 1;
- if (sl.getNumOptions() == 0) topOption = 0;
-#ifndef GRADIENT_DRAWING
- rectangle(220, 385, 180, 25, DrawStyle::VIEWBACKGROUND);
-#endif
- char showing[200];
- sprintf(showing, tr("%i to %i of %i"), topOption, sl.getBottomOption(), sl.getNumOptions());
- drawText(showing, 220, 385, DrawStyle::LIGHTTEXT);
-}
-
-void VRecordingList::quickUpdate() { //only quick for plattform that need it!
-#ifdef GRADIENT_DRAWING
- draw();
-#else
- sl.draw();
- doShowingBar();
-#endif
-}
-
void VRecordingList::processMessage(Message* m)
{
Log::getInstance()->log("VRecordingList", Log::DEBUG, "Got message value %lu", m->message);
return NULL;
}
+Directory* VRecordingList::getCurrentOptionDirectory()
+{
+ Directory* currentSubDir;
+ DirectoryList::iterator i;
+ DirectoryList* dirList = recman->getDirectories();
+ for (i = dirList->begin(); i != dirList->end(); i++)
+ {
+ currentSubDir = *i;
+ if (currentSubDir->index == sl.getCurrentOption())
+ {
+
+ return currentSubDir;
+ }
+ }
+
+ return NULL;
+}
+
int VRecordingList::handleCommand(int command)
{
switch(command)
if (sl.getNumOptions() == 0) return 2;
// Check to see if it is a sub directory
- Directory* currentSubDir;
- DirectoryList::iterator i;
- DirectoryList* dirList = recman->getDirectories();
- for (i = dirList->begin(); i != dirList->end(); i++)
+ Directory* currentSubDir=getCurrentOptionDirectory();
+
+ if (currentSubDir)
{
- currentSubDir = *i;
- if (currentSubDir->index == sl.getCurrentOption())
- {
- if (recman->down(currentSubDir))
- {
- slIndexStack.push(sl.getCurrentOption());
- sl.clear();
- draw();
- boxstack->update(this);
- }
- return 2;
- }
+ if (recman->down(currentSubDir))
+ {
+ slIndexStack.push(sl.getCurrentOption());
+ sl.clear();
+ draw();
+ boxstack->update(this);
+ }
+ return 2;
}
+
// check to see if it's a recording
Recording* current = getCurrentOptionRecording();
if (current)
VRecordingList();
virtual ~VRecordingList();
+
+ virtual void draw(bool doIndexPop = false)=0;
int handleCommand(int command);
void processMessage(Message* m);
- void draw(bool doIndexPop = false);
bool load();
- void drawData(bool doIndexPop = false);
- private:
+ protected:
BoxStack* boxstack;
bool loading;
RecMan* recman;
WSelectList sl;
- void quickUpdate();
- void doShowingBar();
void doDeleteSelected();
int doPlay(bool resume);
void doMoveRecording(Directory* toDir);
Recording* getCurrentOptionRecording();
+ Directory* getCurrentOptionDirectory();
void reSort();
+ virtual void quickUpdate()=0;
+
stack<int> slIndexStack;
};
#include "remote.h"
#include "vdr.h"
#include "vchannellist.h"
-#include "vrecordinglist.h"
+#include "vrecordinglistclassic.h"
+#include "vrecordinglistadvanced.h"
#include "vtimerlist.h"
#include "command.h"
#include "message.h"
void VWelcome::doRecordingsList()
{
- VRecordingList* vrec = new VRecordingList();
- vrec->draw();
- boxstack->add(vrec);
- boxstack->update(vrec);
-
- if (!vrec->load())
- {
- Command::getInstance()->connectionLost();
- }
+ VRecordingList* vrec;
+ if (Command::getInstance()->advMenues()) {
+ vrec = new VRecordingListAdvanced();
+ } else {
+ vrec = new VRecordingListClassic();
+ }
+ vrec->draw();
+ boxstack->add(vrec);
+ boxstack->update(vrec);
+
+ if (!vrec->load())
+ {
+ Command::getInstance()->connectionLost();
+ }
}
void VWelcome::doMediaList()
#include "colour.h"
#include "log.h"
+#include <math.h>
+
WSelectList::WSelectList():
backgroundColour(DrawStyle::VIEWBACKGROUND)
{
gap = 1;
showseloption = true;
darkseloption = false;
+ linesPerOption = 1;
}
for (int i = 0; i < vsize; i++)
{
delete[] options[i].text;
+ if (options[i].pict) delete options[i].pict;
}
options.clear();
topOption = idx;
}
-int WSelectList::addOption(const char* text, ULONG data, int selected)
+int WSelectList::addOption(const char* text, ULONG data, int selected, TVMediaInfo * pict)
{
int thisNewOption = options.size();
wslo.text = new char[strlen(text) + 1];
strcpy(wslo.text, text);
wslo.data = data;
+ wslo.pict = pict;
options.push_back(wslo);
if (selected) selectedOption = thisNewOption;
return thisNewOption;
void WSelectList::draw()
{
int fontHeight = getFontHeight();
- int ySeperation = fontHeight + gap;
+ int ySeperation = fontHeight * linesPerOption + gap;
numOptionsDisplayable = (area.h - 5) / ySeperation;
if (i == selectedOption && showseloption)
{
- rectangle(0, ypos, area.w, fontHeight, darkseloption ? DrawStyle::SELECTDARKHIGHLIGHT: DrawStyle::SELECTHIGHLIGHT);
+ rectangle(0, ypos, area.w, fontHeight * linesPerOption, darkseloption ? DrawStyle::SELECTDARKHIGHLIGHT: DrawStyle::SELECTHIGHLIGHT);
- drawOptionLine(options[i].text, 5, ypos, area.w - 5, DrawStyle::DARKTEXT);
+ drawOptionLine(options[i].text, 5, ypos, area.w - 5, DrawStyle::DARKTEXT, options[i].pict);
}
else
{
- drawOptionLine(options[i].text, 5, ypos, area.w - 5, DrawStyle::LIGHTTEXT);
+ drawOptionLine(options[i].text, 5, ypos, area.w - 5, DrawStyle::LIGHTTEXT, options[i].pict);
}
ypos += ySeperation;
}
columns[numColumns++] = x;
}
-void WSelectList::drawOptionLine(char* text, int xpos, int ypos, int width, const DrawStyle& colour)
+void WSelectList::drawOptionLine(char* text, int xpos, int ypos, int width, const DrawStyle& colour, TVMediaInfo* pict)
{
- if (!numColumns)
+ UINT curline = 0;
+ UINT taboffset = 0;
+ int fontHeight = getFontHeight();
+ float ypos_mod= ypos + (linesPerOption-floor(linesPerOption))*((float)fontHeight)*0.5f;
+
+ if (pict)
+ {
+ drawTVMedia(*pict, xpos,ypos,0,fontHeight*linesPerOption,TopLeft);
+ taboffset++;
+ }
+
+ if (!numColumns && linesPerOption == 1)
{
drawText(text, xpos, ypos, width, colour);
{
char buffer[200];
strncpy(buffer, text, 199);
- int currentColumn = 0;
+ int currentColumn = taboffset;
char* pointer;
- pointer = strtok(buffer, "\t");
+ pointer = strtok(buffer, "\t\n");
while(pointer)
{
+ drawText(pointer, xpos + columns[currentColumn], ypos_mod + curline * fontHeight, width - columns[currentColumn], colour);
+
+ pointer = strtok(NULL, "\t\n");
+ if (pointer) {
+ char delimiter = text[pointer - buffer-1];
+ if (delimiter == '\t') currentColumn++;
+ else if (delimiter == '\n' ){
+ currentColumn = taboffset;
+ curline++;
+ }
+ }
+ if (curline >= linesPerOption) return;
- drawText(pointer, xpos + columns[currentColumn], ypos, width - columns[currentColumn], colour);
-
- currentColumn++;
if (currentColumn == 10) return;
- pointer = strtok(NULL, "\t");
}
}
}
{
char* text;
ULONG data;
+ TVMediaInfo *pict;
} wsloption;
class WSelectList : public Boxx
void setNoLoop();
void setShowSelOption(bool set) { showseloption = set; };
void setDarkSelOption(bool set) { darkseloption = set; };
- int addOption(const char* text, ULONG data, int selected);
+ int addOption(const char* text, ULONG data, int selected, TVMediaInfo * pict=NULL);
void draw();
void setBackgroundColour(const DrawStyle& colour);
+ void setLinesPerOption(float lines) {linesPerOption=lines;};
void down();
void up();
virtual bool mouseAndroidScroll(int x, int y,int sx, int sy);
private:
- void drawOptionLine(char* text, int xpos, int ypos, int width, const DrawStyle& colour);
+ void drawOptionLine(char* text, int xpos, int ypos, int width, const DrawStyle& colour, TVMediaInfo* pict);
int getMouseLine(int x, int y);
vector<wsloption> options;
int numColumns;
int noLoop;
bool showseloption, darkseloption;
+ float linesPerOption;
UINT gap;
DrawStyle backgroundColour;
--- /dev/null
+/*
+ Copyright 2004-2005 Chris Tallon, 2014 Marten Richter
+
+ This file is part of VOMP.
+
+ VOMP is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ VOMP is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with VOMP; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+#include "boxx.h"
+#include "wtvmedia.h"
+
+
+
+
+ WTVMedia::WTVMedia()
+ {
+ media = false;
+ scale=NoZoom;
+ }
+
+ WTVMedia::~WTVMedia()
+ {
+
+ }
+
+
+
+ void WTVMedia::setTVMedia(TVMediaInfo & ninfo, Scaling nscale)
+ {
+ info = ninfo;
+ scale = nscale;
+ media =true;
+ }
+
+ void WTVMedia::draw()
+ {
+ if (!media) return;
+ float w=0;
+ float h=0;
+ switch (scale)
+ {
+ case ZoomHorizontal:
+ w = area.w; break;
+ case ZoomVertical:
+ h = area.h; break;
+ case ZoomBoth:
+ w = area.w;
+ h = area.h; break;
+ }
+ drawTVMedia(info,0.f,0.f,w,h,TopLeft);
+
+ }
--- /dev/null
+/*
+ Copyright 2004-2005 Chris Tallon, 2014 Marten Richter
+
+ This file is part of VOMP.
+
+ VOMP is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ VOMP is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with VOMP; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+*/
+
+#ifndef WTVMEDIA_H
+#define WTVMEDIA_H
+
+#include <stdio.h>
+#include <malloc.h>
+#include "boxx.h"
+
+
+
+
+class WTVMedia : public Boxx
+{
+ public:
+ WTVMedia();
+ virtual ~WTVMedia();
+
+ enum Scaling {
+ NoZoom,
+ ZoomHorizontal,
+ ZoomVertical,
+ ZoomBoth
+ };
+
+ void setTVMedia(TVMediaInfo & info, Scaling scale);
+ void draw();
+
+ protected:
+ TVMediaInfo info;
+ Scaling scale;
+ bool media;
+};
+
+
+
+#endif