2873
Home · All Classes · Modules PyQt's Classes Portions of this documentation have been adapted from the documentation provided with Qt 4.7.1. This document is not an official Nokia document, but is provided with Nokia's permission. Because this is based on the Qt C++ documentation it still contains C++ code fragments, broken links etc. These will be fixed in future releases. A QAbstractAnimation G QGenericArgument QNetworkReply QStyleOptionTabBarBaseV2 QAbstractButton QGenericReturnArgument QNetworkRequest QStyleOptionTabV2 QAbstractEventDispatcher QGesture QNetworkSession QStyleOptionTabV3 QAbstractExtensionFactory QGestureEvent O QObject QStyleOptionTabWidgetFrame QAbstractExtensionManager QGestureRecognizer QObjectCleanupHandler QStyleOptionTabWidgetFrameV2 QAbstractFileEngine QGL P QPageSetupDialog QStyleOptionTitleBar QAbstractFileEngineHandler QGLBuffer QPaintDevice QStyleOptionToolBar QAbstractFileEngineIterator QGLColormap QPaintEngine QStyleOptionToolBox QAbstractFormBuilder QGLContext QPaintEngineState QStyleOptionToolBoxV2 QAbstractGraphicsShapeItem QGLFormat QPainter QStyleOptionToolButton QAbstractItemDelegate QGLFramebufferObject QPainterPath QStyleOptionViewItem QAbstractItemModel QGLFramebufferObjectFormat QPainterPathStroker QStyleOptionViewItemV2 QAbstractItemView QGLPixelBuffer QPaintEvent QStyleOptionViewItemV3 QAbstractListModel QGLShader QPalette QStyleOptionViewItemV4 QAbstractMessageHandler QGLShaderProgram QPanGesture QStylePainter QAbstractNetworkCache QGLWidget QParallelAnimationGroup QSvgGenerator QAbstractPrintDialog QGradient QPauseAnimation QSvgRenderer QAbstractProxyModel QGraphicsAnchor QPen QSvgWidget QAbstractScrollArea QGraphicsAnchorLayout QPersistentModelIndex QSwipeGesture QAbstractSlider QGraphicsBlurEffect Phonon QSyntaxHighlighter QAbstractSocket QGraphicsColorizeEffect QPicture QSysInfo QAbstractSpinBox QGraphicsDropShadowEffect QPictureIO QSystemLocale QAbstractState QGraphicsEffect QPinchGesture QSystemSemaphore QAbstractTableModel QGraphicsEllipseItem QPixmap QSystemTrayIcon QAbstractTextDocumentLayout QGraphicsGridLayout QPixmapCache T Qt QAbstractTransition QGraphicsItem QPlainTextDocumentLayout QTabBar QAbstractUriResolver QGraphicsItemAnimation QPlainTextEdit QTabletEvent QAbstractVideoBuffer QGraphicsItemGroup QPluginLoader QTableView QAbstractVideoSurface QGraphicsLayout QPoint QTableWidget QAbstractXmlNodeModel QGraphicsLayoutItem QPointF QTableWidgetItem QAbstractXmlReceiver QGraphicsLinearLayout QPolygon QTableWidgetSelectionRange QAction QGraphicsLineItem QPolygonF QTabWidget QActionEvent QGraphicsObject QPrintDialog QTapAndHoldGesture QActionGroup QGraphicsOpacityEffect QPrintEngine QTapGesture QAnimationGroup QGraphicsPathItem QPrinter QTcpServer QApplication QGraphicsPixmapItem QPrinterInfo QTcpSocket QAssistantClient QGraphicsPolygonItem QPrintPreviewDialog QTemporaryFile QAudio QGraphicsProxyWidget QPrintPreviewWidget QTest QAudioDeviceInfo QGraphicsRectItem QProcess QTextBlock QAudioFormat QGraphicsRotation QProcessEnvironment QTextBlockFormat QAudioInput QGraphicsScale QProgressBar QTextBlockGroup QAudioOutput QGraphicsScene QProgressDialog QTextBlockUserData QAuthenticator QGraphicsSceneContextMenuEvent QPropertyAnimation QTextBoundaryFinder B QBasicTimer QGraphicsSceneDragDropEvent QProxyModel QTextBrowser QBitArray QGraphicsSceneEvent QPushButton QTextCharFormat QBitmap QGraphicsSceneHelpEvent QPyDeclarativePropertyValueSource QTextCodec QBoxLayout QGraphicsSceneHoverEvent QPyDesignerContainerExtension QTextCursor QBrush QGraphicsSceneMouseEvent QPyDesignerCustomWidgetCollectionPlugin QTextDecoder QBuffer QGraphicsSceneMoveEvent QPyDesignerCustomWidgetPlugin QTextDocument PyQt's Classes PyQt's Classes 1

Clases-PyQT4

Embed Size (px)

DESCRIPTION

Descripción de las clases de PyQT, documento realizado con encoder y HTMLDoc, obtenido de http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/classes.html

Citation preview

PyQt's Classes

Home All Classes Modules

PyQt's ClassesPortions of this documentation have been adapted from the documentation provided with Qt 4.7.1. This document is not an official Nokia document, but is provided with Nokia's permission. Because this is based on the Qt C++ documentation it still contains C++ code fragments, broken links etc. These will be fixed in future releases. A QAbstractAnimation QAbstractButton QAbstractEventDispatcher QAbstractExtensionFactory QAbstractExtensionManager QAbstractFileEngine QAbstractFileEngineHandler QAbstractFileEngineIterator QAbstractFormBuilder QAbstractGraphicsShapeItem QAbstractItemDelegate QAbstractItemModel QAbstractItemView QAbstractListModel QAbstractMessageHandler QAbstractNetworkCache QAbstractPrintDialog QAbstractProxyModel QAbstractScrollArea QAbstractSlider QAbstractSocket QAbstractSpinBox QAbstractState QAbstractTableModel QAbstractTextDocumentLayout QAbstractTransition QAbstractUriResolver QAbstractVideoBuffer QAbstractVideoSurface QAbstractXmlNodeModel QAbstractXmlReceiver QAction QActionEvent QActionGroup QAnimationGroup QApplication QAssistantClient QAudio QAudioDeviceInfo QAudioFormat QAudioInput QAudioOutput QAuthenticator B QBasicTimer QBitArray QBitmap QBoxLayout QBrush QBuffer G QGenericArgument QGenericReturnArgument QGesture QGestureEvent QGestureRecognizer QGL QGLBuffer QGLColormap QGLContext QGLFormat QGLFramebufferObject QGLFramebufferObjectFormat QGLPixelBuffer QGLShader QGLShaderProgram QGLWidget QGradient QGraphicsAnchor QGraphicsAnchorLayout QGraphicsBlurEffect QGraphicsColorizeEffect QGraphicsDropShadowEffect QGraphicsEffect QGraphicsEllipseItem QGraphicsGridLayout QGraphicsItem QGraphicsItemAnimation QGraphicsItemGroup QGraphicsLayout QGraphicsLayoutItem QGraphicsLinearLayout QGraphicsLineItem QGraphicsObject QGraphicsOpacityEffect QGraphicsPathItem QGraphicsPixmapItem QGraphicsPolygonItem QGraphicsProxyWidget QGraphicsRectItem QGraphicsRotation QGraphicsScale QGraphicsScene QGraphicsSceneContextMenuEvent QGraphicsSceneDragDropEvent QGraphicsSceneEvent QGraphicsSceneHelpEvent QGraphicsSceneHoverEvent QGraphicsSceneMouseEvent QGraphicsSceneMoveEvent QNetworkReply QNetworkRequest QNetworkSession O QObject QObjectCleanupHandler P QPageSetupDialog QPaintDevice QPaintEngine QPaintEngineState QPainter QPainterPath QPainterPathStroker QPaintEvent QPalette QPanGesture QParallelAnimationGroup QPauseAnimation QPen QPersistentModelIndex Phonon QPicture QPictureIO QPinchGesture QPixmap QPixmapCache QPlainTextDocumentLayout QPlainTextEdit QPluginLoader QPoint QPointF QPolygon QPolygonF QPrintDialog QPrintEngine QPrinter QPrinterInfo QPrintPreviewDialog QPrintPreviewWidget QProcess QProcessEnvironment QProgressBar QProgressDialog QPropertyAnimation QProxyModel QPushButton QPyDeclarativePropertyValueSource QPyDesignerContainerExtension QPyDesignerCustomWidgetCollectionPlugin QPyDesignerCustomWidgetPlugin QStyleOptionTabBarBaseV2 QStyleOptionTabV2 QStyleOptionTabV3 QStyleOptionTabWidgetFrame QStyleOptionTabWidgetFrameV2 QStyleOptionTitleBar QStyleOptionToolBar QStyleOptionToolBox QStyleOptionToolBoxV2 QStyleOptionToolButton QStyleOptionViewItem QStyleOptionViewItemV2 QStyleOptionViewItemV3 QStyleOptionViewItemV4 QStylePainter QSvgGenerator QSvgRenderer QSvgWidget QSwipeGesture QSyntaxHighlighter QSysInfo QSystemLocale QSystemSemaphore QSystemTrayIcon T Qt QTabBar QTabletEvent QTableView QTableWidget QTableWidgetItem QTableWidgetSelectionRange QTabWidget QTapAndHoldGesture QTapGesture QTcpServer QTcpSocket QTemporaryFile QTest QTextBlock QTextBlockFormat QTextBlockGroup QTextBlockUserData QTextBoundaryFinder QTextBrowser QTextCharFormat QTextCodec QTextCursor QTextDecoder QTextDocument

PyQt's Classes

1

PyQt's Classes

QButtonGroup QByteArray QByteArrayMatcher C QCalendarWidget QChar QCheckBox QChildEvent QClipboard QCloseEvent QColor QColorDialog QColumnView QComboBox QCommandLinkButton QCompleter QConicalGradient QContextMenuEvent QCoreApplication QCryptographicHash QCursor D QDataStream QDataWidgetMapper QDate QDateEdit QDateTime QDateTimeEdit QDeclarativeComponent QDeclarativeContext QDeclarativeEngine QDeclarativeError QDeclarativeExpression QDeclarativeExtensionPlugin QDeclarativeImageProvider QDeclarativeItem QDeclarativeListReference QDeclarativeNetworkAccessManagerFactory QDeclarativeParserStatus QDeclarativeProperty QDeclarativePropertyMap QDeclarativePropertyValueSource QDeclarativeScriptString QDeclarativeView QDesignerActionEditorInterface QDesignerContainerExtension QDesignerCustomWidgetCollectionInterface QDesignerCustomWidgetInterface QDesignerFormEditorInterface QDesignerFormWindowCursorInterface QDesignerFormWindowInterface QDesignerFormWindowManagerInterface QDesignerMemberSheetExtension QDesignerObjectInspectorInterface QDesignerPropertyEditorInterface QDesignerPropertySheetExtension QDesignerTaskMenuExtension QDesignerWidgetBoxInterface QDesktopServices

