2 Copyright 2004-2008 Chris Tallon
4 This file is part of VOMP.
6 VOMP is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 VOMP is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with VOMP. If not, see <https://www.gnu.org/licenses/>.
23 #include "vquestion.h"
24 #include "vepgsettimer.h"
36 #include "wmovieview.h"
37 #include "wseriesview.h"
38 #include "wpictureview.h"
40 #include "vepgsummary.h"
42 VEpgSummary::VEpgSummary(Event *tevent, Channel* tchannel)
48 if (Video::getInstance()->getFormat() == Video::PAL)
50 setSize(640+40, 500+40);
62 setTitleText(event->title.c_str());
64 setTitleBarColour(DrawStyle::TITLEBARBACKGROUND);
66 tabbar.setPosition(10+10, 30 + 5);
67 tabbar.setSize(area.w - 20-10, area.h - 30 - 10-30);
70 boxRed.setBackgroundColour(DrawStyle::RED);
71 boxRed.setPosition(20 /*54*/, tabbar.getY2()+8);
72 boxRed.setSize(18, 16);
75 textRed.setPosition(boxRed.getX2(), tabbar.getY2()+4);
76 textRed.setSize(166, 30);
77 textRed.setText(tr("Record"));
81 WTextbox * summary=new WTextbox();
82 summary->setParaMode(true);
84 std::string summary_text = event->subtitle + "\n" + event->description;
86 summary->setText(summary_text.c_str());
87 OsdVector *osdv=dynamic_cast<OsdVector*>(Osd::getInstance());
88 summary->setBackgroundColour(DrawStyle::VIEWTRANSPARENTBACKGROUND);
90 tabbar.addTab(tr("EPG"), summary);
91 summary->setVideoBackground();
92 WMovieView *movieview=NULL;
93 WSeriesView *seriesview=NULL;
94 if (event->movieInfo) {
95 movieview = new WMovieView(event->movieInfo);
96 movieview->setParaMode(true);
97 movieview->setBackgroundColour(DrawStyle::VIEWTRANSPARENTBACKGROUND);
98 tabbar.addTab(tr("TheTVDB Info"), movieview);
100 if (event->movieInfo->actors.size() > 0 && osdv)
102 WActorGallery *gallery= new WActorGallery(event->movieInfo->actors);
103 gallery->setBackgroundColour(DrawStyle::VIEWTRANSPARENTBACKGROUND);
104 tabbar.addTab(tr("Cast"),gallery);
106 WArtworkGallery *artgallery= new WArtworkGallery(*event->movieInfo);
107 artgallery->setBackgroundColour(DrawStyle::VIEWTRANSPARENTBACKGROUND);
108 tabbar.addTab(tr("Gallery"),artgallery);
110 } else if (event->seriesInfo) {
111 seriesview = new WSeriesView(event->seriesInfo);
112 seriesview->setParaMode(true);
113 seriesview->setBackgroundColour(DrawStyle::VIEWTRANSPARENTBACKGROUND);
114 tabbar.addTab(tr("TheTVDB Info"), seriesview);
116 if (event->seriesInfo->actors.size() > 0 && osdv)
118 WActorGallery *gallery= new WActorGallery(event->seriesInfo->actors);
119 gallery->setBackgroundColour(DrawStyle::VIEWTRANSPARENTBACKGROUND);
120 tabbar.addTab(tr("Cast"),gallery);
122 WArtworkGallery *artgallery= new WArtworkGallery(*event->seriesInfo);
123 artgallery->setBackgroundColour(DrawStyle::VIEWTRANSPARENTBACKGROUND);
124 tabbar.addTab(tr("Gallery"),artgallery);
129 epgTVmedia.setPosition(summary->getRegionR().w-130-10,0);
130 epgTVmedia.setSize(130,(UINT)(195/Osd::getInstance()->getPixelAspect()));
131 summary->add(&epgTVmedia);
132 if (movieview) movieview->add(&epgTVmedia);
133 if (seriesview) seriesview->add(&epgTVmedia);
136 if (event->movieInfo) {
137 poster=event->movieInfo->poster;
139 if (event->seriesInfo) {
140 if (event->seriesInfo->seasonposter.height) {
141 poster=event->seriesInfo->seasonposter;
144 if (event->seriesInfo->posters.size()) {
145 poster=event->seriesInfo->posters[0];
149 epgTVmedia.setTVMedia(poster.info, WTVMedia::ZoomHorizontal);
150 epgTVmedia.setVisible(true);
152 epgTVmedia.setVisible(false);
157 tabbar.activateFocus(true);
160 VEpgSummary::~VEpgSummary()
167 int VEpgSummary::handleCommand(int command)
169 if (command==Input::BACK) {
172 if (command==Input::RED)
174 if (!channel) return 2;
175 Log::getInstance()->log("VEpgSummary", Log::DEBUG, "ID %lu TIME %lu DURATION %lu TITLE %s", event->id, event->time, event->duration, event->title);
176 VEpgSetTimer* vs = new VEpgSetTimer(event, channel);
178 BoxStack *boxstack=BoxStack::getInstance();
180 boxstack->update(vs);
185 int retval = tabbar.handleCommand(command);
188 BoxStack::getInstance()->update(this);
191 else if (retval == 2)
199 // stop command getting to any more views
205 void VEpgSummary::processMessage(Message* m)
207 if (m->message == Message::MOUSE_MOVE)
209 if (tabbar.mouseMove((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY()))
211 BoxStack::getInstance()->update(this);
214 else if (m->message == Message::MOUSE_LBDOWN)
217 int x = (m->parameter >> 16) - getScreenX();
218 int y = (m->parameter & 0xFFFF) - getScreenY();
220 if ((boxRed.getX() <= x) && (boxRed.getX() + (int)boxRed.getWidth() >= x) &&
221 (boxRed.getY() <= y) && (boxRed.getY() + (int)boxRed.getHeight() >= y)) {
222 BoxStack::getInstance()->handleCommand(Input::RED);
227 if (cancel && tabbar.mouseLBDOWN((m->parameter >> 16) - getScreenX(), (m->parameter & 0xFFFF) - getScreenY()))
229 BoxStack::getInstance()->update(this);
234 if (coordsOutsideBox(m))
236 BoxStack::getInstance()->handleCommand(Input::BACK); //simulate cancel press
239 } else if (m->message == Message::MOUSE_SCROLL)
241 if (tabbar.mouseAndroidScroll((m->tag >> 16) - getScreenX(), (m->tag & 0xFFFF) - getScreenY(),
242 (short)(m->parameter >> 16), (short)(m->parameter & 0xFFFF)))
244 BoxStack::getInstance()->update(this);