Statistics
| Branch: | Tag: | Revision:

dvbd / src / clientconnection.h @ 59be6a47

History | View | Annotate | Download (1.79 KB)

1
// -*- c++ -*-
2
/*
3
  Copyright 2003 John Knottenbelt
4
  
5
  This program is free software; you can redistribute it and/or modify
6
  it under the terms of the GNU General Public License as published by
7
  the Free Software Foundation; either version 2 of the License, or
8
  (at your option) any later version.
9
 
10
  This program is distributed in the hope that it will be useful,
11
  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
  GNU General Public License for more details.
14
 
15
  You should have received a copy of the GNU General Public License
16
  along with this program; if not, write to the Free Software
17
  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
18
*/
19

    
20
#if !defined __CLIENTCONNECTION_H
21
#define __CLIENTCONNECTION_H
22

    
23
#include <string>
24
#include "dvbd.h"
25
#include "unixclientsocket.h"
26

    
27
class UnixClientSocket;
28

    
29
/** Establish a pair of connections with the server */
30
class ClientConnection {
31
public:  
32
  ClientConnection( const std::string &socketFile );
33

    
34
  operator bool () const;
35

    
36
  bool getChannels(const std::string &type, int priority, StringList &channels);
37

    
38
  std::string getError() const;
39

    
40
  UnixClientSocket& data();
41
  UnixClientSocket& control();
42

    
43
  void checkSchedule(StringList&);
44

    
45
  int schedule(const std::string &type, const std::string &channel,
46
               bool convertToPS, time_t when, unsigned duration, int priority,
47
               const std::string &outputFile);
48

    
49
  bool removeJob(int job);
50

    
51
  bool listSchedule(StringList &);
52

    
53
  bool tune(const std::string &type, const std::string &channel, bool convertToPS, int priority);
54

    
55
  bool getNextJobTime(time_t &nextJobTime);
56

    
57
  bool listConnections(StringList &);
58

    
59
private:
60
  UnixClientSocket control_, data_;
61
  bool good_;
62
  std::string error_;
63
};
64

    
65
#endif // __CLIENTCONNECTION_H