summaryrefslogtreecommitdiff
path: root/plugins/profiler/vdrDVBProfiler/dvbProfiler.cpp
blob: eb578a0a5303e16f1eedb896e16db5ff10d25990 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
 * dvbProvider.cpp
 *
 *  Created on: 12.10.2012
 *      Author: savop
 */

#include <vdr/channels.h>
#include <vdr/epg.h>
#include <vdr/tools.h>
#include <plugin.h>
#include <tools.h>
#include <string>
#include <sstream>

using namespace std;

namespace upnp {

class DVBProfiler : public cMediaProfiler {
public:
  virtual bool CanHandleSchema(const string& schema){
    if(schema.find("vdr",0) == 0 || schema.find("rec",0) == 0){
      return true;
    } else {
      return false;
    }
  }

  virtual bool GetMetadata(const string& uri, cMetadata& metadata){
    if        (uri.find("vdr",0) == 0){
      return GetChannelMetadata(uri, metadata);
    } else if (uri.find("rec",0) == 0){
      return GetRecordingMetadata(uri, metadata);
    } else {
      return false;
    }
  }

private:

  virtual bool GetRecordingMetadata(const string& uri, cMetadata& metadata){
    dsyslog("DvbProfiler\tGetting recording metadata for '%s'", uri.c_str());
    return false;
  }

  virtual bool GetChannelMetadata(const string& uri, cMetadata& metadata){
    dsyslog("DvbProfiler\tGetting channel metadata for '%s'", uri.c_str());
    return false;
  }
};

UPNP_REGISTER_MEDIA_PLUGIN(DVBProfiler);

}