initial commit version 0.0.1

This commit is contained in:
louis
2014-09-27 09:25:14 +02:00
commit b0509b5182
503 changed files with 24368 additions and 0 deletions

167
services/epgsearch.h Normal file
View File

@@ -0,0 +1,167 @@
/*
Copyright (C) 2004-2007 Christian Wieninger
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
The author can be reached at cwieninger@gmx.de
The project's page is at http://winni.vdr-developer.org/epgsearch
*/
#ifndef EPGSEARCHSERVICES_INC
#define EPGSEARCHSERVICES_INC
// Added by Andreas Mair (mail _AT_ andreas _DOT_ vdr-developer _DOT_ org)
#define EPGSEARCH_SEARCHRESULTS_SERVICE_STRING_ID "Epgsearch-searchresults-v1.0"
#define EPGSEARCH_LASTCONFLICTINFO_SERVICE_STRING_ID "Epgsearch-lastconflictinfo-v1.0"
#include <string>
#include <list>
#include <memory>
#include <set>
#include <vdr/osdbase.h>
// Data structure for service "Epgsearch-search-v1.0"
struct Epgsearch_search_v1_0
{
// in
char* query; // search term
int mode; // search mode (0=phrase, 1=and, 2=or, 3=regular expression)
int channelNr; // channel number to search in (0=any)
bool useTitle; // search in title
bool useSubTitle; // search in subtitle
bool useDescription; // search in description
// out
cOsdMenu* pResultMenu; // pointer to the menu of results
};
// Data structure for service "Epgsearch-exttimeredit-v1.0"
struct Epgsearch_exttimeredit_v1_0
{
// in
cTimer* timer; // pointer to the timer to edit
bool bNew; // flag that indicates, if this is a new timer or an existing one
const cEvent* event; // pointer to the event corresponding to this timer (may be NULL)
// out
cOsdMenu* pTimerMenu; // pointer to the menu of results
};
// Data structure for service "Epgsearch-updatesearchtimers-v1.0"
struct Epgsearch_updatesearchtimers_v1_0
{
// in
bool showMessage; // inform via osd when finished?
};
// Data structure for service "Epgsearch-osdmessage-v1.0"
struct Epgsearch_osdmessage_v1_0
{
// in
char* message; // the message to display
eMessageType type;
};
// Data structure for service "EpgsearchMenu-v1.0"
struct EpgSearchMenu_v1_0
{
// in
// out
cOsdMenu* Menu; // pointer to the menu
};
// Data structure for service "Epgsearch-lastconflictinfo-v1.0"
struct Epgsearch_lastconflictinfo_v1_0
{
// in
// out
time_t nextConflict; // next conflict date, 0 if none
int relevantConflicts; // number of relevant conflicts
int totalConflicts; // total number of conflicts
};
// Data structure for service "Epgsearch-searchresults-v1.0"
struct Epgsearch_searchresults_v1_0
{
// in
char* query; // search term
int mode; // search mode (0=phrase, 1=and, 2=or, 3=regular expression)
int channelNr; // channel number to search in (0=any)
bool useTitle; // search in title
bool useSubTitle; // search in subtitle
bool useDescription; // search in description
// out
class cServiceSearchResult : public cListObject
{
public:
const cEvent* event;
cServiceSearchResult(const cEvent* Event) : event(Event) {}
};
cList<cServiceSearchResult>* pResultList; // pointer to the results
};
// Data structure for service "Epgsearch-switchtimer-v1.0"
struct Epgsearch_switchtimer_v1_0
{
// in
const cEvent* event;
int mode; // mode (0=query existance, 1=add/modify, 2=delete)
// in/out
int switchMinsBefore;
int announceOnly;
// out
bool success; // result
};
// Data structures for service "Epgsearch-services-v1.0"
class cServiceHandler
{
public:
virtual std::list<std::string> SearchTimerList() = 0;
// returns a list of search timer entries in the same format as used in epgsearch.conf
virtual int AddSearchTimer(const std::string&) = 0;
// adds a new search timer and returns its ID (-1 on error)
virtual bool ModSearchTimer(const std::string&) = 0;
// edits an existing search timer and returns success
virtual bool DelSearchTimer(int) = 0;
// deletes search timer with given ID and returns success
virtual std::list<std::string> QuerySearchTimer(int) = 0;
// returns the search result of the searchtimer with given ID in the same format as used in SVDRP command 'QRYS' (->MANUAL)
virtual std::list<std::string> QuerySearch(std::string) = 0;
// returns the search result of the searchtimer with given settings in the same format as used in SVDRP command 'QRYS' (->MANUAL)
virtual std::list<std::string> ExtEPGInfoList() = 0;
// returns a list of extended EPG categories in the same format as used in epgsearchcats.conf
virtual std::list<std::string> ChanGrpList() = 0;
// returns a list of channel groups maintained by epgsearch
virtual std::list<std::string> BlackList() = 0;
// returns a list of blacklists in the same format as used in epgsearchblacklists.conf
virtual std::set<std::string> DirectoryList() = 0;
// List of all recording directories used in recordings, timers, search timers or in epgsearchdirs.conf
virtual ~cServiceHandler() {}
// Read a setup value
virtual std::string ReadSetupValue(const std::string& entry) = 0;
// Write a setup value
virtual bool WriteSetupValue(const std::string& entry, const std::string& value) = 0;
};
struct Epgsearch_services_v1_0
{
// in/out
std::auto_ptr<cServiceHandler> handler;
};
#endif

