diff --git a/designer/phononcollection.cpp b/designer/phononcollection.cpp index 1843859d..7cba856d 100644 --- a/designer/phononcollection.cpp +++ b/designer/phononcollection.cpp @@ -1,106 +1,106 @@ /* Copyright (C) 2011 Harald Sitter This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), Nokia Corporation (or its successors, if any) and the KDE Free Qt Foundation, which shall act as a proxy defined in Section 6 of version 3 of the license. 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Designer of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Nokia. ** ** 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 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** $QT_END_LICENSE$ ** ****************************************************************************/ #include "seeksliderplugin.h" #include "videoplayerplugin.h" #include "videowidgetplugin.h" #include "volumesliderplugin.h" #include #include class PhononCollection: public QObject, public QDesignerCustomWidgetCollectionInterface { Q_OBJECT #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) Q_PLUGIN_METADATA(IID "org.kde.phonon.PhononCollection") #endif Q_INTERFACES(QDesignerCustomWidgetCollectionInterface) public: explicit PhononCollection(QObject *parent = 0); - virtual QList customWidgets() const; + virtual QList customWidgets() const override; private: QList m_plugins; }; PhononCollection::PhononCollection(QObject *parent) : QObject(parent) { const QString group = QLatin1String("Phonon"); m_plugins.push_back(new SeekSliderPlugin(group, this)); m_plugins.push_back(new VideoPlayerPlugin(group, this)); m_plugins.push_back(new VideoWidgetPlugin(group, this)); m_plugins.push_back(new VolumeSliderPlugin(group, this)); } QList PhononCollection::customWidgets() const { return m_plugins; } #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) Q_EXPORT_PLUGIN(PhononCollection) #endif #include "phononcollection.moc" diff --git a/designer/seeksliderplugin.h b/designer/seeksliderplugin.h index d9654031..79ad9dae 100644 --- a/designer/seeksliderplugin.h +++ b/designer/seeksliderplugin.h @@ -1,71 +1,71 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Designer of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Nokia. ** ** 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 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef SEEKSLIDER_PLUGIN_H #define SEEKSLIDER_PLUGIN_H #include class SeekSliderPlugin: public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: explicit SeekSliderPlugin(const QString &group, QObject *parent = 0); - virtual QString name() const; - virtual QString group() const; - virtual QString toolTip() const; - virtual QString whatsThis() const; - virtual QString includeFile() const; - virtual QIcon icon() const; - virtual bool isContainer() const; - virtual QWidget *createWidget(QWidget *parent); - virtual bool isInitialized() const; - virtual void initialize(QDesignerFormEditorInterface *core); - virtual QString domXml() const; + virtual QString name() const override; + virtual QString group() const override; + virtual QString toolTip() const override; + virtual QString whatsThis() const override; + virtual QString includeFile() const override; + virtual QIcon icon() const override; + virtual bool isContainer() const override; + virtual QWidget *createWidget(QWidget *parent) override; + virtual bool isInitialized() const override; + virtual void initialize(QDesignerFormEditorInterface *core) override; + virtual QString domXml() const override; private: const QString m_group; bool m_initialized; }; #endif // SEEKSLIDER_PLUGIN_H diff --git a/designer/videoplayerplugin.h b/designer/videoplayerplugin.h index 782bff21..5ca4f686 100644 --- a/designer/videoplayerplugin.h +++ b/designer/videoplayerplugin.h @@ -1,71 +1,71 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Designer of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Nokia. ** ** 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 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef VIDEOPLAYER_PLUGIN_H #define VIDEOPLAYER_PLUGIN_H #include class VideoPlayerPlugin: public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: explicit VideoPlayerPlugin(const QString &group, QObject *parent = 0); - virtual QString name() const; - virtual QString group() const; - virtual QString toolTip() const; - virtual QString whatsThis() const; - virtual QString includeFile() const; - virtual QIcon icon() const; - virtual bool isContainer() const; - virtual QWidget *createWidget(QWidget *parent); - virtual bool isInitialized() const; - virtual void initialize(QDesignerFormEditorInterface *core); - virtual QString domXml() const; + virtual QString name() const override; + virtual QString group() const override; + virtual QString toolTip() const override; + virtual QString whatsThis() const override; + virtual QString includeFile() const override; + virtual QIcon icon() const override; + virtual bool isContainer() const override; + virtual QWidget *createWidget(QWidget *parent) override; + virtual bool isInitialized() const override; + virtual void initialize(QDesignerFormEditorInterface *core) override; + virtual QString domXml() const override; private: const QString m_group; bool m_initialized; }; #endif // VIDEOPLAYER_PLUGIN_H diff --git a/designer/videoplayertaskmenu.h b/designer/videoplayertaskmenu.h index fc7f8d03..8c5609b3 100644 --- a/designer/videoplayertaskmenu.h +++ b/designer/videoplayertaskmenu.h @@ -1,112 +1,112 @@ /* Copyright (C) 2011 Harald Sitter This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), Nokia Corporation (or its successors, if any) and the KDE Free Qt Foundation, which shall act as a proxy defined in Section 6 of version 3 of the license. 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Designer of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Nokia. ** ** 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 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef VIDEOPLAYERTASKMENU_H #define VIDEOPLAYERTASKMENU_H #include #include #include #include namespace Phonon { class VideoPlayer; } class VideoPlayerTaskMenu: public QObject, public QDesignerTaskMenuExtension { Q_OBJECT Q_INTERFACES(QDesignerTaskMenuExtension) public: explicit VideoPlayerTaskMenu(Phonon::VideoPlayer *object, QObject *parent = 0); - virtual QList taskActions() const; + virtual QList taskActions() const override; private slots: void slotLoad(); void slotMimeTypes(); void mediaObjectStateChanged(Phonon::State newstate, Phonon::State oldstate); private: Phonon::VideoPlayer *m_widget; QAction *m_displayMimeTypesAction; QAction *m_loadAction; QAction *m_playAction; QAction *m_pauseAction; QAction *m_stopAction; QList m_taskActions; }; class VideoPlayerTaskMenuFactory : public QExtensionFactory { Q_OBJECT public: VideoPlayerTaskMenuFactory(QExtensionManager *parent = 0); protected: QObject *createExtension(QObject *object, - const QString &iid, QObject *parent) const; + const QString &iid, QObject *parent) const override; }; #endif // VIDEOPLAYERTASKMENU_H diff --git a/designer/videowidgetplugin.h b/designer/videowidgetplugin.h index ce79809d..940e15a3 100644 --- a/designer/videowidgetplugin.h +++ b/designer/videowidgetplugin.h @@ -1,51 +1,51 @@ /* Copyright (C) 2011 Harald Sitter This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), Nokia Corporation (or its successors, if any) and the KDE Free Qt Foundation, which shall act as a proxy defined in Section 6 of version 3 of the license. 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef VIDEOWIDGET_PLUGIN_H #define VIDEOWIDGET_PLUGIN_H #include class VideoWidgetPlugin: public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: explicit VideoWidgetPlugin(const QString &group, QObject *parent = 0); - virtual QString name() const; - virtual QString group() const; - virtual QString toolTip() const; - virtual QString whatsThis() const; - virtual QString includeFile() const; - virtual QIcon icon() const; - virtual bool isContainer() const; - virtual QWidget *createWidget(QWidget *parent); - virtual bool isInitialized() const; - virtual void initialize(QDesignerFormEditorInterface *core); - virtual QString domXml() const; + virtual QString name() const override; + virtual QString group() const override; + virtual QString toolTip() const override; + virtual QString whatsThis() const override; + virtual QString includeFile() const override; + virtual QIcon icon() const override; + virtual bool isContainer() const override; + virtual QWidget *createWidget(QWidget *parent) override; + virtual bool isInitialized() const override; + virtual void initialize(QDesignerFormEditorInterface *core) override; + virtual QString domXml() const override; private: const QString m_group; bool m_initialized; }; #endif // VIDEOWIDGET_PLUGIN_H diff --git a/designer/volumesliderplugin.h b/designer/volumesliderplugin.h index 47705d14..97a0c98a 100644 --- a/designer/volumesliderplugin.h +++ b/designer/volumesliderplugin.h @@ -1,71 +1,71 @@ /**************************************************************************** ** ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Designer of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Nokia. ** ** 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 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef VOLUMESLIDER_PLUGIN_H #define VOLUMESLIDER_PLUGIN_H #include class VolumeSliderPlugin: public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: explicit VolumeSliderPlugin(const QString &group, QObject *parent = 0); - virtual QString name() const; - virtual QString group() const; - virtual QString toolTip() const; - virtual QString whatsThis() const; - virtual QString includeFile() const; - virtual QIcon icon() const; - virtual bool isContainer() const; - virtual QWidget *createWidget(QWidget *parent); - virtual bool isInitialized() const; - virtual void initialize(QDesignerFormEditorInterface *core); - virtual QString domXml() const; + virtual QString name() const override; + virtual QString group() const override; + virtual QString toolTip() const override; + virtual QString whatsThis() const override; + virtual QString includeFile() const override; + virtual QIcon icon() const override; + virtual bool isContainer() const override; + virtual QWidget *createWidget(QWidget *parent) override; + virtual bool isInitialized() const override; + virtual void initialize(QDesignerFormEditorInterface *core) override; + virtual QString domXml() const override; private: const QString m_group; bool m_initialized; }; #endif // VOLUMESLIDER_PLUGIN_H diff --git a/phonon/abstractaudiooutput_p.h b/phonon/abstractaudiooutput_p.h index 278aa0a2..009ed8d4 100644 --- a/phonon/abstractaudiooutput_p.h +++ b/phonon/abstractaudiooutput_p.h @@ -1,46 +1,46 @@ /* This file is part of the KDE project Copyright (C) 2006 Matthias Kretz This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), Nokia Corporation (or its successors, if any) and the KDE Free Qt Foundation, which shall act as a proxy defined in Section 6 of version 3 of the license. 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef PHONON_ABSTRACTAUDIOOUTPUT_P_H #define PHONON_ABSTRACTAUDIOOUTPUT_P_H #include "abstractaudiooutput.h" #include "medianode_p.h" #include "phonondefs_p.h" namespace Phonon { class AbstractAudioOutputPrivate : public MediaNodePrivate { P_DECLARE_PUBLIC(AbstractAudioOutput) PHONON_PRIVATEABSTRACTCLASS public: - virtual QObject *qObject() { return q_func(); } + virtual QObject *qObject() override { return q_func(); } protected: AbstractAudioOutputPrivate(CastId castId = AbstractAudioOutputPrivateType) : MediaNodePrivate(castId) { } }; } //namespace Phonon #endif // PHONON_ABSTRACTAUDIOOUTPUT_P_H diff --git a/phonon/abstractmediastream_p.h b/phonon/abstractmediastream_p.h index 2d0ba0d8..23060242 100644 --- a/phonon/abstractmediastream_p.h +++ b/phonon/abstractmediastream_p.h @@ -1,79 +1,79 @@ /* This file is part of the KDE project Copyright (C) 2007 Matthias Kretz This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), Nokia Corporation (or its successors, if any) and the KDE Free Qt Foundation, which shall act as a proxy defined in Section 6 of version 3 of the license. 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef ABSTRACTMEDIASTREAM_P_H #define ABSTRACTMEDIASTREAM_P_H #include "phonon_export.h" #include "abstractmediastream.h" #include "mediaobject_p.h" #include "streaminterface.h" #include "medianodedestructionhandler_p.h" #ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM class MediaObjectPrivate; namespace Phonon { class PHONON_EXPORT AbstractMediaStreamPrivate : private MediaNodeDestructionHandler { friend class MediaObject; P_DECLARE_PUBLIC(AbstractMediaStream) public: void setStreamInterface(StreamInterface *); void setMediaObjectPrivate(MediaObjectPrivate *); ~AbstractMediaStreamPrivate(); protected: AbstractMediaStreamPrivate() : streamSize(0), streamSeekable(false), ignoreWrites(false), streamInterface(0), mediaObjectPrivate(0), errorType(NoError) { } virtual void setStreamSize(qint64 newSize); virtual void setStreamSeekable(bool s); virtual void writeData(const QByteArray &data); virtual void endOfData(); - void phononObjectDestroyed(MediaNodePrivate *); + void phononObjectDestroyed(MediaNodePrivate *) override; AbstractMediaStream *q_ptr; qint64 streamSize; bool streamSeekable; bool ignoreWrites; StreamInterface *streamInterface; MediaObjectPrivate *mediaObjectPrivate; Phonon::ErrorType errorType; QString errorText; }; } // namespace Phonon #endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM #endif // ABSTRACTMEDIASTREAM_P_H // vim: sw=4 sts=4 et tw=100 diff --git a/phonon/effect_p.h b/phonon/effect_p.h index 82ca4885..5803b161 100644 --- a/phonon/effect_p.h +++ b/phonon/effect_p.h @@ -1,57 +1,57 @@ /* This file is part of the KDE project Copyright (C) 2006-2007 Matthias Kretz This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), Nokia Corporation (or its successors, if any) and the KDE Free Qt Foundation, which shall act as a proxy defined in Section 6 of version 3 of the license. 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef EFFECT_P_H #define EFFECT_P_H #include "effect.h" #include "effectparameter.h" #include "medianode_p.h" #include #include #include "phonondefs_p.h" #ifndef QT_NO_PHONON_EFFECT namespace Phonon { class EffectPrivate : public MediaNodePrivate { P_DECLARE_PUBLIC(Effect) PHONON_PRIVATECLASS public: - virtual QObject *qObject() { return q_func(); } + virtual QObject *qObject() override { return q_func(); } protected: EffectPrivate() { } //X Effect::Type type; EffectDescription description; QHash parameterValues; }; } //namespace Phonon #endif //QT_NO_PHONON_EFFECT #endif // EFFECT_P_H // vim: sw=4 ts=4 tw=80 diff --git a/phonon/experimental/videodataoutput2.h b/phonon/experimental/videodataoutput2.h index f46a0e4a..76aca3d2 100644 --- a/phonon/experimental/videodataoutput2.h +++ b/phonon/experimental/videodataoutput2.h @@ -1,80 +1,80 @@ /* This file is part of the KDE project Copyright (C) 2008 Matthias Kretz This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), Nokia Corporation (or its successors, if any) and the KDE Free Qt Foundation, which shall act as a proxy defined in Section 6 of version 3 of the license. 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef PHONON_VIDEODATAOUTPUT2_H #define PHONON_VIDEODATAOUTPUT2_H #include "export.h" #include #include "abstractvideodataoutput.h" namespace Phonon { namespace Experimental { class VideoDataOutput2Private; /** * \short This class gives you the video data. * * This class implements a special AbstractVideoOutput that gives your * application the video data. * * You can also use the video data for further processing (e.g. encoding and * saving to a file). * * \author Matthias Kretz */ class PHONONEXPERIMENTAL_EXPORT VideoDataOutput2 : public QObject, public AbstractVideoDataOutput { Q_OBJECT P_DECLARE_PRIVATE(VideoDataOutput2) PHONON_HEIR(VideoDataOutput2) protected: - virtual void frameReady(const VideoFrame2 &); + virtual void frameReady(const VideoFrame2 &) override; - virtual void endOfMedia(); + virtual void endOfMedia() override; Q_SIGNALS: /** * The signal is emitted whenever a frame should be displayed. * nowStamp is the current time, outStamp tells the users * what time the frame should be displayed with. * * The relevant frames should be fetched and displayed using frameForTime * method. */ void frameReadySignal(const Phonon::Experimental::VideoFrame2 &); /** * This signal is emitted after the last frameReady signal of a * media is emitted. */ void endOfMediaSignal(); }; } // namespace Experimental } //namespace Phonon #endif // PHONON_VIDEODATAOUTPUT2_H diff --git a/phonon/experimental/visualization_p.h b/phonon/experimental/visualization_p.h index f7ea53c7..03f32232 100644 --- a/phonon/experimental/visualization_p.h +++ b/phonon/experimental/visualization_p.h @@ -1,51 +1,51 @@ /* This file is part of the KDE project Copyright (C) 2006 Matthias Kretz This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), Nokia Corporation (or its successors, if any) and the KDE Free Qt Foundation, which shall act as a proxy defined in Section 6 of version 3 of the license. 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef PHONON_VISUALIZATION_P_H #define PHONON_VISUALIZATION_P_H #include "visualization.h" #include "../medianode_p.h" #include "../medianodedestructionhandler_p.h" #include "../phonondefs_p.h" namespace Phonon { namespace Experimental { class VisualizationPrivate : public MediaNodePrivate, private MediaNodeDestructionHandler { P_DECLARE_PUBLIC(Visualization) PHONON_PRIVATECLASS public: - virtual QObject *qObject() { return q_func(); } + virtual QObject *qObject() override { return q_func(); } protected: VisualizationDescription description; private: void phononObjectDestroyed(MediaNodePrivate *); }; } // namespace Experimental } // namespace Phonon #endif // PHONON_VISUALIZATION_P_H // vim: sw=4 ts=4 tw=80 diff --git a/phonon/iodevicestream_p.h b/phonon/iodevicestream_p.h index 4b7274be..e63ba0f8 100644 --- a/phonon/iodevicestream_p.h +++ b/phonon/iodevicestream_p.h @@ -1,54 +1,54 @@ /* This file is part of the KDE project Copyright (C) 2007 Matthias Kretz This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), Nokia Corporation (or its successors, if any) and the KDE Free Qt Foundation, which shall act as a proxy defined in Section 6 of version 3 of the license. 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef PHONON_IODEVICESTREAM_P_H #define PHONON_IODEVICESTREAM_P_H #include "abstractmediastream.h" #ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM class QIODevice; namespace Phonon { class IODeviceStreamPrivate; class IODeviceStream : public AbstractMediaStream { Q_OBJECT Q_DECLARE_PRIVATE(IODeviceStream) public: explicit IODeviceStream(QIODevice *ioDevice, QObject *parent = 0); ~IODeviceStream(); - void reset(); - void needData(); - void seekStream(qint64); + void reset() override; + void needData() override; + void seekStream(qint64) override; }; } // namespace Phonon #endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM #endif // PHONON_IODEVICESTREAM_P_H diff --git a/phonon/mediacontroller.cpp b/phonon/mediacontroller.cpp index 2d67b683..e9523727 100644 --- a/phonon/mediacontroller.cpp +++ b/phonon/mediacontroller.cpp @@ -1,345 +1,345 @@ /* Copyright (C) 2007 Matthias Kretz Copyright (C) 2008 Ian Monroe Copyright (C) 2011 Harald Sitter This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), Nokia Corporation (or its successors, if any) and the KDE Free Qt Foundation, which shall act as a proxy defined in Section 6 of version 3 of the license. 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #include "mediacontroller.h" #include "mediaobject.h" #include "addoninterface.h" #include #include #include #include #include "frontendinterface_p.h" #ifndef QT_NO_PHONON_MEDIACONTROLLER namespace Phonon { class MediaControllerPrivate : public FrontendInterfacePrivate { public: MediaControllerPrivate(MediaObject *mp) : FrontendInterfacePrivate(mp) {} - virtual void backendObjectChanged(QObject *); + virtual void backendObjectChanged(QObject *) override; MediaController *q; }; MediaController::MediaController(MediaObject *mp) : QObject(mp) , d(new MediaControllerPrivate(mp)) { d->q = this; d->_backendObjectChanged(); setSubtitleAutodetect(true); } void MediaControllerPrivate::backendObjectChanged(QObject *m_backendObject) { QObject::connect(m_backendObject, SIGNAL(availableSubtitlesChanged()), q, SIGNAL(availableSubtitlesChanged())); QObject::connect(m_backendObject, SIGNAL(availableAudioChannelsChanged()), q, SIGNAL(availableAudioChannelsChanged())); QObject::connect(m_backendObject, SIGNAL(titleChanged(int)), q, SIGNAL(titleChanged(int))); QObject::connect(m_backendObject, SIGNAL(availableTitlesChanged(int)), q, SIGNAL(availableTitlesChanged(int))); QObject::connect(m_backendObject, SIGNAL(chapterChanged(int)), q, SIGNAL(chapterChanged(int))); QObject::connect(m_backendObject, SIGNAL(availableChaptersChanged(int)), q, SIGNAL(availableChaptersChanged(int))); QObject::connect(m_backendObject, SIGNAL(angleChanged(int)), q, SIGNAL(angleChanged(int))); QObject::connect(m_backendObject, SIGNAL(availableAnglesChanged(int)), q, SIGNAL(availableAnglesChanged(int))); } MediaController::~MediaController() { delete d; } #define IFACE \ AddonInterface *iface = d->iface(); \ if (!iface) return MediaController::Features MediaController::supportedFeatures() const { if (!d || !d->media) { return Features(); } IFACE Features(); Features ret; if (iface->hasInterface(AddonInterface::AngleInterface)) { ret |= Angles; } if (iface->hasInterface(AddonInterface::ChapterInterface)) { ret |= Chapters; } if (iface->hasInterface(AddonInterface::NavigationInterface)) { ret |= Navigations; } if (iface->hasInterface(AddonInterface::TitleInterface)) { ret |= Titles; } if (iface->hasInterface(AddonInterface::SubtitleInterface)) { ret |= Subtitles; } if(iface->hasInterface(AddonInterface::AudioChannelInterface)) { ret |= AudioChannels; } return ret; } // -- Angle Control -- // int MediaController::availableAngles() const { IFACE 0; return iface->interfaceCall(AddonInterface::AngleInterface, AddonInterface::availableAngles).toInt(); } int MediaController::currentAngle() const { IFACE 0; return iface->interfaceCall(AddonInterface::AngleInterface, AddonInterface::angle).toInt(); } void MediaController::setCurrentAngle(int titleNumber) { IFACE; iface->interfaceCall(AddonInterface::AngleInterface, AddonInterface::setAngle, QList() << QVariant(titleNumber)); } // -- Chapter Control -- // int MediaController::availableChapters() const { IFACE 0; return iface->interfaceCall(AddonInterface::ChapterInterface, AddonInterface::availableChapters).toInt(); } int MediaController::currentChapter() const { IFACE 0; return iface->interfaceCall(AddonInterface::ChapterInterface, AddonInterface::chapter).toInt(); } void MediaController::setCurrentChapter(int titleNumber) { IFACE; iface->interfaceCall(AddonInterface::ChapterInterface, AddonInterface::setChapter, QList() << QVariant(titleNumber)); } // -- Navigation Menu Control -- // QString MediaController::navigationMenuToString(NavigationMenu menu) { switch (menu) { case RootMenu: return tr("Main Menu"); case TitleMenu : return tr("Title Menu"); case AudioMenu: return tr("Audio Menu"); case SubtitleMenu: return tr("Subtitle Menu"); case ChapterMenu: return tr("Chapter Menu"); case AngleMenu: return tr("Angle Menu"); } return QString(); } QList MediaController::availableMenus() const { QList menus; IFACE menus; menus = iface->interfaceCall(AddonInterface::NavigationInterface, AddonInterface::availableMenus).value< QList >(); return menus; } void MediaController::setCurrentMenu(NavigationMenu menu) { IFACE; iface->interfaceCall(AddonInterface::NavigationInterface, AddonInterface::setMenu, QList() << QVariant::fromValue(menu)); } // -- Title Control -- // int MediaController::availableTitles() const { IFACE 0; return iface->interfaceCall(AddonInterface::TitleInterface, AddonInterface::availableTitles).toInt(); } int MediaController::currentTitle() const { IFACE 0; return iface->interfaceCall(AddonInterface::TitleInterface, AddonInterface::title).toInt(); } void MediaController::setCurrentTitle(int titleNumber) { IFACE; iface->interfaceCall(AddonInterface::TitleInterface, AddonInterface::setTitle, QList() << QVariant(titleNumber)); } bool MediaController::autoplayTitles() const { IFACE true; return iface->interfaceCall(AddonInterface::TitleInterface, AddonInterface::autoplayTitles).toBool(); } void MediaController::setAutoplayTitles(bool b) { IFACE; iface->interfaceCall(AddonInterface::TitleInterface, AddonInterface::setAutoplayTitles, QList() << QVariant(b)); } void MediaController::nextTitle() { setCurrentTitle(currentTitle() + 1); } void MediaController::previousTitle() { setCurrentTitle(currentTitle() - 1); } // -- Audio Channel & Subtitle Control -- // AudioChannelDescription MediaController::currentAudioChannel() const { IFACE AudioChannelDescription(); return iface->interfaceCall(AddonInterface::AudioChannelInterface, AddonInterface::currentAudioChannel).value(); } bool MediaController::subtitleAutodetect() const { IFACE true; return iface->interfaceCall(AddonInterface::SubtitleInterface, AddonInterface::subtitleAutodetect).toBool(); } void MediaController::setSubtitleAutodetect(bool enable) { IFACE; iface->interfaceCall(AddonInterface::SubtitleInterface, AddonInterface::setSubtitleAutodetect, QList() << QVariant(enable)); } QString MediaController::subtitleEncoding() const { IFACE QString(); return iface->interfaceCall(AddonInterface::SubtitleInterface, AddonInterface::subtitleEncoding).toString(); } void MediaController::setSubtitleEncoding(const QString &encoding) { IFACE; if (!QTextCodec::availableCodecs().contains(encoding.toLocal8Bit())) return; iface->interfaceCall(AddonInterface::SubtitleInterface, AddonInterface::setSubtitleEncoding, QList() << QVariant(encoding)); } void MediaController::setSubtitleFont(const QFont &font) { IFACE; iface->interfaceCall(AddonInterface::SubtitleInterface, AddonInterface::setSubtitleFont, QList() << QVariant(font)); } QFont MediaController::subtitleFont() const { IFACE QFont(); return iface->interfaceCall(AddonInterface::SubtitleInterface, AddonInterface::subtitleFont).value(); } SubtitleDescription MediaController::currentSubtitle() const { IFACE SubtitleDescription(); return iface->interfaceCall(AddonInterface::SubtitleInterface, AddonInterface::currentSubtitle).value(); } QList MediaController::availableAudioChannels() const { QList retList; IFACE retList; retList = iface->interfaceCall(AddonInterface::AudioChannelInterface, AddonInterface::availableAudioChannels).value< QList >(); return retList; } QList MediaController::availableSubtitles() const { QList retList; IFACE retList; retList = iface->interfaceCall(AddonInterface::SubtitleInterface, AddonInterface::availableSubtitles) .value< QList >(); return retList; } void MediaController::setCurrentAudioChannel(const Phonon::AudioChannelDescription &stream) { IFACE; iface->interfaceCall(AddonInterface::AudioChannelInterface, AddonInterface::setCurrentAudioChannel, QList() << qVariantFromValue(stream)); } void MediaController::setCurrentSubtitle(const Phonon::SubtitleDescription &stream) { IFACE; iface->interfaceCall(AddonInterface::SubtitleInterface, AddonInterface::setCurrentSubtitle, QList() << qVariantFromValue(stream)); } void MediaController::setCurrentSubtitle(const QUrl &url) { IFACE; iface->interfaceCall(AddonInterface::SubtitleInterface, AddonInterface::setCurrentSubtitleFile, QList() << url); } #undef IFACE } // namespace Phonon #endif //QT_NO_PHONON_MEDIACONTROLLER #include "moc_mediacontroller.cpp" // vim: sw=4 sts=4 et tw=100 diff --git a/phonon/mediaobject_p.h b/phonon/mediaobject_p.h index 3c90c3ea..e6a8ce58 100644 --- a/phonon/mediaobject_p.h +++ b/phonon/mediaobject_p.h @@ -1,162 +1,162 @@ /* This file is part of the KDE project Copyright (C) 2006-2007 Matthias Kretz This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), Nokia Corporation (or its successors, if any) and the KDE Free Qt Foundation, which shall act as a proxy defined in Section 6 of version 3 of the license. 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef MEDIAOBJECT_P_H #define MEDIAOBJECT_P_H #include #include #ifdef HAVE_QZEITGEIST #include #include #endif #include "medianode_p.h" #include "medianodedestructionhandler_p.h" #include "mediaobject.h" #include "mediasource.h" #include "phonondefs_p.h" namespace Phonon { class FrontendInterfacePrivate; class StatesValidator; class MediaObjectPrivate : public MediaNodePrivate, private MediaNodeDestructionHandler { friend class KioFallbackImpl; friend class AbstractMediaStream; friend class AbstractMediaStreamPrivate; P_DECLARE_PUBLIC(MediaObject) public: - virtual QObject *qObject() { return q_func(); } + virtual QObject *qObject() override { return q_func(); } /** * Sends the metadata for this media file to the Zeitgeist tracker * * \param eventInterpretation The interpretation of the event * \param eventManifestation The manifestation type of the event * \param eventActor The application or entity responsible for emitting the zeitgeist event * \param eventTimestamp The time * \param subjectURI The file's URI * \param subjectText A free-form annotation * \param subjectInterpretation The interpretation type * \param subjectManifestation The manifestation type * \param subjectMimetype The file's mimetype */ void sendToZeitgeist(const QString &event_interpretation, const QString &event_manifestation, const QString &event_actor, const QDateTime &subject_timestamp, const QUrl &subject_uri, const QString &subject_text, const QString &subject_interpretation, const QString &subject_manifestation, const QString &subject_mimetype); void sendToZeitgeist(State); void sendToZeitgeist(); QList interfaceList; protected: - virtual bool aboutToDeleteBackendObject(); - virtual void createBackendObject(); - virtual void phononObjectDestroyed(MediaNodePrivate *); + virtual bool aboutToDeleteBackendObject() override; + virtual void createBackendObject() override; + virtual void phononObjectDestroyed(MediaNodePrivate *) override; PHONON_EXPORT void setupBackendObject(); void _k_resumePlay(); void _k_resumePause(); void _k_metaDataChanged(const QMultiMap &); void _k_aboutToFinish(); void _k_currentSourceChanged(const MediaSource &); PHONON_EXPORT void _k_stateChanged(Phonon::State, Phonon::State); #ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM void streamError(Phonon::ErrorType, const QString &); #endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM MediaObjectPrivate() : currentTime(0), tickInterval(0), metaData(), errorString(), prefinishMark(0), transitionTime(0), // gapless playback #ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM abstractStream(0), #endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM state(Phonon::LoadingState), readyForZeitgeist(false), playingQueuedSource(false) #ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM , errorType(Phonon::NormalError), errorOverride(false), ignoreLoadingToBufferingStateChange(false), ignoreErrorToLoadingStateChange(false), validateStates(!(qgetenv("PHONON_ASSERT_STATES").isEmpty())), validator(0) #endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM { #ifdef HAVE_QZEITGEIST log = new QZeitgeist::Log(); #endif } ~MediaObjectPrivate() { #ifdef HAVE_QZEITGEIST delete log; #endif } qint64 currentTime; qint32 tickInterval; QMultiMap metaData; QString errorString; qint32 prefinishMark; qint32 transitionTime; #ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM AbstractMediaStream *abstractStream; #endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM State state #ifdef QT_NO_PHONON_ABSTRACTMEDIASTREAM ; #else : 8; bool readyForZeitgeist; bool playingQueuedSource; ErrorType errorType : 4; bool errorOverride : 1; bool ignoreLoadingToBufferingStateChange : 1; bool ignoreErrorToLoadingStateChange : 1; #endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM MediaSource mediaSource; QQueue sourceQueue; #ifdef HAVE_QZEITGEIST QZeitgeist::Log *log; #endif bool validateStates; StatesValidator *validator; }; } #endif // MEDIAOBJECT_P_H // vim: sw=4 ts=4 tw=80 diff --git a/phonon/objectdescriptionmodel.h b/phonon/objectdescriptionmodel.h index 8a708bf3..11599f78 100644 --- a/phonon/objectdescriptionmodel.h +++ b/phonon/objectdescriptionmodel.h @@ -1,383 +1,383 @@ /* This file is part of the KDE project Copyright (C) 2006-2007 Matthias Kretz This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), Nokia Corporation (or its successors, if any) and the KDE Free Qt Foundation, which shall act as a proxy defined in Section 6 of version 3 of the license. 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef PHONON_OBJECTDESCRIPTIONMODEL_H #define PHONON_OBJECTDESCRIPTIONMODEL_H #include "phonon_export.h" #include "phonondefs.h" #include "objectdescription.h" #include #include #include #ifndef QT_NO_PHONON_OBJECTDESCRIPTIONMODEL namespace Phonon { class ObjectDescriptionModelDataPrivate; /** \internal * \class ObjectDescriptionModelData objectdescriptionmodel.h phonon/ObjectDescriptionModelData * \brief Data class for models for ObjectDescription objects. * * \author Matthias Kretz */ class PHONON_EXPORT ObjectDescriptionModelData { public: /** * Returns the number of rows in the model. This value corresponds * to the size of the list passed through setModelData. * * \param parent The optional \p parent argument is used in most models to specify * the parent of the rows to be counted. Because this is a list if a * valid parent is specified the result will always be 0. * * Reimplemented from QAbstractItemModel. * * \see QAbstractItemModel::rowCount */ int rowCount(const QModelIndex &parent = QModelIndex()) const; /** * Returns data from the item with the given \p index for the specified * \p role. * If the view requests an invalid index, an invalid variant is * returned. * * Reimplemented from QAbstractItemModel. * * \see QAbstractItemModel::data * \see Qt::ItemDataRole */ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; /** * Reimplemented to show unavailable devices as disabled (but still * selectable). */ Qt::ItemFlags flags(const QModelIndex &index) const; /** * Returns a list of indexes in the same order as they are in the * model. The indexes come from the ObjectDescription::index * method. * * This is useful to let the user define a list of preference. */ QList tupleIndexOrder() const; /** * Returns the ObjectDescription::index for the tuple * at the given position \p positionIndex. For example a * QComboBox will give you the currentIndex as the * position in the list. But to select the according * AudioOutputDevice using AudioOutputDevice::fromIndex * you can use this method. * * \param positionIndex The position in the list. */ int tupleIndexAtPositionIndex(int positionIndex) const; /** * Returns the MIME data that dropMimeData() can use to create new * items. */ QMimeData *mimeData(ObjectDescriptionType type, const QModelIndexList &indexes) const; /** * Moves the item at the given \p index up. In the resulting list * the items at index.row() and index.row() - 1 are swapped. * * Connected views are updated automatically. */ void moveUp(const QModelIndex &index); /** * Moves the item at the given \p index down. In the resulting list * the items at index.row() and index.row() + 1 are swapped. * * Connected views are updated automatically. */ void moveDown(const QModelIndex &index); void setModelData(const QList > &data); QList > modelData() const; QExplicitlySharedDataPointer modelData(const QModelIndex &index) const; Qt::DropActions supportedDropActions() const; bool dropMimeData(ObjectDescriptionType type, const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent); bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()); QStringList mimeTypes(ObjectDescriptionType type) const; ObjectDescriptionModelData(QAbstractListModel *); protected: ~ObjectDescriptionModelData(); //ObjectDescriptionModelData(ObjectDescriptionModelDataPrivate *dd); ObjectDescriptionModelDataPrivate *const d; }; /* Required to ensure template class vtables are exported on both symbian and existing builds. */ #if defined(Q_OS_SYMBIAN) && defined(Q_CC_RVCT) // RVCT compiler (2.2.686) requires the export declaration to be on the class to export vtables // MWC compiler works both ways // GCCE compiler is unknown (it can't compile QtCore yet) #define PHONON_TEMPLATE_CLASS_EXPORT PHONON_EXPORT #define PHONON_TEMPLATE_CLASS_MEMBER_EXPORT #else // Windows builds (at least) do not support export declaration on templated class // But if you export a member function, the vtable is implicitly exported #define PHONON_TEMPLATE_CLASS_EXPORT #define PHONON_TEMPLATE_CLASS_MEMBER_EXPORT PHONON_EXPORT #endif /** \class ObjectDescriptionModel objectdescriptionmodel.h Phonon/ObjectDescriptionModel * \short The ObjectDescriptionModel class provides a model from * a list of ObjectDescription objects. * * ObjectDescriptionModel is a readonly model that supplies a list * using ObjectDescription::name() for the text and * ObjectDescription::description() for the tooltip. If set the properties * "icon" and "available" are used to set the decoration and disable the * item (disabled only visually, you can still select and drag it). * * It also provides the methods moveUp() and moveDown() to order the list. * Additionally drag and drop is possible so that * QAbstractItemView::InternalMove can be used. * The resulting order of the ObjectDescription::index() values can then be * retrieved using tupleIndexOrder(). * * An example use case would be to give the user a QComboBox to select * the output device: * \code * QComboBox *cb = new QComboBox(parentWidget); * ObjectDescriptionModel *model = new ObjectDescriptionModel(cb); * model->setModelData(BackendCapabilities::availableAudioOutputDevices()); * cb->setModel(model); * cb->setCurrentIndex(0); // select first entry * \endcode * * And to retrieve the selected AudioOutputDevice: * \code * int cbIndex = cb->currentIndex(); * AudioOutputDevice selectedDevice = model->modelData(cbIndex); * \endcode * * \ingroup Frontend * \author Matthias Kretz */ template class PHONON_TEMPLATE_CLASS_EXPORT ObjectDescriptionModel : public QAbstractListModel { public: Q_OBJECT_CHECK /** \internal */ static PHONON_TEMPLATE_CLASS_MEMBER_EXPORT const QMetaObject staticMetaObject; /** \internal */ - PHONON_TEMPLATE_CLASS_MEMBER_EXPORT const QMetaObject *metaObject() const; + PHONON_TEMPLATE_CLASS_MEMBER_EXPORT const QMetaObject *metaObject() const override; /** \internal */ - PHONON_TEMPLATE_CLASS_MEMBER_EXPORT void *qt_metacast(const char *_clname); + PHONON_TEMPLATE_CLASS_MEMBER_EXPORT void *qt_metacast(const char *_clname) override; //int qt_metacall(QMetaObject::Call _c, int _id, void **_a); /** * Returns the number of rows in the model. This value corresponds * to the size of the list passed through setModelData. * * \param parent The optional \p parent argument is used in most models to specify * the parent of the rows to be counted. Because this is a list if a * valid parent is specified the result will always be 0. * * Reimplemented from QAbstractItemModel. * * \see QAbstractItemModel::rowCount */ - inline int rowCount(const QModelIndex &parent = QModelIndex()) const { return d->rowCount(parent); } //krazy:exclude=inline + inline int rowCount(const QModelIndex &parent = QModelIndex()) const override { return d->rowCount(parent); } //krazy:exclude=inline /** * Returns data from the item with the given \p index for the specified * \p role. * If the view requests an invalid index, an invalid variant is * returned. * * Reimplemented from QAbstractItemModel. * * \see QAbstractItemModel::data * \see Qt::ItemDataRole */ - inline QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const { return d->data(index, role); } //krazy:exclude=inline + inline QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override { return d->data(index, role); } //krazy:exclude=inline /** * Reimplemented to show unavailable devices as disabled (but still * selectable). */ - inline Qt::ItemFlags flags(const QModelIndex &index) const { return d->flags(index); } //krazy:exclude=inline + inline Qt::ItemFlags flags(const QModelIndex &index) const override { return d->flags(index); } //krazy:exclude=inline /** * Returns a list of indexes in the same order as they are in the * model. The indexes come from the ObjectDescription::index * method. * * This is useful to let the user define a list of preference. */ inline QList tupleIndexOrder() const { return d->tupleIndexOrder(); } //krazy:exclude=inline /** * Returns the ObjectDescription::index for the tuple * at the given position \p positionIndex. For example a * QComboBox will give you the currentIndex as the * position in the list. But to select the according * AudioOutputDevice using AudioOutputDevice::fromIndex * you can use this method. * * \param positionIndex The position in the list. */ inline int tupleIndexAtPositionIndex(int positionIndex) const { return d->tupleIndexAtPositionIndex(positionIndex); } //krazy:exclude=inline /** * Returns the MIME data that dropMimeData() can use to create new * items. */ - inline QMimeData *mimeData(const QModelIndexList &indexes) const { return d->mimeData(type, indexes); } //krazy:exclude=inline + inline QMimeData *mimeData(const QModelIndexList &indexes) const override { return d->mimeData(type, indexes); } //krazy:exclude=inline /** * Moves the item at the given \p index up. In the resulting list * the items at index.row() and index.row() - 1 are swapped. * * Connected views are updated automatically. */ inline void moveUp(const QModelIndex &index) { d->moveUp(index); } //krazy:exclude=inline /** * Moves the item at the given \p index down. In the resulting list * the items at index.row() and index.row() + 1 are swapped. * * Connected views are updated automatically. */ inline void moveDown(const QModelIndex &index) { d->moveDown(index); } //krazy:exclude=inline /** * Constructs a ObjectDescription model with the * given \p parent. */ explicit inline ObjectDescriptionModel(QObject *parent = 0) : QAbstractListModel(parent), d(new ObjectDescriptionModelData(this)) {} //krazy:exclude=inline /** * Constructs a ObjectDescription model with the * given \p parent and the given \p data. */ explicit inline ObjectDescriptionModel(const QList > &data, QObject *parent = 0) //krazy:exclude=inline : QAbstractListModel(parent), d(new ObjectDescriptionModelData(this)) { setModelData(data); } /** * Sets the model data using the list provided by \p data. * * All previous model data is cleared. */ inline void setModelData(const QList > &data) { //krazy:exclude=inline QList > list; for (int i = 0; i < data.count(); ++i) { list += data.at(i).d; } d->setModelData(list); } /** * Returns the model data. * * As the order of the list might have changed this can be different * to what was set using setModelData(). */ inline QList > modelData() const { //krazy:exclude=inline QList > ret; QList > list = d->modelData(); for (int i = 0; i < list.count(); ++i) { ret << ObjectDescription(list.at(i)); } return ret; } /** * Returns one ObjectDescription of the model data for the given \p index. */ inline ObjectDescription modelData(const QModelIndex &index) const { return ObjectDescription(d->modelData(index)); } //krazy:exclude=inline /** * This model supports drag and drop to copy or move * items. */ - inline Qt::DropActions supportedDropActions() const { return d->supportedDropActions(); } //krazy:exclude=inline + inline Qt::DropActions supportedDropActions() const override { return d->supportedDropActions(); } //krazy:exclude=inline /** * Accept drops from other models of the same ObjectDescriptionType. * * If a valid \p parent is given the dropped items will be inserted * above that item. */ - inline bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) { //krazy:exclude=inline + inline bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override { //krazy:exclude=inline return d->dropMimeData(type, data, action, row, column, parent); } /** * Removes count rows starting with the given row. * * If a valid \p parent is given no rows are removed since this is a * list model. * * Returns true if the rows were successfully removed; otherwise returns false. */ - inline bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) { //krazy:exclude=inline + inline bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override { //krazy:exclude=inline return d->removeRows(row, count, parent); } /** * Returns a list of supported drag and drop MIME types. Currently * it only supports one type used internally. */ - inline QStringList mimeTypes() const { return d->mimeTypes(type); } //krazy:exclude=inline + inline QStringList mimeTypes() const override { return d->mimeTypes(type); } //krazy:exclude=inline protected: ObjectDescriptionModelData *const d; }; typedef ObjectDescriptionModel AudioOutputDeviceModel; typedef ObjectDescriptionModel AudioCaptureDeviceModel; typedef ObjectDescriptionModel VideoCaptureDeviceModel; typedef ObjectDescriptionModel EffectDescriptionModel; typedef ObjectDescriptionModel AudioChannelDescriptionModel; typedef ObjectDescriptionModel SubtitleDescriptionModel; /* typedef ObjectDescriptionModel VideoOutputDeviceModel; typedef ObjectDescriptionModel AudioCodecDescriptionModel; typedef ObjectDescriptionModel VideoCodecDescriptionModel; typedef ObjectDescriptionModel ContainerFormatDescriptionModel; typedef ObjectDescriptionModel VisualizationDescriptionModel;*/ } #endif //QT_NO_PHONON_OBJECTDESCRIPTIONMODEL #endif // PHONON_OBJECTDESCRIPTIONMODEL_H // vim: sw=4 ts=4 tw=80 diff --git a/phonon/phonondefs_p.h b/phonon/phonondefs_p.h index bd4ea063..d3530544 100644 --- a/phonon/phonondefs_p.h +++ b/phonon/phonondefs_p.h @@ -1,380 +1,380 @@ /* Copyright (C) 2006-2007 Matthias Kretz Copyright (C) 2011 Harald Sitter This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), Nokia Corporation (or its successors, if any) and the KDE Free Qt Foundation, which shall act as a proxy defined in Section 6 of version 3 of the license. 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef PHONONDEFS_P_H #define PHONONDEFS_P_H #include #include "medianode_p.h" #include "phononpimpl_p.h" #define PHONON_CONCAT_HELPER_INTERNAL(x, y) x ## y #define PHONON_CONCAT_HELPER(x, y) PHONON_CONCAT_HELPER_INTERNAL(x, y) #define PHONON_PRIVATECLASS \ protected: \ - virtual bool aboutToDeleteBackendObject(); \ - virtual void createBackendObject(); \ + virtual bool aboutToDeleteBackendObject() override; \ + virtual void createBackendObject() override; \ /** * \internal * After construction of the Iface object this method is called * throughout the complete class hierarchy in order to set up the * properties that were already set on the public interface. * * An example implementation could look like this: * \code * ParentClassPrivate::setupBackendObject(); * m_iface->setPropertyA(d->propertyA); * m_iface->setPropertyB(d->propertyB); * \endcode */ \ void setupBackendObject(); #define PHONON_PRIVATEABSTRACTCLASS \ protected: \ - virtual bool aboutToDeleteBackendObject(); \ + virtual bool aboutToDeleteBackendObject() override; \ /** * \internal * After construction of the Iface object this method is called * throughout the complete class hierarchy in order to set up the * properties that were already set on the public interface. * * An example implementation could look like this: * \code * ParentClassPrivate::setupBackendObject(); * m_iface->setPropertyA(d->propertyA); * m_iface->setPropertyB(d->propertyB); * \endcode */ \ void setupBackendObject(); #define PHONON_ABSTRACTBASE_IMPL \ PHONON_CLASSNAME::PHONON_CLASSNAME(PHONON_CONCAT_HELPER(PHONON_CLASSNAME, Private) &dd, QObject *parent) \ : QObject(parent), \ MediaNode(dd) \ { \ } #define PHONON_OBJECT_IMPL \ PHONON_CLASSNAME::PHONON_CLASSNAME(QObject *parent) \ : QObject(parent), \ MediaNode(*new PHONON_CONCAT_HELPER(PHONON_CLASSNAME, Private)()) \ { \ } \ void PHONON_CONCAT_HELPER(PHONON_CLASSNAME, Private)::createBackendObject() \ { \ if (m_backendObject) \ return; \ P_Q(PHONON_CLASSNAME); \ m_backendObject = Factory::PHONON_CONCAT_HELPER(create, PHONON_CLASSNAME)(q); \ if (m_backendObject) { \ setupBackendObject(); \ } \ } #define PHONON_HEIR_IMPL(parentclass) \ PHONON_CLASSNAME::PHONON_CLASSNAME(QObject *parent) \ : parentclass(*new PHONON_CONCAT_HELPER(PHONON_CLASSNAME, Private), parent) \ { \ } \ void PHONON_CONCAT_HELPER(PHONON_CLASSNAME, Private)::createBackendObject() \ { \ if (m_backendObject) \ return; \ P_Q(PHONON_CLASSNAME); \ m_backendObject = Factory::PHONON_CONCAT_HELPER(create, PHONON_CLASSNAME)(q); \ if (m_backendObject) { \ setupBackendObject(); \ } \ } #define BACKEND_GET(returnType, returnVar, methodName) \ QMetaObject::invokeMethod(d->m_backendObject, methodName, Qt::DirectConnection, Q_RETURN_ARG(returnType, returnVar)) #define BACKEND_GET1(returnType, returnVar, methodName, varType1, var1) \ QMetaObject::invokeMethod(d->m_backendObject, methodName, Qt::DirectConnection, Q_RETURN_ARG(returnType, returnVar), Q_ARG(varType1, var1)) #define BACKEND_GET2(returnType, returnVar, methodName, varType1, var1, varType2, var2) \ QMetaObject::invokeMethod(d->m_backendObject, methodName, Qt::DirectConnection, Q_RETURN_ARG(returnType, returnVar), Q_ARG(varType1, var1), Q_ARG(varType2, var2)) #define BACKEND_CALL(methodName) \ QMetaObject::invokeMethod(d->m_backendObject, methodName, Qt::DirectConnection) #define BACKEND_CALL1(methodName, varType1, var1) \ QMetaObject::invokeMethod(d->m_backendObject, methodName, Qt::DirectConnection, Q_ARG(varType1, var1)) #define BACKEND_CALL2(methodName, varType1, var1, varType2, var2) \ QMetaObject::invokeMethod(d->m_backendObject, methodName, Qt::DirectConnection, Q_ARG(varType1, var1), Q_ARG(varType2, var2)) #define pBACKEND_GET(returnType, returnVar, methodName) \ QMetaObject::invokeMethod(m_backendObject, methodName, Qt::DirectConnection, Q_RETURN_ARG(returnType, returnVar)) #define pBACKEND_GET1(returnType, returnVar, methodName, varType1, var1) \ QMetaObject::invokeMethod(m_backendObject, methodName, Qt::DirectConnection, Q_RETURN_ARG(returnType, returnVar), Q_ARG(varType1, var1)) #define pBACKEND_GET2(returnType, returnVar, methodName, varType1, var1, varType2, var2) \ QMetaObject::invokeMethod(m_backendObject, methodName, Qt::DirectConnection, Q_RETURN_ARG(returnType, returnVar), Q_ARG(varType1, var1), Q_ARG(varType2, var2)) #define pBACKEND_CALL(methodName) \ QMetaObject::invokeMethod(m_backendObject, methodName, Qt::DirectConnection) #define pBACKEND_CALL1(methodName, varType1, var1) \ QMetaObject::invokeMethod(m_backendObject, methodName, Qt::DirectConnection, Q_ARG(varType1, var1)) #define pBACKEND_CALL2(methodName, varType1, var1, varType2, var2) \ QMetaObject::invokeMethod(m_backendObject, methodName, Qt::DirectConnection, Q_ARG(varType1, var1), Q_ARG(varType2, var2)) namespace Phonon { namespace { class NoIface; /// All template arguments are valid template struct IsValid { enum { Result = true }; }; /// except NoIface template<> struct IsValid { enum { Result = false }; }; template inline T my_cast(QObject *o) { return qobject_cast(o); } template inline T my_cast(const QObject *o) { return qobject_cast(o); } template<> inline NoIface *my_cast(QObject *) { return 0; } template<> inline NoIface *my_cast(const QObject *) { return 0; } } // anonymous namespace /** * \internal * * \brief Helper class to cast the backend object to the correct version of the interface. * * Additions to the backend interfaces cannot be done by adding virtual methods as that would * break the binary interface. So the old class is renamed and a new class with the old name * inheriting the old class is added, containing all the new virtual methods. * Example: * \code class FooInterface { public: virtual ~FooInterface() {} virtual oldMethod() = 0; }; Q_DECLARE_INTERFACE(FooInterface, "FooInterface0.phonon.kde.org") * \endcode * becomes * \code class FooInterface0 { public: virtual ~FooInterface0() {} virtual oldMethod() = 0; }; class FooInterface : public FooInterface0 { public: virtual newMethod() = 0; }; Q_DECLARE_INTERFACE(FooInterface0, "FooInterface0.phonon.kde.org") Q_DECLARE_INTERFACE(FooInterface, "FooInterface1.phonon.kde.org") * \endcode * * With this, backends compiled against the old header can be qobject_casted to FooInterface0, * but not to FooInterface. On the other hand backends compiled against the new header (they first * need to implement newMethod) can only be qobject_casted to FooInterface but not to * FooInterface0. (The qobject_cast relies on the string in Q_DECLARE_INTERFACE and not the * class name which is why it behaves that way.) * * Now, in order to call oldMethod, the code needs to try to cast to both FooInterface and * FooInterface0 (new backends will work with the former, old backends with the latter) and then * if one of them in non-zero call oldMethod on it. * * To call newMethod only a cast to FooInterface needs to be done. * * The Iface class does all this for you for up to three (for now) interface revisions. Just * create an object like this: * \code Iface iface0(d); if (iface0) { iface0->oldMethod(); } Iface iface(d); if (iface) { iface->newMethod(); } * \endcode * * This becomes a bit more convenient if you add macros like this: * \code #define IFACES1 FooInterface #define IFACES0 FooInterface0, IFACES1 * \endcode * which you can use like this: * \code Iface iface0(d); if (iface0) { iface0->oldMethod(); } Iface iface(d); if (iface) { iface->newMethod(); } * \endcode * With the next revision you can then change the macros to * \code #define IFACES2 FooInterface #define IFACES1 FooInterface1, IFACES2 #define IFACES0 FooInterface0, IFACES1 * \endcode * * \author Matthias Kretz */ template class Iface { public: static inline T0 *cast(MediaNodePrivate *const d) { if (IsValid::Result) { T0 *ret; if (IsValid::Result) { ret = reinterpret_cast(my_cast(d->m_backendObject)); if (ret) return ret; if (IsValid::Result) { ret = reinterpret_cast(my_cast(d->m_backendObject)); if (ret) return ret; if (IsValid::Result) { ret = reinterpret_cast(my_cast(d->m_backendObject)); if (ret) return ret; } } } ret = reinterpret_cast(my_cast(d->m_backendObject)); if (ret) return ret; } return qobject_cast(d->m_backendObject); } static inline const T0 *cast(const MediaNodePrivate *const d) { if (IsValid::Result) { const T0 *ret; if (IsValid::Result) { ret = reinterpret_cast(my_cast(d->m_backendObject)); if (ret) return ret; if (IsValid::Result) { ret = reinterpret_cast(my_cast(d->m_backendObject)); if (ret) return ret; if (IsValid::Result) { ret = reinterpret_cast(my_cast(d->m_backendObject)); if (ret) return ret; } } } ret = reinterpret_cast(my_cast(d->m_backendObject)); if (ret) return ret; } return qobject_cast(d->m_backendObject); } inline Iface(MediaNodePrivate *const d) : iface(cast(d)) {} inline operator T0 *() { return iface; } inline operator const T0 *() const { return iface; } inline T0 *operator->() { Q_ASSERT(iface); return iface; } inline const T0 *operator->() const { Q_ASSERT(iface); return iface; } private: T0 *const iface; }; template class ConstIface { public: inline ConstIface(const MediaNodePrivate *const d) : iface(Iface::cast(d)) {} inline operator const T0 *() const { return iface; } inline const T0 *operator->() const { Q_ASSERT(iface); return iface; } private: const T0 *const iface; }; } // namespace Phonon #define INTERFACE_CALL(function) \ Iface::cast(d)->function #define pINTERFACE_CALL(function) \ Iface::cast(this)->function #define PHONON_GETTER(rettype, name, retdefault) \ rettype PHONON_CLASSNAME::name() const \ { \ const PHONON_CONCAT_HELPER(PHONON_CLASSNAME, Private) *d = k_func(); \ if (!d->m_backendObject) \ return retdefault; \ rettype ret; \ BACKEND_GET(rettype, ret, #name); \ return ret; \ } #define PHONON_INTERFACE_GETTER(rettype, name, retdefault) \ rettype PHONON_CLASSNAME::name() const \ { \ const PHONON_CONCAT_HELPER(PHONON_CLASSNAME, Private) *d = k_func(); \ if (!d->m_backendObject) \ return retdefault; \ return Iface::cast(d)->name(); \ } #define PHONON_GETTER1(rettype, name, retdefault, argtype1, argvar1) \ rettype PHONON_CLASSNAME::name(argtype1 argvar1) const \ { \ const PHONON_CONCAT_HELPER(PHONON_CLASSNAME, Private) *d = k_func(); \ if (!d->m_backendObject) \ return retdefault; \ rettype ret; \ BACKEND_GET1(rettype, ret, #name, const QObject *, argvar1->k_ptr->backendObject()); \ return ret; \ } #define PHONON_INTERFACE_GETTER1(rettype, name, retdefault, argtype1, argvar1) \ rettype PHONON_CLASSNAME::name(argtype1 argvar1) const \ { \ const PHONON_CONCAT_HELPER(PHONON_CLASSNAME, Private) *d = k_func(); \ if (!d->m_backendObject) \ return retdefault; \ return Iface::cast(d)->name(argvar1->k_ptr->backendObject()); \ } #define PHONON_SETTER(functionname, privatevar, argtype1) \ void PHONON_CLASSNAME::functionname(argtype1 x) \ { \ PHONON_CONCAT_HELPER(PHONON_CLASSNAME, Private) *d = k_func(); \ d->privatevar = x; \ if (k_ptr->backendObject()) { \ BACKEND_CALL1(#functionname, argtype1, x); \ } \ } #define PHONON_INTERFACE_SETTER(functionname, privatevar, argtype1) \ void PHONON_CLASSNAME::functionname(argtype1 x) \ { \ PHONON_CONCAT_HELPER(PHONON_CLASSNAME, Private) *d = k_func(); \ d->privatevar = x; \ if (k_ptr->backendObject()) { \ Iface::cast(d)->functionname(x); \ } \ } #ifndef METATYPE_QLIST_INT_DEFINED #define METATYPE_QLIST_INT_DEFINED // Want this exactly once, see phonondefs_p.h kcm/outputdevicechoice.cpp Q_DECLARE_METATYPE(QList) #endif #endif // PHONONDEFS_P_H diff --git a/phonon/swiftslider_p.h b/phonon/swiftslider_p.h index 2f861320..b3b89d45 100644 --- a/phonon/swiftslider_p.h +++ b/phonon/swiftslider_p.h @@ -1,72 +1,72 @@ /* This file is part of the KDE project Copyright (C) 2006-2008 Ricardo Villalba This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), Nokia Corporation (or its successors, if any) and the KDE Free Qt Foundation, which shall act as a proxy defined in Section 6 of version 3 of the license. 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef SWIFTSLIDER_H #define SWIFTSLIDER_H #include #include #if !defined(QT_NO_PHONON_SEEKSLIDER) && !defined(QT_NO_PHONON_VOLUMESLIDER) namespace Phonon { /** \class SwiftSlider swiftslider_p.h phonon/SwiftSlider * \short Modified QSlider that allows sudden/quick moves instead of stepped moves ("Click'n'Go" QSlider) * * This is an internal class used by SeekSlider and VolumeSlider. * * Ricardo Villalba, the original author of MySlider.cpp (from the SMPlayer project) * gave his permission for the inclusion of this code inside Phonon by * switching MySlider.cpp to the LGPLv2.1+ license. * See http://smplayer.svn.sourceforge.net/viewvc/smplayer/smplayer/trunk/src/myslider.cpp?revision=2406&view=markup * * The original discussion about a "Click'n'Go QSlider": http://lists.trolltech.com/qt-interest/2006-11/msg00363.html * * \ingroup PhononWidgets */ class SwiftSlider : public QSlider { Q_OBJECT public: SwiftSlider(Qt::Orientation orientation, QWidget * parent); ~SwiftSlider(); signals: void scrollStart(); void scrollEnd(); private: - void mousePressEvent(QMouseEvent *event); - void wheelEvent(QWheelEvent *event); + void mousePressEvent(QMouseEvent *event) override; + void wheelEvent(QWheelEvent *event) override; inline int pick(const QPoint &pt) const; int pixelPosToRangeValue(int pos) const; QTimer m_wheelTimer; }; } // namespace Phonon #endif //QT_NO_PHONON_VOLUMESLIDER && QT_NO_PHONON_VOLUMESLIDER #endif //SWIFTSLIDER_H diff --git a/phonon/videoplayer.h b/phonon/videoplayer.h index 1e3e65c3..8f7502b7 100644 --- a/phonon/videoplayer.h +++ b/phonon/videoplayer.h @@ -1,204 +1,204 @@ /* This file is part of the KDE project Copyright (C) 2004-2007 Matthias Kretz This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), Nokia Corporation (or its successors, if any) and the KDE Free Qt Foundation, which shall act as a proxy defined in Section 6 of version 3 of the license. 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef Phonon_VIDEOPLAYER_H #define Phonon_VIDEOPLAYER_H #include "phonon_export.h" #include "phononnamespace.h" #include "mediasource.h" #include #ifndef QT_NO_PHONON_VIDEOPLAYER namespace Phonon { class VideoPlayerPrivate; class MediaObject; class AudioOutput; class VideoWidget; /** \class VideoPlayer videoplayer.h phonon/VideoPlayer * \short Playback class for simple tasks. * * With %VideoPlayer you can get results quickly and easily. You can do the standard * playback tasks like play, pause and stop, but also set a playback volume and * seek (there's no guarantee that the seek will work, though). * * Keep in mind that when the %VideoPlayer instance is deleted the playback will * stop. * * A play and forget code example: * \code * VideoPlayer *player = new VideoPlayer(parentWidget); * connect(player, SIGNAL(finished()), player, SLOT(deleteLater())); * player->play(url); * \endcode * * \ingroup Playback * \ingroup PhononVideo * \author Matthias Kretz */ class PHONON_EXPORT VideoPlayer : public QWidget { Q_OBJECT public: /** * Constructs a new %VideoPlayer instance. * * \param category The category used for the audio output device. * \param parent The QObject parent. */ explicit VideoPlayer(Phonon::Category category, QWidget *parent = 0); /** * Constructs a new video widget with a \p parent * using Phonon::VideoCategory as its category. * * \param parent The QObject parent. */ VideoPlayer(QWidget *parent = 0); /** * On destruction the playback is stopped, also the audio output is * removed so that the desktop mixer will not show the application * anymore. If you need a persistent audio output don't use * %VideoPlayer but MediaObject, VideoPath and VideoOutput. */ ~VideoPlayer(); /** * Get the total time (in milliseconds) of the file currently being played. */ qint64 totalTime() const; /** * Get the current time (in milliseconds) of the file currently being played. */ qint64 currentTime() const; /** * This is the current volume of the output as voltage factor. * * 1.0 means 100%, 0.5 means 50% voltage/25% power, 0.0 means 0% */ float volume() const; /** * \returns \c true if it is currently playing * \returns \c false if it is currently stopped or paused */ bool isPlaying() const; /** * \returns \c true if it is currently paused * \returns \c false if it is currently playing or stopped */ bool isPaused() const; /** * getter for the MediaObject. */ MediaObject *mediaObject() const; /** * getter for the AudioOutput. */ AudioOutput *audioOutput() const; /** * getter for the VideoWidget. */ VideoWidget *videoWidget() const; public Q_SLOTS: /** * Starts preloading the media data and fill audiobuffers in the * backend. * * When there's already a media playing (or paused) it will be stopped * (the finished signal will not be emitted). */ void load(const Phonon::MediaSource &source); /** * Play the media at the given URL. Starts playback as fast as possible. * This can take a considerable time depending on the URL and the * backend. * * If you need low latency between calling play() and the sound actually * starting to play on your output device you need to use MediaObject * and be able to set the URL before calling play(). Note that * \code * audioPlayer->load(url); * audioPlayer->play(); * \endcode * doesn't make a difference: the application should be idle between the * load and play calls so that the backend can start preloading the * media and fill audio buffers. */ void play(const Phonon::MediaSource &source); /** * Continues playback of a paused media. Restarts playback of a stopped * media. */ void play(); /** * Pauses the playback. */ void pause(); /** * Stops the playback. */ void stop(); /** * Seeks to the requested time. Note that the backend is free to ignore * the seek request if the media source isn't seekable. * * \param ms Time in milliseconds from the start of the media. */ void seek(qint64 ms); /** * Sets the volume of the output as voltage factor. * * 1.0 means 100%, 0.5 means 50% voltage/25% power, 0.0 means 0% */ void setVolume(float volume); Q_SIGNALS: /** * This signal is emitted when the playback finished. */ void finished(); protected: - bool event(QEvent *); + bool event(QEvent *) override; VideoPlayerPrivate *const d; }; } //namespace Phonon #endif //QT_NO_PHONON_VIDEOPLAYER #endif // Phonon_VIDEOPLAYER_H // vim: sw=4 ts=4 tw=80 diff --git a/phonon/videowidget.h b/phonon/videowidget.h index 86d9930e..9fc2ee73 100644 --- a/phonon/videowidget.h +++ b/phonon/videowidget.h @@ -1,216 +1,216 @@ /* This file is part of the KDE project Copyright (C) 2005-2007 Matthias Kretz This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), Nokia Corporation (or its successors, if any) and the KDE Free Qt Foundation, which shall act as a proxy defined in Section 6 of version 3 of the license. 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef Phonon_VIDEOWIDGET_H #define Phonon_VIDEOWIDGET_H #include "phonon_export.h" #include "phonondefs.h" #include "abstractvideooutput.h" #include class QString; #ifndef QT_NO_PHONON_VIDEO namespace Phonon { class AbstractVideoOutput; class VideoWidgetPrivate; /** \class VideoWidget videowidget.h phonon/VideoWidget * \short Widget to display video. * * This widget shows the video signal. * * \code * MediaObject *media = new MediaObject(parent); * VideoWidget *vwidget = new VideoWidget(parent); * Phonon::createPath(media, vwidget); * \endcode * * \ingroup PhononVideo * \ingroup PhononWidgets * \author Matthias Kretz */ class PHONON_EXPORT VideoWidget : public QWidget, public Phonon::AbstractVideoOutput { P_DECLARE_PRIVATE(VideoWidget) Q_OBJECT Q_ENUMS(AspectRatio ScaleMode) /** * This property holds whether the video is shown using the complete * screen. * * The property differs from QWidget::fullScreen in that it is * writeable. * * By default the widget is not shown in fullScreen. * * \warning When switching the video to fullscreen using setFullScreen * your application loses control over the widget that actually shows * the video (which is then shown as a toplevel window while your * application still uses this widget). If you only need to capture key * events the event forwarding done internally should suffice for your * needs. If you need to map mouse coordinates or add widgets (that are * not overlays) you should probably handle fullscreen yourself. */ Q_PROPERTY(bool fullScreen READ isFullScreen WRITE setFullScreen) /** * * Defaults to AspectRatioAuto. * * \see AspectRatio */ Q_PROPERTY(AspectRatio aspectRatio READ aspectRatio WRITE setAspectRatio) /** * If the size of the widget and the size of the video are not equal. * The video will be zoomed to fit the widget. The smaller zoom * (AddBarsScaleMode) adds black bars at the left/right or top/bottom to * make all of the image visible (default). The bigger zoom (ExpandMode) * fills the widget completely, keeping all information in one direction * and leaving parts of the image outside of the widget in the other * direction. */ Q_PROPERTY(ScaleMode scaleMode READ scaleMode WRITE setScaleMode) /** * This property holds brightness of the video. * * Default is 0. Acceptable values are in range of -1, 1. */ Q_PROPERTY(qreal brightness READ brightness WRITE setBrightness) /** * This property holds the contrast of the video. * * Default is 0. Acceptable values are in range of -1, 1. */ Q_PROPERTY(qreal contrast READ contrast WRITE setContrast) /** * This property holds the hue of the video. * * Default is 0. Acceptable values are in range of -1, 1. */ Q_PROPERTY(qreal hue READ hue WRITE setHue) /** * This property holds saturation of the video. * * Default is 0. Acceptable values are in range of -1, 1. */ Q_PROPERTY(qreal saturation READ saturation WRITE setSaturation) public: /** * Defines the width:height to be used for the video. */ enum AspectRatio { /** * Let the decoder find the aspect ratio automatically from the * media file (this is the default). */ AspectRatioAuto = 0, /** * Fits the video into the widget making the aspect ratio depend * solely on the size of the widget. This way the aspect ratio * is freely resizeable by the user. */ AspectRatioWidget = 1, /** * Make width/height == 4/3, which is the old TV size and * monitor size (1024/768 == 4/3). (4:3) */ AspectRatio4_3 = 2, /** * Make width/height == 16/9, which is the size of most current * media. (16:9) */ AspectRatio16_9 = 3 //X /** //X * Assume that every pixel of the video image needs to be displayed with the same //X * physical width and height. (1:1 image pixels, not imagewidth //X * = imageheight) //X */ //X AspectRatioSquare = 4, }; enum ScaleMode { FitInView = 0, ScaleAndCrop = 1 }; /** * Constructs a new video widget with a \p parent. */ VideoWidget(QWidget *parent = 0); AspectRatio aspectRatio() const; ScaleMode scaleMode() const; qreal brightness() const; qreal contrast() const; qreal hue() const; qreal saturation() const; QImage snapshot() const; //TODO: bar colors property public Q_SLOTS: void setFullScreen(bool fullscreen); /** * Convenience slot, calling setFullScreen(false) */ void exitFullScreen(); /** * Convenience slot, calling setFullScreen(true) */ void enterFullScreen(); void setAspectRatio(AspectRatio); void setScaleMode(ScaleMode); void setBrightness(qreal value); void setContrast(qreal value); void setHue(qreal value); void setSaturation(qreal value); protected: /** * \internal * * Constructs a new video widget with private data pointer \p d and * a \p parent. */ VideoWidget(VideoWidgetPrivate &d, QWidget *parent); - void mouseMoveEvent(QMouseEvent *); - bool event(QEvent *); + void mouseMoveEvent(QMouseEvent *) override; + bool event(QEvent *) override; }; } //namespace Phonon #endif //QT_NO_PHONON_VIDEO // vim: sw=4 ts=4 tw=80 #endif // Phonon_VIDEOWIDGET_H diff --git a/phonon/videowidget_p.h b/phonon/videowidget_p.h index cda3d1c3..061415e0 100644 --- a/phonon/videowidget_p.h +++ b/phonon/videowidget_p.h @@ -1,75 +1,75 @@ /* This file is part of the KDE project Copyright (C) 2006-2007 Matthias Kretz This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) version 3, or any later version accepted by the membership of KDE e.V. (or its successor approved by the membership of KDE e.V.), Nokia Corporation (or its successors, if any) and the KDE Free Qt Foundation, which shall act as a proxy defined in Section 6 of version 3 of the license. 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ #ifndef VIDEOWIDGET_P_H #define VIDEOWIDGET_P_H #include "videowidget.h" #include "abstractvideooutput_p.h" #include #ifndef QT_NO_PHONON_VIDEO namespace Phonon { class VideoWidgetPrivate : public Phonon::AbstractVideoOutputPrivate { P_DECLARE_PUBLIC(VideoWidget) public: - virtual QObject *qObject() { return q_func(); } + virtual QObject *qObject() override { return q_func(); } protected: - virtual bool aboutToDeleteBackendObject(); - virtual void createBackendObject(); + virtual bool aboutToDeleteBackendObject() override; + virtual void createBackendObject() override; void setupBackendObject(); VideoWidgetPrivate(VideoWidget *parent) : layout(parent), aspectRatio(VideoWidget::AspectRatioAuto), scaleMode(VideoWidget::FitInView), brightness(0), contrast(0), hue(0), saturation(0) { layout.setMargin(0); } QHBoxLayout layout; VideoWidget::AspectRatio aspectRatio; VideoWidget::ScaleMode scaleMode; Qt::WindowFlags changeFlags; qreal brightness; qreal contrast; qreal hue; qreal saturation; private: void init(); }; } // namespace Phonon #endif //QT_NO_PHONON_VIDEO #endif // VIDEOWIDGET_P_H // vim: sw=4 ts=4 tw=80