~phablet-team/+junk/qtmultimedia

« back to all changes in this revision

Viewing changes to src/multimedia/controls/qmetadatareadercontrol.cpp

  • Committer: Jim Hodapp
  • Date: 2015-05-15 19:17:49 UTC
  • Revision ID: jim.hodapp@canonical.com-20150515191749-r4xausjaaphme9ok
Initial import.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
**
 
3
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
 
4
** Contact: http://www.qt-project.org/legal
 
5
**
 
6
** This file is part of the Qt Toolkit.
 
7
**
 
8
** $QT_BEGIN_LICENSE:LGPL21$
 
9
** Commercial License Usage
 
10
** Licensees holding valid commercial Qt licenses may use this file in
 
11
** accordance with the commercial license agreement provided with the
 
12
** Software or, alternatively, in accordance with the terms contained in
 
13
** a written agreement between you and Digia. For licensing terms and
 
14
** conditions see http://qt.digia.com/licensing. For further information
 
15
** use the contact form at http://qt.digia.com/contact-us.
 
16
**
 
17
** GNU Lesser General Public License Usage
 
18
** Alternatively, this file may be used under the terms of the GNU Lesser
 
19
** General Public License version 2.1 or version 3 as published by the Free
 
20
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
 
21
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
 
22
** following information to ensure the GNU Lesser General Public License
 
23
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
 
24
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 
25
**
 
26
** In addition, as a special exception, Digia gives you certain additional
 
27
** rights. These rights are described in the Digia Qt LGPL Exception
 
28
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
 
29
**
 
30
** $QT_END_LICENSE$
 
31
**
 
32
****************************************************************************/
 
33
 
 
34
#include "qmediacontrol_p.h"
 
35
#include <qmetadatareadercontrol.h>
 
36
 
 
37
QT_BEGIN_NAMESPACE
 
38
 
 
39
 
 
40
/*!
 
41
    \class QMetaDataReaderControl
 
42
    \inmodule QtMultimedia
 
43
 
 
44
 
 
45
    \ingroup multimedia_control
 
46
 
 
47
 
 
48
    \brief The QMetaDataReaderControl class provides read access to the
 
49
    meta-data of a QMediaService's media.
 
50
 
 
51
    If a QMediaService can provide read or write access to the meta-data of
 
52
    its current media it will implement QMetaDataReaderControl.  This control
 
53
    provides functions for both retrieving and setting meta-data values.
 
54
    Meta-data may be addressed by the keys defined in the
 
55
    QMediaMetaData namespace.
 
56
 
 
57
    The functionality provided by this control is exposed to application
 
58
    code by the meta-data members of QMediaObject, and so meta-data access
 
59
    is potentially available in any of the media object classes.  Any media
 
60
    service may implement QMetaDataReaderControl.
 
61
 
 
62
    The interface name of QMetaDataReaderControl is
 
63
    \c org.qt-project.qt.metadatareadercontrol/5.0 as defined in
 
64
    QMetaDataReaderControl_iid.
 
65
 
 
66
    \sa QMediaService::requestControl(), QMediaObject
 
67
*/
 
68
 
 
69
/*!
 
70
    \macro QMetaDataReaderControl_iid
 
71
 
 
72
    \c org.qt-project.qt.metadatareadercontrol/5.0
 
73
 
 
74
    Defines the interface name of the QMetaDataReaderControl class.
 
75
 
 
76
    \relates QMetaDataReaderControl
 
77
*/
 
78
 
 
79
/*!
 
80
    Construct a QMetaDataReaderControl with \a parent. This class is meant as a base class
 
81
    for service specific meta data providers so this constructor is protected.
 
82
*/
 
83
 
 
84
QMetaDataReaderControl::QMetaDataReaderControl(QObject *parent):
 
85
    QMediaControl(*new QMediaControlPrivate, parent)
 
86
{
 
87
}
 
88
 
 
89
/*!
 
90
    Destroy the meta-data object.
 
91
*/
 
92
 
 
93
QMetaDataReaderControl::~QMetaDataReaderControl()
 
94
{
 
95
}
 
96
 
 
97
/*!
 
98
    \fn bool QMetaDataReaderControl::isMetaDataAvailable() const
 
99
 
 
100
    Identifies if meta-data is available from a media service.
 
101
 
 
102
    Returns true if the meta-data is available and false otherwise.
 
103
*/
 
104
 
 
105
/*!
 
106
    \fn QVariant QMetaDataReaderControl::metaData(const QString &key) const
 
107
 
 
108
    Returns the meta-data for the given \a key.
 
109
*/
 
110
 
 
111
/*!
 
112
    \fn QMetaDataReaderControl::availableMetaData() const
 
113
 
 
114
    Returns a list of keys there is meta-data available for.
 
115
*/
 
116
 
 
117
/*!
 
118
    \fn void QMetaDataReaderControl::metaDataChanged()
 
119
 
 
120
    Signal the changes of meta-data.
 
121
 
 
122
    If multiple meta-data elements are changed,
 
123
    metaDataChanged(const QString &key, const QVariant &value) signal is emitted
 
124
    for each of them with metaDataChanged() changed emitted once.
 
125
*/
 
126
 
 
127
/*!
 
128
    \fn void QMetaDataReaderControl::metaDataChanged(const QString &key, const QVariant &value)
 
129
 
 
130
    Signal the changes of one meta-data element \a value with the given \a key.
 
131
*/
 
132
 
 
133
/*!
 
134
    \fn void QMetaDataReaderControl::metaDataAvailableChanged(bool available)
 
135
 
 
136
    Signal the availability of meta-data has changed, \a available will
 
137
    be true if the multimedia object has meta-data.
 
138
*/
 
139
 
 
140
#include "moc_qmetadatareadercontrol.cpp"
 
141
QT_END_NAMESPACE
 
142