QGraphicsSceneResizeEvent QGraphicsSceneWheelEvent QGraphicsSimpleTextItem QGraphicsSvgItem QGraphicsTextItem QGraphicsTransform QGraphicsView QGraphicsWebView QGraphicsWidget QGridLayout QGroupBox H QHBoxLayout QHeaderView QHelpContentItem QHelpContentModel QHelpContentWidget QHelpEngine QHelpEngineCore QHelpEvent QHelpIndexModel QHelpIndexWidget QHelpSearchEngine QHelpSearchQuery QHelpSearchQueryWidget QHelpSearchResultWidget QHideEvent QHistoryState QHostAddress QHostInfo QHoverEvent QHttp QHttpHeader QHttpRequestHeader QHttpResponseHeader I QIcon QIconDragEvent QIconEngine QIconEngineV2 QImage QImageIOHandler QImageReader QImageWriter QInputContext QInputContextFactory QInputDialog QInputEvent QInputMethodEvent QIntValidator QIODevice QItemDelegate QItemEditorCreatorBase QItemEditorFactory QItemSelection QItemSelectionModel QItemSelectionRange K QKeyEvent QKeyEventTransition

QPyDesignerMemberSheetExtension QPyDesignerPropertySheetExtension QPyDesignerTaskMenuExtension QPyTextObject Q QQuaternion R QRadialGradient QRadioButton QReadLocker QReadWriteLock QRect QRectF QRegExp QRegExpValidator QRegion QResizeEvent QResource QRubberBand QRunnable S QScriptClass QScriptClassPropertyIterator QScriptContext QScriptContextInfo QScriptEngine QScriptEngineAgent QScriptEngineDebugger QScriptString QScriptSyntaxCheckResult QScriptValue QScriptValueIterator QScrollArea QScrollBar QSemaphore QSequentialAnimationGroup QSessionManager QSettings QSharedMemory QShortcut QShortcutEvent QShowEvent QSignalMapper QSignalTransition QSimpleXmlNodeModel QSize QSizeF QSizeGrip QSizePolicy QSlider QSocketNotifier QSortFilterProxyModel QSound QSourceLocation QSpacerItem QSpinBox QSplashScreen QSplitter QSplitterHandle QSql

QTextDocumentFragment QTextDocumentWriter QTextEdit QTextEncoder QTextFormat QTextFragment QTextFrame QTextFrameFormat QTextImageFormat QTextInlineObject QTextItem QTextLayout QTextLength QTextLine QTextList QTextListFormat QTextObject QTextObjectInterface QTextOption QTextStream QTextTable QTextTableCell QTextTableCellFormat QTextTableFormat QThread QThreadPool QTime QTimeEdit QTimeLine QTimer QTimerEvent QToolBar QToolBox QToolButton QToolTip QTouchEvent QTransform QTranslator QTreeView QTreeWidget QTreeWidgetItem QTreeWidgetItemIterator U QUdpSocket QUndoCommand QUndoGroup QUndoStack QUndoView QUrl QUrlInfo QUuid V QValidator QVariant QVariantAnimation QVBoxLayout QVector2D QVector3D QVector4D

PyQt's Classes

2

PyQt's Classes

QDesktopWidget QDial QDialog QDialogButtonBox QDir QDirIterator QDirModel QDockWidget QDomAttr QDomCDATASection QDomCharacterData QDomComment QDomDocument QDomDocumentFragment QDomDocumentType QDomElement QDomEntity QDomEntityReference QDomImplementation QDomNamedNodeMap QDomNode QDomNodeList QDomNotation QDomProcessingInstruction QDomText QDoubleSpinBox QDoubleValidator QDrag QDragEnterEvent QDragLeaveEvent QDragMoveEvent QDropEvent QDynamicPropertyChangeEvent E QEasingCurve QElapsedTimer QErrorMessage QEvent QEventLoop QEventTransition QExtensionFactory QExtensionManager F QFile QFileDialog QFileIconProvider QFileInfo QFileOpenEvent QFileSystemModel QFileSystemWatcher QFinalState QFocusEvent QFocusFrame QFont QFontComboBox QFontDatabase QFontDialog QFontInfo QFontMetrics

QKeySequence L QLabel QLatin1Char QLatin1String QLayout QLayoutItem QLCDNumber QLibrary QLibraryInfo QLine QLinearGradient QLineEdit QLineF QListView QListWidget QListWidgetItem QLocale QLocalServer QLocalSocket M QMainWindow QMargins QMatrix QMatrix2x2 QMatrix2x3 QMatrix2x4 QMatrix3x2 QMatrix3x3 QMatrix3x4 QMatrix4x2 QMatrix4x3 QMatrix4x4 QMdiArea QMdiSubWindow QMenu QMenuBar QMessageBox QMetaClassInfo QMetaEnum QMetaMethod QMetaObject QMetaProperty QMetaType QMimeData QMimeSource QModelIndex QMouseEvent QMouseEventTransition QMoveEvent QMovie QMutex QMutexLocker N QNetworkAccessManager QNetworkAddressEntry QNetworkCacheMetaData QNetworkConfiguration QNetworkConfigurationManager QNetworkCookie

QSqlDatabase QSqlDriver QSqlDriverCreatorBase QSqlError QSqlField QSqlIndex QSqlQuery QSqlQueryModel QSqlRecord QSqlRelation QSqlRelationalDelegate QSqlRelationalTableModel QSqlResult QSqlTableModel QSsl QSslCertificate QSslCipher QSslConfiguration QSslError QSslKey QSslSocket QStackedLayout QStackedWidget QStandardItem QStandardItemModel QState QStateMachine QStaticText QStatusBar QStatusTipEvent QString QStringList QStringListModel QStringMatcher QStringRef QStyle QStyledItemDelegate QStyleFactory QStyleHintReturn QStyleHintReturnMask QStyleHintReturnVariant QStyleOption QStyleOptionButton QStyleOptionComboBox QStyleOptionComplex QStyleOptionDockWidget QStyleOptionDockWidgetV2 QStyleOptionFocusRect QStyleOptionFrame QStyleOptionFrameV2 QStyleOptionFrameV3 QStyleOptionGraphicsItem QStyleOptionGroupBox QStyleOptionHeader QStyleOptionMenuItem QStyleOptionProgressBar QStyleOptionProgressBarV2

QVideoFrame QVideoSurfaceFormat W QWaitCondition QWebDatabase QWebElement QWebElementCollection QWebFrame QWebHistory QWebHistoryInterface QWebHistoryItem QWebHitTestResult QWebInspector QWebPage QWebPluginFactory QWebSecurityOrigin QWebSettings QWebView QWhatsThis QWhatsThisClickedEvent QWheelEvent QWidget QWidgetAction QWidgetItem QWindowStateChangeEvent QWizard QWizardPage QWorkspace QWriteLocker X QX11EmbedContainer QX11EmbedWidget QX11Info QXmlAttributes QXmlContentHandler QXmlDeclHandler QXmlDefaultHandler QXmlDTDHandler QXmlEntityResolver QXmlErrorHandler QXmlFormatter QXmlInputSource QXmlItem QXmlLexicalHandler QXmlLocator QXmlName QXmlNamePool QXmlNamespaceSupport QXmlNodeModelIndex QXmlParseException QXmlQuery QXmlReader QXmlResultItems QXmlSchema QXmlSchemaValidator QXmlSerializer QXmlSimpleReader QXmlStreamAttribute QXmlStreamAttributes

PyQt's Classes

3

PyQt's Classes

QFontMetricsF QFormBuilder QFormLayout QFrame QFSFileEngine QFtp PyQt 4.8.2 for X11

QNetworkCookieJar QNetworkDiskCache QNetworkInterface QNetworkProxy QNetworkProxyFactory QNetworkProxyQuery

QStyleOptionRubberBand QStyleOptionSizeGrip QStyleOptionSlider QStyleOptionSpinBox QStyleOptionTab QStyleOptionTabBarBase

QXmlStreamEntityDeclaration QXmlStreamEntityResolver QXmlStreamNotationDeclaration QXmlStreamReader QXmlStreamWriter Qt 4.7.1

QXmlStreamNamespaceDeclaratio

Copyright Riverbank Computing Ltd and Nokia 2010

PyQt's Classes

4

PyQt's Classes

Home All Classes Modules

Contents The One-Minute Guide to Using Qt Assistant

Qt Assistant ManualThis document introduces Qt Assistant, a tool for presenting on-line documentation. The document is divided into the following sections: Table of contents: The One-Minute Guide to Using Qt Assistant Qt Assistant in More Detail Using Qt Assistant as a Custom Help Viewer

The One-Minute Guide to Using Qt AssistantOnce you have installed Qt, Qt Assistant should be ready to run: On Windows, Qt Assistant is available as a menu option on the Qt menu. On Mac OS X, Qt Assistant is installed in the /Developer/Applications/Qt directory. On Unix/Linux, open a terminal, type assistant and press Enter. When you start up Qt Assistant, you will be presented with a standard main window application, with a menu bar and toolbar. Below these, on the left hand side are navigation windows called Contents, Index and Bookmarks. On the right, taking up most of the space, is the Documentation window. By default, Qt Assistant loads the Qt reference documentation along with the manuals of other Qt tools, like Qt Designer or Qt Linguist. Qt Assistant works in a similar way to a Web browser. If you click hyperlinks (cross-references), the Documentation window will present the relevant page. You can bookmark pages of particular interest and you can click the Previous and Next toolbar buttons to navigate within the pages you have visited. Although Qt Assistant can be used just like a Web browser to navigate through the documentation, Qt Assistant offers a powerful means of navigation that Web browsers do not provide. Qt Assistant uses an advanced full text search engine to index all the pages in each compressed help file so that you can search for particular words and phrases. To perform an index search, click the Index tab on the Sidebar (or press Alt+I). In the 'Look For' line edit enter a word; e.g., 'homedirpath'. As you type, words are found and highlighted in a list beneath the line edit. If the highlighted text matches what you're looking for, double click it, (or press Enter) and the Documentation window will display the relevant page. You rarely have to type in the whole word before Qt Assistant finds a match. Note that for some words there may be more than one possible page that is relevant. Qt Assistant also provides full text searching for finding specific words in the documentation. To activate the full text search, either press (Alt+S) or click on the Search tab in the Documentation window. Then enter the term you're looking for and hit the Search button. All documents containing the specified term will then be listed in the list box below. [Next: Qt Assistant in More Detail] [+] Documentation Feedback PyQt 4.8.2 for X11 Copyright Riverbank Computing Ltd and Nokia 2010 Qt 4.7.1

Qt Assistant Manual

5

PyQt's Classes

Home All Classes Modules

