From 6ad300cca5e32a24004a9ef79284af7ef8e12341 Mon Sep 17 00:00:00 2001 From: Marten Richter Date: Sun, 14 Sep 2014 13:31:13 +0200 Subject: [PATCH] Add recording option to VEpgSummary --- vepgsummary.cc | 56 ++++++++++++++++++++++++++++--------------------- vepgsummary.h | 7 ++++++- vvideolivetv.cc | 2 +- 3 files changed, 39 insertions(+), 26 deletions(-) diff --git a/vepgsummary.cc b/vepgsummary.cc index 023ab18..84c0669 100644 --- a/vepgsummary.cc +++ b/vepgsummary.cc @@ -22,6 +22,7 @@ #include "remote.h" #include "vquestion.h" +#include "vepgsettimer.h" #include "vinfo.h" #include "vdr.h" #include "colour.h" @@ -30,6 +31,7 @@ #include "command.h" #include "boxstack.h" #include "event.h" +#include "channel.h" #include "message.h" #include "log.h" #include "wmovieview.h" @@ -38,9 +40,10 @@ #include -VEpgSummary::VEpgSummary(Event *tevent) +VEpgSummary::VEpgSummary(Event *tevent, Channel* tchannel) { event = tevent; + channel = tchannel; if (Video::getInstance()->getFormat() == Video::PAL) @@ -62,9 +65,19 @@ VEpgSummary::VEpgSummary(Event *tevent) setTitleBarColour(DrawStyle::TITLEBARBACKGROUND); tabbar.setPosition(10+10, 30 + 5); - tabbar.setSize(area.w - 20-10, area.h - 30 - 10); + tabbar.setSize(area.w - 20-10, area.h - 30 - 10-30); add(&tabbar); + boxRed.setBackgroundColour(DrawStyle::RED); + boxRed.setPosition(20 /*54*/, tabbar.getY2()+8); + boxRed.setSize(18, 16); + add(&boxRed); + + textRed.setPosition(boxRed.getX2(), tabbar.getY2()+4); + textRed.setSize(166, 30); + textRed.setText(tr("Record")); + add(&textRed); + WTextbox * summary=new WTextbox(); summary->setParaMode(true); @@ -75,8 +88,10 @@ VEpgSummary::VEpgSummary(Event *tevent) OsdVector *osdv=dynamic_cast(Osd::getInstance()); tabbar.addTab(tr("EPG"), summary); + WMovieView *movieview=NULL; + WSeriesView *seriesview=NULL; if (event->movieInfo) { - WMovieView *movieview = new WMovieView(event->movieInfo); + movieview = new WMovieView(event->movieInfo); movieview->setParaMode(true); tabbar.addTab(tr("TheTVDB Info"), movieview); if (osdv) { @@ -89,7 +104,7 @@ VEpgSummary::VEpgSummary(Event *tevent) tabbar.addTab(tr("Gallery"),artgallery); } } else if (event->seriesInfo) { - WSeriesView *seriesview = new WSeriesView(event->seriesInfo); + seriesview = new WSeriesView(event->seriesInfo); seriesview->setParaMode(true); tabbar.addTab(tr("TheTVDB Info"), seriesview); if (osdv) { @@ -107,6 +122,8 @@ VEpgSummary::VEpgSummary(Event *tevent) epgTVmedia.setPosition(summary->getRegionR().w-130-10,0); epgTVmedia.setSize(130,195/Osd::getInstance()->getPixelAspect()); summary->add(&epgTVmedia); + if (movieview) movieview->add(&epgTVmedia); + if (seriesview) movieview->add(&epgTVmedia); TVMedia poster; poster.height=0; if (event->movieInfo) { @@ -129,27 +146,7 @@ VEpgSummary::VEpgSummary(Event *tevent) } - /* - int sfh = getFontHeight(); - buttonRegion.x = 10; - buttonRegion.y = 10+30; - buttonRegion.w = 130; - buttonRegion.h = sfh*2*last; - button[PLAY].setText(tr("Play")); - button[RESUME].setText(tr("Resume")); - button[MOVE].setText(tr("Move")); - button[A_DELETE].setText(tr("Delete")); - - for (int i=PLAY, ver=10+30; ilog("VEpgSummary", Log::DEBUG, "ID %lu TIME %lu DURATION %lu TITLE %s", event->id, event->time, event->duration, event->title); + VEpgSetTimer* vs = new VEpgSetTimer(event, channel); + vs->draw(); + BoxStack *boxstack=BoxStack::getInstance(); + boxstack->add(vs); + boxstack->update(vs); + return 2; + } // Pass to tabbar int retval = tabbar.handleCommand(command); diff --git a/vepgsummary.h b/vepgsummary.h index b52df1e..92ec74a 100644 --- a/vepgsummary.h +++ b/vepgsummary.h @@ -34,11 +34,12 @@ class VRecordingList; class Event; class Message; +class Channel; class VEpgSummary : public TBBoxx { public: - VEpgSummary(Event* event); + VEpgSummary(Event* event, Channel* tchannel); ~VEpgSummary(); @@ -48,8 +49,12 @@ class VEpgSummary : public TBBoxx private: Event* event; + Channel *channel; WTabBar tabbar; WTVMedia epgTVmedia; + + Boxx boxRed; + WTextbox textRed; }; #endif diff --git a/vvideolivetv.cc b/vvideolivetv.cc index efc1cd7..bf550c2 100644 --- a/vvideolivetv.cc +++ b/vvideolivetv.cc @@ -540,7 +540,7 @@ void VVideoLiveTV::doSummary() Event* event = (*eventList)[0]; event->loadinfos(currentChannel->number); - VEpgSummary* vr = new VEpgSummary(event); + VEpgSummary* vr = new VEpgSummary(event,currentChannel); vr->draw(); boxstack->add(vr); boxstack->update(vr); -- 2.39.5