~vanvugt/+junk/mediatomb

« back to all changes in this revision

Viewing changes to src/cds_resource.h

  • Committer: Bazaar Package Importer
  • Author(s): Andres Mejia
  • Date: 2008-03-02 13:09:16 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080302130916-zlljdze3kt7vuq4b
Tags: 0.11.0-1
* New upstream release.
* Include message about which inotify headers will be used when enabling
  inotify runtime support.
* Fixed error with use of INTERFACE in init script. Also removed use of -m
  option.
* Including new config.xml options.
* Added more build dependencies for new upstream release.
* Removed build dependency of libid3-dev, taglib is now preferred.
* mediatomb.xpm and manpage.xml is now included in orig tarball.
* inotify patch is not needed anymore.
* md5 patch has been committed upstream and is no longer needed. Also removed
  README.Debian.
* TwinHelix PNG fix is now used. Removed from TODO.
* Adding dependency of iceweasel for mediatomb package.
* Updated copyright file.
* Updated watch file.
* Updated rules file for proper configure options.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
    Copyright (C) 2005 Gena Batyan <bgeradz@mediatomb.cc>,
8
8
                       Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>
9
9
    
10
 
    Copyright (C) 2006-2007 Gena Batyan <bgeradz@mediatomb.cc>,
 
10
    Copyright (C) 2006-2008 Gena Batyan <bgeradz@mediatomb.cc>,
11
11
                            Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>,
12
12
                            Leonhard Wimmer <leo@mediatomb.cc>
13
13
    
24
24
    version 2 along with MediaTomb; if not, write to the Free Software
25
25
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
26
26
    
27
 
    $Id: cds_resource.h 1294 2007-05-13 16:28:24Z lww $
 
27
    $Id: cds_resource.h 1698 2008-02-23 20:48:30Z lww $
28
28
*/
29
29
 
30
30
/// \file cds_resource.h
35
35
#include "common.h"
36
36
#include "dictionary.h"
37
37
 
38
 
#define RESOURCE_SEP '|'
39
 
#define RESOURCE_PART_SEP '~'
 
38
/// \brief name for external urls that can appear in object resources (i.e.
 
39
/// a YouTube thumbnail)
 
40
#define RESOURCE_OPTION_URL         "url"
 
41
 
 
42
/// \brief if set, overrides the OBJECT_FLAG_PROXY_URL setting for the given
 
43
/// resource
 
44
#define RESOURCE_OPTION_PROXY_URL   "prx"
 
45
 
 
46
#define RESOURCE_OPTION_FOURCC      "4cc"
40
47
 
41
48
class CdsResource : public zmm::Object
42
49
{
44
51
    int handlerType;
45
52
    zmm::Ref<Dictionary> attributes;
46
53
    zmm::Ref<Dictionary> parameters;
 
54
    zmm::Ref<Dictionary> options;
47
55
 
48
56
public:
 
57
    /// \brief creates a new resource object.
 
58
    ///
 
59
    /// The CdsResource object represents a <res> tag in the DIDL-Lite XML.
 
60
    ///
 
61
    /// \param handler_type id of the associated handler
49
62
    CdsResource(int handlerType);
50
63
    CdsResource(int handlerType,
51
64
                zmm::Ref<Dictionary> attributes,
52
 
                zmm::Ref<Dictionary> parameters);
53
 
    
 
65
                zmm::Ref<Dictionary> parameters,
 
66
                zmm::Ref<Dictionary> options);
 
67
   
 
68
    /// \brief Adds a resource attribute.
 
69
    ///
 
70
    /// This maps to an attribute of the <res> tag in the DIDL-Lite XML.
 
71
    ///
 
72
    /// \param name attribute name 
 
73
    /// \param value attribute value
54
74
    void addAttribute(zmm::String name, zmm::String value);
 
75
 
 
76
    /// \brief Merge existing attributes with new ones
 
77
    void mergeAttributes(zmm::Ref<Dictionary> additional);
 
78
 
 
79
    /// \brief Adds a parameter (will be appended to the URL)
 
80
    /// 
 
81
    /// The parameters will be appended to the object URL in the DIDL-Lite XML.
 
82
    /// This is useful for cases, where you need to identify specific options,
 
83
    /// i.e. something that is only relevant to a particular metadata handler
 
84
    /// and so on. The parameters will be automatically URL encoded.
 
85
    ///
 
86
    /// \param name parameter name
 
87
    /// \param value parameter value
55
88
    void addParameter(zmm::String name, zmm::String value);
56
89
 
 
90
    /// \brief Add an option to the resource.
 
91
    /// 
 
92
    /// The options are internal, they do not appear in the URL or in the
 
93
    /// XML but can be used for any purpose.
 
94
    void addOption(zmm::String name, zmm::String value);
 
95
 
57
96
    // urlencode into string
58
97
    int getHandlerType();
59
98
    zmm::Ref<Dictionary> getAttributes();
60
99
    zmm::Ref<Dictionary> getParameters();
 
100
    zmm::Ref<Dictionary> getOptions();
61
101
    zmm::String getAttribute(zmm::String name);
62
102
    zmm::String getParameter(zmm::String name);
 
103
    zmm::String getOption(zmm::String name);
63
104
 
64
105
    bool equals(zmm::Ref<CdsResource> other);
65
106
    zmm::Ref<CdsResource> clone();