~phablet-team/+junk/qtmultimedia

« back to all changes in this revision

Viewing changes to src/multimedia/controls/qmediaplaylistcontrol.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
 
 
35
#include "qmediaplaylistcontrol_p.h"
 
36
#include "qmediacontrol_p.h"
 
37
 
 
38
QT_BEGIN_NAMESPACE
 
39
 
 
40
/*!
 
41
    \class QMediaPlaylistControl
 
42
    \internal
 
43
 
 
44
    \inmodule QtMultimedia
 
45
 
 
46
 
 
47
    \ingroup multimedia_control
 
48
 
 
49
 
 
50
    \brief The QMediaPlaylistControl class provides access to the playlist
 
51
    functionality of a QMediaService.
 
52
 
 
53
    If a QMediaService contains an internal playlist it will implement
 
54
    QMediaPlaylistControl.  This control provides access to the contents of the
 
55
    \l {playlistProvider()}{playlist}, as well as the \l
 
56
    {currentIndex()}{position} of the current media, and a means of navigating
 
57
    to the \l {next()}{next} and \l {previous()}{previous} media.
 
58
 
 
59
    The functionality provided by the control is exposed to application code
 
60
    through the QMediaPlaylist class.
 
61
 
 
62
    The interface name of QMediaPlaylistControl is \c org.qt-project.qt.mediaplaylistcontrol/5.0 as
 
63
    defined in QMediaPlaylistControl_iid.
 
64
 
 
65
    \sa QMediaService::requestControl(), QMediaPlayer
 
66
*/
 
67
 
 
68
/*!
 
69
    \macro QMediaPlaylistControl_iid
 
70
 
 
71
    \c org.qt-project.qt.mediaplaylistcontrol/5.0
 
72
 
 
73
    Defines the interface name of the QMediaPlaylistControl class.
 
74
 
 
75
    \relates QMediaPlaylistControl
 
76
*/
 
77
 
 
78
/*!
 
79
  Create a new playlist control object with the given \a parent.
 
80
*/
 
81
QMediaPlaylistControl::QMediaPlaylistControl(QObject *parent):
 
82
    QMediaControl(*new QMediaControlPrivate, parent)
 
83
{
 
84
}
 
85
 
 
86
/*!
 
87
  Destroys the playlist control.
 
88
*/
 
89
QMediaPlaylistControl::~QMediaPlaylistControl()
 
90
{
 
91
}
 
92
 
 
93
 
 
94
/*!
 
95
  \fn QMediaPlaylistControl::playlistProvider() const
 
96
 
 
97
  Returns the playlist used by this media player.
 
98
*/
 
99
 
 
100
/*!
 
101
  \fn QMediaPlaylistControl::setPlaylistProvider(QMediaPlaylistProvider *playlist)
 
102
 
 
103
  Set the playlist of this media player to \a playlist.
 
104
 
 
105
  In many cases it is possible just to use the playlist
 
106
  constructed by player, but sometimes replacing the whole
 
107
  playlist allows to avoid copyting of all the items bettween playlists.
 
108
 
 
109
  Returns true if player can use this passed playlist; otherwise returns false.
 
110
 
 
111
*/
 
112
 
 
113
/*!
 
114
  \fn QMediaPlaylistControl::currentIndex() const
 
115
 
 
116
  Returns position of the current media source in the playlist.
 
117
*/
 
118
 
 
119
/*!
 
120
  \fn QMediaPlaylistControl::setCurrentIndex(int position)
 
121
 
 
122
  Jump to the item at the given \a position.
 
123
*/
 
124
 
 
125
/*!
 
126
  \fn QMediaPlaylistControl::nextIndex(int step) const
 
127
 
 
128
  Returns the index of item, which were current after calling next()
 
129
  \a step times.
 
130
 
 
131
  Returned value depends on the size of playlist, current position
 
132
  and playback mode.
 
133
 
 
134
  \sa QMediaPlaylist::playbackMode
 
135
*/
 
136
 
 
137
/*!
 
138
  \fn QMediaPlaylistControl::previousIndex(int step) const
 
139
 
 
140
  Returns the index of item, which were current after calling previous()
 
141
  \a step times.
 
142
 
 
143
  \sa QMediaPlaylist::playbackMode
 
144
*/
 
145
 
 
146
/*!
 
147
  \fn QMediaPlaylistControl::next()
 
148
 
 
149
  Moves to the next item in playlist.
 
150
*/
 
151
 
 
152
/*!
 
153
  \fn QMediaPlaylistControl::previous()
 
154
 
 
155
  Returns to the previous item in playlist.
 
156
*/
 
157
 
 
158
/*!
 
159
  \fn QMediaPlaylistControl::playbackMode() const
 
160
 
 
161
  Returns the playlist navigation mode.
 
162
 
 
163
  \sa QMediaPlaylist::PlaybackMode
 
164
*/
 
165
 
 
166
/*!
 
167
  \fn QMediaPlaylistControl::setPlaybackMode(QMediaPlaylist::PlaybackMode mode)
 
168
 
 
169
  Sets the playback \a mode.
 
170
 
 
171
  \sa QMediaPlaylist::PlaybackMode
 
172
*/
 
173
 
 
174
/*!
 
175
  \fn QMediaPlaylistControl::playlistProviderChanged()
 
176
 
 
177
  Signal emitted when the playlist provider has changed.
 
178
*/
 
179
 
 
180
/*!
 
181
  \fn QMediaPlaylistControl::currentIndexChanged(int position)
 
182
 
 
183
  Signal emitted when the playlist \a position is changed.
 
184
*/
 
185
 
 
186
/*!
 
187
  \fn QMediaPlaylistControl::playbackModeChanged(QMediaPlaylist::PlaybackMode mode)
 
188
 
 
189
  Signal emitted when the playback \a mode is changed.
 
190
*/
 
191
 
 
192
/*!
 
193
  \fn QMediaPlaylistControl::currentMediaChanged(const QMediaContent& content)
 
194
 
 
195
  Signal emitted when current media changes to \a content.
 
196
*/
 
197
 
 
198
#include "moc_qmediaplaylistcontrol_p.cpp"
 
199
QT_END_NAMESPACE
 
200