mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-26 15:02:50 +02:00
... by moving functions to execute scripts to helpers.cpp|h
Change outType from ExecCGI to text/plain because all arguments
are passed to the script. So no format can be defined.
Origin commit data
------------------
Branch: ni/coolstream
Commit: b5e2998d54
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-02-22 (Mon, 22 Feb 2016)
Origin message was:
------------------
- controlapi/mod_yparse: avoid double code ...
... by moving functions to execute scripts to helpers.cpp|h
Change outType from ExecCGI to text/plain because all arguments
are passed to the script. So no format can be defined.
------------------
This commit was generated by Migit
155 lines
5.3 KiB
C++
155 lines
5.3 KiB
C++
//=============================================================================
|
|
// NHTTPD
|
|
// Neutrino ControlAPI
|
|
//=============================================================================
|
|
#ifndef __nhttpd_neutrinocontrolapi_hpp__
|
|
#define __nhttpd_neutrinocontrolapi_hpp__
|
|
// C++
|
|
#include <string>
|
|
// yhttpd
|
|
#include <zapit/channel.h>
|
|
#include <yhook.h>
|
|
|
|
// forward declaration
|
|
class CNeutrinoAPI;
|
|
|
|
//-----------------------------------------------------------------------------
|
|
class CControlAPI : public Cyhook
|
|
{
|
|
private:
|
|
// Dispatcher Array
|
|
typedef void (CControlAPI::*TyFunc)(CyhookHandler *hh);
|
|
typedef struct
|
|
{
|
|
const char *func_name;
|
|
TyFunc pfunc;
|
|
const char *mime_type;
|
|
} TyCgiCall;
|
|
const static TyCgiCall yCgiCallList[];
|
|
|
|
struct FileCGI_List
|
|
{
|
|
std::string name;
|
|
std::string type_str;
|
|
unsigned char type;
|
|
std::string fullname;
|
|
|
|
bool operator() (FileCGI_List a, FileCGI_List b)
|
|
{
|
|
return (a.name < b.name);
|
|
}
|
|
} fsort;
|
|
|
|
int rc_send(int ev, unsigned int code, unsigned int value);
|
|
|
|
// send functions for ExecuteCGI (controld api)
|
|
void SendEventList(CyhookHandler *hh,t_channel_id channel_id);
|
|
void SendFoundEvents(CyhookHandler *hh, bool xml_format = false);
|
|
void SendcurrentVAPid(CyhookHandler *hh);
|
|
void SendAllCurrentVAPid(CyhookHandler *hh);
|
|
void SendStreamInfo(CyhookHandler *hh);
|
|
void SendBouquets(CyhookHandler *hh);
|
|
void SendBouquet(CyhookHandler *hh,int BouquetNr);
|
|
void SendChannelList(CyhookHandler *hh, bool currentTP = false);
|
|
void SendTimers(CyhookHandler *hh);
|
|
void SendTimersXML(CyhookHandler *hh);
|
|
void epgDetailList(CyhookHandler *hh);
|
|
void EpgSearchXMLCGI(CyhookHandler *hh);
|
|
void EpgSearchCGI(CyhookHandler *hh);
|
|
// subs
|
|
friend class CNeutrinoWebserver; // for timer /fb/ compatibility
|
|
void doModifyTimer(CyhookHandler *hh);
|
|
void doNewTimer(CyhookHandler *hh);
|
|
void _SendTime(CyhookHandler *hh, struct tm *Time, int digits);
|
|
std::string _GetBouquetWriteItem(CyhookHandler *hh, CZapitChannel * channel, int bouquetNr, int nr);
|
|
std::string channelEPGformated(CyhookHandler *hh, int bouquetnr, t_channel_id channel_id, int max, long stoptime);
|
|
std::string _GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChannel * channel);
|
|
|
|
//yweb
|
|
void YWeb_SendVideoStreamingPids(CyhookHandler *hh, int apid_no);
|
|
void YWeb_SendRadioStreamingPid(CyhookHandler *hh);
|
|
void compatibility_Timer(CyhookHandler *hh);
|
|
|
|
// CGI functions for ExecuteCGI
|
|
void TimerCGI(CyhookHandler *hh);
|
|
void SetModeCGI(CyhookHandler *hh);
|
|
void GetModeCGI(CyhookHandler *hh);
|
|
void ExecCGI(CyhookHandler *hh);
|
|
void SystemCGI(CyhookHandler *hh);
|
|
void StandbyCGI(CyhookHandler *hh);
|
|
void RCCGI(CyhookHandler *hh);
|
|
void GetDateCGI(CyhookHandler *hh);
|
|
void GetTimeCGI(CyhookHandler *hh);
|
|
void GetServicesxmlCGI(CyhookHandler *hh);
|
|
void GetBouquetsxmlCGI(CyhookHandler *hh);
|
|
void GetUBouquetsxmlCGI(CyhookHandler *hh);
|
|
void GetChannel_IDCGI(CyhookHandler *hh);
|
|
void GetTPChannel_IDCGI(CyhookHandler *hh);
|
|
void MessageCGI(CyhookHandler *hh);
|
|
void InfoCGI(CyhookHandler *hh);
|
|
void HWInfoCGI(CyhookHandler *hh);
|
|
void ShutdownCGI(CyhookHandler *hh);
|
|
void VolumeCGI(CyhookHandler *hh);
|
|
void ChannellistCGI(CyhookHandler *hh);
|
|
void LogolistCGI(CyhookHandler *hh);
|
|
void GetBouquetCGI(CyhookHandler *hh);
|
|
void GetBouquetsCGI(CyhookHandler *hh);
|
|
void EpgCGI(CyhookHandler *hh);
|
|
void VersionCGI(CyhookHandler *hh);
|
|
void ReloadNeutrinoSetupCGI(CyhookHandler *hh);
|
|
void ReloadPluginsCGI(CyhookHandler *hh);
|
|
void ReloadChannelsCGI(CyhookHandler *hh);
|
|
void ScreenshotCGI(CyhookHandler *hh);
|
|
void ZaptoCGI(CyhookHandler *hh);
|
|
void StartPluginCGI(CyhookHandler *hh);
|
|
void LCDAction(CyhookHandler *hh);
|
|
void YWebCGI(CyhookHandler *hh);
|
|
void RebootCGI(CyhookHandler *hh);
|
|
void RCEmCGI(CyhookHandler *hh);
|
|
void AspectRatioCGI(CyhookHandler *hh);
|
|
void VideoFormatCGI(CyhookHandler *hh);
|
|
void VideoOutputCGI(CyhookHandler *hh);
|
|
void VCROutputCGI(CyhookHandler *hh);
|
|
void ScartModeCGI(CyhookHandler *hh);
|
|
void AudioCGI(CyhookHandler *hh);
|
|
void CryptCGI(CyhookHandler *hh);
|
|
void setBouquetCGI(CyhookHandler *hh);
|
|
void saveBouquetCGI(CyhookHandler *hh);
|
|
void moveBouquetCGI(CyhookHandler *hh);
|
|
void deleteBouquetCGI(CyhookHandler *hh);
|
|
void addBouquetCGI(CyhookHandler *hh);
|
|
void renameBouquetCGI(CyhookHandler *hh);
|
|
void changeBouquetCGI(CyhookHandler *hh);
|
|
void updateBouquetCGI(CyhookHandler *hh);
|
|
void build_live_url(CyhookHandler *hh);
|
|
void logoCGI(CyhookHandler *hh);
|
|
void ConfigCGI(CyhookHandler *hh);
|
|
void FileCGI(CyhookHandler *hh);
|
|
void StatfsCGI(CyhookHandler *hh);
|
|
void SignalInfoCGI(CyhookHandler *hh);
|
|
void getDirCGI(CyhookHandler *hh);
|
|
std::string getSubdirectories(CyhookHandler *hh, std::string path, std::string result);
|
|
|
|
|
|
protected:
|
|
CNeutrinoAPI *NeutrinoAPI;
|
|
|
|
void init(CyhookHandler *hh);
|
|
void Execute(CyhookHandler *hh);
|
|
|
|
public:
|
|
static const unsigned int PLUGIN_DIR_COUNT = 9;
|
|
static std::string PLUGIN_DIRS[PLUGIN_DIR_COUNT];
|
|
|
|
// constructor & deconstructor
|
|
CControlAPI(CNeutrinoAPI *_NeutrinoAPI);
|
|
|
|
// virtual functions for HookHandler/Hook
|
|
virtual std::string getHookName(void) {return std::string("mod_ControlAPI");}
|
|
virtual std::string getHookVersion(void) {return std::string("$Revision$");}
|
|
virtual THandleStatus Hook_SendResponse(CyhookHandler *hh);
|
|
virtual THandleStatus Hook_PrepareResponse(CyhookHandler *hh);
|
|
};
|
|
|
|
#endif /* __nhttpd_neutrinocontrolapi_hpp__ */
|