]> git.vomp.tv Git - vompclient.git/blob - event.cc
Message queue fix for VVideoRec
[vompclient.git] / event.cc
1 /*
2     Copyright 2004-2005 Chris Tallon
3     Copyright 2014 Marten Richter
4
5     This file is part of VOMP.
6
7     VOMP is free software; you can redistribute it and/or modify
8     it under the terms of the GNU General Public License as published by
9     the Free Software Foundation; either version 2 of the License, or
10     (at your option) any later version.
11
12     VOMP is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15     GNU General Public License for more details.
16
17     You should have received a copy of the GNU General Public License
18     along with VOMP.  If not, see <https://www.gnu.org/licenses/>.
19 */
20
21 #include "event.h"
22 #include "log.h"
23 #include "control.h"
24 #include "movieinfo.h"
25 #include "seriesinfo.h"
26 #include "vdr.h"
27
28 static const char* TAG = "Event";
29
30 MovieInfo* Event::movieInfo = NULL;
31 SeriesInfo* Event::seriesInfo = NULL;
32
33 void Event::loadinfos(UINT channelid)
34 {
35   VDR* vdr = VDR::getInstance();
36   if (movieInfo) delete movieInfo;
37   if (seriesInfo) delete seriesInfo;
38
39   movieInfo = NULL;
40   seriesInfo = NULL;
41
42   if (movieID == 0 && seriesID == 0)
43   {
44     vdr->getScraperEventType(channelid, id, movieID, seriesID, episodeID, epgImage);
45     LogNT::getInstance()->debug(TAG, "Got Scraper EventType {} {}, {} {} {}",
46                             id, channelid, movieID, seriesID, episodeID);
47   }
48
49   if (!vdr->isConnected()) Control::getInstance()->connectionLost();
50
51   if (movieID != 0)
52   {
53     movieInfo = vdr->getScraperMovieInfo(movieID);
54     LogNT::getInstance()->debug(TAG, "Got Scraper MovieInfo");
55   }
56   else if (seriesID != 0)
57   {
58     seriesInfo = vdr->getScraperSeriesInfo(seriesID, episodeID);
59     LogNT::getInstance()->debug(TAG, "Got Scraper SeriesInfo");
60   }
61
62   if (!vdr->isConnected()) Control::getInstance()->connectionLost();
63 }