mirror of
				https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
				synced 2023-10-05 13:01:48 +00:00 
			
		
		
		
	changed build system
This commit is contained in:
		
							
								
								
									
										4
									
								
								HISTORY
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								HISTORY
									
									
									
									
									
								
							| @@ -65,3 +65,7 @@ VDR Plugin 'tvguide' Revision History | ||||
| 2013-07-23: Version 1.0.0 | ||||
|  | ||||
| - added tvscraper support | ||||
|  | ||||
| Version 1.1.0 | ||||
|  | ||||
| - changed build system | ||||
|   | ||||
							
								
								
									
										2
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								Makefile
									
									
									
									
									
								
							| @@ -54,7 +54,7 @@ LIBS += $(shell pkg-config --libs Magick++) | ||||
|  | ||||
| ### The object files (add further files here): | ||||
|  | ||||
| OBJS = $(PLUGIN).o | ||||
| OBJS = $(PLUGIN).o channelcolumn.o channelgroup.o channelgroups.o config.o detailview.o dummygrid.o epggrid.o footer.o grid.o headergrid.o imageloader.o osdmanager.o recmanager.o recmenu.o recmenuitem.o recmenumanager.o recmenus.o setup.o statusheader.o styledpixmap.o switchtimer.o timeline.o timer.o tools.o tvguideosd.o | ||||
|  | ||||
| ### The main target: | ||||
|  | ||||
|   | ||||
| @@ -1,4 +1,5 @@ | ||||
| #include "channelcolumn.h" | ||||
| #include "dummygrid.h" | ||||
|  | ||||
| cChannelColumn::cChannelColumn(int num, const cChannel *channel, cMyTime *myTime) { | ||||
|     this->channel = channel; | ||||
|   | ||||
| @@ -1,9 +1,16 @@ | ||||
| #ifndef __TVGUIDE_CHANNELCOLUMN_H | ||||
| #define __TVGUIDE_CHANNELCOLUMN_H | ||||
|  | ||||
| #include <vdr/tools.h> | ||||
| #include "grid.h" | ||||
| #include "epggrid.h" | ||||
| #include "headergrid.h" | ||||
| #include "switchtimer.h" | ||||
|  | ||||
| class cGrid; | ||||
| class cEpgGrid; | ||||
| class cHeaderGrid; | ||||
|  | ||||
| // --- cChannelColumn  ------------------------------------------------------------- | ||||
|  | ||||
| class cChannelColumn : public cListObject, public cStyledPixmap { | ||||
|   | ||||
| @@ -1,4 +1,6 @@ | ||||
| #include <algorithm> | ||||
| #include "channelgroup.h" | ||||
| #include "tools.h" | ||||
|  | ||||
| cChannelGroup::cChannelGroup(const char *name) { | ||||
|     channelStart = 0; | ||||
|   | ||||
| @@ -1,6 +1,10 @@ | ||||
| #ifndef __TVGUIDE_CHANNELGROUP_H | ||||
| #define __TVGUIDE_CHANNELGROUP_H | ||||
|  | ||||
| #include <vdr/tools.h> | ||||
| #include "styledpixmap.h" | ||||
|  | ||||
|  | ||||
| // --- cChannelGroup  ------------------------------------------------------------- | ||||
|  | ||||
| class cChannelGroup { | ||||
|   | ||||
| @@ -1,6 +1,10 @@ | ||||
| #ifndef __TVGUIDE_CHANNELGROUPS_H | ||||
| #define __TVGUIDE_CHANNELGROUPS_H | ||||
|  | ||||
| #include <vector> | ||||
| #include <vdr/channels.h> | ||||
| #include "channelgroup.h" | ||||
|  | ||||
| // --- cChannelGroups  ------------------------------------------------------------- | ||||
|  | ||||
| class cChannelGroups { | ||||
|   | ||||
							
								
								
									
										15
									
								
								config.c
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								config.c
									
									
									
									
									
								
							| @@ -1,20 +1,5 @@ | ||||
| #include "config.h" | ||||
|  | ||||
| enum { | ||||
|     e12Hours, | ||||
|     e24Hours | ||||
| }; | ||||
|  | ||||
| enum { | ||||
|     eVertical, | ||||
|     eHorizontal | ||||
| }; | ||||
|  | ||||
| enum { | ||||
|     eNumJump, | ||||
|     eGroupJump | ||||
| }; | ||||
|  | ||||
| cTvguideConfig::cTvguideConfig() { | ||||
|     showMainMenuEntry = 1; | ||||
|     replaceOriginalSchedule = 0; | ||||
|   | ||||
							
								
								
									
										85
									
								
								config.h
									
									
									
									
									
								
							
							
						
						
									
										85
									
								
								config.h
									
									
									
									
									
								
							| @@ -1,6 +1,25 @@ | ||||
| #ifndef __TVGUIDE_CONFIG_H | ||||
| #define __TVGUIDE_CONFIG_H | ||||
|  | ||||
| #include <vdr/themes.h> | ||||
| #include <vdr/plugin.h> | ||||
| #include "osdmanager.h" | ||||
|  | ||||
| enum { | ||||
|     e12Hours, | ||||
|     e24Hours | ||||
| }; | ||||
|  | ||||
| enum { | ||||
|     eVertical, | ||||
|     eHorizontal | ||||
| }; | ||||
|  | ||||
| enum { | ||||
|     eNumJump, | ||||
|     eGroupJump | ||||
| }; | ||||
|  | ||||
| class cTvguideConfig { | ||||
|     private: | ||||
|         void SetGeometry(int width, int height); | ||||
| @@ -127,4 +146,70 @@ class cTvguideConfig { | ||||
|         void loadTheme(); | ||||
| }; | ||||
|  | ||||
| #ifdef DEFINE_CONFIG | ||||
|     cTvguideConfig tvguideConfig; | ||||
|     cOsdManager osdManager; | ||||
|     cTheme theme; | ||||
|     cPlugin* pRemoteTimers = NULL; | ||||
| #else | ||||
|     extern cTvguideConfig tvguideConfig; | ||||
|     extern cOsdManager osdManager; | ||||
|     extern cTheme theme; | ||||
|     extern cPlugin* pRemoteTimers; | ||||
| #endif | ||||
|  | ||||
|  | ||||
| // --- Theme ------------------------------------------------------------- | ||||
| //BLENDING SETUP | ||||
| #define CLR_BLENDING_NOPACITY   0xFFFFFFFF | ||||
| #define CLR_BLENDING_DEFAULT    0xAAAAAAAA | ||||
| #define CLR_BLENDING_OFF        0x00000000 | ||||
|  | ||||
| THEME_CLR(theme, clrDoBlending, CLR_BLENDING_DEFAULT); | ||||
| THEME_CLR(theme, clrBackgroundOSD, clrBlack); | ||||
| THEME_CLR(theme, clrBackground, clrBlack); | ||||
| THEME_CLR(theme, clrGrid1, 0xFF404749); | ||||
| THEME_CLR(theme, clrGrid1Blending, 0xFF000000); | ||||
| THEME_CLR(theme, clrGrid2, 0xFF20293F); | ||||
| THEME_CLR(theme, clrGrid2Blending, 0xFF000000); | ||||
| THEME_CLR(theme, clrHighlight, 0xFFFF4D00); | ||||
| THEME_CLR(theme, clrHighlightBlending, 0xFF000000); | ||||
| THEME_CLR(theme, clrFont, clrWhite); | ||||
| THEME_CLR(theme, clrFontActive, clrWhite); | ||||
| THEME_CLR(theme, clrFontHeader, clrWhite); | ||||
| THEME_CLR(theme, clrFontButtons, clrWhite); | ||||
| THEME_CLR(theme, clrStatusHeader, clrBlack); | ||||
| THEME_CLR(theme, clrStatusHeaderBlending, clrBlack); | ||||
| THEME_CLR(theme, clrHeader, clrBlack); | ||||
| THEME_CLR(theme, clrHeaderBlending, 0xFFE0E0E0); | ||||
| THEME_CLR(theme, clrBorder, clrWhite); | ||||
| THEME_CLR(theme, clrTimeline1, clrWhite); | ||||
| THEME_CLR(theme, clrTimeline1Blending, 0xFF828282); | ||||
| THEME_CLR(theme, clrTimeline2, clrBlack); | ||||
| THEME_CLR(theme, clrTimeline2Blending, 0xFF3F3F3F); | ||||
| THEME_CLR(theme, clrButtonRed, 0x99BB0000); | ||||
| THEME_CLR(theme, clrButtonRedBorder, 0xFFBB0000); | ||||
| THEME_CLR(theme, clrButtonGreen, 0x9900BB00); | ||||
| THEME_CLR(theme, clrButtonGreenBorder, 0xFF00BB00); | ||||
| THEME_CLR(theme, clrButtonYellow, 0x99BBBB00); | ||||
| THEME_CLR(theme, clrButtonYellowBorder, 0xFFBBBB00); | ||||
| THEME_CLR(theme, clrButtonBlue, 0x990000BB); | ||||
| THEME_CLR(theme, clrButtonBlueBorder, 0xFF0000BB); | ||||
| THEME_CLR(theme, clrButtonBlend, 0xDD000000); | ||||
| THEME_CLR(theme, clrRecMenuBackground, 0xB0000000); | ||||
| THEME_CLR(theme, clrRecMenuTimerConflictBackground, 0xFFCCCCCC); | ||||
| THEME_CLR(theme, clrRecMenuTimerConflictBar, 0xFF222222); | ||||
| THEME_CLR(theme, clrRecMenuTimerConflictOverlap, 0xAAFF0000); | ||||
| THEME_CLR(theme, clrRecMenuDayActive, 0xFF00FF00); | ||||
| THEME_CLR(theme, clrRecMenuDayInactive, 0xFFFF0000); | ||||
| THEME_CLR(theme, clrRecMenuDayHighlight, 0x44FFFFFF); | ||||
| THEME_CLR(theme, clrRecMenuTextBack, 0xFF000000); | ||||
| THEME_CLR(theme, clrRecMenuTextActiveBack, 0xFF404749); | ||||
| THEME_CLR(theme, clrRecMenuKeyboardBack, 0xFF000000); | ||||
| THEME_CLR(theme, clrRecMenuKeyboardBorder, clrWhite); | ||||
| THEME_CLR(theme, clrRecMenuKeyboardHigh, 0x55FFFFFF); | ||||
| THEME_CLR(theme, clrButtonRedKeyboard, 0xFFBB0000); | ||||
| THEME_CLR(theme, clrButtonGreenKeyboard, 0xFF00BB00); | ||||
| THEME_CLR(theme, clrButtonYellowKeyboard, 0xFFBBBB00); | ||||
|  | ||||
| #endif //__TVGUIDE_CONFIG_H | ||||
| @@ -1,4 +1,10 @@ | ||||
| #include <sstream> | ||||
| #include <vdr/plugin.h> | ||||
| #include "imageloader.h" | ||||
| #include "services/epgsearch.h" | ||||
| #include "services/remotetimers.h" | ||||
| #include "config.h" | ||||
| #include "tools.h" | ||||
| #include "detailview.h" | ||||
|  | ||||
| cDetailView::cDetailView(const cEvent *event) { | ||||
|   | ||||
| @@ -1,6 +1,12 @@ | ||||
| #ifndef __TVGUIDE_DETAILVIEW_H | ||||
| #define __TVGUIDE_DETAILVIEW_H | ||||
|  | ||||
| #include <vdr/osd.h> | ||||
| #include <vdr/osdbase.h> | ||||
| #include <vdr/epg.h> | ||||
| #include "services/tvscraper.h" | ||||
| #include "styledpixmap.h" | ||||
|  | ||||
| // --- cDetailView  ------------------------------------------------------------- | ||||
|  | ||||
| class cEpgGrid; | ||||
|   | ||||
| @@ -1,6 +1,9 @@ | ||||
| #ifndef __TVGUIDE_DUMMYGRID_H | ||||
| #define __TVGUIDE_DUMMYGRID_H | ||||
|  | ||||
| #include "grid.h" | ||||
| #include "channelcolumn.h" | ||||
|  | ||||
| // --- cDummyGrid  ------------------------------------------------------------- | ||||
|  | ||||
| class cDummyGrid : public cGrid { | ||||
|   | ||||
| @@ -1,4 +1,6 @@ | ||||
| #include "services/remotetimers.h" | ||||
| #include "channelcolumn.h" | ||||
| #include "tools.h" | ||||
| #include "epggrid.h" | ||||
|  | ||||
| cEpgGrid::cEpgGrid(cChannelColumn *c, const cEvent *event)  : cGrid(c) { | ||||
|   | ||||
| @@ -1,6 +1,9 @@ | ||||
| #ifndef __TVGUIDE_EPGGRID_H | ||||
| #define __TVGUIDE_EPGGRID_H | ||||
|  | ||||
| #include <vdr/epg.h> | ||||
| #include "grid.h" | ||||
|  | ||||
| // --- cEpgGrid  ------------------------------------------------------------- | ||||
|  | ||||
| class cEpgGrid : public cGrid { | ||||
|   | ||||
							
								
								
									
										3
									
								
								footer.c
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								footer.c
									
									
									
									
									
								
							| @@ -1,3 +1,6 @@ | ||||
| #include <string> | ||||
| #include "imageloader.h" | ||||
| #include "tools.h" | ||||
| #include "footer.h" | ||||
|  | ||||
| cFooter::cFooter(cChannelGroups *channelGroups) { | ||||
|   | ||||
							
								
								
									
										3
									
								
								footer.h
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								footer.h
									
									
									
									
									
								
							| @@ -1,6 +1,9 @@ | ||||
| #ifndef __TVGUIDE_FOOTER_H | ||||
| #define __TVGUIDE_FOOTER_H | ||||
|  | ||||
| #include <vdr/osd.h> | ||||
| #include "channelgroups.h" | ||||
|  | ||||
| // --- cFooter  ------------------------------------------------------------- | ||||
|  | ||||
| class cFooter  { | ||||
|   | ||||
							
								
								
									
										5
									
								
								grid.h
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								grid.h
									
									
									
									
									
								
							| @@ -1,6 +1,11 @@ | ||||
| #ifndef __TVGUIDE_GRID_H | ||||
| #define __TVGUIDE_GRID_H | ||||
|  | ||||
| #include <vdr/tools.h> | ||||
| #include "styledpixmap.h" | ||||
|  | ||||
| class cChannelColumn; | ||||
|  | ||||
| // --- cEpgGrid  ------------------------------------------------------------- | ||||
|  | ||||
| class cGrid : public cListObject, public cStyledPixmap { | ||||
|   | ||||
| @@ -1,3 +1,5 @@ | ||||
| #include "imageloader.h" | ||||
| #include "tools.h" | ||||
| #include "headergrid.h" | ||||
|  | ||||
| cHeaderGrid::cHeaderGrid(void) : cGrid(NULL) { | ||||
|   | ||||
| @@ -1,6 +1,8 @@ | ||||
| #ifndef __TVGUIDE_HEADERGRID_H | ||||
| #define __TVGUIDE_HEADERGRID_H | ||||
|  | ||||
| #include "grid.h" | ||||
|  | ||||
| // --- cHeaderGrid  ------------------------------------------------------------- | ||||
|  | ||||
| class cHeaderGrid : public cGrid { | ||||
|   | ||||
| @@ -1,9 +1,11 @@ | ||||
| #include "imageloader.h" | ||||
| #include <math.h> | ||||
| #include <string> | ||||
| #include <dirent.h> | ||||
| #include <iostream> | ||||
|  | ||||
| #include "config.h" | ||||
| #include "imageloader.h" | ||||
|  | ||||
| using namespace Magick; | ||||
|  | ||||
| cImageLoader::cImageLoader() { | ||||
|   | ||||
							
								
								
									
										111
									
								
								messagebox.c
									
									
									
									
									
								
							
							
						
						
									
										111
									
								
								messagebox.c
									
									
									
									
									
								
							| @@ -1,111 +0,0 @@ | ||||
| #include "messagebox.h" | ||||
|  | ||||
| cMessageBoxThread::cMessageBoxThread(cPixmap *content, int displayTime) { | ||||
|     this->content = content; | ||||
|     FrameTime = 30; // ms | ||||
|     FadeTime = 200; // ms | ||||
|     this->displayTime = displayTime; | ||||
| } | ||||
|  | ||||
| cMessageBoxThread::~cMessageBoxThread(void) { | ||||
|     Cancel(-1); | ||||
|     while (Active()) | ||||
|         cCondWait::SleepMs(10); | ||||
| } | ||||
|  | ||||
| void cMessageBoxThread::Action(void) { | ||||
|     uint64_t Start = cTimeMs::Now(); | ||||
|     while (Running()) { | ||||
|         uint64_t Now = cTimeMs::Now(); | ||||
|         cPixmap::Lock(); | ||||
|         double t = min(double(Now - Start) / FadeTime, 1.0); | ||||
|         int Alpha = t * ALPHA_OPAQUE; | ||||
|         if (Running() && content) { | ||||
|             content->SetAlpha(Alpha); | ||||
|             osdManager.flush(); | ||||
|         } | ||||
|         cPixmap::Unlock(); | ||||
|         int Delta = cTimeMs::Now() - Now; | ||||
|         if (Delta < FrameTime) | ||||
|            cCondWait::SleepMs(FrameTime - Delta); | ||||
|         if ((Now - Start) > FadeTime) | ||||
|             break; | ||||
|     } | ||||
|     cCondWait::SleepMs(displayTime - 2*FadeTime); | ||||
|     Start = cTimeMs::Now(); | ||||
|     while (Running()) { | ||||
|         uint64_t Now = cTimeMs::Now(); | ||||
|         cPixmap::Lock(); | ||||
|         double t = min(double(Now - Start) / FadeTime, 1.0); | ||||
|         int Alpha = (1-t) * ALPHA_OPAQUE; | ||||
|         if (Running() && content) { | ||||
|             content->SetAlpha(Alpha); | ||||
|             osdManager.flush(); | ||||
|         } | ||||
|         cPixmap::Unlock(); | ||||
|         int Delta = cTimeMs::Now() - Now; | ||||
|         if (Delta < FrameTime) | ||||
|            cCondWait::SleepMs(FrameTime - Delta); | ||||
|         if ((Now - Start) > FadeTime) | ||||
|             break; | ||||
|     } | ||||
|     osdManager.flush(); | ||||
| } | ||||
|  | ||||
| //--cMessageBox------------------------------------------------------------- | ||||
| cMessageBoxThread *cMessageBox::msgboxThread = NULL; | ||||
| cPixmap *cMessageBox::content = NULL; | ||||
|  | ||||
| bool cMessageBox::Start(int displayTime, cString msg) { | ||||
|     int width = (tvguideConfig.osdWidth - 600)/2; | ||||
|     if (!content) { | ||||
|         int height = 400; | ||||
|         content = osdManager.requestPixmap(5, cRect((tvguideConfig.osdWidth - width)/2,  | ||||
|                                                     (tvguideConfig.osdHeight- height)/2,  | ||||
|                                                     width, height)); | ||||
|     } | ||||
|     if (msgboxThread) { | ||||
|         delete msgboxThread; | ||||
|         msgboxThread = NULL; | ||||
|     } | ||||
|     if (!msgboxThread) { | ||||
|         msgboxThread = new cMessageBoxThread(content, displayTime); | ||||
|         cTextWrapper message; | ||||
|         message.Set(msg, tvguideConfig.FontMessageBox, width - 40); | ||||
|         int textHeight = tvguideConfig.FontMessageBox->Height(); | ||||
|         int textLines = message.Lines(); | ||||
|         int height = textLines * (textHeight+20); | ||||
|         cPixmap::Lock(); | ||||
|         content->SetViewPort(cRect((tvguideConfig.osdWidth - width)/2,(tvguideConfig.osdHeight- height)/2, width, height)); | ||||
|         content->SetAlpha(0); | ||||
|         content->Fill(theme.Color(clrBorder)); | ||||
|         content->DrawRectangle(cRect(2,2,width-4, height-4), theme.Color(clrBackground)); | ||||
|         int textWidth = 0; | ||||
|         for (int i=0; i<textLines; i++) { | ||||
|             textWidth = tvguideConfig.FontMessageBox->Width(message.GetLine(i)); | ||||
|             content->DrawText(cPoint((width - textWidth)/2, 20 + i*textHeight), message.GetLine(i), theme.Color(clrFont), theme.Color(clrBackground), tvguideConfig.FontMessageBox); | ||||
|         } | ||||
|         cPixmap::Unlock(); | ||||
|         msgboxThread->Start(); | ||||
|         return true; | ||||
|     } | ||||
|     return false; | ||||
| } | ||||
|  | ||||
| void cMessageBox::Stop(void) { | ||||
|     if (msgboxThread) { | ||||
|         delete msgboxThread; | ||||
|         msgboxThread = NULL; | ||||
|     } | ||||
| } | ||||
|  | ||||
| void cMessageBox::Destroy(void) { | ||||
|     if (msgboxThread) { | ||||
|         delete msgboxThread; | ||||
|         msgboxThread = NULL; | ||||
|     } | ||||
|     if (content) { | ||||
|         osdManager.releasePixmap(content); | ||||
|         content = NULL; | ||||
|     } | ||||
| } | ||||
							
								
								
									
										29
									
								
								messagebox.h
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								messagebox.h
									
									
									
									
									
								
							| @@ -1,29 +0,0 @@ | ||||
| #ifndef __TVGUIDE_MESSAGEBOX_H | ||||
| #define __TVGUIDE_MESSAGEBOX_H | ||||
|  | ||||
| // --- cMessageBox  ------------------------------------------------------------- | ||||
|  | ||||
| class cMessageBoxThread : public cThread { | ||||
| private: | ||||
|     cPixmap *content; | ||||
|     int FadeTime; | ||||
|     int FrameTime; | ||||
|     int displayTime; | ||||
|     virtual void Action(void); | ||||
| public: | ||||
|     cMessageBoxThread(cPixmap *content, int displayTime); | ||||
|     virtual ~cMessageBoxThread(void); | ||||
| }; | ||||
|  | ||||
| class cMessageBox { | ||||
| private: | ||||
|     static cMutex mutex; | ||||
|     static cMessageBoxThread *msgboxThread; | ||||
|     static cPixmap *content; | ||||
| public: | ||||
|     static bool Start(int displayTime, cString msg); | ||||
|     static void Stop(void); | ||||
|     static void Destroy(void); | ||||
| }; | ||||
|  | ||||
| #endif //__TVGUIDE_MESSAGEBOX_H | ||||
							
								
								
									
										23
									
								
								osdmanager.c
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								osdmanager.c
									
									
									
									
									
								
							| @@ -1,24 +1,5 @@ | ||||
| #ifndef __TVGUIDE_OSDMANAGER_H | ||||
| #define __TVGUIDE_OSDMANAGER_H | ||||
|  | ||||
| class cOsdManager { | ||||
|     private: | ||||
|         cOsd *osd; | ||||
|     public: | ||||
|         cOsdManager(void); | ||||
|         bool setOsd(); | ||||
|         void setBackground(); | ||||
|         void flush() {osd->Flush();}; | ||||
|         cPixmap *requestPixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort = cRect::Null); | ||||
|         void releasePixmap(cPixmap *pixmap); | ||||
|         void deleteOsd() {delete osd;}; | ||||
|         int Width() { return osd->Width(); }; | ||||
|         int Height() { return osd->Height(); }; | ||||
|         int Top() { return osd->Top(); }; | ||||
|         int Left() { return osd->Left(); }; | ||||
| }; | ||||
|  | ||||
| #endif //__TVGUIDE_OSDMANAGER_H | ||||
| #include "config.h" | ||||
| #include "osdmanager.h" | ||||
|  | ||||
| cOsdManager::cOsdManager(void) { | ||||
| } | ||||
|   | ||||
							
								
								
									
										23
									
								
								osdmanager.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								osdmanager.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | ||||
| #ifndef __TVGUIDE_OSDMANAGER_H | ||||
| #define __TVGUIDE_OSDMANAGER_H | ||||
|  | ||||
| #include <vdr/osd.h> | ||||
|  | ||||
| class cOsdManager { | ||||
|     private: | ||||
|         cOsd *osd; | ||||
|     public: | ||||
|         cOsdManager(void); | ||||
|         bool setOsd(); | ||||
|         void setBackground(); | ||||
|         void flush() {osd->Flush();}; | ||||
|         cPixmap *requestPixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort = cRect::Null); | ||||
|         void releasePixmap(cPixmap *pixmap); | ||||
|         void deleteOsd() {delete osd;}; | ||||
|         int Width() { return osd->Width(); }; | ||||
|         int Height() { return osd->Height(); }; | ||||
|         int Top() { return osd->Top(); }; | ||||
|         int Left() { return osd->Left(); }; | ||||
| }; | ||||
|  | ||||
| #endif //__TVGUIDE_OSDMANAGER_H | ||||
| @@ -1,5 +1,14 @@ | ||||
| #include <string> | ||||
| #include <sstream> | ||||
| #include <vector> | ||||
| #include <algorithm> | ||||
|  | ||||
| #include <vdr/menu.h> | ||||
| #include "services/epgsearch.h" | ||||
| #include "services/remotetimers.h" | ||||
| #include "services/tvscraper.h" | ||||
| #include "tools.h" | ||||
| #include "switchtimer.h" | ||||
| #include "recmanager.h" | ||||
|  | ||||
| static int CompareRecording(const void *p1, const void *p2) { | ||||
|   | ||||
| @@ -1,6 +1,12 @@ | ||||
| #ifndef __TVGUIDE_RECMMANAGER_H | ||||
| #define __TVGUIDE_RECMMANAGER_H | ||||
|  | ||||
| #include <string> | ||||
| #include <vector> | ||||
| #include <vdr/plugin.h> | ||||
| #include "detailview.h" | ||||
| #include "recmenu.h" | ||||
|  | ||||
| class TVGuideTimerConflict { | ||||
| public: | ||||
|     time_t time; | ||||
|   | ||||
| @@ -1,6 +1,8 @@ | ||||
| #ifndef __TVGUIDE_RECMENU_H | ||||
| #define __TVGUIDE_RECMENU_H | ||||
|  | ||||
| #include "recmenuitem.h" | ||||
|  | ||||
| // --- cRecMenu  ------------------------------------------------------------- | ||||
|  | ||||
| class cRecMenu : public cStyledPixmap { | ||||
|   | ||||
| @@ -1,5 +1,7 @@ | ||||
| #include <math.h> | ||||
| #include <vdr/remote.h> | ||||
| #include "imageloader.h" | ||||
| #include "tools.h" | ||||
| #include "recmenuitem.h" | ||||
|  | ||||
| // --- cRecMenuItem  ------------------------------------------------------------- | ||||
|   | ||||
| @@ -3,6 +3,10 @@ | ||||
|  | ||||
| #define AUTO_ADVANCE_TIMEOUT 1500 | ||||
|  | ||||
| #include <string> | ||||
| #include <vdr/tools.h>  | ||||
| #include "styledpixmap.h" | ||||
|  | ||||
| enum eRecMenuState { | ||||
|     rmsConsumed, | ||||
|     rmsNotConsumed, | ||||
|   | ||||
| @@ -1,3 +1,6 @@ | ||||
| #include "recmenu.h"  | ||||
| #include "recmenus.h" | ||||
| #include "switchtimer.h" | ||||
| #include "recmenumanager.h" | ||||
|  | ||||
| cRecMenuManager::cRecMenuManager(void) { | ||||
|   | ||||
| @@ -1,6 +1,10 @@ | ||||
| #ifndef __TVGUIDE_RECMENUMANAGER_H | ||||
| #define __TVGUIDE_RECMENUMANAGER_H | ||||
|  | ||||
| #include "recmenu.h" | ||||
| #include "recmanager.h" | ||||
| #include "services/epgsearch.h" | ||||
|  | ||||
| // --- cRecMenuManager  ------------------------------------------------------------- | ||||
| class cRecMenuManager { | ||||
| private: | ||||
|   | ||||
							
								
								
									
										1707
									
								
								recmenus.c
									
									
									
									
									
								
							
							
						
						
									
										1707
									
								
								recmenus.c
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										266
									
								
								recmenus.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										266
									
								
								recmenus.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,266 @@ | ||||
| #ifndef __TVGUIDE_RECMENUS_H | ||||
| #define __TVGUIDE_RECMENUS_H | ||||
|  | ||||
| #define TEXTINPUTLENGTH 80 | ||||
|  | ||||
| #include <vector> | ||||
| #include <vdr/epg.h> | ||||
| #include "recmanager.h" | ||||
|  | ||||
| // --- cRecMenuMain  --------------------------------------------------------- | ||||
| class cRecMenuMain : public cRecMenu { | ||||
| public: | ||||
|     cRecMenuMain(bool epgSearchAvailable, bool timerActive, bool switchTimerActive); | ||||
|     virtual ~cRecMenuMain(void) {}; | ||||
| }; | ||||
|  | ||||
| // --- cRecMenuAskFolder  --------------------------------------------------------- | ||||
| class cRecMenuAskFolder: public cRecMenu { | ||||
| private: | ||||
|     std::vector<cString> folders; | ||||
|     eRecMenuState NextAction; | ||||
|     void readFolders(cList<cNestedItem> *rootFolders, cString path); | ||||
| public: | ||||
|     cRecMenuAskFolder(const cEvent *event, eRecMenuState nextAction); | ||||
|     cRecMenuItem *GetMenuItem(int number); | ||||
|     int GetTotalNumMenuItems(void); | ||||
|     virtual ~cRecMenuAskFolder(void) {}; | ||||
| }; | ||||
|  | ||||
| // --- cRecMenuConfirmTimer  --------------------------------------------------------- | ||||
| class cRecMenuConfirmTimer: public cRecMenu { | ||||
| public: | ||||
|     cRecMenuConfirmTimer(const cEvent *event); | ||||
|     virtual ~cRecMenuConfirmTimer(void) {}; | ||||
| }; | ||||
|  | ||||
| // --- cRecMenuConfirmDeleteTimer  --------------------------------------------------------- | ||||
| class cRecMenuConfirmDeleteTimer: public cRecMenu { | ||||
| public: | ||||
|     cRecMenuConfirmDeleteTimer(const cEvent *event); | ||||
|     virtual ~cRecMenuConfirmDeleteTimer(void) {}; | ||||
| }; | ||||
|  | ||||
| // --- cRecMenuAskDeleteTimer --------------------------------------------------------- | ||||
| class cRecMenuAskDeleteTimer: public cRecMenu { | ||||
| public: | ||||
|     cRecMenuAskDeleteTimer(const cEvent *event); | ||||
|     virtual ~cRecMenuAskDeleteTimer(void) {}; | ||||
| }; | ||||
|  | ||||
| // --- cRecMenuTimerConflicts  --------------------------------------------------------- | ||||
| class cRecMenuTimerConflicts: public cRecMenu { | ||||
| public: | ||||
|     cRecMenuTimerConflicts(std::vector<TVGuideTimerConflict> conflicts);     | ||||
|     virtual ~cRecMenuTimerConflicts(void) {}; | ||||
| }; | ||||
|  | ||||
| // --- cRecMenuTimerConflict  --------------------------------------------------------- | ||||
| class cRecMenuTimerConflict: public cRecMenu { | ||||
| private: | ||||
|     TVGuideTimerConflict conflict; | ||||
| public: | ||||
|     cRecMenuTimerConflict(TVGuideTimerConflict conflict); | ||||
|     cRecMenuItem *GetMenuItem(int number); | ||||
|     int GetTotalNumMenuItems(void); | ||||
|     virtual ~cRecMenuTimerConflict(void) {}; | ||||
| }; | ||||
|  | ||||
| // --- cRecMenuNoTimerConflict --------------------------------------------------------- | ||||
| class cRecMenuNoTimerConflict: public cRecMenu { | ||||
| public: | ||||
|     cRecMenuNoTimerConflict(void);    | ||||
|     virtual ~cRecMenuNoTimerConflict(void) {}; | ||||
| }; | ||||
|  | ||||
| // --- cRecMenuEditTimer  --------------------------------------------------------- | ||||
| class cRecMenuEditTimer: public cRecMenu { | ||||
| public: | ||||
|     cRecMenuEditTimer(const cTimer *timer, eRecMenuState nextState); | ||||
|     virtual ~cRecMenuEditTimer(void) {}; | ||||
| }; | ||||
|  | ||||
|  | ||||
| // --- cRecMenuSeriesTimer --------------------------------------------------------- | ||||
| class cRecMenuSeriesTimer: public cRecMenu { | ||||
| public: | ||||
|     cRecMenuSeriesTimer(cChannel *initialChannel, const cEvent *event); | ||||
|     virtual ~cRecMenuSeriesTimer(void) {}; | ||||
| }; | ||||
|  | ||||
| // --- cRecMenuConfirmSeriesTimer  --------------------------------------------------------- | ||||
| class cRecMenuConfirmSeriesTimer: public cRecMenu { | ||||
| public: | ||||
|     cRecMenuConfirmSeriesTimer(cTimer *seriesTimer);     | ||||
|     virtual ~cRecMenuConfirmSeriesTimer(void) {}; | ||||
| }; | ||||
|  | ||||
| // --- cRecMenuSearchTimer  --------------------------------------------------------- | ||||
| class cRecMenuSearchTimer: public cRecMenu { | ||||
| private: | ||||
|     char initialText[TEXTINPUTLENGTH]; | ||||
| public: | ||||
|     cRecMenuSearchTimer(const cEvent *event); | ||||
|     virtual ~cRecMenuSearchTimer(void) {}; | ||||
| }; | ||||
|  | ||||
| // --- cRecMenuSearchTimerTemplates  --------------------------------------------------------- | ||||
| class cRecMenuSearchTimerTemplates: public cRecMenu { | ||||
| private: | ||||
|     int numTemplates; | ||||
|     std::vector<TVGuideEPGSearchTemplate> templates; | ||||
| public: | ||||
|     cRecMenuSearchTimerTemplates(cString searchString, std::vector<TVGuideEPGSearchTemplate> templates); | ||||
|     cRecMenuItem *GetMenuItem(int number); | ||||
|     int GetTotalNumMenuItems(void); | ||||
|     virtual ~cRecMenuSearchTimerTemplates(void) {}; | ||||
| }; | ||||
|  | ||||
| // --- cRecMenuSearchTimerTemplatesCreate  --------------------------------------------------------- | ||||
| class cRecMenuSearchTimerTemplatesCreate: public cRecMenu { | ||||
| private: | ||||
| public: | ||||
|     cRecMenuSearchTimerTemplatesCreate(cString searchString, cString tmplName); | ||||
|     virtual ~cRecMenuSearchTimerTemplatesCreate(void) {}; | ||||
| }; | ||||
|  | ||||
| // --- cRecMenuSearchTimerOptions  --------------------------------------------------------- | ||||
| class cRecMenuSearchTimerOptions: public cRecMenu { | ||||
| private: | ||||
|     const char * searchModes[5]; | ||||
|     cString searchString; | ||||
| public: | ||||
|     cRecMenuSearchTimerOptions(cString searchString); | ||||
|     void CreateMenuItems(void); | ||||
|     virtual ~cRecMenuSearchTimerOptions(void) {}; | ||||
| }; | ||||
|  | ||||
| // --- cRecMenuSearchTimerResults --------------------------------------------------------- | ||||
| class cRecMenuSearchTimerResults: public cRecMenu { | ||||
| private: | ||||
|     const cEvent **searchResults; | ||||
|     int numResults; | ||||
| public: | ||||
|     cRecMenuSearchTimerResults(cString searchString, const cEvent **searchResults, int numResults, std::string templateName); | ||||
|     cRecMenuItem *GetMenuItem(int number); | ||||
|     int GetTotalNumMenuItems(void); | ||||
|     virtual ~cRecMenuSearchTimerResults(void) { | ||||
|         delete[] searchResults; | ||||
|     }; | ||||
| }; | ||||
|  | ||||
| // --- cRecMenuSearchTimerNothingFound  --------------------------------------------------------- | ||||
| class cRecMenuSearchTimerNothingFound: public cRecMenu { | ||||
| public: | ||||
|     cRecMenuSearchTimerNothingFound(cString searchString, std::string templateName); | ||||
|     virtual ~cRecMenuSearchTimerNothingFound(void) {}; | ||||
| }; | ||||
|  | ||||
| // --- cRecMenuSearchTimerCreateConfirm  --------------------------------------------------------- | ||||
| class cRecMenuSearchTimerCreateConfirm: public cRecMenu { | ||||
| private: | ||||
| public: | ||||
|     cRecMenuSearchTimerCreateConfirm(bool success); | ||||
|     virtual ~cRecMenuSearchTimerCreateConfirm(void) {}; | ||||
| }; | ||||
|  | ||||
| // --- cRecMenuSwitchTimer  --------------------------------------------------------- | ||||
| class cRecMenuSwitchTimer: public cRecMenu { | ||||
| private: | ||||
|     const char *switchModes[3]; | ||||
| public: | ||||
|     cRecMenuSwitchTimer(void); | ||||
|     virtual ~cRecMenuSwitchTimer(void) {}; | ||||
| }; | ||||
|  | ||||
| // --- cRecMenuSwitchTimerConfirm  --------------------------------------------------------- | ||||
| class cRecMenuSwitchTimerConfirm: public cRecMenu { | ||||
| private: | ||||
| public: | ||||
|     cRecMenuSwitchTimerConfirm(bool success); | ||||
|     virtual ~cRecMenuSwitchTimerConfirm(void) {}; | ||||
| }; | ||||
|  | ||||
| // --- cRecMenuSwitchTimerDelete  --------------------------------------------------------- | ||||
| class cRecMenuSwitchTimerDelete: public cRecMenu { | ||||
| private: | ||||
| public: | ||||
|     cRecMenuSwitchTimerDelete(void); | ||||
|     virtual ~cRecMenuSwitchTimerDelete(void) {}; | ||||
| }; | ||||
|  | ||||
|  | ||||
| // --- cRecMenuSearch  --------------------------------------------------------- | ||||
| class cRecMenuSearch: public cRecMenu { | ||||
| private: | ||||
|     char initialText[TEXTINPUTLENGTH]; | ||||
|     const char * searchModes[5]; | ||||
| public: | ||||
|     cRecMenuSearch(const cEvent *event); | ||||
|     cRecMenuSearch(const cEvent *event, const char *searchString); | ||||
|     virtual ~cRecMenuSearch(void) {}; | ||||
| }; | ||||
|  | ||||
| // --- cRecMenuSearchResults  --------------------------------------------------------- | ||||
| class cRecMenuSearchResults: public cRecMenu { | ||||
| private: | ||||
|     const cEvent **searchResults; | ||||
|     int numResults; | ||||
| public: | ||||
|     cRecMenuSearchResults(cString searchString, const cEvent **searchResults, int numResults); | ||||
|     cRecMenuItem *GetMenuItem(int number); | ||||
|     int GetTotalNumMenuItems(void); | ||||
|     virtual ~cRecMenuSearchResults(void) { | ||||
|         delete[] searchResults; | ||||
|     }; | ||||
| }; | ||||
|  | ||||
| // --- cRecMenuSearchConfirmTimer  --------------------------------------------------------- | ||||
| class cRecMenuSearchConfirmTimer: public cRecMenu { | ||||
| public: | ||||
|     cRecMenuSearchConfirmTimer(const cEvent *event); | ||||
|     virtual ~cRecMenuSearchConfirmTimer(void) {}; | ||||
| }; | ||||
|  | ||||
| // --- cRecMenuSearchNothingFound  --------------------------------------------------------- | ||||
| class cRecMenuSearchNothingFound: public cRecMenu { | ||||
| public: | ||||
|     cRecMenuSearchNothingFound(cString searchString); | ||||
|     virtual ~cRecMenuSearchNothingFound(void) {}; | ||||
| }; | ||||
|  | ||||
|  | ||||
|  | ||||
| // --- cRecMenuRecordingSearch  --------------------------------------------------------- | ||||
| class cRecMenuRecordingSearch: public cRecMenu { | ||||
| private: | ||||
|     char initialText[TEXTINPUTLENGTH]; | ||||
| public: | ||||
|     cRecMenuRecordingSearch(const cEvent *event); | ||||
|     virtual ~cRecMenuRecordingSearch(void) {}; | ||||
| }; | ||||
|  | ||||
| // --- cRecMenuRecordingSearchResults  --------------------------------------------------------- | ||||
|  | ||||
| class cRecMenuRecordingSearchResults: public cRecMenu { | ||||
| private: | ||||
|     cRecording **searchResults; | ||||
|     int numResults; | ||||
| public: | ||||
|     cRecMenuRecordingSearchResults(cString searchString, cRecording **searchResults, int numResults); | ||||
|     cRecMenuItem *GetMenuItem(int number); | ||||
|     int GetTotalNumMenuItems(void); | ||||
|     virtual ~cRecMenuRecordingSearchResults(void) { | ||||
|         delete[] searchResults; | ||||
|     }; | ||||
| }; | ||||
|  | ||||
| // --- cRecMenuRecordingSearchNotFound  --------------------------------------------------------- | ||||
| class cRecMenuRecordingSearchNotFound: public cRecMenu { | ||||
| public: | ||||
|     cRecMenuRecordingSearchNotFound(cString searchString); | ||||
|     virtual ~cRecMenuRecordingSearchNotFound(void) {}; | ||||
| }; | ||||
|  | ||||
|  | ||||
| #endif //__TVGUIDE_RECMENUS_H | ||||
| @@ -1,3 +1,9 @@ | ||||
| #ifndef REMOTETIMERSERVICES_INC | ||||
| #define REMOTETIMERSERVICES_INC | ||||
|  | ||||
| #include <vdr/epg.h> | ||||
| #include <vdr/timers.h> | ||||
|  | ||||
| // RemoteTimers services | ||||
| struct RemoteTimers_Event_v1_0 { | ||||
|     //in | ||||
| @@ -22,4 +28,6 @@ struct RemoteTimers_Timer_v1_0 { | ||||
|     cTimer *timer; | ||||
|     //out | ||||
|     cString errorMsg; | ||||
| }; | ||||
| }; | ||||
|  | ||||
| #endif //REMOTETIMERSERVICES_INC | ||||
| @@ -1,3 +1,10 @@ | ||||
| #ifndef __TVGUIDE_TVSCRAPER_H | ||||
| #define __TVGUIDE_TVSCRAPER_H | ||||
|  | ||||
| #include <string> | ||||
| #include <vector> | ||||
| #include <vdr/epg.h> | ||||
|  | ||||
| enum tvMediaType { | ||||
|     typeSeries, | ||||
|     typeMovie, | ||||
| @@ -53,4 +60,6 @@ struct TVScraperGetFullInformation | ||||
|     std::vector<tvMedia> fanart; | ||||
|     std::vector<tvActor> actors; | ||||
|     std::string description; | ||||
| }; | ||||
| }; | ||||
|  | ||||
| #endif //__TVGUIDE_TVSCRAPER_H | ||||
							
								
								
									
										3
									
								
								setup.h
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								setup.h
									
									
									
									
									
								
							| @@ -1,6 +1,9 @@ | ||||
| #ifndef __TVGUIDE_SETUP_H | ||||
| #define __TVGUIDE_SETUP_H | ||||
|  | ||||
| #include <vdr/menuitems.h> | ||||
| #include "config.h" | ||||
|  | ||||
| class cTvguideSetup : public cMenuSetupPage { | ||||
|     public: | ||||
|         cTvguideSetup(void); | ||||
|   | ||||
| @@ -1,3 +1,6 @@ | ||||
| #include "tools.h" | ||||
| #include "services/tvscraper.h" | ||||
| #include "imageloader.h" | ||||
| #include "statusheader.h" | ||||
|  | ||||
| cStatusHeader::cStatusHeader(void) { | ||||
|   | ||||
| @@ -1,6 +1,9 @@ | ||||
| #ifndef __TVGUIDE_STATUSHEADER_H | ||||
| #define __TVGUIDE_STATUSHEADER_H | ||||
|  | ||||
| #include "styledpixmap.h" | ||||
| #include "grid.h" | ||||
|  | ||||
| // --- cStatusHeader  ------------------------------------------------------------- | ||||
|  | ||||
| class cStatusHeader : public cStyledPixmap { | ||||
|   | ||||
| @@ -1,3 +1,4 @@ | ||||
| #include "imageloader.h" | ||||
| #include "styledpixmap.h" | ||||
|  | ||||
| cStyledPixmap::cStyledPixmap(void) { | ||||
|   | ||||
| @@ -1,6 +1,11 @@ | ||||
| #ifndef __TVGUIDE_STYLEDPIXMAP_H | ||||
| #define __TVGUIDE_STYLEDPIXMAP_H | ||||
|  | ||||
| #include <vdr/osd.h> | ||||
| #include <vdr/epg.h> | ||||
| #include "timer.h" | ||||
| #include "config.h" | ||||
|  | ||||
| // --- cStyledPixmap ------------------------------------------------------------- | ||||
|  | ||||
| class cStyledPixmap { | ||||
|   | ||||
| @@ -1,3 +1,4 @@ | ||||
| #include "imageloader.h" | ||||
| #include "timeline.h" | ||||
|  | ||||
| cTimeLine::cTimeLine(cMyTime *myTime) { | ||||
|   | ||||
| @@ -1,6 +1,9 @@ | ||||
| #ifndef __TVGUIDE_TIMELINE_H | ||||
| #define __TVGUIDE_TIMELINE_H | ||||
|  | ||||
| #include "timer.h" | ||||
| #include "styledpixmap.h" | ||||
|  | ||||
| // --- cTimeLine  ------------------------------------------------------------- | ||||
|  | ||||
| class cTimeLine  { | ||||
|   | ||||
							
								
								
									
										3
									
								
								timer.c
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								timer.c
									
									
									
									
									
								
							| @@ -1,3 +1,6 @@ | ||||
| #include <time.h> | ||||
| #include <vdr/tools.h> | ||||
| #include "config.h" | ||||
| #include "timer.h" | ||||
|  | ||||
| cMyTime::~cMyTime(void) { | ||||
|   | ||||
							
								
								
									
										2
									
								
								timer.h
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								timer.h
									
									
									
									
									
								
							| @@ -1,6 +1,8 @@ | ||||
| #ifndef __TVGUIDE_TIMER_H | ||||
| #define __TVGUIDE_TIMER_H | ||||
|  | ||||
| #include <vdr/tools.h> | ||||
|  | ||||
| // --- cMyTime -------------------------------------------------------------  | ||||
|  | ||||
| class cMyTime { | ||||
|   | ||||
							
								
								
									
										62
									
								
								tools.c
									
									
									
									
									
								
							
							
						
						
									
										62
									
								
								tools.c
									
									
									
									
									
								
							| @@ -1,11 +1,17 @@ | ||||
| #include <string> | ||||
| #include <vector> | ||||
| #include <sstream> | ||||
| #include <ctype.h> | ||||
| #include <string.h> | ||||
| #include <stdlib.h> | ||||
| #include <stdio.h> | ||||
|  | ||||
| #include "tools.h" | ||||
|  | ||||
| /**************************************************************************************** | ||||
| *            CUTTEXT | ||||
| ****************************************************************************************/ | ||||
| static std::string CutText(std::string text, int width, const cFont *font) { | ||||
| std::string CutText(std::string text, int width, const cFont *font) { | ||||
|     if (width <= font->Size()) | ||||
|         return text.c_str(); | ||||
|     if (font->Width(text.c_str()) < width) | ||||
| @@ -35,13 +41,6 @@ static std::string CutText(std::string text, int width, const cFont *font) { | ||||
| /**************************************************************************************** | ||||
| *            SPLTSTRING | ||||
| ****************************************************************************************/ | ||||
| class splitstring : public std::string { | ||||
|     std::vector<std::string> flds; | ||||
| public: | ||||
|     splitstring(const char *s) : std::string(s) { }; | ||||
|     std::vector<std::string>& split(char delim, int rep=0); | ||||
| }; | ||||
|  | ||||
| // split: receives a char delimiter; returns a vector of strings | ||||
| // By default ignores repeated delimiters, unless argument rep == 1. | ||||
| std::vector<std::string>& splitstring::split(char delim, int rep) { | ||||
| @@ -82,53 +81,6 @@ int FindIgnoreCase(const std::string& expr, const std::string& query) | ||||
| /**************************************************************************************** | ||||
| *            FUZZYSEARCH | ||||
| ****************************************************************************************/ | ||||
| #include <ctype.h> | ||||
| #include <string.h> | ||||
| #include <stdlib.h> | ||||
| #include <stdio.h> | ||||
|  | ||||
| #ifndef _AFUZZY_H | ||||
| #define _AFUZZY_H | ||||
|  | ||||
| // source from: | ||||
| /* | ||||
|   Leonid Boitsov 2002. (itman@narod.ru) | ||||
|   C version of Stas Namin. | ||||
|   This code is a GPL software and is distributed under GNU | ||||
|   public licence without any warranty. | ||||
| */ | ||||
|  | ||||
| typedef unsigned int Uint; | ||||
|  | ||||
| #define MaxPatSize (sizeof(Uint) * 8) | ||||
|  | ||||
| typedef struct | ||||
| { | ||||
| 	Uint 		*R, | ||||
| 				*R1, | ||||
| 				*RP, | ||||
| 				*S, | ||||
| 				*RI; | ||||
| 	Uint 		*FilterS; | ||||
|  | ||||
| 	int 		Map[256]; | ||||
| 	int 		FilterMap[256]; | ||||
| 	int			k; | ||||
| 	Uint		mask_ok; | ||||
| 	Uint		filter_ok; | ||||
| 	Uint		filter_shift; | ||||
| 	int			r_size; | ||||
| 	int			FilterSet; | ||||
| } AFUZZY; | ||||
|  | ||||
| void afuzzy_init(const char *p, int kerr, int UseFilter, AFUZZY *fuzzy); | ||||
| void afuzzy_free(AFUZZY *fuzzy); | ||||
| int afuzzy_checkSUB(const char *t, AFUZZY *fuzzy); | ||||
|  | ||||
| #endif | ||||
|  | ||||
|  | ||||
| static int afuzzy_checkFLT(const char *t, AFUZZY *fuzzy); | ||||
|  | ||||
| /****************************************************************************** | ||||
| FUNCTION afuzzy_init()  | ||||
|   | ||||
							
								
								
									
										59
									
								
								tools.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										59
									
								
								tools.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,59 @@ | ||||
| #ifndef __TVGUIDETOOLS_H | ||||
| #define __TVGUIDETOOLS_H | ||||
|  | ||||
| #include <string> | ||||
| #include <vector> | ||||
| #include <vdr/font.h> | ||||
|  | ||||
| std::string CutText(std::string text, int width, const cFont *font); | ||||
|  | ||||
| class splitstring : public std::string { | ||||
|     std::vector<std::string> flds; | ||||
| public: | ||||
|     splitstring(const char *s) : std::string(s) { }; | ||||
|     std::vector<std::string>& split(char delim, int rep=0); | ||||
| }; | ||||
|  | ||||
| int FindIgnoreCase(const std::string& expr, const std::string& query); | ||||
|  | ||||
| #ifndef _AFUZZY_H | ||||
| #define _AFUZZY_H | ||||
|  | ||||
| // source from: | ||||
| /* | ||||
|   Leonid Boitsov 2002. (itman@narod.ru) | ||||
|   C version of Stas Namin. | ||||
|   This code is a GPL software and is distributed under GNU | ||||
|   public licence without any warranty. | ||||
| */ | ||||
|  | ||||
| typedef unsigned int Uint; | ||||
|  | ||||
| #define MaxPatSize (sizeof(Uint) * 8) | ||||
|  | ||||
| typedef struct | ||||
| { | ||||
| 	Uint 		*R, | ||||
| 				*R1, | ||||
| 				*RP, | ||||
| 				*S, | ||||
| 				*RI; | ||||
| 	Uint 		*FilterS; | ||||
|  | ||||
| 	int 		Map[256]; | ||||
| 	int 		FilterMap[256]; | ||||
| 	int			k; | ||||
| 	Uint		mask_ok; | ||||
| 	Uint		filter_ok; | ||||
| 	Uint		filter_shift; | ||||
| 	int			r_size; | ||||
| 	int			FilterSet; | ||||
| } AFUZZY; | ||||
|  | ||||
| void afuzzy_init(const char *p, int kerr, int UseFilter, AFUZZY *fuzzy); | ||||
| void afuzzy_free(AFUZZY *fuzzy); | ||||
| int afuzzy_checkSUB(const char *t, AFUZZY *fuzzy); | ||||
| static int afuzzy_checkFLT(const char *t, AFUZZY *fuzzy); | ||||
| #endif | ||||
|  | ||||
| #endif // __TVGUIDETOOLS_H | ||||
							
								
								
									
										17
									
								
								tvguide.c
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								tvguide.c
									
									
									
									
									
								
							| @@ -13,14 +13,16 @@ | ||||
| #include <vdr/device.h> | ||||
| #include <vdr/menu.h> | ||||
|  | ||||
| #include "tvguideosd.c" | ||||
| #define DEFINE_CONFIG 1 | ||||
| #include "config.h" | ||||
| #include "setup.h" | ||||
| #include "tvguideosd.h" | ||||
|  | ||||
|  | ||||
| #if defined(APIVERSNUM) && APIVERSNUM < 20000 | ||||
| #error "VDR-2.0.0 API version or greater is required!" | ||||
| #endif | ||||
|  | ||||
|  | ||||
|  | ||||
| static const char *VERSION        = "1.1.0"; | ||||
| static const char *DESCRIPTION    = "A fancy 2d EPG Viewer"; | ||||
| static const char *MAINMENUENTRY  = "Tvguide"; | ||||
| @@ -115,10 +117,11 @@ bool cPluginTvguide::ProcessArgs(int argc, char *argv[]) | ||||
|   return true; | ||||
| } | ||||
|  | ||||
| bool cPluginTvguide::Initialize(void) | ||||
| { | ||||
|   // Initialize any background activities the plugin shall perform. | ||||
|   return true; | ||||
| bool cPluginTvguide::Initialize(void) { | ||||
|     esyslog("tvguide: Initialize"); | ||||
|     esyslog("tvguide: OSD Wwidth %d, OSD Height %d", cOsd::OsdWidth(), cOsd::OsdHeight()); | ||||
|     esyslog("tvguide: numRows: %d, numCols: %d", tvguideConfig.channelRows, tvguideConfig.channelCols); | ||||
|     return true; | ||||
| } | ||||
|  | ||||
| bool cPluginTvguide::Start(void) | ||||
|   | ||||
							
								
								
									
										92
									
								
								tvguideosd.c
									
									
									
									
									
								
							
							
						
						
									
										92
									
								
								tvguideosd.c
									
									
									
									
									
								
							| @@ -1,94 +1,14 @@ | ||||
| // --- Theme ------------------------------------------------------------- | ||||
| static cTheme theme; | ||||
|  | ||||
| //BLENDING SETUP | ||||
| #define CLR_BLENDING_NOPACITY   0xFFFFFFFF | ||||
| #define CLR_BLENDING_DEFAULT    0xAAAAAAAA | ||||
| #define CLR_BLENDING_OFF        0x00000000 | ||||
|  | ||||
| THEME_CLR(theme, clrDoBlending, CLR_BLENDING_DEFAULT); | ||||
| THEME_CLR(theme, clrBackgroundOSD, clrBlack); | ||||
| THEME_CLR(theme, clrBackground, clrBlack); | ||||
| THEME_CLR(theme, clrGrid1, 0xFF404749); | ||||
| THEME_CLR(theme, clrGrid1Blending, 0xFF000000); | ||||
| THEME_CLR(theme, clrGrid2, 0xFF20293F); | ||||
| THEME_CLR(theme, clrGrid2Blending, 0xFF000000); | ||||
| THEME_CLR(theme, clrHighlight, 0xFFFF4D00); | ||||
| THEME_CLR(theme, clrHighlightBlending, 0xFF000000); | ||||
| THEME_CLR(theme, clrFont, clrWhite); | ||||
| THEME_CLR(theme, clrFontActive, clrWhite); | ||||
| THEME_CLR(theme, clrFontHeader, clrWhite); | ||||
| THEME_CLR(theme, clrFontButtons, clrWhite); | ||||
| THEME_CLR(theme, clrStatusHeader, clrBlack); | ||||
| THEME_CLR(theme, clrStatusHeaderBlending, clrBlack); | ||||
| THEME_CLR(theme, clrHeader, clrBlack); | ||||
| THEME_CLR(theme, clrHeaderBlending, 0xFFE0E0E0); | ||||
| THEME_CLR(theme, clrBorder, clrWhite); | ||||
| THEME_CLR(theme, clrTimeline1, clrWhite); | ||||
| THEME_CLR(theme, clrTimeline1Blending, 0xFF828282); | ||||
| THEME_CLR(theme, clrTimeline2, clrBlack); | ||||
| THEME_CLR(theme, clrTimeline2Blending, 0xFF3F3F3F); | ||||
| THEME_CLR(theme, clrButtonRed, 0x99BB0000); | ||||
| THEME_CLR(theme, clrButtonRedBorder, 0xFFBB0000); | ||||
| THEME_CLR(theme, clrButtonGreen, 0x9900BB00); | ||||
| THEME_CLR(theme, clrButtonGreenBorder, 0xFF00BB00); | ||||
| THEME_CLR(theme, clrButtonYellow, 0x99BBBB00); | ||||
| THEME_CLR(theme, clrButtonYellowBorder, 0xFFBBBB00); | ||||
| THEME_CLR(theme, clrButtonBlue, 0x990000BB); | ||||
| THEME_CLR(theme, clrButtonBlueBorder, 0xFF0000BB); | ||||
| THEME_CLR(theme, clrButtonBlend, 0xDD000000); | ||||
| THEME_CLR(theme, clrRecMenuBackground, 0xB0000000); | ||||
| THEME_CLR(theme, clrRecMenuTimerConflictBackground, 0xFFCCCCCC); | ||||
| THEME_CLR(theme, clrRecMenuTimerConflictBar, 0xFF222222); | ||||
| THEME_CLR(theme, clrRecMenuTimerConflictOverlap, 0xAAFF0000); | ||||
| THEME_CLR(theme, clrRecMenuDayActive, 0xFF00FF00); | ||||
| THEME_CLR(theme, clrRecMenuDayInactive, 0xFFFF0000); | ||||
| THEME_CLR(theme, clrRecMenuDayHighlight, 0x44FFFFFF); | ||||
| THEME_CLR(theme, clrRecMenuTextBack, 0xFF000000); | ||||
| THEME_CLR(theme, clrRecMenuTextActiveBack, 0xFF404749); | ||||
| THEME_CLR(theme, clrRecMenuKeyboardBack, 0xFF000000); | ||||
| THEME_CLR(theme, clrRecMenuKeyboardBorder, clrWhite); | ||||
| THEME_CLR(theme, clrRecMenuKeyboardHigh, 0x55FFFFFF); | ||||
| THEME_CLR(theme, clrButtonRedKeyboard, 0xFFBB0000); | ||||
| THEME_CLR(theme, clrButtonGreenKeyboard, 0xFF00BB00); | ||||
| THEME_CLR(theme, clrButtonYellowKeyboard, 0xFFBBBB00); | ||||
|  | ||||
| #include "config.c" | ||||
| cTvguideConfig tvguideConfig; | ||||
|  | ||||
| #include "osdmanager.c" | ||||
| cOsdManager osdManager; | ||||
| #include <stdlib.h> | ||||
| #include <vector> | ||||
|  | ||||
| #include "config.h" | ||||
| #include "services/epgsearch.h" | ||||
| #include "services/remotetimers.h" | ||||
| cPlugin* pRemoteTimers = NULL; | ||||
| #include <vector> | ||||
| #include "services/tvscraper.h" | ||||
| #include "tools.c" | ||||
| #include "switchtimer.c" | ||||
| #include "setup.c" | ||||
| #include "imageloader.c" | ||||
| #include "styledpixmap.c" | ||||
| #include "timer.c" | ||||
| #include "timeline.c" | ||||
| #include "grid.c" | ||||
| #include "headergrid.c" | ||||
| #include "dummygrid.c" | ||||
| #include "epggrid.c" | ||||
| #include "statusheader.c" | ||||
| #include "detailview.c" | ||||
| #include "channelcolumn.c" | ||||
| #include "channelgroup.c" | ||||
| #include "channelgroups.c" | ||||
| #include "footer.c" | ||||
| #include "recmenuitem.c" | ||||
| #include "recmenu.c" | ||||
| #include "recmanager.c" | ||||
| #include "recmenus.c" | ||||
| #include "recmenumanager.c" | ||||
|  | ||||
| #include "tools.h" | ||||
| #include "setup.h" | ||||
|  | ||||
| #include "tvguideosd.h" | ||||
| #include <stdlib.h> | ||||
|  | ||||
| cTvGuideOsd::cTvGuideOsd(void) { | ||||
|     detailView = NULL; | ||||
|   | ||||
							
								
								
									
										10
									
								
								tvguideosd.h
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								tvguideosd.h
									
									
									
									
									
								
							| @@ -1,6 +1,16 @@ | ||||
| #ifndef __TVGUIDE_TVGUIDEOSD_H | ||||
| #define __TVGUIDE_TVGUIDEOSD_H | ||||
|  | ||||
| #include "timer.h" | ||||
| #include "grid.h" | ||||
| #include "channelcolumn.h" | ||||
| #include "statusheader.h" | ||||
| #include "detailview.h" | ||||
| #include "timeline.h" | ||||
| #include "channelgroups.h" | ||||
| #include "footer.h" | ||||
| #include "recmenumanager.h" | ||||
|  | ||||
| // --- cTvGuideOsd ------------------------------------------------------------- | ||||
|  | ||||
| class cTvGuideOsd : public cOsdObject { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user