~ubuntu-branches/ubuntu/vivid/mediatomb/vivid

« back to all changes in this revision

Viewing changes to src/youtube_content_handler.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:
 
1
/*MT*
 
2
    
 
3
    MediaTomb - http://www.mediatomb.cc/
 
4
    
 
5
    youtube_content_handler.h - this file is part of MediaTomb.
 
6
    
 
7
    Copyright (C) 2005 Gena Batyan <bgeradz@mediatomb.cc>,
 
8
                       Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>
 
9
    
 
10
    Copyright (C) 2006-2008 Gena Batyan <bgeradz@mediatomb.cc>,
 
11
                            Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>,
 
12
                            Leonhard Wimmer <leo@mediatomb.cc>
 
13
    
 
14
    MediaTomb is free software; you can redistribute it and/or modify
 
15
    it under the terms of the GNU General Public License version 2
 
16
    as published by the Free Software Foundation.
 
17
    
 
18
    MediaTomb is distributed in the hope that it will be useful,
 
19
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
20
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
21
    GNU General Public License for more details.
 
22
    
 
23
    You should have received a copy of the GNU General Public License
 
24
    version 2 along with MediaTomb; if not, write to the Free Software
 
25
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
26
    
 
27
    $Id: youtube_content_handler.h 1698 2008-02-23 20:48:30Z lww $
 
28
*/
 
29
 
 
30
/// \file youtube_content_handler.h
 
31
/// \brief Definitions of the YouTubeContentHandler class.
 
32
 
 
33
#ifdef YOUTUBE
 
34
 
 
35
#ifndef __YOUTUBE_DATA_HANDLER_H__
 
36
#define __YOUTUBE_DATA_HANDLER_H__
 
37
 
 
38
#define YOUTUBE_SERVICE                 "YouTube"
 
39
#define YOUTUBE_SERVICE_ID              "Y"
 
40
 
 
41
#define YOUTUBE_AUXDATA_TAGS            "tags"
 
42
#define YOUTUBE_AUXDATA_AVG_RATING      "rating"
 
43
#define YOUTUBE_AUXDATA_AUTHOR          "author"
 
44
#define YOUTUBE_AUXDATA_COMMENT_COUNT   "ccount"
 
45
#define YOUTUBE_AUXDATA_VIEW_COUNT      "vcount"
 
46
#define YOUTUBE_AUXDATA_RATING_COUNT    "rcount"
 
47
#define YOUTUBE_AUXDATA_REQUEST         "req"
 
48
#define YOUTUBE_AUXDATA_REQUEST_SUBNAME "sreq"
 
49
#define YOUTUBE_AUXDATA_CATEGORY        "cat"
 
50
 
 
51
 
 
52
#include "zmmf/zmmf.h"
 
53
#include "mxml/mxml.h"
 
54
#include "cds_objects.h"
 
55
 
 
56
/// \brief this class is responsible for creating objects from the YouTube
 
57
/// metadata XML.
 
58
class YouTubeContentHandler : public zmm::Object
 
59
{
 
60
public:
 
61
    /// \brief Sets the service XML from which we will extract the objects.
 
62
    /// \return false if service XML contained an error status.
 
63
    bool setServiceContent(zmm::Ref<mxml::Element> service);
 
64
 
 
65
    /// \brief retrieves an object from the service.
 
66
    ///
 
67
    /// Each invokation of this funtion will return a new object,
 
68
    /// when the whole service XML is parsed and no more objects are left,
 
69
    /// this function will return nil.
 
70
    ///
 
71
    /// \return CdsObject or nil if there are no more objects to parse.
 
72
    zmm::Ref<CdsObject> getNextObject();
 
73
 
 
74
 
 
75
protected:
 
76
    zmm::Ref<mxml::Element> service_xml;
 
77
    int current_video_node_index;
 
78
    int video_list_child_count;
 
79
    zmm::String thumb_mimetype;
 
80
};
 
81
 
 
82
#endif//__YOUTUBE_CONTENT_HANDLER_H__
 
83
 
 
84
#endif//YOUTUBE