summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/epgsearch.h209
-rw-r--r--services/remotetimers.h47
2 files changed, 166 insertions, 90 deletions
diff --git a/services/epgsearch.h b/services/epgsearch.h
index de29299..05ceeeb 100644
--- a/services/epgsearch.h
+++ b/services/epgsearch.h
@@ -1,5 +1,5 @@
-/*
-Copyright (C) 2004-2007 Christian Wieninger
+/* -*- c++ -*-
+Copyright (C) 2004-2013 Christian Wieninger
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -24,10 +24,6 @@ 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>
@@ -35,133 +31,172 @@ The project's page is at http://winni.vdr-developer.org/epgsearch
#include <vdr/osdbase.h>
// Data structure for service "Epgsearch-search-v1.0"
-struct 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
+ 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
+ cOsdMenu* pResultMenu; // pointer to the menu of results
};
// Data structure for service "Epgsearch-exttimeredit-v1.0"
-struct 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)
+ 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
+ cOsdMenu* pTimerMenu; // pointer to the menu of results
+};
+
+// Data structure for service "Epgsearch-enablesearchtimers-v1.0"
+struct Epgsearch_enablesearchtimers_v1_0 {
+// in
+ bool enable; // enable search timer thread?
};
// Data structure for service "Epgsearch-updatesearchtimers-v1.0"
-struct Epgsearch_updatesearchtimers_v1_0
-{
+struct Epgsearch_updatesearchtimers_v1_0 {
// in
- bool showMessage; // inform via osd when finished?
+ bool showMessage; // inform via osd when finished?
};
// Data structure for service "Epgsearch-osdmessage-v1.0"
-struct Epgsearch_osdmessage_v1_0
-{
+struct Epgsearch_osdmessage_v1_0 {
// in
- char* message; // the message to display
- eMessageType type;
+ char* message; // the message to display
+ eMessageType type;
};
// Data structure for service "EpgsearchMenu-v1.0"
-struct EpgSearchMenu_v1_0
-{
+struct EpgSearchMenu_v1_0 {
// in
// out
- cOsdMenu* Menu; // pointer to the menu
+ cOsdMenu* Menu; // pointer to the menu
};
// Data structure for service "Epgsearch-lastconflictinfo-v1.0"
-struct 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
+ 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
-{
+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
+ 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) {}
- };
+ class cServiceSearchResult : public cListObject
+ {
+ public:
+ const cEvent* event;
+ cServiceSearchResult(const cEvent* Event) : event(Event) {}
+ };
- cList<cServiceSearchResult>* pResultList; // pointer to the results
+ cList<cServiceSearchResult>* pResultList; // pointer to the results
};
// Data structure for service "Epgsearch-switchtimer-v1.0"
-struct Epgsearch_switchtimer_v1_0
-{
+struct Epgsearch_switchtimer_v1_0 {
// in
- const cEvent* event;
- int mode; // mode (0=query existance, 1=add/modify, 2=delete)
+ const cEvent* event;
+ int mode; // mode (0=query existence, 1=add/modify, 2=delete)
// in/out
- int switchMinsBefore;
- int announceOnly;
-// out
- bool success; // result
+ 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;
+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
+struct Epgsearch_services_v1_0 {
+// in/out
+#if __cplusplus < 201103L
+ std::auto_ptr<cServiceHandler> handler;
+#else
+ std::unique_ptr<cServiceHandler> handler;
+#endif
+};
+
+// Data structures for service "Epgsearch-services-v1.1"
+class cServiceHandler_v1_1 : public cServiceHandler
{
+public:
+ // Get timer conflicts
+ virtual std::list<std::string> TimerConflictList(bool relOnly = false) = 0;
+ // Check if a conflict check is advised
+ virtual bool IsConflictCheckAdvised() = 0;
+};
+
+struct Epgsearch_services_v1_1 {
// in/out
- std::auto_ptr<cServiceHandler> handler;
+#if __cplusplus < 201103L
+ std::auto_ptr<cServiceHandler_v1_1> handler;
+#else
+ std::unique_ptr<cServiceHandler_v1_1> handler;
+#endif
+};
+
+// Data structures for service "Epgsearch-services-v1.2"
+class cServiceHandler_v1_2 : public cServiceHandler_v1_1
+{
+public:
+ // List of all recording directories used in recordings, timers (and optionally search timers or in epgsearchdirs.conf)
+ virtual std::set<std::string> ShortDirectoryList() = 0;
+ // Evaluate an expression against an event
+ virtual std::string Evaluate(const std::string& expr, const cEvent* event) = 0;
+};
+
+struct Epgsearch_services_v1_2 {
+// in/out
+#if __cplusplus < 201103L
+ std::auto_ptr<cServiceHandler_v1_2> handler;
+#else
+ std::unique_ptr<cServiceHandler_v1_2> handler;
+#endif
};
#endif
diff --git a/services/remotetimers.h b/services/remotetimers.h
index ea31124..950474f 100644
--- a/services/remotetimers.h
+++ b/services/remotetimers.h
@@ -1,7 +1,7 @@
/*
* remotetimers.h: Public interface of the plugin's services
*
- * Copyright (C) 2008-2011 Frank Schmirler <vdr@schmirler.de>
+ * Copyright (C) 2008-2013 Frank Schmirler <vdr@schmirler.de>
*
* This file is part of VDR Plugin remotetimers.
*
@@ -24,10 +24,9 @@
#ifndef _SERVICE__H
#define _SERVICE__H
-#ifndef __TIMERS_H
#include <vdr/timers.h>
#include <vdr/epg.h>
-#endif
+#include <vdr/osdbase.h>
/*
* If the Data argument is NULL, all service calls return true.
@@ -63,6 +62,16 @@ struct RemoteTimers_InstantRecording_v1_0 {
// cString errorMsg;
/*
+ * RemoteTimers::ForEachConflict-v1.0
+ * Iterates the list of remote timer conflicts.
+ * The service call always returns true.
+ * Data points to a const char* which must be NULL to return the first conflict. Pass the previously returned conflict to get the next one until const char* is NULL.
+ *
+ */
+//in+out
+// const char* conflict;
+
+/*
* RemoteTimers::ForEach-v1.0
* Iterates the list of remote timers.
* The service call always returns true.
@@ -138,4 +147,36 @@ struct RemoteTimers_Timer_v1_0 {
cString errorMsg;
};
+/*
+ * RemoteTimers::GetTimerById-v1.0
+ * Get a remote timer by its id (i.e. timer->Index()+1 on remote machine).
+ * The service call always returns true.
+ * Data must point to a RemoteTimers_Timer_v1_1 structure. errorMsg is unused.
+ * NULL is returned as timer if no remote timer exists for the given id locally.
+ * Note that a timer with this id may exist remotely. This can happen if the
+ * remote timer's channel doesn't exist on the local machine.
+ */
+
+struct RemoteTimers_Timer_v1_1 {
+//in+out
+ cTimer *timer;
+ int id;
+//out
+ cString errorMsg;
+};
+
+/*
+ * RemoteTimers::Menu-v1.0
+ * Depending on the state parameter, open the Timers or Schedule menu.
+ * In case of an error, menu is NULL.
+ * Data points to a RemoteTimers_Menu_v1_0 struct.
+ */
+struct RemoteTimers_Menu_v1_0 {
+//in
+ const char *serverIp;
+ unsigned short serverPort;
+ eOSState state;
+//out
+ cOsdMenu *menu;
+};
#endif //_SERVICE__H