141
services/remotetimers.h Normal file
View File

@@ -0,0 +1,141 @@
/*
* remotetimers.h: Public interface of the plugin's services
*
* Copyright (C) 2008-2011 Frank Schmirler <vdr@schmirler.de>
*
* This file is part of VDR Plugin remotetimers.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
#ifndef _SERVICE__H
#define _SERVICE__H
#ifndef __TIMERS_H
#include <vdr/timers.h>
#include <vdr/epg.h>
#endif
/*
* If the Data argument is NULL, all service calls return true.
* Otherwise the return value indicates success or failure of the service call.
*
* The service calls are not thread safe and must be called from the VDR main loop.
*/
/*
* RemoteTimers::InstantRecording-v1.0
* Start an instant recording or pause live TV. VDR needs to be patched to support this.
* The service returns false if a local timer should be used. An error occured if true is returned but the out parameters name and fileName are NULL.
* Data points to the following structure where pause indicates if it is an instant recording or an attempt to pause live TV.
*/
struct RemoteTimers_InstantRecording_v1_0 {
//in
const cTimer *timer;
bool pause;
const cEvent *event;
//out
cString name;
cString fileName;
};
/*
* RemoteTimers::RefreshTimers-v1.0
* Fetch timer list from remote VDR. You must call this service before you can use one of the service calls below.
* Data points to a cString which in case of failure (service call returns false) contains an error message.
*/
//out
// cString errorMsg;
/*
* RemoteTimers::ForEach-v1.0
* Iterates the list of remote timers.
* The service call always returns true.
* Data points to a cTimer* which must be NULL to return the first timer. Pass the previously returned timer to get the next one until cTimer* is NULL.
*
* RemoteTimers::GetTimer-v1.0
* Test if the timer exists as either a remote or a local timer.
* The service call always returns true.
* Data points to a cTimer* which points to the timer you are looking for. If found, cTimer* will point to the timer, otherwise it will be NULL.
*/
//in+out
// cTimer* timer;
/*
* RemoteTimers::GetMatch-v1.0
* Find the remote or local timer which matches the event best.
* The service call always returns true.
* Data points to the following structure:
*/
struct RemoteTimers_GetMatch_v1_0 {
//in
const cEvent *event;
//out
cTimer *timer;
int timerMatch;
int timerType;
bool isRemote;
};
/*
* RemoteTimers::GetTimerByEvent-v1.0
* Find the remote or local timer matching the event.
* If no timer matches, the service call returns false.
* Data points to a RemoteTimers_Event_v1_0 struct.
*
* RemoteTimers::NewTimerByEvent-v1.0
* Add a new timer for an event.
* In case of an error, the service call returns false and the structure includes an error message.
* Data points to a RemoteTimers_Event_v1_0 struct.
*/
struct RemoteTimers_Event_v1_0 {
//in
const cEvent *event;
//out
cTimer *timer;
cString errorMsg;
};
/*
* RemoteTimers::NewTimer-v1.0
* Add a new timer.
* In case of an error, the service call returns false and the structure includes an error message.
* Data points to a RemoteTimers_Timer_v1_0 struct.
*
* RemoteTimers::ModTimer-v1.0
* Change an existing timer.
* In case of an error, the service call returns false and the structure includes an error message.
* Data points to a RemoteTimers_Timer_v1_0 struct.
*
* RemoteTimers::DelTimer-v1.0
* Delete an existing timer.
* In case of an error, the service call returns false and the structure includes an error message.
* Data points to a RemoteTimers_Timer_v1_0 struct.
*/
struct RemoteTimers_Timer_v1_0 {
//in+out
cTimer *timer;
//out
cString errorMsg;
};
#endif //_SERVICE__H

