]> git.vomp.tv Git - vompserver.git/blob - media.h
Fix for moving recordings
[vompserver.git] / media.h
1 /*
2     Copyright 2004-2005 Chris Tallon, Andreas Vogel
3
4     This file is part of VOMP.
5
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.
10
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.
15
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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19 */
20
21 #ifndef MEDIA_H
22 #define MEDIA_H
23
24 #include <stdio.h>
25 #include <pthread.h>
26 #include <signal.h>
27 #include <endian.h>
28
29 #include <unistd.h> // sleep
30 #include <vector>
31
32 using namespace std;
33 //#include "defines.h"
34 //#include "tcp.h"
35 //#include "mvpreceiver.h"
36 //#include "recplayer.h"
37 #include "config.h"
38
39 //the following defines must be consisten to the client side
40 /* media types form a bitmask
41    so you can add them to have > 1*/
42 #define MEDIA_TYPE_DIR 1
43 #define MEDIA_TYPE_AUDIO 2
44 #define MEDIA_TYPE_VIDEO 4
45 #define MEDIA_TYPE_PICTURE 8
46 #define MEDIA_TYPE_UNKNOWN 256
47
48 #define MEDIA_TYPE_ALL (1+2+4+8)
49
50 class Media 
51 {
52   public:
53     /**
54       * create a media entry
55       * filename will get copied
56       */
57     Media(int type, const char * filename, int time);
58     ~Media();
59     const char * getFilename();
60     int getType();
61     int getTime();
62
63   private:
64     char * _filename;
65     int _type;
66     int _time;
67
68
69 };
70
71 class MediaList : public vector<Media*> {
72   public:
73     static MediaList *readList(Config *cfg,const char * dirname,int type=MEDIA_TYPE_ALL);
74     ~MediaList();
75   };
76
77 #endif