PyQt's ModulesPyQt consists of several modules all of which are part of the PyQt4 Python package. Qt QtCore QtDeclarative QtGui QtHelp QtMultimedia QtNetwork QtOpenGL QtScript QtScriptTools QtSql QtSvg QtTest QtWebKit QtXml QtXmlPatterns phonon QtAssistant QtDesigner QAxContainer PyQt 4.8.2 for X11 Consolidates all other modules into a single module for ease of use at the expense of memory Core non-GUI classes used by other modules Declarative framework for graphical user interfaces Graphical user interface components Classes for online help Classes for low-level multimedia programming Classes for network programming OpenGL support classes Classes for evaluating Qt Scripts Additional Qt Script components Classes for database integration using SQL Classes for displaying the contents of SVG files Functions for unit testing PyQt applications Classes for rendering and editing HTML Classes for handling XML An XQuery and XPath engine for XML and custom data models Multimedia framework classes Support for online help Classes for extending Qt Designer Classes for accessing ActiveX controls Copyright Riverbank Computing Ltd and Nokia 2010 Qt 4.7.1

PyQt's Modules

6

PyQt's Classes

Home All Classes Modules

Phonon.AbstractAudioOutput Class Reference[phonon module]

Inherits QObject and MediaNode. Inherited by AudioOutput.

Detailed DescriptionPyQt 4.8.2 for X11 Copyright Riverbank Computing Ltd and Nokia 2010 Qt 4.7.1

Phonon.AbstractAudioOutput Class Reference[phonon module]

7

PyQt's Classes

Home All Classes Modules

Phonon.AbstractVideoOutput Class Reference[phonon module]

Inherits MediaNode. Inherited by VideoWidget.

Detailed DescriptionPyQt 4.8.2 for X11 Copyright Riverbank Computing Ltd and Nokia 2010 Qt 4.7.1

Phonon.AbstractVideoOutput Class Reference[phonon module]

8

PyQt's Classes

Home All Classes Modules

Phonon.AudioCaptureDevice Class Reference[phonon module]

Methods __init__ (self) __init__ (self, int index, dict-of-QByteArray-QVariant properties) __init__ (self, AudioCaptureDevice) QString description (self) int index (self) bool isValid (self) QString name (self) QVariant property (self, str name) list-of-QByteArray propertyNames (self)

Static Methods AudioCaptureDevice fromIndex (int index)

Special Methods bool __eq__ (self, AudioCaptureDevice otherDescription) bool __ne__ (self, AudioCaptureDevice otherDescription)

Detailed Description Method DocumentationAudioCaptureDevice.__init__ (self) AudioCaptureDevice.__init__ (self, int index, dict-of-QByteArray-QVariant properties) AudioCaptureDevice.__init__ (self, AudioCaptureDevice) QString AudioCaptureDevice.description (self) AudioCaptureDevice AudioCaptureDevice.fromIndex (int index) int AudioCaptureDevice.index (self) bool AudioCaptureDevice.isValid (self) QString AudioCaptureDevice.name (self) QVariant AudioCaptureDevice.property (self, str name) list-of-QByteArray AudioCaptureDevice.propertyNames (self) bool AudioCaptureDevice.__eq__ (self, AudioCaptureDevice otherDescription) bool AudioCaptureDevice.__ne__ (self, AudioCaptureDevice otherDescription)PyQt 4.8.2 for X11 Copyright Riverbank Computing Ltd and Nokia 2010 Qt 4.7.1

Phonon.AudioCaptureDevice Class Reference[phonon module]

9

PyQt's Classes

Home All Classes Modules

Phonon.AudioChannelDescription Class Reference[phonon module]

Methods __init__ (self) __init__ (self, int index, dict-of-QByteArray-QVariant properties) __init__ (self, AudioChannelDescription) QString description (self) int index (self) bool isValid (self) QString name (self) QVariant property (self, str name) list-of-QByteArray propertyNames (self)

Static Methods AudioChannelDescription fromIndex (int index)

Special Methods bool __eq__ (self, AudioChannelDescription otherDescription) bool __ne__ (self, AudioChannelDescription otherDescription)

Detailed Description Method DocumentationAudioChannelDescription.__init__ (self) AudioChannelDescription.__init__ (self, int index, dict-of-QByteArray-QVariant properties) AudioChannelDescription.__init__ (self, AudioChannelDescription) QString AudioChannelDescription.description (self) AudioChannelDescription AudioChannelDescription.fromIndex (int index) int AudioChannelDescription.index (self) bool AudioChannelDescription.isValid (self) QString AudioChannelDescription.name (self) QVariant AudioChannelDescription.property (self, str name) list-of-QByteArray AudioChannelDescription.propertyNames (self) bool AudioChannelDescription.__eq__ (self, AudioChannelDescription otherDescription) bool AudioChannelDescription.__ne__ (self, AudioChannelDescription otherDescription)PyQt 4.8.2 for X11 Copyright Riverbank Computing Ltd and Nokia 2010 Qt 4.7.1

Phonon.AudioChannelDescription Class Reference[phonon module]

10

PyQt's Classes

Home All Classes Modules

Phonon.AudioOutput Class Reference[phonon module]

The AudioOutput class is used to send data to audio output devices. More... Inherits AbstractAudioOutput.

Methods __init__ (self, Category category, QObject parent = None) __init__ (self, QObject parent = None) Category category (self) bool isMuted (self) QString name (self) AudioOutputDevice outputDevice (self) setMuted (self, bool mute) setName (self, QString newName) bool setOutputDevice (self, AudioOutputDevice newAudioOutputDevice) setVolume (self, float newVolume) setVolumeDecibel (self, float newVolumeDecibel) float volume (self) float volumeDecibel (self)

Qt Signals void mutedChanged (bool) void outputDeviceChanged (const Phonon::AudioOutputDevice&) void volumeChanged (qreal)

Detailed DescriptionThe AudioOutput class is used to send data to audio output devices. The AudioOutput class plays sound over a sound device. The audio output needs to be connected to a MediaObject using createPath(). To start playback, you call play() on the media object.Phonon.MediaObject *mediaObject = new Phonon.MediaObject(this); mediaObject->setCurrentSource(Phonon.MediaSource("/mymusic/barbiegirl.wav")); Phonon.AudioOutput *audioOutput = new Phonon.AudioOutput(Phonon.MusicCategory, this); Phonon.Path path = Phonon.createPath(mediaObject, audioOutput);

The class supports changing the volume(). It is also possible to mute the sound. To find out what AudioOutputDevices are available for AudioOutput, you can call BackendCapabilities.availableAudioOutputDevices(). A default device is selected by the backend, but it is possible to set the device to be used with setOutputDevice(). The outputDeviceChanged() signal will be emitted if the device changes. If an error occurs with the playback, for instance, if no valid output device is found, the media object will receive a stateChanged() signal with the ErrorState. Note that the default values of properties are dependent on the backend.

Method DocumentationAudioOutput.__init__ (self, Category category, QObject parent = None)The parent argument, if not None, causes self to be owned by Qt instead of PyQt.

AudioOutput.__init__ (self, QObject parent = None)The parent argument, if not None, causes self to be owned by Qt instead of PyQt. Creates a new AudioOutput that defines output to the system default device with the {Phonon.Category.}{NoCategory} category See also Phonon.categoryToString() and outputDevice.

Category AudioOutput.category (self)Returns the category of this output. See also Phonon.AudioOutput.AudioOutput().

Phonon.AudioOutput Class Reference[phonon module]

11

PyQt's Classes

bool AudioOutput.isMuted (self) QString AudioOutput.name (self) AudioOutputDevice AudioOutput.outputDevice (self) AudioOutput.setMuted (self, bool mute)This method is also a Qt slot with the C++ signature void setMuted(bool).

AudioOutput.setName (self, QString newName)This method is also a Qt slot with the C++ signature void setName(const QString&).

bool AudioOutput.setOutputDevice (self, AudioOutputDevice newAudioOutputDevice)This method is also a Qt slot with the C++ signature bool setOutputDevice(const Phonon::AudioOutputDevice&).

AudioOutput.setVolume (self, float newVolume)This method is also a Qt slot with the C++ signature void setVolume(qreal).

AudioOutput.setVolumeDecibel (self, float newVolumeDecibel)This method is also a Qt slot with the C++ signature void setVolumeDecibel(qreal).

float AudioOutput.volume (self) float AudioOutput.volumeDecibel (self)

Qt Signal Documentationvoid mutedChanged (bool)This is the default overload of this signal. This signal is emitted when the muted property has changed. The muted value passed by the signal indicates the state of the muted property. As this property can change by IPC (DBus) calls a UI element showing the muted property should listen to this signal.

void outputDeviceChanged (const Phonon::AudioOutputDevice&)This is the default overload of this signal. This signal is emitted when the (hardware) device for the output has changed. newAudioOutputDevice is the new device. The change can happen either through setOutputDevice or if the global configuration for the used category has changed. See also outputDevice.

void volumeChanged (qreal)This is the default overload of this signal. This signal is emitted whenever the volume has changed. As the volume can change without a call to setVolume (calls over dbus) this is important to keep a widget showing the current volume up to date. newVolume is the new volume level. See also setVolume() and volume(). PyQt 4.8.2 for X11 Copyright Riverbank Computing Ltd and Nokia 2010 Qt 4.7.1

bool AudioOutput.isMuted (self)

12

PyQt's Classes

Home All Classes Modules

Phonon.AudioOutputDevice Class Reference[phonon module]

Methods __init__ (self) __init__ (self, int index, dict-of-QByteArray-QVariant properties) __init__ (self, AudioOutputDevice) QString description (self) int index (self) bool isValid (self) QString name (self) QVariant property (self, str name) list-of-QByteArray propertyNames (self)

Static Methods AudioOutputDevice fromIndex (int index)

Special Methods bool __eq__ (self, AudioOutputDevice otherDescription) bool __ne__ (self, AudioOutputDevice otherDescription)

Detailed Description Method DocumentationAudioOutputDevice.__init__ (self) AudioOutputDevice.__init__ (self, int index, dict-of-QByteArray-QVariant properties) AudioOutputDevice.__init__ (self, AudioOutputDevice) QString AudioOutputDevice.description (self) AudioOutputDevice AudioOutputDevice.fromIndex (int index) int AudioOutputDevice.index (self) bool AudioOutputDevice.isValid (self) QString AudioOutputDevice.name (self) QVariant AudioOutputDevice.property (self, str name) list-of-QByteArray AudioOutputDevice.propertyNames (self) bool AudioOutputDevice.__eq__ (self, AudioOutputDevice otherDescription) bool AudioOutputDevice.__ne__ (self, AudioOutputDevice otherDescription)PyQt 4.8.2 for X11 Copyright Riverbank Computing Ltd and Nokia 2010 Qt 4.7.1

Phonon.AudioOutputDevice Class Reference[phonon module]

13

PyQt's Classes

Home All Classes Modules

Phonon.AudioOutputDeviceModel Class Reference[phonon module]

Inherits QAbstractListModel.

