Changeset 561 for trunk/doc/src/examples/musicplayerexample.qdoc
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/doc/src/examples/musicplayerexample.qdoc
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the documentation of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 41 41 42 42 /*! 43 \example phonon/ musicplayer43 \example phonon/qmusicplayer 44 44 \title Music Player Example 45 45 … … 91 91 implementation. 92 92 93 \snippet examples/phonon/ musicplayer/mainwindow.h 293 \snippet examples/phonon/qmusicplayer/mainwindow.h 2 94 94 95 95 We use the \l{Phonon::}{SeekSlider} to move the current playback … … 100 100 music files. More on this later. 101 101 102 \snippet examples/phonon/ musicplayer/mainwindow.h 1102 \snippet examples/phonon/qmusicplayer/mainwindow.h 1 103 103 104 104 The \l{Phonon::}{MediaObject} informs us of the state of the playback and … … 117 117 We start with the constructor: 118 118 119 \snippet examples/phonon/ musicplayer/mainwindow.cpp 0119 \snippet examples/phonon/qmusicplayer/mainwindow.cpp 0 120 120 121 121 We start by instantiating our media and audio output objects. … … 131 131 which is part of the Phonon namespace. 132 132 133 \snippet examples/phonon/ musicplayer/mainwindow.cpp 1133 \snippet examples/phonon/qmusicplayer/mainwindow.cpp 1 134 134 135 135 We also connect signals of the media object to slots in our \c 136 136 MainWindow. We will examine them shortly. 137 137 138 \snippet examples/phonon/ musicplayer/mainwindow.cpp 2138 \snippet examples/phonon/qmusicplayer/mainwindow.cpp 2 139 139 140 140 Finally, we call private helper functions to set up the GUI. … … 142 142 , and volume slider. We move on to \c setupUi(): 143 143 144 \snippet examples/phonon/ musicplayer/mainwindow.cpp 3144 \snippet examples/phonon/qmusicplayer/mainwindow.cpp 3 145 145 \dots 146 \snippet examples/phonon/ musicplayer/mainwindow.cpp 4146 \snippet examples/phonon/qmusicplayer/mainwindow.cpp 4 147 147 148 148 After creating the widgets, they must be supplied with the … … 153 153 pause, and stop tool buttons, to slots of the media object. 154 154 155 \snippet examples/phonon/ musicplayer/mainwindow.cpp 5156 157 We move on to the theslots of \c MainWindow, starting with \c155 \snippet examples/phonon/qmusicplayer/mainwindow.cpp 5 156 157 We move on to the slots of \c MainWindow, starting with \c 158 158 addFiles(): 159 159 160 \snippet examples/phonon/ musicplayer/mainwindow.cpp 6160 \snippet examples/phonon/qmusicplayer/mainwindow.cpp 6 161 161 162 162 In the \c addFiles() slot, we add files selected by the user to … … 170 170 to this signal. 171 171 172 \snippet examples/phonon/ musicplayer/mainwindow.cpp 9172 \snippet examples/phonon/qmusicplayer/mainwindow.cpp 9 173 173 174 174 The \l{Phonon::MediaObject::}{errorString()} function gives a … … 178 178 file again. 179 179 180 \snippet examples/phonon/ musicplayer/mainwindow.cpp 10180 \snippet examples/phonon/qmusicplayer/mainwindow.cpp 10 181 181 182 182 We update the GUI when the playback state changes, i.e., when it … … 189 189 emitted when the playback position changes: 190 190 191 \snippet examples/phonon/ musicplayer/mainwindow.cpp 11191 \snippet examples/phonon/qmusicplayer/mainwindow.cpp 11 192 192 193 193 The \c time is given in milliseconds. … … 196 196 is invoked: 197 197 198 \snippet examples/phonon/ musicplayer/mainwindow.cpp 12198 \snippet examples/phonon/qmusicplayer/mainwindow.cpp 12 199 199 200 200 Since we stop the media object, we first check whether it is … … 203 203 can simply use \c row to find the new source. 204 204 205 \snippet examples/phonon/ musicplayer/mainwindow.cpp 13205 \snippet examples/phonon/qmusicplayer/mainwindow.cpp 13 206 206 207 207 When the media source changes, we simply need to select the 208 208 corresponding row in the table. 209 209 210 \snippet examples/phonon/ musicplayer/mainwindow.cpp 14210 \snippet examples/phonon/qmusicplayer/mainwindow.cpp 14 211 211 212 212 When \c metaStateChanged() is invoked, \c … … 221 221 in which case an empty string is returned. 222 222 223 \snippet examples/phonon/ musicplayer/mainwindow.cpp 15223 \snippet examples/phonon/qmusicplayer/mainwindow.cpp 15 224 224 225 225 If we have media sources in \c sources of which meta information … … 230 230 We move on to the \c aboutToFinish() slot: 231 231 232 \snippet examples/phonon/ musicplayer/mainwindow.cpp 16232 \snippet examples/phonon/qmusicplayer/mainwindow.cpp 16 233 233 234 234 When a file is finished playing, the Music Player will move on and … … 245 245 D-Bus, which is used by Phonon on Linux systems, demands this. 246 246 247 \snippet examples/phonon/ musicplayer/main.cpp 1247 \snippet examples/phonon/qmusicplayer/main.cpp 1 248 248 */
Note:
See TracChangeset
for help on using the changeset viewer.