From 559ef5cafeb39766a7481a37168e37e9cb315bb5 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Thu, 27 Aug 2009 13:27:15 +0100 Subject: Wrapped code using QT_BEGIN/END_NAMESPACE macros --- src/3rdparty/phonon/mmf/1 | 139 ++++++++++++++++++++++++ src/3rdparty/phonon/mmf/TODO.txt | 6 - src/3rdparty/phonon/mmf/abstractmediaplayer.cpp | 6 +- src/3rdparty/phonon/mmf/abstractmediaplayer.h | 4 + src/3rdparty/phonon/mmf/abstractplayer.cpp | 5 + src/3rdparty/phonon/mmf/abstractplayer.h | 4 + src/3rdparty/phonon/mmf/audiooutput.cpp | 4 + src/3rdparty/phonon/mmf/audiooutput.h | 4 + src/3rdparty/phonon/mmf/audioplayer.cpp | 16 +-- src/3rdparty/phonon/mmf/audioplayer.h | 4 + src/3rdparty/phonon/mmf/backend.cpp | 4 + src/3rdparty/phonon/mmf/backend.h | 4 + src/3rdparty/phonon/mmf/defs.h | 4 + src/3rdparty/phonon/mmf/dummyplayer.cpp | 5 +- src/3rdparty/phonon/mmf/dummyplayer.h | 4 + src/3rdparty/phonon/mmf/mediaobject.cpp | 3 + src/3rdparty/phonon/mmf/mediaobject.h | 4 + src/3rdparty/phonon/mmf/utils.cpp | 6 + src/3rdparty/phonon/mmf/utils.h | 4 + src/3rdparty/phonon/mmf/videooutput.cpp | 18 ++- src/3rdparty/phonon/mmf/videooutput.h | 7 +- src/3rdparty/phonon/mmf/videooutputobserver.h | 4 + src/3rdparty/phonon/mmf/videoplayer.cpp | 6 + src/3rdparty/phonon/mmf/videoplayer.h | 3 + src/3rdparty/phonon/mmf/videowidget.cpp | 8 +- src/3rdparty/phonon/mmf/videowidget.h | 4 + src/3rdparty/phonon/mmf/volumeobserver.h | 4 + 27 files changed, 251 insertions(+), 33 deletions(-) create mode 100644 src/3rdparty/phonon/mmf/1 diff --git a/src/3rdparty/phonon/mmf/1 b/src/3rdparty/phonon/mmf/1 new file mode 100644 index 0000000..e5d6b26 --- /dev/null +++ b/src/3rdparty/phonon/mmf/1 @@ -0,0 +1,139 @@ +/* This file is part of the KDE project. + +Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + +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 or 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 "dummyplayer.h" + +QT_BEGIN_NAMESPACE + +using namespace Phonon; +using namespace Phonon::MMF; + +//----------------------------------------------------------------------------- +// Constructor / destructor +//----------------------------------------------------------------------------- + +MMF::DummyPlayer::DummyPlayer() +{ + +} + +MMF::DummyPlayer::DummyPlayer(const AbstractPlayer& player) + : AbstractPlayer(player) +{ + +} + + +//----------------------------------------------------------------------------- +// MediaObjectInterface +//----------------------------------------------------------------------------- + +void MMF::DummyPlayer::play() +{ + +} + +void MMF::DummyPlayer::pause() +{ + +} + +void MMF::DummyPlayer::stop() +{ + +} + +void MMF::DummyPlayer::seek(qint64) +{ + +} + +bool MMF::DummyPlayer::hasVideo() const +{ + return false; +} + +bool MMF::DummyPlayer::isSeekable() const +{ + return false; +} + +Phonon::State MMF::DummyPlayer::state() const +{ + return Phonon::LoadingState; +} + +qint64 MMF::DummyPlayer::currentTime() const +{ + return 0; +} + +QString MMF::DummyPlayer::errorString() const +{ + return QString(); +} + +Phonon::ErrorType MMF::DummyPlayer::errorType() const +{ + return Phonon::NoError; +} + +qint64 MMF::DummyPlayer::totalTime() const +{ + return 0; +} + +MediaSource MMF::DummyPlayer::source() const +{ + return MediaSource(); +} + +void MMF::DummyPlayer::setFileSource(const Phonon::MediaSource &, RFile &) +{ + +} + +void MMF::DummyPlayer::setNextSource(const MediaSource &) +{ + +} + + +//----------------------------------------------------------------------------- +// VolumeObserver +//----------------------------------------------------------------------------- + +void MMF::DummyPlayer::volumeChanged(qreal) +{ + +} + + +//----------------------------------------------------------------------------- +// AbstractPlayer +//----------------------------------------------------------------------------- + +void MMF::DummyPlayer::doSetTickInterval(qint32) +{ + +} + + + + + diff --git a/src/3rdparty/phonon/mmf/TODO.txt b/src/3rdparty/phonon/mmf/TODO.txt index 49e8074..7f20793 100644 --- a/src/3rdparty/phonon/mmf/TODO.txt +++ b/src/3rdparty/phonon/mmf/TODO.txt @@ -12,9 +12,6 @@ The following items are in rough order of priority. - Dragging of other widgets on top of / underneath the video widget These will allow the video widget's moveEvent / resizeEvent implementations to be tested. -* Write / modify a test app which allows audio effects to be enabled / disabled. - - In the simplest case, this could just be a command-line app which allows effects to be specified using flags. - * On-target testing 1. Ensure that Phonon front- and back-end libraries are included in the SIS file. 2. Add musicplayer.exe and mediaplayer.exe to the FluidLauncher @@ -40,9 +37,6 @@ Compare video frame rate obtained using default S60 media player and Qt demo app * Implement MMF::Backend::disconnectNodes This should probably be left for now, particularly until audio effects have been implemented. This is because the node connection mechanism may need to be refactored slightly once we start building up longer graphs (e.g. MediaObject -> Effect -> Effect -> AudioOutput). -* Namespace macros -For consistency with other backends, the code should be wrapped in QT_BEGIN_NAMESPACE / QT_END_NAMESPACE macros. - * Fix code layout My editor was set to use tabs for indenting, rather than the Qt standard of 4 spaces. So we can either: 1. Do "s/\t/ /g" - which will just fix the indenting diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp index 7849d87..7883709 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.cpp @@ -20,6 +20,8 @@ along with this library. If not, see . #include "defs.h" #include "utils.h" +QT_BEGIN_NAMESPACE + using namespace Phonon; using namespace Phonon::MMF; @@ -459,7 +461,5 @@ void MMF::AbstractMediaPlayer::tick() emit tick(currentTime()); } - - - +QT_END_NAMESPACE diff --git a/src/3rdparty/phonon/mmf/abstractmediaplayer.h b/src/3rdparty/phonon/mmf/abstractmediaplayer.h index 7f53a2d..51935a3 100644 --- a/src/3rdparty/phonon/mmf/abstractmediaplayer.h +++ b/src/3rdparty/phonon/mmf/abstractmediaplayer.h @@ -26,6 +26,8 @@ along with this library. If not, see . class RFile; +QT_BEGIN_NAMESPACE + namespace Phonon { namespace MMF @@ -154,5 +156,7 @@ namespace Phonon } } +QT_END_NAMESPACE + #endif diff --git a/src/3rdparty/phonon/mmf/abstractplayer.cpp b/src/3rdparty/phonon/mmf/abstractplayer.cpp index 9027f08..328ab37 100644 --- a/src/3rdparty/phonon/mmf/abstractplayer.cpp +++ b/src/3rdparty/phonon/mmf/abstractplayer.cpp @@ -19,6 +19,8 @@ along with this library. If not, see . #include "abstractplayer.h" #include "defs.h" +QT_BEGIN_NAMESPACE + using namespace Phonon; using namespace Phonon::MMF; @@ -96,3 +98,6 @@ void MMF::AbstractPlayer::videoOutputChanged() // Default behaviour is empty - overridden by VideoPlayer } + +QT_END_NAMESPACE + diff --git a/src/3rdparty/phonon/mmf/abstractplayer.h b/src/3rdparty/phonon/mmf/abstractplayer.h index 1c9ef9b..399cd5d 100644 --- a/src/3rdparty/phonon/mmf/abstractplayer.h +++ b/src/3rdparty/phonon/mmf/abstractplayer.h @@ -30,6 +30,8 @@ along with this library. If not, see . class RFile; +QT_BEGIN_NAMESPACE + namespace Phonon { namespace MMF @@ -105,5 +107,7 @@ namespace Phonon } } +QT_END_NAMESPACE + #endif diff --git a/src/3rdparty/phonon/mmf/audiooutput.cpp b/src/3rdparty/phonon/mmf/audiooutput.cpp index 82b2b82..099c899 100644 --- a/src/3rdparty/phonon/mmf/audiooutput.cpp +++ b/src/3rdparty/phonon/mmf/audiooutput.cpp @@ -23,6 +23,8 @@ along with this library. If not, see . #include "utils.h" #include "volumeobserver.h" +QT_BEGIN_NAMESPACE + using namespace Phonon; using namespace Phonon::MMF; @@ -92,3 +94,5 @@ void MMF::AudioOutput::setVolumeObserver(VolumeObserver* observer) } } + +QT_END_NAMESPACE diff --git a/src/3rdparty/phonon/mmf/audiooutput.h b/src/3rdparty/phonon/mmf/audiooutput.h index 5ecfc0d..ab90c44 100644 --- a/src/3rdparty/phonon/mmf/audiooutput.h +++ b/src/3rdparty/phonon/mmf/audiooutput.h @@ -21,6 +21,8 @@ along with this library. If not, see . #include +QT_BEGIN_NAMESPACE + namespace Phonon { namespace MMF @@ -85,4 +87,6 @@ namespace Phonon } } +QT_END_NAMESPACE + #endif diff --git a/src/3rdparty/phonon/mmf/audioplayer.cpp b/src/3rdparty/phonon/mmf/audioplayer.cpp index 41fedb4..50048c8 100644 --- a/src/3rdparty/phonon/mmf/audioplayer.cpp +++ b/src/3rdparty/phonon/mmf/audioplayer.cpp @@ -21,6 +21,8 @@ along with this library. If not, see . #include "audioplayer.h" #include "utils.h" +QT_BEGIN_NAMESPACE + using namespace Phonon; using namespace Phonon::MMF; @@ -242,17 +244,5 @@ void MMF::AudioPlayer::MaloLoadingComplete() #endif // QT_PHONON_MMF_AUDIO_DRM - - - - - - - - - - - - - +QT_END_NAMESPACE diff --git a/src/3rdparty/phonon/mmf/audioplayer.h b/src/3rdparty/phonon/mmf/audioplayer.h index 8d29547..cdb6cb9 100644 --- a/src/3rdparty/phonon/mmf/audioplayer.h +++ b/src/3rdparty/phonon/mmf/audioplayer.h @@ -34,6 +34,8 @@ typedef CMdaAudioPlayerUtility CPlayerType; typedef MMdaAudioPlayerCallback MPlayerObserverType; #endif +QT_BEGIN_NAMESPACE + namespace Phonon { namespace MMF @@ -102,4 +104,6 @@ namespace Phonon } } +QT_END_NAMESPACE + #endif diff --git a/src/3rdparty/phonon/mmf/backend.cpp b/src/3rdparty/phonon/mmf/backend.cpp index 010562e..236ef28 100644 --- a/src/3rdparty/phonon/mmf/backend.cpp +++ b/src/3rdparty/phonon/mmf/backend.cpp @@ -29,6 +29,8 @@ along with this library. If not, see . #include "utils.h" #include "videowidget.h" +QT_BEGIN_NAMESPACE + using namespace Phonon; using namespace Phonon::MMF; @@ -184,3 +186,5 @@ QStringList Backend::availableMimeTypes() const Q_EXPORT_PLUGIN2(phonon_mmf, Phonon::MMF::Backend); +QT_END_NAMESPACE + diff --git a/src/3rdparty/phonon/mmf/backend.h b/src/3rdparty/phonon/mmf/backend.h index 4fff204..b448187 100644 --- a/src/3rdparty/phonon/mmf/backend.h +++ b/src/3rdparty/phonon/mmf/backend.h @@ -22,6 +22,8 @@ along with this library. If not, see . #include #include +QT_BEGIN_NAMESPACE + namespace Phonon { namespace MMF @@ -49,4 +51,6 @@ namespace Phonon } } +QT_END_NAMESPACE + #endif diff --git a/src/3rdparty/phonon/mmf/defs.h b/src/3rdparty/phonon/mmf/defs.h index 12b8785..37a25d1 100644 --- a/src/3rdparty/phonon/mmf/defs.h +++ b/src/3rdparty/phonon/mmf/defs.h @@ -36,6 +36,8 @@ along with this library. If not, see . #define PHONON_MMF_DEBUG_VIDEO_OUTPUT +QT_BEGIN_NAMESPACE + namespace Phonon { namespace MMF @@ -52,4 +54,6 @@ namespace Phonon } } +QT_END_NAMESPACE + #endif // PHONON_MMF_DEFS_H diff --git a/src/3rdparty/phonon/mmf/dummyplayer.cpp b/src/3rdparty/phonon/mmf/dummyplayer.cpp index d9e836d..dc7f8d1 100644 --- a/src/3rdparty/phonon/mmf/dummyplayer.cpp +++ b/src/3rdparty/phonon/mmf/dummyplayer.cpp @@ -18,6 +18,8 @@ along with this library. If not, see . #include "dummyplayer.h" +QT_BEGIN_NAMESPACE + using namespace Phonon; using namespace Phonon::MMF; @@ -132,6 +134,5 @@ void MMF::DummyPlayer::doSetTickInterval(qint32) } - - +QT_END_NAMESPACE diff --git a/src/3rdparty/phonon/mmf/dummyplayer.h b/src/3rdparty/phonon/mmf/dummyplayer.h index 5846d88..12e3bd8 100644 --- a/src/3rdparty/phonon/mmf/dummyplayer.h +++ b/src/3rdparty/phonon/mmf/dummyplayer.h @@ -21,6 +21,8 @@ along with this library. If not, see . #include "abstractplayer.h" +QT_BEGIN_NAMESPACE + namespace Phonon { namespace MMF @@ -70,4 +72,6 @@ namespace Phonon } } +QT_END_NAMESPACE + #endif diff --git a/src/3rdparty/phonon/mmf/mediaobject.cpp b/src/3rdparty/phonon/mmf/mediaobject.cpp index 04b7dc7..91ed859 100644 --- a/src/3rdparty/phonon/mmf/mediaobject.cpp +++ b/src/3rdparty/phonon/mmf/mediaobject.cpp @@ -23,6 +23,7 @@ along with this library. If not, see . #include "utils.h" #include "videoplayer.h" +QT_BEGIN_NAMESPACE using namespace Phonon; using namespace Phonon::MMF; @@ -387,3 +388,5 @@ void MMF::MediaObject::setVideoOutput(VideoOutput* videoOutput) } +QT_END_NAMESPACE + diff --git a/src/3rdparty/phonon/mmf/mediaobject.h b/src/3rdparty/phonon/mmf/mediaobject.h index 5bbca96..d9c32ce 100644 --- a/src/3rdparty/phonon/mmf/mediaobject.h +++ b/src/3rdparty/phonon/mmf/mediaobject.h @@ -30,6 +30,8 @@ along with this library. If not, see . #include "defs.h" #include "volumeobserver.h" +QT_BEGIN_NAMESPACE + namespace Phonon { namespace MMF @@ -122,4 +124,6 @@ namespace Phonon } } +QT_END_NAMESPACE + #endif diff --git a/src/3rdparty/phonon/mmf/utils.cpp b/src/3rdparty/phonon/mmf/utils.cpp index 2655962..eb367f6 100644 --- a/src/3rdparty/phonon/mmf/utils.cpp +++ b/src/3rdparty/phonon/mmf/utils.cpp @@ -19,6 +19,8 @@ along with this library. If not, see . #include "utils.h" #include +QT_BEGIN_NAMESPACE + using namespace Phonon; using namespace Phonon::MMF; @@ -65,3 +67,7 @@ MMF::MediaType MMF::Utils::mimeTypeToMediaType(const TDesC& mimeType) return result; } + + +QT_END_NAMESPACE + diff --git a/src/3rdparty/phonon/mmf/utils.h b/src/3rdparty/phonon/mmf/utils.h index 2df7e48..e2b5e59 100644 --- a/src/3rdparty/phonon/mmf/utils.h +++ b/src/3rdparty/phonon/mmf/utils.h @@ -24,6 +24,8 @@ along with this library. If not, see . #include "defs.h" +QT_BEGIN_NAMESPACE + namespace Phonon { namespace MMF @@ -158,4 +160,6 @@ namespace Phonon } } +QT_END_NAMESPACE + #endif diff --git a/src/3rdparty/phonon/mmf/videooutput.cpp b/src/3rdparty/phonon/mmf/videooutput.cpp index 171565b..6534b7b 100644 --- a/src/3rdparty/phonon/mmf/videooutput.cpp +++ b/src/3rdparty/phonon/mmf/videooutput.cpp @@ -24,6 +24,8 @@ along with this library. If not, see . #include #include +QT_BEGIN_NAMESPACE + using namespace Phonon; using namespace Phonon::MMF; @@ -87,12 +89,15 @@ void VideoOutput::dump() TRACE("maxSize %d %d", maximumWidth(), maximumHeight()); TRACE("sizeHint %d %d", sizeHint().width(), sizeHint().height()); - QWidget& parentWidget = *qobject_cast(parent()); - TRACE("parent.isVisible %d", parentWidget.isVisible()); - TRACE("parent.pos %d %d", parentWidget.x(), parentWidget.y()); - TRACE("parent.size %d %d", parentWidget.size().width(), parentWidget.size().height()); - TRACE("parent.maxSize %d %d", parentWidget.maximumWidth(), parentWidget.maximumHeight()); - TRACE("parent.sizeHint %d %d", parentWidget.sizeHint().width(), parentWidget.sizeHint().height()); + QWidget* parentWidget = qobject_cast(parent()); + if(parentWidget) + { + TRACE("parent.isVisible %d", parentWidget->isVisible()); + TRACE("parent.pos %d %d", parentWidget->x(), parentWidget->y()); + TRACE("parent.size %d %d", parentWidget->size().width(), parentWidget->size().height()); + TRACE("parent.maxSize %d %d", parentWidget->maximumWidth(), parentWidget->maximumHeight()); + TRACE("parent.sizeHint %d %d", parentWidget->sizeHint().width(), parentWidget->sizeHint().height()); + } TRACE_EXIT_0(); } @@ -214,4 +219,5 @@ void MMF::VideoOutput::moveEvent(QMoveEvent* event) //----------------------------------------------------------------------------- +QT_END_NAMESPACE diff --git a/src/3rdparty/phonon/mmf/videooutput.h b/src/3rdparty/phonon/mmf/videooutput.h index 6d1e4a0..b8e22ca 100644 --- a/src/3rdparty/phonon/mmf/videooutput.h +++ b/src/3rdparty/phonon/mmf/videooutput.h @@ -22,6 +22,8 @@ along with this library. If not, see . #include #include "defs.h" +QT_BEGIN_NAMESPACE + namespace Phonon { namespace MMF @@ -33,11 +35,10 @@ namespace Phonon Q_OBJECT public: - VideoOutput(QWidget* parent); + explicit VideoOutput(QWidget* parent); ~VideoOutput(); void setFrameSize(const QSize& size); - void setObserver(VideoOutputObserver* observer); protected: @@ -64,4 +65,6 @@ namespace Phonon } } +QT_END_NAMESPACE + #endif diff --git a/src/3rdparty/phonon/mmf/videooutputobserver.h b/src/3rdparty/phonon/mmf/videooutputobserver.h index 30fb3e0..d38ff87 100644 --- a/src/3rdparty/phonon/mmf/videooutputobserver.h +++ b/src/3rdparty/phonon/mmf/videooutputobserver.h @@ -21,6 +21,8 @@ along with this library. If not, see . #include +QT_BEGIN_NAMESPACE + namespace Phonon { namespace MMF @@ -37,4 +39,6 @@ namespace Phonon } } +QT_END_NAMESPACE + #endif diff --git a/src/3rdparty/phonon/mmf/videoplayer.cpp b/src/3rdparty/phonon/mmf/videoplayer.cpp index 546f761..ba06379 100644 --- a/src/3rdparty/phonon/mmf/videoplayer.cpp +++ b/src/3rdparty/phonon/mmf/videoplayer.cpp @@ -26,6 +26,8 @@ along with this library. If not, see . #include "videoplayer.h" #include "utils.h" +QT_BEGIN_NAMESPACE + using namespace Phonon; using namespace Phonon::MMF; @@ -408,3 +410,7 @@ void MMF::VideoPlayer::getNativeWindowSystemHandles() m_clipRect = m_windowRect; } + + +QT_END_NAMESPACE + diff --git a/src/3rdparty/phonon/mmf/videoplayer.h b/src/3rdparty/phonon/mmf/videoplayer.h index a6f069f..f8b1486 100644 --- a/src/3rdparty/phonon/mmf/videoplayer.h +++ b/src/3rdparty/phonon/mmf/videoplayer.h @@ -25,6 +25,7 @@ along with this library. If not, see . #include "videooutput.h" #include "videooutputobserver.h" +QT_BEGIN_NAMESPACE namespace Phonon { @@ -105,4 +106,6 @@ namespace Phonon } } +QT_END_NAMESPACE + #endif diff --git a/src/3rdparty/phonon/mmf/videowidget.cpp b/src/3rdparty/phonon/mmf/videowidget.cpp index 515f04e..ae94e5e 100644 --- a/src/3rdparty/phonon/mmf/videowidget.cpp +++ b/src/3rdparty/phonon/mmf/videowidget.cpp @@ -20,6 +20,8 @@ along with this library. If not, see . #include "videooutput.h" #include "videowidget.h" +QT_BEGIN_NAMESPACE + using namespace Phonon; using namespace Phonon::MMF; @@ -42,7 +44,8 @@ static const qreal DefaultSaturation = 1.0; //----------------------------------------------------------------------------- MMF::VideoWidget::VideoWidget(QWidget* parent) - : m_widget(new VideoOutput(parent)) + : QObject(parent) + , m_widget(new VideoOutput(parent)) , m_aspectRatio(DefaultAspectRatio) , m_brightness(DefaultBrightness) , m_scaleMode(DefaultScaleMode) @@ -158,3 +161,6 @@ VideoOutput& MMF::VideoWidget::videoOutput() return *static_cast(widget()); } + +QT_END_NAMESPACE + diff --git a/src/3rdparty/phonon/mmf/videowidget.h b/src/3rdparty/phonon/mmf/videowidget.h index e8fc603..799121b 100644 --- a/src/3rdparty/phonon/mmf/videowidget.h +++ b/src/3rdparty/phonon/mmf/videowidget.h @@ -23,6 +23,8 @@ along with this library. If not, see . #include #include +QT_BEGIN_NAMESPACE + namespace Phonon { namespace MMF @@ -70,4 +72,6 @@ namespace Phonon } } +QT_END_NAMESPACE + #endif diff --git a/src/3rdparty/phonon/mmf/volumeobserver.h b/src/3rdparty/phonon/mmf/volumeobserver.h index 11ee960..d6717cba 100644 --- a/src/3rdparty/phonon/mmf/volumeobserver.h +++ b/src/3rdparty/phonon/mmf/volumeobserver.h @@ -21,6 +21,8 @@ along with this library. If not, see . #include +QT_BEGIN_NAMESPACE + namespace Phonon { namespace MMF @@ -37,4 +39,6 @@ namespace Phonon } } +QT_END_NAMESPACE + #endif -- cgit v0.12