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"
35 #include "wmovieview.h"
36 #include "wseriesview.h"
37 #include "wpictureview.h"
41 VEpgSummary::VEpgSummary(Event *tevent)
46 if (Video::getInstance()->getFormat() == Video::PAL)
60 setTitleText(event->title);
62 setTitleBarColour(DrawStyle::TITLEBARBACKGROUND);
64 tabbar.setPosition(10+10, 30 + 5);
65 tabbar.setSize(area.w - 20-10, area.h - 30 - 10);
69 WTextbox * summary=new WTextbox();
70 summary->setParaMode(true);
72 std::string summary_text = std::string(event->subtitle)+ "\n" +std::string(event->description);
74 summary->setText(summary_text.c_str());
75 OsdVector *osdv=dynamic_cast<OsdVector*>(Osd::getInstance());
77 tabbar.addTab(tr("EPG"), summary);
78 if (event->movieInfo) {
79 WMovieView *movieview = new WMovieView(event->movieInfo);
80 movieview->setParaMode(true);
81 tabbar.addTab(tr("TheTVDB Info"), movieview);
83 if (event->movieInfo->actors.size() > 0 && osdv)
85 WActorGallery *gallery= new WActorGallery(event->movieInfo->actors);
86 tabbar.addTab(tr("Cast"),gallery);
88 WArtworkGallery *artgallery= new WArtworkGallery(*event->movieInfo);
89 tabbar.addTab(tr("Gallery"),artgallery);
91 } else if (event->seriesInfo) {
92 WSeriesView *seriesview = new WSeriesView(event->seriesInfo);
93 seriesview->setParaMode(true);
94 tabbar.addTab(tr("TheTVDB Info"), seriesview);
96 if (event->seriesInfo->actors.size() > 0 && osdv)
98 WActorGallery *gallery= new WActorGallery(event->seriesInfo->actors);
99 tabbar.addTab(tr("Cast"),gallery);
101 WArtworkGallery *artgallery= new WArtworkGallery(*event->seriesInfo);
102 tabbar.addTab(tr("Gallery"),artgallery);
107 epgTVmedia.setPosition(summary->getRegionR().w-130-10,0);
108 epgTVmedia.setSize(130,195/Osd::getInstance()->getPixelAspect());
109 summary->add(&epgTVmedia);
112 if (event->movieInfo) {
113 poster=event->movieInfo->poster;
115 if (event->seriesInfo) {
116 if (event->seriesInfo->seasonposter.height) {
117 poster=event->seriesInfo->seasonposter;
120 if (event->seriesInfo->posters.size()) {
121 poster=event->seriesInfo->posters[0];
125 epgTVmedia.setTVMedia(poster.info, WTVMedia::ZoomHorizontal);
126 epgTVmedia.setVisible(true);
128 epgTVmedia.setVisible(false);
133 int sfh = getFontHeight();
135 buttonRegion.y = 10+30;
136 buttonRegion.w = 130;
137 buttonRegion.h = sfh*2*last;
139 button[PLAY].setText(tr("Play"));
140 button[RESUME].setText(tr("Resume"));
141 button[MOVE].setText(tr("Move"));
142 button[A_DELETE].setText(tr("Delete"));
144 for (int i=PLAY, ver=10+30; i<last; i++, ver+= sfh*2)
146 button[i].setPosition(10, ver);
147 button[i].setSize(130, sfh);
152 button[selected].setActive(1);*/
153 tabbar.activateFocus(true);
156 VEpgSummary::~VEpgSummary()
163 int VEpgSummary::handleCommand(int command)
165 if (command==Remote::BACK) {
170 int retval = tabbar.handleCommand(command);
173 BoxStack::getInstance()->update(this);
176 else if (retval == 2)
184 // stop command getting to any more views
190 void VEpgSummary::processMessage(Message* m)
192 if (m->message == Message::MOUSE_MOVE)
196 else if (m->message == Message::MOUSE_LBDOWN)
201 //check if press is outside this view! then simulate cancel
202 int x=(m->parameter>>16)-getScreenX();
203 int y=(m->parameter&0xFFFF)-getScreenY();
204 if (x<0 || y <0 || x>(int)getWidth() || y>(int)getHeight())
206 BoxStack::getInstance()->handleCommand(Remote::BACK); //simulate cancel press