diff --git a/src/multimedia/audio/qaudio.h b/src/multimedia/audio/qaudio.h index 6395314..2ee66bc 100644 --- a/src/multimedia/audio/qaudio.h +++ b/src/multimedia/audio/qaudio.h @@ -51,12 +51,26 @@ namespace QAudio enum Error { NoError, OpenError, IOError, UnderrunError, FatalError }; enum State { ActiveState, SuspendedState, StoppedState, IdleState }; enum Mode { AudioInput, AudioOutput }; + + enum Role { + UnknownRole, + MusicRole, + VideoRole, + VoiceCommunicationRole, + AlarmRole, + NotificationRole, + RingtoneRole, + AccessibilityRole, + SonificationRole, + GameRole + }; } #ifndef QT_NO_DEBUG_STREAM Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug dbg, QAudio::Error error); Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug dbg, QAudio::State state); Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug dbg, QAudio::Mode mode); +Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug dbg, QAudio::Role role); #endif QT_END_NAMESPACE @@ -64,5 +78,6 @@ QT_END_NAMESPACE Q_DECLARE_METATYPE(QAudio::Error) Q_DECLARE_METATYPE(QAudio::State) Q_DECLARE_METATYPE(QAudio::Mode) +Q_DECLARE_METATYPE(QAudio::Role) #endif // QAUDIO_H diff --git a/src/multimedia/playback/qmediaplayer.h b/src/multimedia/playback/qmediaplayer.h index 735f111..437bf58 100644 --- a/src/multimedia/playback/qmediaplayer.h +++ b/src/multimedia/playback/qmediaplayer.h @@ -37,6 +37,7 @@ #include <QtMultimedia/qmediaobject.h> #include <QtMultimedia/qmediacontent.h> #include <QtMultimedia/qmediaenumdebug.h> +#include <QtMultimedia/qaudio.h> #include <QtNetwork/qnetworkconfiguration.h> @@ -66,6 +67,7 @@ class Q_MULTIMEDIA_EXPORT QMediaPlayer : public QMediaObject Q_PROPERTY(qreal playbackRate READ playbackRate WRITE setPlaybackRate NOTIFY playbackRateChanged) Q_PROPERTY(State state READ state NOTIFY stateChanged) Q_PROPERTY(MediaStatus mediaStatus READ mediaStatus NOTIFY mediaStatusChanged) + Q_PROPERTY(QAudio::Role audioRole READ audioRole WRITE setAudioRole) Q_PROPERTY(QString error READ errorString) Q_ENUMS(State) Q_ENUMS(MediaStatus) @@ -151,6 +153,10 @@ public: QMultimedia::AvailabilityStatus availability() const; + QAudio::Role audioRole() const; + void setAudioRole(QAudio::Role audioRole); + QList<QAudio::Role> supportedAudioRoles() const; + public Q_SLOTS: void play(); void pause(); @@ -187,6 +193,8 @@ Q_SIGNALS: void seekableChanged(bool seekable); void playbackRateChanged(qreal rate); + void audioRoleChanged(QAudio::Role role); + void error(QMediaPlayer::Error error); void networkConfigurationChanged(const QNetworkConfiguration &configuration); INFO - New header: src/multimedia/controls/qaudiorolecontrol.h /**************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 or version 3 as published by the Free ** Software Foundation and appearing in the file LICENSE.LGPLv21 and ** LICENSE.LGPLv3 included in the packaging of this file. Please review the ** following information to ensure the GNU Lesser General Public License ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** As a special exception, The Qt Company gives you certain additional ** rights. These rights are described in The Qt Company LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** $QT_END_LICENSE$ ** ****************************************************************************/
#ifndef QAUDIOROLECONTROL_H #define QAUDIOROLECONTROL_H #include <QtMultimedia/qmediacontrol.h> #include <QtMultimedia/qaudio.h> QT_BEGIN_NAMESPACE // Class forward declaration required for QDoc bug class QString; class Q_MULTIMEDIA_EXPORT QAudioRoleControl : public QMediaControl { Q_OBJECT public: virtual ~QAudioRoleControl(); virtual QAudio::Role audioRole() const = 0; virtual void setAudioRole(QAudio::Role role) = 0; virtual QList<QAudio::Role> supportedAudioRoles() const = 0; Q_SIGNALS: void audioRoleChanged(QAudio::Role role); protected: explicit QAudioRoleControl(QObject *parent = 0); }; #define QAudioRoleControl_iid "org.qt-project.qt.audiorolecontrol/5.6" Q_MEDIA_DECLARE_CONTROL(QAudioRoleControl, QAudioRoleControl_iid) QT_END_NAMESPACE #endif // QAUDIOROLECONTROL_H
_______________________________________________ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development