Methods __init__ (self, QObject parent = None) __init__ (self, list-of-Phonon.AudioOutputDevice data, QObject parent = None) QVariant data (self, QModelIndex index, int role = Qt.DisplayRole) bool dropMimeData (self, QMimeData data, Qt.DropAction action, int row, int column, QModelIndex parent) Qt.ItemFlags flags (self, QModelIndex index) QMimeData mimeData (self, list-of-QModelIndex indexes) QStringList mimeTypes (self) list-of-Phonon.AudioOutputDevice modelData (self) AudioOutputDevice modelData (self, QModelIndex index) moveDown (self, QModelIndex index) moveUp (self, QModelIndex index) bool removeRows (self, int row, int count, QModelIndex parent = QModelIndex()) int rowCount (self, QModelIndex parent = QModelIndex()) setModelData (self, list-of-Phonon.AudioOutputDevice data) Qt.DropActions supportedDropActions (self) int tupleIndexAtPositionIndex (self, int positionIndex) list-of-int tupleIndexOrder (self)

Detailed Description Method DocumentationAudioOutputDeviceModel.__init__ (self, QObject parent = None)The parent argument, if not None, causes self to be owned by Qt instead of PyQt.

AudioOutputDeviceModel.__init__ (self, list-of-Phonon.AudioOutputDevice data, QObject parent = None)The parent argument, if not None, causes self to be owned by Qt instead of PyQt.

QVariant AudioOutputDeviceModel.data (self, QModelIndex index, int role = Qt.DisplayRole) bool AudioOutputDeviceModel.dropMimeData (self, QMimeData data, Qt.DropAction action, int row, int column, QModelIndex parent) Qt.ItemFlags AudioOutputDeviceModel.flags (self, QModelIndex index) QMimeData AudioOutputDeviceModel.mimeData (self, list-of-QModelIndex indexes) QStringList AudioOutputDeviceModel.mimeTypes (self) list-of-Phonon.AudioOutputDevice AudioOutputDeviceModel.modelData (self) AudioOutputDevice AudioOutputDeviceModel.modelData (self, QModelIndex index) AudioOutputDeviceModel.moveDown (self, QModelIndex index) AudioOutputDeviceModel.moveUp (self, QModelIndex index) bool AudioOutputDeviceModel.removeRows (self, int row, int count, QModelIndex parent = QModelIndex()) int AudioOutputDeviceModel.rowCount (self, QModelIndex parent = QModelIndex()) AudioOutputDeviceModel.setModelData (self, list-of-Phonon.AudioOutputDevice data) Qt.DropActions AudioOutputDeviceModel.supportedDropActions (self) int AudioOutputDeviceModel.tupleIndexAtPositionIndex (self, int positionIndex)

Phonon.AudioOutputDeviceModel Class Reference[phonon module]

14

PyQt's Classes

list-of-int AudioOutputDeviceModel.tupleIndexOrder (self)PyQt 4.8.2 for X11 Copyright Riverbank Computing Ltd and Nokia 2010 Qt 4.7.1

list-of-int AudioOutputDeviceModel.tupleIndexOrder (self)

15

PyQt's Classes

Home All Classes Modules

Phonon.BackendCapabilities.Notifier Class Reference[phonon module]

Inherits QObject.

Qt Signals void availableAudioCaptureDevicesChanged () void availableAudioOutputDevicesChanged () void capabilitiesChanged ()

Detailed DescriptionNotifications about backend capabilities.

Qt Signal Documentationvoid availableAudioCaptureDevicesChanged ()This is the default overload of this signal.

void availableAudioOutputDevicesChanged ()This is the default overload of this signal. This signal is emitted when audio output devices were plugged or unplugged. Check BackendCapabilities.availableAudioOutputDevices to get the current list of available devices.

void capabilitiesChanged ()This is the default overload of this signal. This signal is emitted if the capabilities have changed. This can happen if the user has requested a backend change. PyQt 4.8.2 for X11 Copyright Riverbank Computing Ltd and Nokia 2010 Qt 4.7.1

Phonon.BackendCapabilities.Notifier Class Reference[phonon module]

16

PyQt's Classes

Home All Classes Modules

Phonon.BackendCapabilities Class Reference[phonon module]

The BackendCapabilities namespace contains functions to describe the capabilities of the multimedia backend. More...

Types class Notifier

Static Methods list-of-Phonon.AudioCaptureDevice availableAudioCaptureDevices () list-of-Phonon.EffectDescription availableAudioEffects () list-of-Phonon.AudioOutputDevice availableAudioOutputDevices () QStringList availableMimeTypes () bool isMimeTypeAvailable (QString mimeType) Notifier notifier ()

Detailed DescriptionThe BackendCapabilities namespace contains functions to describe the capabilities of the multimedia backend.

Method Documentationlist-of-Phonon.AudioCaptureDevice BackendCapabilities.availableAudioCaptureDevices () list-of-Phonon.EffectDescription BackendCapabilities.availableAudioEffects ()Returns descriptions for the audio effects the backend supports. Returns A list of AudioEffectDescription objects that give a name and description for every supported audio effect.

list-of-Phonon.AudioOutputDevice BackendCapabilities.availableAudioOutputDevices ()Returns the audio output devices the backend supports. Returns A list of AudioOutputDevice objects that give a name and description for every supported audio output device.

QStringList BackendCapabilities.availableMimeTypes ()Returns a list of mime types that the Backend can decode. See also isMimeTypeAvailable().

bool BackendCapabilities.isMimeTypeAvailable (QString mimeType)Often all you want to know is whether one given MIME type can be decoded by the backend. Use this method in favor of availableMimeTypes() as it can give you a negative answer without having a backend loaded. Returns true if the given mimeType is supported by the backend; otherwise, returns false. See also availableMimeTypes().