214
services/scraper2vdr.h Normal file
View File

@@ -0,0 +1,214 @@
#ifndef __SCRAPER2VDRSERVICES_H
#define __SCRAPER2VDRSERVICES_H
#include <string>
#include <vector>
#include <vdr/epg.h>
#include <vdr/recording.h>
enum tvType {
tSeries,
tMovie,
tNone,
};
/*********************************************************************
* Helper Structures
*********************************************************************/
class cTvMedia {
public:
cTvMedia(void) {
path = "";
width = height = 0;
};
std::string path;
int width;
int height;
};
class cEpisode {
public:
cEpisode(void) {
number = 0;
season = 0;
name = "";
firstAired = "";
guestStars = "";
overview = "";
rating = 0.0;
};
int number;
int season;
std::string name;
std::string firstAired;
std::string guestStars;
std::string overview;
float rating;
cTvMedia episodeImage;
};
class cActor {
public:
cActor(void) {
name = "";
role = "";
};
std::string name;
std::string role;
cTvMedia actorThumb;
};
/*********************************************************************
* Data Structures for Service Calls
*********************************************************************/
// Data structure for service "GetEventType"
class ScraperGetEventType {
public:
ScraperGetEventType(void) {
event = NULL;
recording = NULL;
type = tNone;
movieId = 0;
seriesId = 0;
episodeId = 0;
};
// in
const cEvent *event; // check type for this event
const cRecording *recording; // or for this recording
//out
tvType type; //typeSeries or typeMovie
int movieId;
int seriesId;
int episodeId;
};
//Data structure for full series and episode information
class cMovie {
public:
cMovie(void) {
title = "";
originalTitle = "";
tagline = "";
overview = "";
adult = false;
collectionName = "";
budget = 0;
revenue = 0;
genres = "";
homepage = "";
releaseDate = "";
runtime = 0;
popularity = 0.0;
voteAverage = 0.0;
};
//IN
int movieId; // movieId fetched from ScraperGetEventType
//OUT
std::string title;
std::string originalTitle;
std::string tagline;
std::string overview;
bool adult;
std::string collectionName;
int budget;
int revenue;
std::string genres;
std::string homepage;
std::string releaseDate;
int runtime;
float popularity;
float voteAverage;
cTvMedia poster;
cTvMedia fanart;
cTvMedia collectionPoster;
cTvMedia collectionFanart;
std::vector<cActor> actors;
};
//Data structure for full series and episode information
class cSeries {
public:
cSeries(void) {
seriesId = 0;
episodeId = 0;
name = "";
overview = "";
firstAired = "";
network = "";
genre = "";
rating = 0.0;
status = "";
};
//IN
int seriesId; // seriesId fetched from ScraperGetEventType
int episodeId; // episodeId fetched from ScraperGetEventType
//OUT
std::string name;
std::string overview;
std::string firstAired;
std::string network;
std::string genre;
float rating;
std::string status;
cEpisode episode;
std::vector<cActor> actors;
std::vector<cTvMedia> posters;
std::vector<cTvMedia> banners;
std::vector<cTvMedia> fanarts;
cTvMedia seasonPoster;
};
// Data structure for service "GetPosterBanner"
class ScraperGetPosterBanner {
public:
ScraperGetPosterBanner(void) {
type = tNone;
event = NULL;
};
// in
const cEvent *event; // check type for this event
//out
tvType type; //typeSeries or typeMovie
cTvMedia poster;
cTvMedia banner;
};
// Data structure for service "GetPosterBannerV2"
class ScraperGetPosterBannerV2 {
public:
ScraperGetPosterBannerV2(void) {
type = tNone;
event = NULL;
recording = NULL;
};
// in
const cEvent *event; // check type for this event
const cRecording *recording; // check type for this recording
//out
tvType type; //typeSeries or typeMovie
cTvMedia poster;
cTvMedia banner;
};
// Data structure for service "GetPoster"
class ScraperGetPoster {
public:
// in
const cEvent *event; // check type for this event
const cRecording *recording; // or for this recording
//out
cTvMedia poster;
};
// Data structure for service "GetPosterThumb"
class ScraperGetPosterThumb {
public:
// in
const cEvent *event; // check type for this event
const cRecording *recording; // or for this recording
//out
cTvMedia poster;
};
#endif //__SCRAPER2VDRSERVICES_H