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, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #include "vepgsummary.h"
24 #include "vquestion.h"
25 #include "vepgsettimer.h"
37 #include "wmovieview.h"
38 #include "wseriesview.h"
39 #include "wpictureview.h"
43 VEpgSummary::VEpgSummary(Event *tevent, Channel* tchannel)
49 if (Video::getInstance()->getFormat() == Video::PAL)
63 setTitleText(event->title);
65 setTitleBarColour(DrawStyle::TITLEBARBACKGROUND);
67 tabbar.setPosition(10+10, 30 + 5);
68 tabbar.setSize(area.w - 20-10, area.h - 30 - 10-30);
71 boxRed.setBackgroundColour(DrawStyle::RED);
72 boxRed.setPosition(20 /*54*/, tabbar.getY2()+8);
73 boxRed.setSize(18, 16);
76 textRed.setPosition(boxRed.getX2(), tabbar.getY2()+4);
77 textRed.setSize(166, 30);
78 textRed.setText(tr("Record"));
82 WTextbox * summary=new WTextbox();
83 summary->setParaMode(true);
85 std::string summary_text = std::string(event->subtitle)+ "\n" +std::string(event->description);
87 summary->setText(summary_text.c_str());
88 OsdVector *osdv=dynamic_cast<OsdVector*>(Osd::getInstance());
90 tabbar.addTab(tr("EPG"), summary);
91 WMovieView *movieview=NULL;
92 WSeriesView *seriesview=NULL;
93 if (event->movieInfo) {
94 movieview = new WMovieView(event->movieInfo);
95 movieview->setParaMode(true);
96 tabbar.addTab(tr("TheTVDB Info"), movieview);
98 if (event->movieInfo->actors.size() > 0 && osdv)
100 WActorGallery *gallery= new WActorGallery(event->movieInfo->actors);
101 tabbar.addTab(tr("Cast"),gallery);
103 WArtworkGallery *artgallery= new WArtworkGallery(*event->movieInfo);
104 tabbar.addTab(tr("Gallery"),artgallery);
106 } else if (event->seriesInfo) {
107 seriesview = new WSeriesView(event->seriesInfo);
108 seriesview->setParaMode(true);
109 tabbar.addTab(tr("TheTVDB Info"), seriesview);
111 if (event->seriesInfo->actors.size() > 0 && osdv)
113 WActorGallery *gallery= new WActorGallery(event->seriesInfo->actors);
114 tabbar.addTab(tr("Cast"),gallery);
116 WArtworkGallery *artgallery= new WArtworkGallery(*event->seriesInfo);
117 tabbar.addTab(tr("Gallery"),artgallery);
122 epgTVmedia.setPosition(summary->getRegionR().w-130-10,0);
123 epgTVmedia.setSize(130,195/Osd::getInstance()->getPixelAspect());
124 summary->add(&epgTVmedia);
125 if (movieview) movieview->add(&epgTVmedia);
126 if (seriesview) seriesview->add(&epgTVmedia);
129 if (event->movieInfo) {
130 poster=event->movieInfo->poster;
132 if (event->seriesInfo) {
133 if (event->seriesInfo->seasonposter.height) {
134 poster=event->seriesInfo->seasonposter;
137 if (event->seriesInfo->posters.size()) {
138 poster=event->seriesInfo->posters[0];
142 epgTVmedia.setTVMedia(poster.info, WTVMedia::ZoomHorizontal);
143 epgTVmedia.setVisible(true);
145 epgTVmedia.setVisible(false);
150 tabbar.activateFocus(true);
153 VEpgSummary::~VEpgSummary()
160 int VEpgSummary::handleCommand(int command)
162 if (command==Remote::BACK) {
165 if (command==Remote::RED)
167 if (!channel) return 2;
168 Log::getInstance()->log("VEpgSummary", Log::DEBUG, "ID %lu TIME %lu DURATION %lu TITLE %s", event->id, event->time, event->duration, event->title);
169 VEpgSetTimer* vs = new VEpgSetTimer(event, channel);
171 BoxStack *boxstack=BoxStack::getInstance();
173 boxstack->update(vs);
178 int retval = tabbar.handleCommand(command);
181 BoxStack::getInstance()->update(this);
184 else if (retval == 2)
192 // stop command getting to any more views
198 void VEpgSummary::processMessage(Message* m)
200 if (m->message == Message::MOUSE_MOVE)
204 else if (m->message == Message::MOUSE_LBDOWN)
209 //check if press is outside this view! then simulate cancel
210 int x=(m->parameter>>16)-getScreenX();
211 int y=(m->parameter&0xFFFF)-getScreenY();
212 if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
214 BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press