3
MediaTomb - http://www.mediatomb.cc/
5
youtube_content_handler.h - this file is part of MediaTomb.
7
Copyright (C) 2005 Gena Batyan <bgeradz@mediatomb.cc>,
8
Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>
10
Copyright (C) 2006-2008 Gena Batyan <bgeradz@mediatomb.cc>,
11
Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>,
12
Leonhard Wimmer <leo@mediatomb.cc>
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.
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.
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.
27
$Id: youtube_content_handler.h 1698 2008-02-23 20:48:30Z lww $
30
/// \file youtube_content_handler.h
31
/// \brief Definitions of the YouTubeContentHandler class.
35
#ifndef __YOUTUBE_DATA_HANDLER_H__
36
#define __YOUTUBE_DATA_HANDLER_H__
38
#define YOUTUBE_SERVICE "YouTube"
39
#define YOUTUBE_SERVICE_ID "Y"
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"
52
#include "zmmf/zmmf.h"
53
#include "mxml/mxml.h"
54
#include "cds_objects.h"
56
/// \brief this class is responsible for creating objects from the YouTube
58
class YouTubeContentHandler : public zmm::Object
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);
65
/// \brief retrieves an object from the service.
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.
71
/// \return CdsObject or nil if there are no more objects to parse.
72
zmm::Ref<CdsObject> getNextObject();
76
zmm::Ref<mxml::Element> service_xml;
77
int current_video_node_index;
78
int video_list_child_count;
79
zmm::String thumb_mimetype;
82
#endif//__YOUTUBE_CONTENT_HANDLER_H__