2 Copyright 2004-2005 Chris Tallon
4 This file is part of VOMP.
6 VOMP is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 VOMP is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with VOMP; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
34 #include "directory.h"
35 #include "recording.h"
42 // FIXME do some tcp connection error checking and kill it!
44 typedef vector<Event*> EventList;
45 typedef vector<Channel*> ChannelList;
46 typedef vector<RecTimer*> RecTimerList;
48 struct RecTimerSorter // : public binary_function<double, double, bool>
50 bool operator() (const RecTimer* a, const RecTimer* b)
52 return a->startTime < b->startTime;
64 bool operator() (const VDRServer a, const VDRServer b)
66 if (strcmp(b.name, a.name) > 0) return true;
77 static VDR* getInstance();
82 void findServers(vector<VDRServer>& servers);
83 void cancelFindingServer();
84 void setServerIP(char*);
87 ULLONG getResumePoint(char* fileName); // uses configLoad
93 Directory* getRecordingsList();
94 char* getRecordingSummary(char* fileName);
95 int deleteRecording(char* fileName);
96 ULLONG streamRecording(Recording* rec);
97 ULLONG rescanRecording();
99 ChannelList* getChannelsList(ULONG type);
100 int streamChannel(ULONG number);
102 UCHAR* getBlock(ULLONG position, UINT maxAmount, UINT* amountReceived);
104 EventList* getChannelSchedule(ULONG number);
105 EventList* getChannelSchedule(ULONG number, time_t start, ULONG duration);
106 int configSave(char* section, char* key, const char* value);
107 char* configLoad(char* section, char* key);
109 RecTimerList* getRecTimersList();
113 const static ULONG VIDEO = 1;
114 const static ULONG RADIO = 2;
117 static VDR* instance;
125 pthread_mutex_t mutex;
131 const static ULONG VDR_LOGIN = 1;
132 const static ULONG VDR_GETRECORDINGLIST = 2;
133 const static ULONG VDR_DELETERECORDING = 3;
134 const static ULONG VDR_GETSUMMARY = 4;
135 const static ULONG VDR_GETCHANNELLIST = 5;
136 const static ULONG VDR_STREAMCHANNEL = 6;
137 const static ULONG VDR_GETBLOCK = 7;
138 const static ULONG VDR_STOPSTREAMING = 8;
139 const static ULONG VDR_STREAMRECORDING = 9;
140 const static ULONG VDR_GETCHANNELSCHEDULE = 10;
141 const static ULONG VDR_CONFIGSAVE = 11;
142 const static ULONG VDR_CONFIGLOAD = 12;
143 const static ULONG VDR_RESCANRECORDING = 13;
144 const static ULONG VDR_GETTIMERS = 14;
149 char* extractString();
150 ULONG extractULONG();
151 ULLONG extractULLONG();