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;
62 static VDR* getInstance();
67 void findServers(vector<char*>& serverIPs);
68 void cancelFindingServer();
69 void setServerIP(char*);
72 ULLONG getResumePoint(char* fileName); // uses configLoad
78 Directory* getRecordingsList();
79 char* getRecordingSummary(char* fileName);
80 int deleteRecording(char* fileName);
81 ULLONG streamRecording(Recording* rec);
82 ULLONG rescanRecording();
84 ChannelList* getChannelsList(ULONG type);
85 int streamChannel(ULONG number);
87 UCHAR* getBlock(ULLONG position, UINT maxAmount, UINT* amountReceived);
89 EventList* getChannelSchedule(ULONG number);
90 EventList* getChannelSchedule(ULONG number, time_t start, ULONG duration);
91 int configSave(char* section, char* key, const char* value);
92 char* configLoad(char* section, char* key);
94 RecTimerList* getRecTimersList();
98 const static ULONG VIDEO = 1;
99 const static ULONG RADIO = 2;
102 static VDR* instance;
110 pthread_mutex_t mutex;
116 const static ULONG VDR_LOGIN = 1;
117 const static ULONG VDR_GETRECORDINGLIST = 2;
118 const static ULONG VDR_DELETERECORDING = 3;
119 const static ULONG VDR_GETSUMMARY = 4;
120 const static ULONG VDR_GETCHANNELLIST = 5;
121 const static ULONG VDR_STREAMCHANNEL = 6;
122 const static ULONG VDR_GETBLOCK = 7;
123 const static ULONG VDR_STOPSTREAMING = 8;
124 const static ULONG VDR_STREAMRECORDING = 9;
125 const static ULONG VDR_GETCHANNELSCHEDULE = 10;
126 const static ULONG VDR_CONFIGSAVE = 11;
127 const static ULONG VDR_CONFIGLOAD = 12;
128 const static ULONG VDR_RESCANRECORDING = 13;
129 const static ULONG VDR_GETTIMERS = 14;
134 char* extractString();
135 ULONG extractULONG();
136 ULLONG extractULLONG();