Notifier BackendCapabilities.notifier ()Use this function to get a QObject pointer to connect to the capabilitiesChanged signal. Returns a pointer to a QObject. The capabilitiesChanged signal is emitted if the capabilities have changed. This can happen if the user has requested a backend change. To connect to this signal do the following:QObject.connect(BackendCapabilities.notifier(), SIGNAL(capabilitiesChanged()), ...

See also Notifier.capabilitiesChanged(). PyQt 4.8.2 for X11 Copyright Riverbank Computing Ltd and Nokia 2010 Qt 4.7.1

Phonon.BackendCapabilities Class Reference[phonon module]

17

PyQt's Classes

Home All Classes Modules

Phonon.Effect Class Reference[phonon module]

The Effect class is used to transform audio streams. More... Inherits QObject and MediaNode.

Methods __init__ (self, EffectDescription description, QObject parent = None) EffectDescription description (self) list-of-Phonon.EffectParameter parameters (self) QVariant parameterValue (self, EffectParameter) setParameterValue (self, EffectParameter, QVariant value)

Detailed DescriptionThe Effect class is used to transform audio streams. An effect is a media node which is inserted into a path between a MediaObject and an audio output node, for instance, an AudioOutput. The Effect transforms the media stream on that path. Examples may include simple modifiers, such as fading or pitch shifting, and more complex mathematical transformations. You can query the backend for available effects with BackendCapabilities.availableAudioEffects(). Note that the effects available is dependent on the underlying system (DirectDraw, GStreamer, or QuickTime). In order to use an effect, insert it into the path as follows:Path path = Phonon.createPath(...); Effect *effect = new Effect(this); path.insertEffect(effect);

The effect will immediately begin applying it's transformations on the path. To stop it, remove the Effect from the path. To create an effect, you use the EffectDescription class, which you get from availableAudioEffects(). We give a code example below.QList effectDescriptions = Phonon.BackendCapabilities.availableAudioEffects(); Phonon.EffectDescription effectDescription = effectDescriptions.at(4); Phonon.Path path = Phonon.createPath(mediaObject, audioOutput); Phonon.Effect *effect = new Phonon.Effect(effectDescription); path.insertEffect(effect);

An effect can have one or more parameters, which let you alter how the effect works, for instance, by specifying the depth of a reverb effect. See the EffectParameter class description for details. Phonon also provides EffectWidget, which lets the user modify the parameters of an effect an the fly; e.g., with combo boxes.

Method DocumentationEffect.__init__ (self, EffectDescription description, QObject parent = None)The parent argument, if not None, causes self to be owned by Qt instead of PyQt. Constructs a new effect object with the given description and parent object. The EffectDescription object determines the type of the effect. See also Phonon.BackendCapabilities.availableAudioEffects().

EffectDescription Effect.description (self)Returns the description of this effect. This is the same description that was passed to the constructor.

list-of-Phonon.EffectParameter Effect.parameters (self)Returns a list of parameters that this effect provides to control its behavior. See also EffectParameter and EffectWidget.

Phonon.Effect Class Reference[phonon module]

18

PyQt's Classes

QVariant Effect.parameterValue (self, EffectParameter)Returns the value of the given effect parameter. You can fetch the available parameters for an effect with parameters(). See also setParameterValue() and EffectParameter.

Effect.setParameterValue (self, EffectParameter, QVariant value)Sets the given effect parameter to the specified value. Parameters for an effect are returned by parameters(). You can check which QVariant.Type an EffectParameter takes with the EffectParameter.type() function. See also parameterValue() and EffectParameter. PyQt 4.8.2 for X11 Copyright Riverbank Computing Ltd and Nokia 2010 Qt 4.7.1

QVariant Effect.parameterValue (self, EffectParameter)

19

PyQt's Classes

Home All Classes Modules

Phonon.EffectDescription Class Reference[phonon module]

Methods __init__ (self) __init__ (self, int index, dict-of-QByteArray-QVariant properties) __init__ (self, EffectDescription) QString description (self) int index (self) bool isValid (self) QString name (self) QVariant property (self, str name) list-of-QByteArray propertyNames (self)

Static Methods EffectDescription fromIndex (int index)

Special Methods bool __eq__ (self, EffectDescription otherDescription) bool __ne__ (self, EffectDescription otherDescription)

Detailed Description Method DocumentationEffectDescription.__init__ (self) EffectDescription.__init__ (self, int index, dict-of-QByteArray-QVariant properties) EffectDescription.__init__ (self, EffectDescription) QString EffectDescription.description (self) EffectDescription EffectDescription.fromIndex (int index) int EffectDescription.index (self) bool EffectDescription.isValid (self) QString EffectDescription.name (self) QVariant EffectDescription.property (self, str name) list-of-QByteArray EffectDescription.propertyNames (self) bool EffectDescription.__eq__ (self, EffectDescription otherDescription) bool EffectDescription.__ne__ (self, EffectDescription otherDescription)PyQt 4.8.2 for X11 Copyright Riverbank Computing Ltd and Nokia 2010 Qt 4.7.1

Phonon.EffectDescription Class Reference[phonon module]

20

PyQt's Classes

Home All Classes Modules

Phonon.EffectDescriptionModel Class Reference[phonon module]

Inherits QAbstractListModel.

Methods __init__ (self, QObject parent = None) __init__ (self, list-of-Phonon.EffectDescription data, QObject parent = None) QVariant data (self, QModelIndex index, int role = Qt.DisplayRole) bool dropMimeData (self, QMimeData data, Qt.DropAction action, int row, int column, QModelIndex parent) Qt.ItemFlags flags (self, QModelIndex index) QMimeData mimeData (self, list-of-QModelIndex indexes) QStringList mimeTypes (self) list-of-Phonon.EffectDescription modelData (self) EffectDescription modelData (self, QModelIndex index) moveDown (self, QModelIndex index) moveUp (self, QModelIndex index) bool removeRows (self, int row, int count, QModelIndex parent = QModelIndex()) int rowCount (self, QModelIndex parent = QModelIndex()) setModelData (self, list-of-Phonon.EffectDescription data) Qt.DropActions supportedDropActions (self) int tupleIndexAtPositionIndex (self, int positionIndex) list-of-int tupleIndexOrder (self)

Detailed Description Method DocumentationEffectDescriptionModel.__init__ (self, QObject parent = None)The parent argument, if not None, causes self to be owned by Qt instead of PyQt.

EffectDescriptionModel.__init__ (self, list-of-Phonon.EffectDescription data, QObject parent = None)The parent argument, if not None, causes self to be owned by Qt instead of PyQt.

QVariant EffectDescriptionModel.data (self, QModelIndex index, int role = Qt.DisplayRole) bool EffectDescriptionModel.dropMimeData (self, QMimeData data, Qt.DropAction action, int row, int column, QModelIndex parent) Qt.ItemFlags EffectDescriptionModel.flags (self, QModelIndex index) QMimeData EffectDescriptionModel.mimeData (self, list-of-QModelIndex indexes) QStringList EffectDescriptionModel.mimeTypes (self) list-of-Phonon.EffectDescription EffectDescriptionModel.modelData (self) EffectDescription EffectDescriptionModel.modelData (self, QModelIndex index) EffectDescriptionModel.moveDown (self, QModelIndex index) EffectDescriptionModel.moveUp (self, QModelIndex index) bool EffectDescriptionModel.removeRows (self, int row, int count, QModelIndex parent = QModelIndex()) int EffectDescriptionModel.rowCount (self, QModelIndex parent = QModelIndex()) EffectDescriptionModel.setModelData (self, list-of-Phonon.EffectDescription data) Qt.DropActions EffectDescriptionModel.supportedDropActions (self) int EffectDescriptionModel.tupleIndexAtPositionIndex (self, int positionIndex)

Phonon.EffectDescriptionModel Class Reference[phonon module]

21

PyQt's Classes

list-of-int EffectDescriptionModel.tupleIndexOrder (self)PyQt 4.8.2 for X11 Copyright Riverbank Computing Ltd and Nokia 2010 Qt 4.7.1

list-of-int EffectDescriptionModel.tupleIndexOrder (self)

22

PyQt's Classes

Home All Classes Modules

Phonon.EffectParameter.Hints Class Reference[phonon module]

Methods __init__ (self, Hints) __init__ (self, int) __init__ (self)

Special Methods Hints __and__ (self, int mask) int __bool__ (self) bool __eq__ (self, Hints f) Hints __iand__ (self, int mask) int __int__ (self) Hints __invert__ (self) Hints __ior__ (self, Hints f) Hints __ixor__ (self, Hints f) bool __ne__ (self, Hints f) Hints __or__ (self, Hints f) Hints __or__ (self, int f) Hints __xor__ (self, Hints f) Hints __xor__ (self, int f)

Detailed DescriptionHint may be used whenever Hints is expected.

Method DocumentationHints.__init__ (self, Hints) Hints.__init__ (self, int) Hints.__init__ (self) Hints Hints.__and__ (self, int mask) int Hints.__bool__ (self) bool Hints.__eq__ (self, Hints f) Hints Hints.__iand__ (self, int mask) int Hints.__int__ (self) Hints Hints.__invert__ (self) Hints Hints.__ior__ (self, Hints f) Hints Hints.__ixor__ (self, Hints f) bool Hints.__ne__ (self, Hints f) Hints Hints.__or__ (self, Hints f) Hints Hints.__or__ (self, int f) Hints Hints.__xor__ (self, Hints f) Hints Hints.__xor__ (self, int f)PyQt 4.8.2 for X11 Copyright Riverbank Computing Ltd and Nokia 2010 Qt 4.7.1

Phonon.EffectParameter.Hints Class Reference[phonon module]

23

PyQt's Classes

Home All Classes Modules

Phonon.EffectParameter Class Reference[phonon module]

The EffectParameter class describes one parameter of an effect. More...

Types enum Hint { ToggledHint, LogarithmicHint, IntegerHint } class Hints

Methods __init__ (self, int parameterId, QString name, Hints hints, QVariant defaultValue, QVariant min = QVariant(), QVariant max = QVariant(), list-of-QVariant values = [], QString description = QString()) __init__ (self, EffectParameter rhs) QVariant defaultValue (self) QString description (self) bool isLogarithmicControl (self) QVariant maximumValue (self) QVariant minimumValue (self) QString name (self) list-of-QVariant possibleValues (self) QVariant.Type type (self)

Special Methods int __hash__ (self)

Detailed DescriptionThe EffectParameter class describes one parameter of an effect. You fetch the parameters of an Effect with Effect.parameters().QList parameters = effect->parameters(); foreach(Phonon.EffectParameter parameter, parameters) { // Do something with parameter }

To describe itself, an effect parameter gives a name() and possibly description() (depending on the backend used). These are suited to present the effect parameter to the user of a Phonon application. Note that effects are created by the backend, and that their name and descriptions may vary. The value of an effect parameter is stored in a QVariant, of which type() is usually int or double. The value is retrieved with Effect.parameterValue() and set with setParameterValue() - both of which takes the EffectParameter as argument. Note that not all effect parameters support setting of their value. You get the values a parameter can take with possibleValues(); an empty list is returned if the values are continuous. A parameter may also specify default(), minimum(), and maximum() values. Values are returned as QVariants. If the parameter does not have the requested value, an QVariant.Invalid invalid QVariant is returned from these functions. The EffectWidget provides a widget with which one can control the parameters of an Effect.Phonon.EffectWidget *effectWidget = new Phonon.EffectWidget(effect);

Type DocumentationEffectParameter.HintOnly for backend developers: Flags to set the return values of isToggleControl(), isLogarithmicControl(), isIntegerControl(), isBoundedBelow() and isBoundedAbove(). The values of the flags correspond to the values used for LADSPA effects. Constant Phonon.EffectParameter.ToggledHint Value Description

0x04 If this hint is set it means that the control has only two states: zero and non-zero (see isToggleControl()).

Phonon.EffectParameter Class Reference[phonon module]

24

PyQt's Classes

Phonon.EffectParameter.LogarithmicHint 0x10

LADSPA's SAMPLE_RATE hint needs to be translated by the backend to normal bounds, as the backend knows the sample rate - and the frontend doesn't (see isLogarithmicControl()).

Phonon.EffectParameter.IntegerHint 0x20 See isIntegerControl(). The Hints type is a typedef for QFlags. It stores an OR combination of Hint values.

Method DocumentationEffectParameter.__init__ (self, int parameterId, QString name, Hints hints, QVariant defaultValue, QVariant min = QVariant(), QVariant max = QVariant(), list-of-QVariant values = [], QString description = QString())Constructs a copy of the other effect parameter.

EffectParameter.__init__ (self, EffectParameter rhs) QVariant EffectParameter.defaultValue (self)The default value.

QString EffectParameter.description (self)The parameter may come with a description (LADSPA doesn't have a field for this, so don't expect many effects to provide a description). The description can be used for a tooltip or WhatsThis help. Returns A text describing the parameter.

bool EffectParameter.isLogarithmicControl (self)Returns whether the parameter should be displayed using a logarithmic scale. This is particularly useful for frequencies and gains.

QVariant EffectParameter.maximumValue (self)The maximum value to be used for the control to edit the parameter. If the returned QVariant is invalid the value is not bounded from above.

QVariant EffectParameter.minimumValue (self)The minimum value to be used for the control to edit the parameter. If the returned QVariant is invalid the value is not bounded from below.

QString EffectParameter.name (self)The name of the parameter. Can be used as the label. Returns A label for the parameter.

list-of-QVariant EffectParameter.possibleValues (self)The possible values to be used for the control to edit the parameter. if the value of this parameter is to be picked from predefined values this returns the list (otherwise it returns an empty QVariantList).

QVariant.Type EffectParameter.type (self)Returns the parameter type. Common types are QVariant.Int, QVariant.Double, QVariant.Bool and QVariant.String. When QVariant.String is returned you get the possible values from possibleValues.

int EffectParameter.__hash__ (self)PyQt 4.8.2 for X11 Copyright Riverbank Computing Ltd and Nokia 2010 Qt 4.7.1

EffectParameter.Hint

25

PyQt's Classes

Home All Classes Modules

Phonon.EffectWidget Class Reference[phonon module]

The EffectWidget class provides a widget to control the parameters of an Effect. More... Inherits QWidget.

Methods __init__ (self, Effect effect, QWidget parent = None)

Detailed DescriptionThe EffectWidget class provides a widget to control the parameters of an Effect. The EffectWidget class provides a widget, with which an effects parameters can be controlled. The widget does not have an API, and is constructed with the Effect, of which parameters should be controlled.Phonon.Effect *effect = new Phonon.Effect(effectDescription); path.insertEffect(effect); Phonon.EffectWidget *effectWidget = new Phonon.EffectWidget(effect); effectWidget->show();

The following image shows an example of an effect widget.

Note that some audio effects do not have parameters, and the widget will then not show() at all.

Method DocumentationEffectWidget.__init__ (self, Effect effect, QWidget parent = None)The parent argument, if not None, causes self to be owned by Qt instead of PyQt. PyQt 4.8.2 for X11 Copyright Riverbank Computing Ltd and Nokia 2010 Qt 4.7.1

Phonon.EffectWidget Class Reference[phonon module]

26

PyQt's Classes

Home All Classes Modules

Phonon.MediaController.Features Class Reference[phonon module]

Methods __init__ (self, Features) __init__ (self, int) __init__ (self)

Special Methods Features __and__ (self, int mask) int __bool__ (self) bool __eq__ (self, Features f) Features __iand__ (self, int mask) int __int__ (self) Features __invert__ (self) Features __ior__ (self, Features f) Features __ixor__ (self, Features f) bool __ne__ (self, Features f) Features __or__ (self, Features f) Features __or__ (self, int f) Features __xor__ (self, Features f) Features __xor__ (self, int f)

Detailed DescriptionFeature may be used whenever Features is expected.

Method DocumentationFeatures.__init__ (self, Features) Features.__init__ (self, int) Features.__init__ (self) Features Features.__and__ (self, int mask) int Features.__bool__ (self) bool Features.__eq__ (self, Features f) Features Features.__iand__ (self, int mask) int Features.__int__ (self) Features Features.__invert__ (self) Features Features.__ior__ (self, Features f) Features Features.__ixor__ (self, Features f) bool Features.__ne__ (self, Features f) Features Features.__or__ (self, Features f) Features Features.__or__ (self, int f) Features Features.__xor__ (self, Features f) Features Features.__xor__ (self, int f)PyQt 4.8.2 for X11 Copyright Riverbank Computing Ltd and Nokia 2010 Qt 4.7.1

Phonon.MediaController.Features Class Reference[phonon module]

27

PyQt's Classes

Home All Classes Modules

Phonon.MediaController Class Reference[phonon module]

The MediaController class controls optional features of a media file/device. More... Inherits QObject.

Types enum Feature { Angles, Chapters, Titles } class Features

Methods __init__ (self, MediaObject parent) bool autoplayTitles (self) int availableAngles (self) list-of-Phonon.AudioChannelDescription availableAudioChannels (self) int availableChapters (self) list-of-Phonon.SubtitleDescription availableSubtitles (self) int availableTitles (self) int currentAngle (self) AudioChannelDescription currentAudioChannel (self) int currentChapter (self) SubtitleDescription currentSubtitle (self) int currentTitle (self) nextTitle (self) previousTitle (self) setAutoplayTitles (self, bool) setCurrentAngle (self, int angleNumber) setCurrentAudioChannel (self, AudioChannelDescription stream) setCurrentChapter (self, int chapterNumber) setCurrentSubtitle (self, SubtitleDescription stream) setCurrentTitle (self, int titleNumber) Features supportedFeatures (self)

Qt Signals void angleChanged (int) void availableAnglesChanged (int) void availableAudioChannelsChanged () void availableChaptersChanged (int) void availableSubtitlesChanged () void availableTitlesChanged (int) void chapterChanged (int) void titleChanged (int)

Detailed DescriptionThe MediaController class controls optional features of a media file/device. Some media sources have content that the MediaObject does not provide control over, for instance, chapters in a DVD file. The functionality the media controller offers is dependent on the type of media source that is played back. Commonly, the media controller allows you to: Navigate between chapters. Navigate between titles. Select between angles. The Feature enum explains these terms in more detail, and their context in playback of CD and DVD. The media controller keeps a MediaObject, of which media source is played back. You can still call the media object's functions, e.g., stop(); this is all handled correctly by the media controller. You have the option of letting the media controller play all titles of a source in sequence by setting the autoplay titles option. To start a playback using a media object, you call play() on the media object. To play a specific title, use setCurrentTitle() and then call play(). Warning: The Phonon.MediaController class is not yet supported by Qt backends.

Phonon.MediaController Class Reference[phonon module]

28

PyQt's Classes

Type DocumentationMediaController.FeatureThe values of this enum are interpreted differently depending on the type of media source, e.g., DVD or CD. We give examples for these sources. Constant Phonon.MediaController.Angles Value 1 Description In the VOB (DVD) format, it is possible to to give several video streams of the same scene, each of which displays the scene from a different angle. The DVD viewer can then change between these angles. In the VOB format, chapters are points in a single video stream that can be played and seeked to separately.

Phonon.MediaController.Chapters 2

Phonon.MediaController.Titles 4 On a CD, a title is a separate sound track. On DVD, a title is a separate VOB file. The Features type is a typedef for QFlags. It stores an OR combination of Feature values.

Method DocumentationMediaController.__init__ (self, MediaObject parent)The parent argument, if not None, causes self to be owned by Qt instead of PyQt. Constructs a new MediaController with the media object (parent) to be used by the media controller. See also MediaObject and Feature.

bool MediaController.autoplayTitles (self)Returns true if titles will automatically be played when the media is played; otherwise returns false. The media controller will play the titles of the media source in sequence when the media object's play() function is called. If the autoplay option is disabled, the media object will play the MediaController.currentTitle(){current title} and then finish the playback. See also setAutoplayTitles() and currentTitle().

int MediaController.availableAngles (self)Returns the available angles that is available for the current media source. See also Feature.

list-of-Phonon.AudioChannelDescription MediaController.availableAudioChannels (self) int MediaController.availableChapters (self)Returns the number of chapters the current media source contains. See also Feature.

list-of-Phonon.SubtitleDescription MediaController.availableSubtitles (self) int MediaController.availableTitles (self)Returns the number of titles that the current media source contains. See also Feature.

int MediaController.currentAngle (self)Returns the angle that is currently used. See also setCurrentAngle() and Feature.

AudioChannelDescription MediaController.currentAudioChannel (self) int MediaController.currentChapter (self)Returns the chapter that is currently being played back. See also setCurrentChapter() and Feature.

SubtitleDescription MediaController.currentSubtitle (self)

Type Documentation

29

PyQt's Classes

int MediaController.currentTitle (self)Returns the title that is currently played back. The current title is 0 (the first) by default. See also setCurrentTitle() and Feature.

MediaController.nextTitle (self)This method is also a Qt slot with the C++ signature void nextTitle(). Skips to the next title. If it was playing before the title change it will start playback on the next title if autoplayTitles is enabled. See also Feature.

MediaController.previousTitle (self)This method is also a Qt slot with the C++ signature void previousTitle(). Skips to the previous title. If it was playing before the title change it will start playback on the previous title if autoplayTitles is enabled. See also Feature.

MediaController.setAutoplayTitles (self, bool)This method is also a Qt slot with the C++ signature void setAutoplayTitles(bool). Sets the titles to play automatically when the media is played if enable is true; otherwise disables this option. The media controller will play the titles of the media source in sequence when the media object's play() function is called. If the autoplay option is disabled, the media object will play the MediaController.currentTitle(){current title} and then finish the playback. See also autoplayTitles() and currentTitle().

MediaController.setCurrentAngle (self, int angleNumber)This method is also a Qt slot with the C++ signature void setCurrentAngle(int). Sets the current angle to the given angleNumber if the media file or device supports navigation by angle number. See also currentAngle() and Feature.

MediaController.setCurrentAudioChannel (self, AudioChannelDescription stream) MediaController.setCurrentChapter (self, int chapterNumber)This method is also a Qt slot with the C++ signature void setCurrentChapter(int). Sets the current chapter to the given chapterNumber if the media file or device supports navigation by chapter number. See also currentChapter() and Feature.

MediaController.setCurrentSubtitle (self, SubtitleDescription stream) MediaController.setCurrentTitle (self, int titleNumber)This method is also a Qt slot with the C++ signature void setCurrentTitle(int). Skips to the given title titleNumber. If it was playing before the title change it will start playback on the new title if autoplayTitles is enabled. See also currentTitle() and Feature.

Features MediaController.supportedFeatures (self)

int MediaController.currentTitle (self)

30

PyQt's Classes

Qt Signal Documentationvoid angleChanged (int)This is the default overload of this signal. This signal is emitted whenever the current angle changes. The new angle number is given by angleNumber. See also Feature.

void availableAnglesChanged (int)This is the default overload of this signal. This signal is emitted whenever the number of available angles changes. The new number of available angles is given by availableAngles. See also Feature.

void availableAudioChannelsChanged ()This is the default overload of this signal.

void availableChaptersChanged (int)This is the default overload of this signal. This signal is emitted whenever the number of available chapters changes. The new number of available chapters is given by availableChapters. See also Feature.

void availableSubtitlesChanged ()This is the default overload of this signal.

void availableTitlesChanged (int)This is the default overload of this signal. This signal is emitted whenever the number of available titles changes. The new number of available titles is given by availableTitles. See also Feature.

void chapterChanged (int)This is the default overload of this signal. This signal is emitted whenever the current chapter changes. The new chapter number is given by chapterNumber. See also Feature.

void titleChanged (int)This is the default overload of this signal. This signal is emitted whenever the current title changes. The new title number is given by titleNumber. See also Feature. PyQt 4.8.2 for X11 Copyright Riverbank Computing Ltd and Nokia 2010 Qt 4.7.1

Qt Signal Documentation

31

PyQt's Classes

Home All Classes Modules

Phonon.MediaNode Class Reference[phonon module]

The MediaNode class is the base class for all nodes in a media graph. More... Inherited by AbstractAudioOutput, AbstractVideoOutput, Effect and MediaObject.

Methods list-of-Phonon.Path inputPaths (self) bool isValid (self) list-of-Phonon.Path outputPaths (self)

Detailed DescriptionThe MediaNode class is the base class for all nodes in a media graph. In all phonon applications, one builds a media graph consisting of MediaNodes. The graph will take multimedia content, e.g., from a file, as input. After its nodes have processed the multimedia, the graph will output the media again, e.g., to a sound card. The multimedia content is streamed over Paths between the nodes in the graph. You can query the paths that are connected to a media node with inputPaths() and outputPaths(). You can check whether the node is implemented by the current backend by calling isValid(). This does not guarantee that an instance of the class works as expected, but that the backend has implemented functionality for the class. Currently, Phonon has four media nodes: MediaObject, AudioOutput, VideoWidget, and Effect. Please refer to their class descriptions for details about their usage, and to find out which nodes can be connected to each other. See also Building Graphs in Phonon's overview document. Two nodes are connected to each other using the Phonon.createPath() or Path.insertEffect() functions (only Phonon.Effects use insertEffect()). We show a code example below, in which we build a media graph for video playback and then query its media nodes for their Paths:Phonon.MediaObject *mediaObject = new Phonon.MediaObject; Phonon.AudioOutput *audioOutput = new Phonon.AudioOutput; Phonon.VideoWidget *videoWidget = new Phonon.VideoWidget; Phonon.createPath(mediaObject, audioOutput); Phonon.createPath(mediaObject, videoWidget); QList inputPaths = audioOutput->inputPaths(); // inputPaths = [ mediaObject ] QList outputPaths = mediaObject->outputPaths(); // outputPaths = [ audioOutput, videoWidget ]

When you create a Phonon application, you will likely build the graph yourself. This makes isValid() the most useful function of this class. The other two functions help navigate the graph, which you do not need to do as you created the nodes yourself.

Method Documentationlist-of-Phonon.Path MediaNode.inputPaths (self)Returns the paths that inputs multimedia to this media node. See also outputPaths().

bool MediaNode.isValid (self)Returns true if the backend provides an implementation of this class; otherwise returns false. This does not guarantee that instances of the class works as expected, but that the backend has implemented the functionality for this class. For instance, Qt's GStreamer backend will return true for instances of the AudioOutput class, even if there is a problem with GStreamer and it could not play sound.

list-of-Phonon.Path MediaNode.outputPaths (self)Returns the paths to which this media node outputs media. See also inputPaths(). PyQt 4.8.2 for X11 Copyright Riverbank Computing Ltd and Nokia 2010 Qt 4.7.1

Phonon.MediaNode Class Reference[phonon module]

32

PyQt's Classes

Home All Classes Modules

Phonon.MediaObject Class Reference[phonon module]

The MediaObject class provides an interface for media playback. More... Inherits QObject and MediaNode.

Methods __init__ (self, QObject parent = None) clear (self) clearQueue (self) MediaSource currentSource (self) int currentTime (self) enqueue (self, MediaSource source) enqueue (self, list-of-Phonon.MediaSource sources) enqueue (self, list-of-QUrl urls) QString errorString (self) ErrorType errorType (self) bool hasVideo (self) bool isSeekable (self) QStringList metaData (self, QString key) QStringList metaData (self, MetaData key) dict-of-QString-list-of-QString metaData (self) pause (self) play (self) int prefinishMark (self) list-of-Phonon.MediaSource queue (self) int remainingTime (self) seek (self, int time) setCurrentSource (self, MediaSource source) setPrefinishMark (self, int msecToEnd) setQueue (self, list-of-Phonon.MediaSource sources) setQueue (self, list-of-QUrl urls) setTickInterval (self, int newTickInterval) setTransitionTime (self, int msec) State state (self) stop (self) int tickInterval (self) int totalTime (self) int transitionTime (self)

Qt Signals void aboutToFinish () void bufferStatus (int) void currentSourceChanged (const Phonon::MediaSource&) void finished () void hasVideoChanged (bool) void metaDataChanged () void prefinishMarkReached (qint32) void seekableChanged (bool) void stateChanged (Phonon::State,Phonon::State) void tick (qint64) void totalTimeChanged (qint64)

Detailed DescriptionThe MediaObject class provides an interface for media playback. The media object manages a MediaSource, which supplies the media object with multimedia content, e.g., from a file. A playback in Phonon is always started by calling the play() function. The state of play (play, pause, stop, seek) is controlled by the media object, and you can also query the current state(). It keeps track of the playback position in the media stream, and emits the tick() signal when the current position in the stream changes. Notice that most functions of this class are asynchronous, so you cannot rely on that a state is entered after a function call before you receive the stateChanged() signal. The description of the State enum gives a description of the different states. Before play() is called, the media object should be connected to output nodes, which outputs the media to the underlying hardware. The output nodes required are dependent on the contents of the multimedia file that is played back. Phonon has currently two output nodes: the AudioOutput for audio content and VideoWidget for video content. If a MediaSource contains both audio and video, both nodes need to be connected to the media object.

Phonon.MediaObject Class Reference[phonon module]

33

PyQt's Classes

Phonon.MediaObject *mediaObject = new Phonon.MediaObject(this); Phonon.VideoWidget *videoWidget = new Phonon.VideoWidget(this); Phonon.createPath(mediaObject, videoWidget); Phonon.AudioOutput *audioOutput = new Phonon.AudioOutput(Phonon.VideoCategory, this); Phonon.createPath(mediaObject, audioOutput); mediaObject->play();

The media object can queue sources for playback. When it has finished to play one source, it will start playing the next in the queue; the new source is then removed from the queue. The queue can be altered at any time.media->setCurrentSource(":/sounds/startsound.ogg"); media->enqueue("/home/username/music/song.mp3"); media->enqueue(":/sounds/endsound.ogg");

You can also make use of the aboutToFinish() signal, which is guaranteed to be emitted in time for altering the queue.media->setCurrentSource(":/sounds/startsound.ogg"); connect(media, SIGNAL(aboutToFinish()), SLOT(enqueueNextSource())); } void enqueueNextSource() { media->enqueue("/home/username/music/song.mp3"); }

When playback is finishing, i.e., when a media source has been played to the end and the queue is empty, several signals are emitted. First, the media object will emit aboutToFinish() - shortly before the playback has finished - and then finished(). The stateChanged() signal will also be emitted with PausedState, which is the state the media object takes when the playback is finished. If you wish to enter another state, you can connect a slot to finished() and set a new state there. The media object resolves the meta information, such as title, artist, and album. The meta data is not resolved immediately after a new source is provided, but will be resolved before the object leaves the LoadingState. The data is queried by string keys - which should follow the Ogg Vorbis specification http://xiph.org/vorbis/doc/v-comment.html or by using the MetaData enum. The data available will depend on the type and content of the individual media files. metaDataChanged() will be emitted when the media object has resolved new meta data. Errors encountered during playback and loading of media sources are reported by emitting a state changed signal with ErrorState. The severity of the error can be queried by the ErrorType. With a NormalError, it might be possible to continue the playback, for instance, if only audio playback fails for a media source which also has video. A FatalError indicates that Phonon cannot continue playback of the current source, but it is possible to try with a different one. A user readable error message is given by errorString().

Method DocumentationMediaObject.__init__ (self, QObject parent = None)The parent argument, if not None, causes self to be owned by Qt instead of PyQt.

MediaObject.clear (self)This method is also a Qt slot with the C++ signature void clear(). Stops and removes all playing and enqueued media sources. See also setCurrentSource().

MediaObject.clearQueue (self)Clears the queue of media sources. See also queue() and enqueue().

MediaSource MediaObject.currentSource (self)Returns the current media source, i.e., the media source that is being played back. The current source is either set with setCurrentSource() or taken from the media queue() when a media source has finished playing. See also setCurrentSource().

int MediaObject.currentTime (self)Returns the current time (in milliseconds), i.e., position in the media stream, of the file currently being played. See also tick(), totalTime(), and remainingTime().

MediaObject.enqueue (self, MediaSource source)Appends source to the queue.

Detailed Description

34

PyQt's Classes

You can use this function to provide the next source after the aboutToFinish() signal has been emitted. See also aboutToFinish(), setQueue(), and clearQueue().

MediaObject.enqueue (self, list-of-Phonon.MediaSource sources)Appends multiple sources to the queue. See also setQueue() and clearQueue().

MediaObject.enqueue (self, list-of-QUrl urls)Appends the URLs in urls to the media source queue. The function will create MediaSources from the QUrls, and append these to the queue. See also setQueue() and clearQueue().

QString MediaObject.errorString (self)Returns a human-readable description of the last error that occurred. The strings given may vary between backends. The error description can be used to give a message to the user - and the developer - when the stateChanged() signal is emitted with ErrorState.

Qt Backends On Windows, Qt fetches its error messages from the DirectShow backend. This usually includes an error number, which can be looked up in the DirectShow documentation: http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dx81_c/directx_cpp/htm/errorandsuccesscodes.asp. On Linux and Mac, the error strings are not fetched directly from the backend, but are created in the backend. See also Phonon.ErrorState and stateChanged().

ErrorType MediaObject.errorType (self)Tells your program what to do about the last error that occurred. Use this function after receiving a stateChanged() signal with ErrorState. See also Phonon.ErrorType, Phonon.ErrorState, and stateChanged().

bool MediaObject.hasVideo (self)Check whether the current media source includes a video stream. Warning: This information is not resolved immediately after a media object gets a new source. Listen to the hasVideoChanged() signal instead.connect(media, SIGNAL(hasVideoChanged(bool)), hasVideoChanged(bool)); media->setCurrentSource("somevideo.avi"); media->hasVideo(); // returns false; } void hasVideoChanged(bool b) { // b == true media->hasVideo(); // returns true; }

Returns true if the media contains video data; otherwise, returns false. See also hasVideoChanged().

bool MediaObject.isSeekable (self)Check whether it is possible to seek, i.e., change the playback position in the media stream. Warning: This information is not solved immediately after the media object gets a new media source. The hasVideoChanged() signal is emitted after this information is available.connect(media, SIGNAL(hasVideoChanged(bool)), hasVideoChanged(bool)); media->setCurrentSource("somevideo.avi"); media->hasVideo(); // returns false; } void hasVideoChanged(bool b) { // b == true media->hasVideo(); // returns true; }

MediaObject.enqueue (self, MediaSource source)

35

PyQt's Classes

Returns true if the current media may be seeked; otherwise, returns false. See also seekableChanged().

QStringList MediaObject.metaData (self, QString key)Returns the strings associated with the given key. Backends should use the keys specified in the Ogg Vorbis documentation: http://xiph.org/vorbis/doc/v-comment.html Therefore the following should work with every backend: Note that meta data is not resolved before the metaDataChanged() signal is emitted. A typical usage looks like this:setMetaArtist(media->metaData("ARTIST")); setMetaAlbum(media->metaData("ALBUM")); setMetaTitle(media->metaData("TITLE")); setMetaDate(media->metaData("DATE")); setMetaGenre(media->metaData("GENRE")); setMetaTrack(media->metaData("TRACKNUMBER")); setMetaComment(media->metaData("DESCRIPTION"));

QStringList MediaObject.metaData (self, MetaData key)Returns the strings associated with the given key. Same as above except that the keys are defined in the Phonon.MetaData enum. See also metaDataChanged().

dict-of-QString-list-of-QString MediaObject.metaData (self)Returns all meta data in a multi map. See also metaDataChanged().

MediaObject.pause (self)This method is also a Qt slot with the C++ signature void pause(). Requests playback to pause, and the media object to enter the PausedState. If it was paused already, nothing changes. This function is asynchronous and the media might not be paused immediately. See also play(), stop(), and stateChanged().

MediaObject.play (self)This method is also a Qt slot with the C++ signature void play(). Requests playback of the media data to start. Playback starts when the stateChanged() signal is emitted with PlayingState. If the media object is already in a PlayingState, nothing happens. See also stop(), pause(), and stateChanged().

int MediaObject.prefinishMark (self) list-of-Phonon.MediaSource MediaObject.queue (self)Returns the queued media sources. This does list does not include the current source, returned by currentSource(). See also setQueue() and enqueue().

int MediaObject.remainingTime (self)Get the remaining time (in milliseconds) of the file currently being played. Returns the remaining time in milliseconds.

bool MediaObject.isSeekable (self)

36

PyQt's Classes

See also totalTime(), currentTime(), and totalTimeChanged().

MediaObject.seek (self, int time)This method is also a Qt slot with the C++ signature void seek(qint64). Requests a seek to the time indicated, specified in milliseconds. You can only seek if state() is PlayingState, BufferingState or PausedState. The call is asynchronous, so currentTime can still be the old value right after this method was called. If all you need is a slider that shows the current position and allows the user to seek, use the class SeekSlider. If the current source of the media object is not seekable, calls to this functions do nothing. See also SeekSlider and tick().

MediaObject.setCurrentSource (self, MediaSource source)Set the media source the MediaObject should use. After the media object receives a new source, it will enter the LoadingState. When it is ready to play, it enters the StoppedState unless another state has been requested, e.g., by calling play(). source is the MediaSource object to the media data. You can just as well use a QUrl or QString (for a local file) here. We show an example:QUrl url("http://www.example.com/music.ogg"); media->setCurrentSource(url);

See also currentSource() and MediaSource.

MediaObject.setPrefinishMark (self, int msecToEnd) MediaObject.setQueue (self, list-of-Phonon.MediaSource sources)Set the sources to play when the current source has finished. This function will overwrite the current queue. See also clearQueue() and enqueue().

MediaObject.setQueue (self, list-of-QUrl urls)Set the urls to play when the current media has finished. This function overwrites the current queue. See also clearQueue() and enqueue().

MediaObject.setTickInterval (self, int newTickInterval)This method is also a Qt slot with the C++ signature void setTickInterval(qint32).

MediaObject.setTransitionTime (self, int msec) State MediaObject.state (self)Returns the current Phonon.State of the object. See also Phonon.State and stateChanged().

MediaObject.stop (self)This method is also a Qt slot with the C++ signature void stop(). Requests playback to stop, and the media object to enter the StoppedState. If it was stopped before nothing changes. This function is asynchronous and the media might not be stopped immediately. See also play(), pause(), and stateChanged().

int MediaObject.remainingTime (self)

37

PyQt's Classes

int MediaObject.tickInterval (self) int MediaObject.totalTime (self)Get the total time (in milliseconds) of the file currently being played. Returns the total time in milliseconds. Warning: The total time is not defined before the media object enters the LoadingState. See also totalTimeChanged().

int MediaObject.transitionTime (self)

Qt Signal Documentationvoid aboutToFinish ()This is the default overload of this signal. Emitted before the playback of the whole queue ends. When this signal is emitted you still have time to enqueue() a new MediaSource, so that playback continues. If you need a signal to be emitted at a specific time before playback is finished, you should use the prefinishMarkReached() signal instead. See also enqueue(), prefinishMark, and prefinishMarkReached().

void bufferStatus (int)This is the default overload of this signal. Provides information about the status of the buffer. When a MediaObject is in the BufferingState, it will send this signal regularly. percentFilled is a number between 0 and 100 telling you how much the buffer is filled. You can use this signal to show a progress bar to the user when in BufferingState:progressBar->setRange(0, 100); // this is the default connect(media, SIGNAL(bufferStatus(int)), progressBar, SLOT(setValue(int)));

Note that the BufferingState is commonly used when waiting for data over a network connection, but this might not be true for all backends.

void currentSourceChanged (const Phonon::MediaSource&)This is the default overload of this signal. Emitted when the MediaObject fetches a new MediaSource from the queue() and before it enters the LoadingState for the new source. The media object will take a new source from the queue() when it has finished the playback of the current source. newSource is the source that starts to play at the time the signal is emitted.

void finished ()This is the default overload of this signal. Emitted when the object has finished playback. It is not emitted if you call stop(), pause() or load(). It is emitted only when the current media source has finished playing and the media queue() is empty, or when a fatal error occurs. Warning: This signal is not emitted when the current source has finished and there's another source in the queue. It is only emitted when the queue is empty. See also currentSourceChanged(), aboutToFinish(), and prefinishMarkReached().

void hasVideoChanged (bool)This is the default overload of this signal. Emitted whenever the return value of hasVideo() changes, i.e., the media source being played back contains video. Normally you'll check hasVideo() first and then let this signal tell you whether video is available now or not. That way you don't have to poll hasVideo(). hasVideo is true when the stream contains video and adding a VideoWidget will show a video, and false if there is no video data in the stream and adding a VideoWidget will show an empty (black) VideoWidget.

int MediaObject.tickInterval (self)

38

PyQt's Classes

void metaDataChanged ()This is the default overload of this signal. This signal is emitted when the media object has resolved new meta data. This will happen before the media object leaves the LoadingState after a new source has been set. This signal is not emitted when the media object removes the current data, i.e., when a new source is set or an error has occurred. If you need to know this, you can listen for the ErrorState, and connect to the currentSourceChanged() signal. You can get the new meta data with the metaData methods. See also metaData(), currentSourceChanged(), stateChanged(), and Phonon.State.

void prefinishMarkReached (qint32)This is the default overload of this signal. Emitted when there are only msecToEnd milliseconds left of playback. Warning: This signal is not emitted when there is another source in the queue. It is only emitted when the queue is empty. See also setPrefinishMark(), prefinishMark(), aboutToFinish(), and finished().

void seekableChanged (bool)This is the default overload of this signal. This signal is emitted when the media object's ability to seek in the media stream changes. isSeekable is true if it is possible to seek(); otherwise, it is false. Change in the ability to seek in the stream usually happens when the current source changes or when an error occurs. Normally you'll check isSeekable() after setting a new media source, and then let this signal tell you when seeking is possible. That way you don't have to poll isSeekable().

void stateChanged (Phonon::State,Phonon::State)This is the default overload of this signal. This signal is emitted when the state of the MediaObject has changed. The oldstate and newstate parameters indicate the previous state and current state of the media object. If you are only interested in the new state of the media object, you can connect this signal to a slot that accepts only one State argument.

void tick (qint64)This is the default overload of this signal. This signal is emitted in intervals defined by the tickInterval property. The current position of the media object in the stream is given by the time parameter. The time is specified in milliseconds. See also tickInterval.

void totalTimeChanged (qint64)This is the default overload of this signal. This signal is emitted as soon as the total time of the media file is known or has changed. For most non-local media data the total time of the media can only be known after some time. At that time the totalTime function can not return useful information. You have to wait for this signal to know the real total time. newTotalTime is the length of the media file in milliseconds. See also totalTime(). PyQt 4.8.2 for X11 Copyright Riverbank Computing Ltd and Nokia 2010 Qt 4.7.1

void metaDataChanged ()

39

PyQt's Classes

Home All Classes Modules

Phonon.MediaSource Class Reference[phonon module]

The MediaSource class provides multimedia data for media objects. More...

Types enum Type { Invalid, LocalFile, Url, Disc, Stream, Empty }

Methods __init__ (self, QString fileName) __init__ (self, QUrl url) __init__ (self, DiscType discType, QString deviceName = QString()) __init__ (self, QIODevice ioDevice) __init__ (self, MediaSource rhs) bool autoDelete (self) QString deviceName (self) DiscType discType (self) QString fileName (self) setAutoDelete (self, bool enable) Type type (self) QUrl url (self)

Special Methods bool __eq__ (self, MediaSource rhs) bool __ne__ (self, MediaSource rhs)

Detailed DescriptionThe MediaSource class provides multimedia data for media objects. The MediaSource class manages a source of multimedia content, such as a music or video file, of which data is given to a MediaObject. The media source knows how fetch its data from several sources, e.g., from files, a QIODevice, or a CD. The possible source types are described by the Type enum. The type of the source is set by the media source itself, and is dependent on the constructor used to create it. Note that it is possible to provide data from any source by implementing a QIODevice. The class has several functions to acquire information about the source it manages, e.g., fileName() and url(). The return from these functions are dependent on the type() of the media source. Normally, a programmer does not need to be concerned with media sources. It's constructors are implicit, so one can, for instance, send an URL or filename directly to the constructors of the MediaObject.MediaObject m; QString fileName("/home/foo/bar.ogg"); QUrl url("http://www.example.com/stream.mp3"); QBuffer *someBuffer; m.setCurrentSource(fileName); m.setCurrentSource(url); m.setCurrentSource(someBuffer); m.setCurrentSource(Phonon.Cd);

A MediaSource object cannot be reused for another multimedia source. It is possible to play the same source again, and also stop and start a non-seekable media source, such as a radio stream, with the same MediaSource object.

Qt BackendsCurrently, Qt's backends support files in local and remote locations. Support for other sources, such as CD/DVD, are planned for the future.

Type DocumentationMediaSource.TypeIdentifies the type of media described by the MediaSource object. Constant Phonon.MediaSource.Invalid Value -1 Description The MediaSource object does not describe any valid source.

Phonon.MediaSource Class Reference[phonon module]

40

PyQt's Classes

Phonon.MediaSource.LocalFile 0 Phonon.MediaSource.Url Phonon.MediaSource.Disc Phonon.MediaSource.Stream Phonon.MediaSource.Empty See also MediaSource.type(). 1 2 3 4

The MediaSource object describes a local file. The MediaSource object describes an URL, which can be either a local file or a file on the network. The MediaSource object describes a disc, e.g., a CD. The MediaSource object describes a data stream. This is the type used for QIODevices. Note that a stream opened with a QUrl, will still be of the Url type. The media source doesn't have a source.

Method DocumentationMediaSource.__init__ (self, QString fileName)Creates a MediaSource object for the file specified by fileName. You can also use this constructor with Qt resources

MediaSource.__init__ (self, QUrl url) MediaSource.__init__ (self, DiscType discType, QString deviceName = QString())Creates a MediaSource object for a the URL specified by url. If the multimedia content you would like to play back is on a remote network location, you should use this constructor; though, it also possible to specify an URL to a local file. See also QUrl.

MediaSource.__init__ (self, QIODevice ioDevice)Creates a MediaSource object for the type of disc specified by discType in the named device referred to by deviceName. Note: deviceName is a platform dependent device name. It can be useful to specify this if the computer has more than one CD drive. On KDE, it is recommended to use the Solid hardware discovery framework to retrieve the device name in a portable way.

MediaSource.__init__ (self, MediaSource rhs) bool MediaSource.autoDelete (self)Returns the setting of the auto-delete option. The default is false. See also setAutoDelete().

QString MediaSource.deviceName (self)Returns the device name of the MediaSource if type() == Disc; otherwise returns QString(). See also type().

DiscType MediaSource.discType (self)Returns the disc type of the MediaSource if type() == Disc; otherwise returns NoDisc. See also type().

QString MediaSource.fileName (self)Returns the file name of the MediaSource if type() == LocalFile; otherwise, returns QString(). See also type().

MediaSource.setAutoDelete (self, bool enable)If enable is true, the media source will take ownership of the object passed in the MediaSource's constructor object that was passed in the constructor; otherwise, the programmer is responsible for deletion of this object. This setting is false by default. If you enable it, you should only access the stream or device as long as you keep the media source object around. As long as you keep the media source wrapping the stream or device, the object will not get deleted. See also autoDelete().

Type MediaSource.type (self)Returns the type of the MediaSource (depends on the constructor that was used).

MediaSource.Type

41

PyQt's Classes

See also Type.

QUrl MediaSource.url (self)Returns the URL of the MediaSource if type() == URL or type() == LocalFile; otherwise returns QUrl(). See also type().

bool MediaSource.__eq__ (self, MediaSource rhs) bool MediaSource.__ne__ (self, MediaSource rhs)PyQt 4.8.2 for X11 Copyright Riverbank Computing Ltd and Nokia 2010 Qt 4.7.1

Type MediaSource.type (self)

42

PyQt's Classes

Home All Classes Modules

phonon ModulePhonon is a cross-platform multimedia framework that enables the use of audio and video content in PyQt applications. More...

Types class Phonon

Detailed DescriptionPhonon is a cross-platform multimedia framework that enables the use of audio and video content in Qt applications. The Phonon namespace contains a list of all classes, functions and namespaces provided by the module. To import the module use, for example, the following statement:from PyQt4 import phonon

The Phonon module is part of the Qt Desktop Edition and the Qt Open Source Edition.

License InformationThis file is part of the KDE project Copyright (C) 2005-2007 Matthias Kretz Copyright (C) 2007-2008 Trolltech ASA. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Phonon Overview Introduction Architecture Media Objects Sinks Processors Playback Building Graphs Audio Audio Effects Video Backends Querying Backends for Support Installing Phonon Windows Linux Mac OS X Work in Progress

IntroductionMultimedia is content that combines multiple forms of media information, such as audio, text, animations and video, within a single stream of data, and which is often used to provide a basic level of interactivity in applications. Qt uses the Phonon multimedia framework to provide functionality for playback of the most common multimedia formats.Th