Remove a few more obsolete parts.
Change-Id: I3a001f01ab7fd8cf63452126037b98c1b01df80d Reviewed-on: http://codereview.qt.nokia.com/1797 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
1403a1c7be
commit
eccb43d73c
@@ -1,10 +0,0 @@
|
||||
CONFIG -= qt
|
||||
TEMPLATE = app
|
||||
|
||||
# Input
|
||||
SOURCES += main.cpp
|
||||
|
||||
INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
|
||||
LIBS += -lhwrmfmtxclient
|
||||
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the Qt Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
#include <e32base.h>
|
||||
#include <hwrmfmtx.h>
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
CHWRMFmTx *fmTX = CHWRMFmTx::NewL();
|
||||
delete fmTX;
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
CONFIG -= qt
|
||||
TEMPLATE = app
|
||||
|
||||
# Input
|
||||
SOURCES += main.cpp
|
||||
|
||||
#INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
|
||||
LIBS += -laudiooutputrouting
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the Qt Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
message($$MAKEFILE_GENERATOR)
|
||||
contains(MAKEFILE_GENERATOR, SYMBIAN_ABLD) {
|
||||
message(symbian-abld)
|
||||
} else:contains(MAKEFILE_GENERATOR, SYMBIAN_SBSV2) {
|
||||
message(symbian-sbsv2)
|
||||
} else:contains(MAKEFILE_GENERATOR, MSVC)|contains(MAKEFILE_GENERATOR, MSVC.NET)|contains(MAKEFILE_GENERATOR, MSBUILD) {
|
||||
message(win32-nmake)
|
||||
} else:contains(MAKEFILE_GENERATOR, MINGW) {
|
||||
message(win32-mingw)
|
||||
}
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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 Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "\epoc32\include\platform\mw\MMFSessionInfoCustomCommandConstants.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
TMMFSessionInfoControllerMessage m;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
TEMPLATE = app
|
||||
TARGET =
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += .
|
||||
|
||||
# Input
|
||||
SOURCES += main.cpp
|
||||
@@ -1,45 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the Qt Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
CONFIG -= qt
|
||||
TEMPLATE = app
|
||||
|
||||
# Input
|
||||
SOURCES += main.cpp
|
||||
|
||||
LIBS += -lopenmaxal
|
||||
@@ -1,46 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the Qt Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
CONFIG -= qt
|
||||
TEMPLATE = app
|
||||
|
||||
# Input
|
||||
SOURCES += main.cpp
|
||||
|
||||
#INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
|
||||
LIBS += -lRadio_Utility
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the Qt Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
#include <videoplayer2.h>
|
||||
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
CVideoPlayerUtility2 *utility;
|
||||
return 0;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
CONFIG -= qt
|
||||
TEMPLATE = app
|
||||
|
||||
# Input
|
||||
SOURCES += main.cpp
|
||||
|
||||
INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
|
||||
LIBS += -mediaclientvideo.lib
|
||||
@@ -1,45 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the Qt Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
CONFIG -= qt
|
||||
TEMPLATE = app
|
||||
|
||||
# Input
|
||||
SOURCES += main.cpp
|
||||
|
||||
LIBS += -lCamAutoFocus_s
|
||||
@@ -1,45 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the Qt Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
CONFIG -= qt
|
||||
TEMPLATE = app
|
||||
|
||||
# Input
|
||||
SOURCES += main.cpp
|
||||
|
||||
LIBS += -ldevvideo
|
||||
@@ -1,45 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the Qt Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
CONFIG -= qt
|
||||
TEMPLATE = app
|
||||
|
||||
# Input
|
||||
SOURCES += main.cpp
|
||||
|
||||
LIBS += -lecamadvsettings
|
||||
@@ -1,45 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the Qt Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
CONFIG -= qt
|
||||
TEMPLATE = app
|
||||
|
||||
# Input
|
||||
SOURCES += main.cpp
|
||||
|
||||
LIBS += -lecamsnapshot
|
||||
@@ -1,46 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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 Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
CONFIG -= qt
|
||||
TEMPLATE = app
|
||||
|
||||
# Input
|
||||
SOURCES += main.cpp
|
||||
|
||||
#INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
|
||||
LIBS += -ltunerutility
|
||||
|
||||
443
configure
vendored
443
configure
vendored
@@ -1,443 +0,0 @@
|
||||
#!/bin/sh
|
||||
#############################################################################
|
||||
##
|
||||
## 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 Mobility Components.
|
||||
##
|
||||
## $QT_BEGIN_LICENSE:LGPL$
|
||||
## GNU Lesser General Public License Usage
|
||||
## 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.
|
||||
##
|
||||
## Other Usage
|
||||
## Alternatively, this file may be used in accordance with the terms and
|
||||
## conditions contained in a signed written agreement between you and Nokia.
|
||||
##
|
||||
##
|
||||
##
|
||||
##
|
||||
##
|
||||
## $QT_END_LICENSE$
|
||||
##
|
||||
#############################################################################
|
||||
|
||||
# return status of 1 if absolute path as first argument
|
||||
# also prints the return status
|
||||
isAbsPath() {
|
||||
slash=$(echo $1 | cut -c 1)
|
||||
if [ "$slash" != "/" ]; then
|
||||
echo 0
|
||||
return 0
|
||||
fi
|
||||
echo 1
|
||||
return 1
|
||||
}
|
||||
|
||||
# Returns the absolute path for $1 for target $2
|
||||
# as an example $2 might have value "maemo5".
|
||||
# This is required because when building in scratchbox for
|
||||
# maemo we do not want to follow symbolic links that are
|
||||
# introduced by scratchbox
|
||||
absPath() {
|
||||
if [ "$2" = "maemo5" -o "$2" = "maemo6" -o "$2" = "meego" ]; then
|
||||
if [ `isAbsPath $1` = '1' ]; then
|
||||
echo $1;
|
||||
else
|
||||
echo >&2 "Relative prefix/bin/lib/header/plugin paths are not supported for Maemo"
|
||||
exit 1;
|
||||
fi
|
||||
else
|
||||
PATH=`$relpath/bin/pathhelper $1`
|
||||
echo $PATH
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# the current directory (shadow build dir)
|
||||
shadowpath=`/bin/pwd`
|
||||
# the name of this script
|
||||
relconf=`basename $0`
|
||||
# the directory of this script is the "source tree"
|
||||
relpath=`dirname $0`
|
||||
relpath=`(cd "$relpath"; /bin/pwd)`
|
||||
|
||||
CONFIG_IN="$shadowpath/config.in"
|
||||
BUILD_UNITTESTS=
|
||||
BUILD_PUBLIC_UNITTESTS=
|
||||
BUILD_EXAMPLES=
|
||||
BUILD_DEMOS=
|
||||
BUILD_DOCS=yes
|
||||
BUILD_TOOLS=yes
|
||||
RELEASEMODE=
|
||||
BUILD_SILENT=
|
||||
LINUX_TARGET=
|
||||
LANGUAGES=
|
||||
QMAKE_CACHE="$shadowpath/.qmake.cache"
|
||||
QMAKE_EXEC=qmake
|
||||
LIB_PATH="lib"
|
||||
BIN_PATH="bin"
|
||||
PLUGIN_PATH="plugins"
|
||||
PLATFORM_CONFIG=
|
||||
MAC_SDK=
|
||||
QMKSPEC=
|
||||
OS="other"
|
||||
# By default, all modules are requested. Reset this later if -modules is supplied
|
||||
ORGANIZER_REQUESTED=yes
|
||||
TEST_USE_SIMULATOR=
|
||||
NFC_SYMBIAN=auto
|
||||
MAC_DEPLOY=
|
||||
|
||||
usage()
|
||||
{
|
||||
echo "Usage: configure [-prefix <dir>] [headerdir <dir>] [libdir <dir>]"
|
||||
echo " [-bindir <dir>] [-tests] [-examples] [-no-docs]"
|
||||
echo " [-no-tools] [-debug] [-release] [-silent]"
|
||||
echo " [-modules <list>]"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo
|
||||
echo "-prefix <dir> ..... This will install everything relative to <dir>"
|
||||
echo " (default prefix: $shadowpath/install)"
|
||||
echo "-headerdir <dir> .. Header files will be installed to <dir>"
|
||||
echo " (default prefix: PREFIX/include)"
|
||||
echo "-libdir <dir> ..... Libraries will be installed to <dir>"
|
||||
echo " (default: PREFIX/lib)"
|
||||
echo "-bindir <dir> ..... Executables will be installed to <dir>"
|
||||
echo " (default: PREFIX/bin)"
|
||||
echo "-plugindir <dir> .. Plug-ins will be installed to <dir>"
|
||||
echo " (default: PREFIX/plugins)"
|
||||
echo "-demosdir <dir> ... Demos will be installed to <dir>"
|
||||
echo " (default: PREFIX/bin)"
|
||||
echo "-examplesdir <dir> Examples will be installed to <dir>"
|
||||
echo " (default PREFIX/bin)"
|
||||
echo "-debug ............ Build with debugging symbols"
|
||||
echo "-release .......... Build without debugging symbols"
|
||||
echo "-silent ........... Reduces build output"
|
||||
echo "-tests ............ Build unit tests (not build by default)"
|
||||
echo " Note, this adds test symbols to all libraries"
|
||||
echo " and should not be used for release builds."
|
||||
echo "-examples ......... Build example applications"
|
||||
echo "-demos ............ Build demo applications"
|
||||
echo "-no-docs .......... Do not build documentation (build by default)"
|
||||
echo "-no-tools ......... Do not build tools (build by default)"
|
||||
echo "-modules <list> ... Restrict list of modules to build (default all supported)"
|
||||
echo " Choose from: bearer contacts gallery location publishsubscribe"
|
||||
echo " messaging multimedia systeminfo serviceframework"
|
||||
echo " sensors versit organizer feedback connectivity"
|
||||
echo " Modules should be separated by a space and surrounded"
|
||||
echo " by double quotation. If a selected module depends on other modules"
|
||||
echo " those modules (and their dependencies) will automatically be enabled."
|
||||
echo "-maemo6 ........... Build Qt Mobility for Maemo6 (Harmattan)."
|
||||
echo "-maemo5 ........... Build Qt Mobility for Maemo5 (Fremantle)."
|
||||
echo "-meego ........... Build Qt Mobility for MeeGo."
|
||||
echo "-sdk <sdk> ........ Build using Apple provided SDK <path/to/sdk>."
|
||||
echo " example: -sdk /Developer/SDKs/MacOSX10.6.sdk"
|
||||
echo "-languages ........ Languages/translations to be installed (e.g.: \"ar de ko\")."
|
||||
echo " (default is empty)"
|
||||
echo "-qmake-exec <name> Sets custom binary name for qmake binary"
|
||||
echo " (default: qmake)"
|
||||
echo "-no-nfc-symbian Disables the NFC Sybmian backend."
|
||||
# echo "-test-sim Use simulator backend for testing systeminfo"
|
||||
# echo "-staticconfig <name>"
|
||||
# echo " Avoids running of configuration tests. The default"
|
||||
# echo " values are sourced from features/platformconfig/<name>.pri"
|
||||
echo "-mac-deploy .... Use this option for deploying QtMobility into Qt for use with macdeployqt tool"
|
||||
echo " This overrides any -prefix that may be set."
|
||||
echo
|
||||
|
||||
rm -f "$CONFIG_IN"
|
||||
exit 1
|
||||
}
|
||||
|
||||
rm -rf "$QMAKE_CACHE"
|
||||
CONFIG_LOG="$shadowpath/config.log"
|
||||
rm -rf "$CONFIG_LOG"
|
||||
|
||||
while [ "$#" -gt 0 ]; do
|
||||
case "$1" in
|
||||
-h|-help|--help)
|
||||
usage
|
||||
;;
|
||||
-tests)
|
||||
BUILD_UNITTESTS="yes"
|
||||
;;
|
||||
-public-tests-only)
|
||||
BUILD_PUBLIC_UNITTESTS="yes"
|
||||
;;
|
||||
-demos)
|
||||
BUILD_DEMOS="yes"
|
||||
;;
|
||||
-examples)
|
||||
BUILD_EXAMPLES="yes"
|
||||
;;
|
||||
-no-docs)
|
||||
BUILD_DOCS=
|
||||
;;
|
||||
-no-tools)
|
||||
BUILD_TOOLS=
|
||||
;;
|
||||
-debug)
|
||||
RELEASEMODE=debug
|
||||
;;
|
||||
-release)
|
||||
RELEASEMODE=release
|
||||
;;
|
||||
-silent)
|
||||
BUILD_SILENT=yes
|
||||
;;
|
||||
-maemo5)
|
||||
LINUX_TARGET=maemo5
|
||||
;;
|
||||
-maemo6)
|
||||
LINUX_TARGET=maemo6
|
||||
;;
|
||||
-meego)
|
||||
LINUX_TARGET=meego
|
||||
;;
|
||||
-sdk)
|
||||
MAC_SDK="$2"
|
||||
shift
|
||||
;;
|
||||
-qmake-exec)
|
||||
QMAKE_EXEC="$2"
|
||||
shift
|
||||
;;
|
||||
-staticconfig)
|
||||
PLATFORM_CONFIG=$2
|
||||
shift
|
||||
;;
|
||||
-languages)
|
||||
LANGUAGES=$2
|
||||
shift
|
||||
;;
|
||||
-test-sim)
|
||||
TEST_USE_SIMULATOR="yes"
|
||||
;;
|
||||
-no-nfc-symbian)
|
||||
NFC_SYMBIAN=no
|
||||
;;
|
||||
-mac-deploy)
|
||||
MAC_DEPLOY='yes'
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "Unknown option: $1"
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ -z "$RELEASEMODE" ]; then
|
||||
RELEASEMODE="debug"
|
||||
fi
|
||||
echo "CONFIG += $RELEASEMODE" > "$CONFIG_IN"
|
||||
|
||||
|
||||
if [ -n "$BUILD_SILENT" ]; then
|
||||
echo "CONFIG += silent" >> "$CONFIG_IN"
|
||||
fi
|
||||
|
||||
checkostype()
|
||||
{
|
||||
match="Darwin"
|
||||
if [ `uname -s` = "${match}" ]; then
|
||||
OS="darwin"
|
||||
QMKSPEC="-spec macx-g++"
|
||||
if [[ `gcc --version` =~ .*llvm.* ]]; then
|
||||
QMKSPEC="-spec macx-llvm"
|
||||
else
|
||||
QMKSPEC="-spec macx-g++"
|
||||
fi
|
||||
echo "QMAKESPEC = "$QMKSPEC >> "$CONFIG_IN"
|
||||
fi
|
||||
}
|
||||
|
||||
checkostype
|
||||
|
||||
findUniversal()
|
||||
{
|
||||
if [ -e "mac.inc" ]; then
|
||||
rm mac.inc
|
||||
fi
|
||||
echo "contains(QT_CONFIG,x86): system(echo CONFIG+=x86 >> mac.inc)" > 2.pro
|
||||
echo "contains(QT_CONFIG,ppc): system(echo CONFIG+=ppc >> mac.inc)" >> 2.pro
|
||||
echo "contains(QT_CONFIG,ppc64): system(echo CONFIG+=ppc64 >> mac.inc)" >> 2.pro
|
||||
echo "contains(QT_CONFIG,x86_64): system(echo CONFIG+=x86_64 >> mac.inc)" >> 2.pro
|
||||
SOMETIME=`$QMAKE_EXEC $QMKSPEC 2.pro 2>&1`
|
||||
rm 2.pro
|
||||
if [ -e "mac.inc" ]; then
|
||||
echo "exists(mac.inc): include(mac.inc)" >> "$CONFIG_IN"
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$OS" = "darwin" ] ; then
|
||||
findUniversal
|
||||
fi
|
||||
|
||||
if [ -n "$MAC_SDK" ]; then
|
||||
QMAKE_MAC_SDK="$MAC_SDK"
|
||||
echo "QMAKE_MAC_SDK = $QMAKE_MAC_SDK" >> "$CONFIG_IN"
|
||||
fi
|
||||
|
||||
if [ -z "$BUILD_UNITTESTS" ]; then
|
||||
echo "build_unit_tests = no" >> "$CONFIG_IN"
|
||||
else
|
||||
echo "build_unit_tests = yes" >> "$CONFIG_IN"
|
||||
fi
|
||||
|
||||
if [ -z "$BUILD_PUBLIC_UNITTESTS" ]; then
|
||||
echo "build_public_unit_tests = no" >> "$CONFIG_IN"
|
||||
else
|
||||
echo "build_public_unit_tests = yes" >> "$CONFIG_IN"
|
||||
fi
|
||||
|
||||
if [ -z "$BUILD_EXAMPLES" ]; then
|
||||
echo "build_examples = no" >> "$CONFIG_IN"
|
||||
else
|
||||
echo "build_examples = yes" >> "$CONFIG_IN"
|
||||
fi
|
||||
|
||||
if [ -z "$BUILD_DEMOS" ]; then
|
||||
echo "build_demos = no" >> "$CONFIG_IN"
|
||||
else
|
||||
echo "build_demos = yes" >> "$CONFIG_IN"
|
||||
fi
|
||||
|
||||
if [ -z "$BUILD_DOCS" ]; then
|
||||
echo "build_docs = no" >> "$CONFIG_IN"
|
||||
else
|
||||
echo "build_docs = yes" >> "$CONFIG_IN"
|
||||
fi
|
||||
|
||||
if [ -z "$BUILD_TOOLS" ]; then
|
||||
echo "build_tools = no" >> "$CONFIG_IN"
|
||||
else
|
||||
echo "build_tools = yes" >> "$CONFIG_IN"
|
||||
fi
|
||||
|
||||
if [ -z "$TEST_USE_SIMULATOR" ]; then
|
||||
echo "test_use_sim = no" >> "$CONFIG_IN"
|
||||
else
|
||||
echo "test_use_sim = yes" >> "$CONFIG_IN"
|
||||
fi
|
||||
|
||||
#process languages
|
||||
if [ -z "LANGUAGES" ]; then
|
||||
echo "selected_languages =" >> "$CONFIG_IN"
|
||||
else
|
||||
echo "selected_languages = $LANGUAGES" >> "$CONFIG_IN"
|
||||
fi
|
||||
|
||||
|
||||
echo "Configuring Qt MultimediaKit"
|
||||
echo
|
||||
|
||||
WHICH="$relpath/config.tests/tools/which.test"
|
||||
|
||||
printf "Checking available Qt"
|
||||
if ! "$WHICH" $QMAKE_EXEC 2>/dev/null 1>&2; then
|
||||
QMAKE_EXEC_ALTERNATIVE=
|
||||
if "$WHICH" qmake4 2>/dev/null 1>&2; then
|
||||
QMAKE_EXEC_ALTERNATIVE=qmake4
|
||||
elif "$WHICH" qmake-qt4 2>/dev/null 1>&2; then
|
||||
QMAKE_EXEC_ALTERNATIVE=qmake-qt4
|
||||
fi
|
||||
|
||||
if [ -z "$QMAKE_EXEC_ALTERNATIVE" ]; then
|
||||
printf " ... Not found\n\n" >&2
|
||||
echo >&2 "Cannot find "$QMAKE_EXEC" in your PATH.";
|
||||
echo >&2 "Aborting."
|
||||
exit 1
|
||||
else
|
||||
QMAKE_EXEC="$QMAKE_EXEC_ALTERNATIVE"
|
||||
fi
|
||||
fi
|
||||
|
||||
#we found a qmake binary
|
||||
printf " ... "
|
||||
$QMAKE_EXEC -query QT_VERSION
|
||||
|
||||
# find out which make we want to use
|
||||
MAKE=
|
||||
for m in make gmake; do
|
||||
if "$WHICH" $m >/dev/null 2>&1; then
|
||||
MAKE=`$WHICH $m`
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ -z "$MAKE" ]; then
|
||||
echo >&2 "Cannot find 'make' or 'gmake' in your PATH";
|
||||
echo >&2 "Aborting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
compileTest()
|
||||
{
|
||||
printf "Checking $1"
|
||||
CURRENT_PWD=`pwd`
|
||||
|
||||
if [ "$shadowpath" = "$relpath" ]; then
|
||||
#doing source tree build
|
||||
cd "$relpath/config.tests/$2"
|
||||
rm -rf ./$2
|
||||
else
|
||||
#using shadow build
|
||||
rm -rf config.tests/$2
|
||||
mkdir -p config.tests/$2
|
||||
cd config.tests/$2
|
||||
fi
|
||||
|
||||
$QMAKE_EXEC $QMKSPEC "$relpath/config.tests/$2/$2.pro" 2>> "$CONFIG_LOG" >> "$CONFIG_LOG"
|
||||
printf " ."
|
||||
"$MAKE" clean >> "$CONFIG_LOG"
|
||||
printf "."
|
||||
"$MAKE" >> "$CONFIG_LOG" 2>&1
|
||||
printf ". "
|
||||
if [ -e ./$2 ]; then
|
||||
echo "OK"
|
||||
echo "$2_enabled = yes" >> "$CONFIG_IN"
|
||||
else
|
||||
echo "Not Found"
|
||||
echo "$2_enabled = no" >> "$CONFIG_IN"
|
||||
fi
|
||||
cd "$CURRENT_PWD"
|
||||
}
|
||||
|
||||
if [ -z "$PLATFORM_CONFIG" ]; then
|
||||
#compile tests
|
||||
compileTest "Gstreamer Photography" gstreamer-photography
|
||||
compileTest "Gstreamer AppSrc" gstreamer-appsrc
|
||||
compileTest "Pulse Audio" pulseaudio
|
||||
else
|
||||
echo "Skipping configure tests"
|
||||
echo "Loading ... features/platformconfig/$PLATFORM_CONFIG.pri"
|
||||
if [ ! -f "$relpath/features/platformconfig/$PLATFORM_CONFIG.pri" ]; then
|
||||
echo "Invalid platform configuration $PLATFORM_CONFIG.pri"
|
||||
exit 1;
|
||||
else
|
||||
echo "include(\$\${QT_MOBILITY_SOURCE_TREE}/features/platformconfig/$PLATFORM_CONFIG.pri)" >> "$CONFIG_IN"
|
||||
fi
|
||||
fi
|
||||
|
||||
mv "$CONFIG_IN" config.pri
|
||||
|
||||
806
configure.bat
806
configure.bat
@@ -1,806 +0,0 @@
|
||||
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
::
|
||||
:: 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 Mobility Components.
|
||||
::
|
||||
:: $QT_BEGIN_LICENSE:LGPL$
|
||||
:: GNU Lesser General Public License Usage
|
||||
:: 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.
|
||||
::
|
||||
:: Other Usage
|
||||
:: Alternatively, this file may be used in accordance with the terms and
|
||||
:: conditions contained in a signed written agreement between you and Nokia.
|
||||
::
|
||||
::
|
||||
::
|
||||
::
|
||||
::
|
||||
:: $QT_END_LICENSE$
|
||||
::
|
||||
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
@echo off
|
||||
|
||||
set QT_MOBILITY_PREFIX= C:\QtMobility
|
||||
set BUILD_PATH=%CD%
|
||||
set SOURCE_PATH= %~dp0
|
||||
cd /D %SOURCE_PATH%
|
||||
set SOURCE_PATH=%CD%
|
||||
cd /D %BUILD_PATH%
|
||||
|
||||
set PROJECT_CONFIG=%BUILD_PATH%\config.in
|
||||
set PROJECT_LOG=%BUILD_PATH%\config.log
|
||||
set RELEASEMODE=release
|
||||
set WIN32_RELEASEMODE=debug_and_release build_all
|
||||
set QT_MOBILITY_LIB=
|
||||
set BUILD_UNITTESTS=no
|
||||
set BUILD_PUBLIC_UNITTESTS=no
|
||||
set BUILD_EXAMPLES=no
|
||||
set BUILD_DEMOS=no
|
||||
set BUILD_DOCS=yes
|
||||
set BUILD_TOOLS=yes
|
||||
set LANGUAGES_CONFIG=
|
||||
set MOBILITY_MODULES=bearer location contacts systeminfo publishsubscribe versit messaging sensors serviceframework multimedia gallery organizer feedback connectivity
|
||||
set MOBILITY_MODULES_UNPARSED=
|
||||
set VC_TEMPLATE_OPTION=
|
||||
set QT_PATH=
|
||||
set QMAKE_CACHE=%BUILD_PATH%\.qmake.cache
|
||||
set PLATFORM_CONFIG=
|
||||
set NFC_SYMBIAN=auto
|
||||
|
||||
REM By default, all modules are requested. Reset this later if -modules is supplied
|
||||
set ORGANIZER_REQUESTED=yes
|
||||
|
||||
if exist "%QMAKE_CACHE%" del /Q %QMAKE_CACHE%
|
||||
if exist "%PROJECT_LOG%" del /Q %PROJECT_LOG%
|
||||
if exist "%PROJECT_CONFIG%" del /Q %PROJECT_CONFIG%
|
||||
|
||||
echo QT_MOBILITY_SOURCE_TREE = %SOURCE_PATH:\=/% > %QMAKE_CACHE%
|
||||
echo QT_MOBILITY_BUILD_TREE = %BUILD_PATH:\=/% >> %QMAKE_CACHE%
|
||||
set QMAKE_CACHE=
|
||||
|
||||
:cmdline_parsing
|
||||
if "%1" == "" goto startProcessing
|
||||
if "%1" == "-debug" goto debugTag
|
||||
if "%1" == "-release" goto releaseTag
|
||||
if "%1" == "-silent" goto silentTag
|
||||
if "%1" == "-prefix" goto prefixTag
|
||||
if "%1" == "-libdir" goto libTag
|
||||
if "%1" == "-bindir" goto binTag
|
||||
if "%1" == "-headerdir" goto headerTag
|
||||
if "%1" == "-plugindir" goto pluginTag
|
||||
if "%1" == "-examplesdir" goto examplesDirTag
|
||||
if "%1" == "-demosdir" goto demosDirTag
|
||||
if "%1" == "-tests" goto testTag
|
||||
if "%1" == "-public-tests-only" goto publicTestTag
|
||||
if "%1" == "-examples" goto exampleTag
|
||||
if "%1" == "-demos" goto demosTag
|
||||
if "%1" == "-qt" goto qtTag
|
||||
if "%1" == "-vc" goto vcTag
|
||||
if "%1" == "-no-docs" goto nodocsTag
|
||||
if "%1" == "-no-tools" goto noToolsTag
|
||||
if "%1" == "-modules" goto modulesTag
|
||||
if "%1" == "/?" goto usage
|
||||
if "%1" == "-h" goto usage
|
||||
if "%1" == "-help" goto usage
|
||||
if "%1" == "--help" goto usage
|
||||
if "%1" == "-symbian-unfrozen" goto unfrozenTag
|
||||
if "%1" == "-staticconfig" goto staticConfigTag
|
||||
if "%1" == "-languages" goto languagesTag
|
||||
if "%1" == "-no-nfc-symbian" goto noNfcSymbianTag
|
||||
|
||||
echo Unknown option: "%1"
|
||||
goto usage
|
||||
|
||||
:usage
|
||||
echo Usage: configure.bat [-prefix (dir)] [headerdir (dir)] [libdir (dir)]
|
||||
echo [-bindir (dir)] [-tests] [-examples]
|
||||
echo [-debug] [-release] [-silent]
|
||||
echo.
|
||||
echo Options:
|
||||
echo.
|
||||
echo -prefix (dir) ..... This will install everything relative to dir
|
||||
echo (default prefix: C:\QtMobility)
|
||||
echo -headerdir (dir) .. Header files will be installed to dir
|
||||
echo (default prefix: PREFIX/include)
|
||||
echo -libdir (dir) ..... Libraries will be installed to dir
|
||||
echo (default PREFIX/lib)
|
||||
echo -bindir (dir) ..... Executables will be installed to dir
|
||||
echo (default PREFIX/bin)
|
||||
echo -plugindir (dir) .. Plug-ins will be installed to dir
|
||||
echo (default PREFIX/plugins)
|
||||
echo -examplesdir (dir) Examples will be installed to dir
|
||||
echo (default PREFIX/bin)
|
||||
echo -demosdir (dir) ... Demos will be installed to dir
|
||||
echo (default PREFIX/bin)
|
||||
echo -debug ............ Build with debugging symbols
|
||||
echo -release .......... Build without debugging symbols
|
||||
echo -silent ........... Reduces build output
|
||||
echo -tests ............ Build unit tests (not build by default)
|
||||
echo Note, this adds test symbols to all libraries
|
||||
echo and should not be used for release builds.
|
||||
echo -examples ......... Build example applications
|
||||
echo -demos ............ Build demo applications
|
||||
echo -no-docs .......... Do not build documentation (build by default)
|
||||
echo -modules ^<list^> ... Build only the specified modules (default all)
|
||||
echo Choose from: bearer contacts gallery location publishsubscribe
|
||||
echo messaging multimedia systeminfo serviceframework
|
||||
echo sensors versit organizer feedback connectivity
|
||||
echo Modules should be separated by a space and surrounded
|
||||
echo by double quotation. If a selected module depends on other modules
|
||||
echo those modules (and their dependencies) will automatically be enabled.
|
||||
echo -vc ............... Generate Visual Studio make files
|
||||
echo -languages ........ Languages/translations to be installed (e.g.: ar de ko)
|
||||
echo (default is empty)
|
||||
echo -no-nfc-symbian ... Disables the NFC Symbian backend.
|
||||
|
||||
|
||||
if exist "%PROJECT_CONFIG%" del %PROJECT_CONFIG%
|
||||
goto exitTag
|
||||
|
||||
:qtTag
|
||||
shift
|
||||
set QT_PATH=%1\
|
||||
shift
|
||||
goto cmdline_parsing
|
||||
|
||||
:noNfcSymbianTag
|
||||
shift
|
||||
set NFC_SYMBIAN=no
|
||||
goto cmdline_parsing
|
||||
|
||||
:languagesTag
|
||||
shift
|
||||
:: %1 can have leading/trailing quotes, so we can't use if "%1" == ""
|
||||
if xx%1xx == xxxx (
|
||||
echo. >&2
|
||||
echo >&2The -languages option requires a list of languages.
|
||||
echo. >&2
|
||||
goto usage
|
||||
)
|
||||
|
||||
:: Remove leading/trailing quotes, if we have them
|
||||
set MOBILITY_LANGUAGES_UNPARSED=xxx%1xxx
|
||||
set MOBILITY_LANGUAGES_UNPARSED=%MOBILITY_LANGUAGES_UNPARSED:"xxx=%
|
||||
set MOBILITY_LANGUAGES_UNPARSED=%MOBILITY_LANGUAGES_UNPARSED:xxx"=%
|
||||
set MOBILITY_LANGUAGES_UNPARSED=%MOBILITY_LANGUAGES_UNPARSED:xxx=%
|
||||
|
||||
REM for now we don't check the languages for their validity
|
||||
set LANGUAGES_CONFIG=
|
||||
set LANGUAGES_CONFIG= %MOBILITY_LANGUAGES_UNPARSED%
|
||||
echo Selected Languages: %LANGUAGES_CONFIG%
|
||||
shift
|
||||
goto cmdline_parsing
|
||||
|
||||
:staticConfigTag
|
||||
shift
|
||||
set PLATFORM_CONFIG=%1
|
||||
shift
|
||||
goto cmdline_parsing
|
||||
|
||||
:debugTag
|
||||
if "%RELEASEMODE%" == "release" set RELEASEMODE=debug
|
||||
set WIN32_RELEASEMODE=
|
||||
shift
|
||||
goto cmdline_parsing
|
||||
|
||||
:releaseTag
|
||||
if "%RELEASEMODE%" == "debug" set RELEASEMODE=release
|
||||
set WIN32_RELEASEMODE=
|
||||
shift
|
||||
goto cmdline_parsing
|
||||
|
||||
:silentTag
|
||||
echo CONFIG += silent > %PROJECT_CONFIG%
|
||||
shift
|
||||
goto cmdline_parsing
|
||||
|
||||
:prefixTag
|
||||
shift
|
||||
set QT_MOBILITY_PREFIX=%1
|
||||
shift
|
||||
goto cmdline_parsing
|
||||
|
||||
:libTag
|
||||
shift
|
||||
echo QT_MOBILITY_LIB = %1 >> %PROJECT_CONFIG%
|
||||
shift
|
||||
goto cmdline_parsing
|
||||
|
||||
:binTag
|
||||
shift
|
||||
echo QT_MOBILITY_BIN = %1 >> %PROJECT_CONFIG%
|
||||
shift
|
||||
goto cmdline_parsing
|
||||
|
||||
:headerTag
|
||||
shift
|
||||
echo QT_MOBILITY_INCLUDE = %1 >> %PROJECT_CONFIG%
|
||||
shift
|
||||
goto cmdline_parsing
|
||||
|
||||
:pluginTag
|
||||
shift
|
||||
echo QT_MOBILITY_PLUGINS = %1 >> %PROJECT_CONFIG%
|
||||
shift
|
||||
echo
|
||||
goto cmdline_parsing
|
||||
|
||||
:examplesDirTag
|
||||
shift
|
||||
echo QT_MOBILITY_EXAMPLES = %1 >> %PROJECT_CONFIG%
|
||||
shift
|
||||
echo
|
||||
goto cmdline_parsing
|
||||
|
||||
:demosDirTag
|
||||
shift
|
||||
echo QT_MOBILITY_DEMOS =%1 >> %PROJECT_CONFIG%
|
||||
shift
|
||||
echo
|
||||
goto cmdline_parsing
|
||||
|
||||
:unfrozenTag
|
||||
REM Should never be used in release builds
|
||||
REM Some SDK's seem to exclude Q_AUTOTEST_EXPORT symbols if the
|
||||
REM libraries are frozen. This breaks unit tests relying on the auto test exports
|
||||
REM This flag unfreezes the SYMBIAN libraries for the purpose of unit test building.
|
||||
REM Ideally this should be connected to '-tests' option but that would prevent
|
||||
REM integration testing for frozen symbols as the CI system should test unit tests
|
||||
REM and frozen symbol compliance.
|
||||
echo symbian_symbols_unfrozen = 1 >> %PROJECT_CONFIG%
|
||||
shift
|
||||
goto cmdline_parsing
|
||||
|
||||
:testTag
|
||||
set BUILD_UNITTESTS=yes
|
||||
shift
|
||||
goto cmdline_parsing
|
||||
|
||||
:publicTestTag
|
||||
set BUILD_PUBLIC_UNITTESTS=yes
|
||||
shift
|
||||
goto cmdline_parsing
|
||||
|
||||
:exampleTag
|
||||
set BUILD_EXAMPLES=yes
|
||||
shift
|
||||
goto cmdline_parsing
|
||||
|
||||
:demosTag
|
||||
set BUILD_DEMOS=yes
|
||||
shift
|
||||
goto cmdline_parsing
|
||||
|
||||
:vcTag
|
||||
shift
|
||||
set VC_TEMPLATE_OPTION=-tp vc
|
||||
goto cmdline_parsing
|
||||
|
||||
:nodocsTag
|
||||
set BUILD_DOCS=no
|
||||
shift
|
||||
goto cmdline_parsing
|
||||
|
||||
:noToolsTag
|
||||
set BUILD_TOOLS=no
|
||||
shift
|
||||
goto cmdline_parsing
|
||||
|
||||
:modulesTag
|
||||
shift
|
||||
:: %1 can have leading/trailing quotes, so we can't use if "%1" == ""
|
||||
if xx%1xx == xxxx (
|
||||
echo. >&2
|
||||
echo >&2The -modules option requires a list of modules.
|
||||
echo. >&2
|
||||
goto usage
|
||||
)
|
||||
|
||||
:: Remove leading/trailing quotes, if we have them
|
||||
set MOBILITY_MODULES_UNPARSED=xxx%1xxx
|
||||
set MOBILITY_MODULES_UNPARSED=%MOBILITY_MODULES_UNPARSED:"xxx=%
|
||||
set MOBILITY_MODULES_UNPARSED=%MOBILITY_MODULES_UNPARSED:xxx"=%
|
||||
set MOBILITY_MODULES_UNPARSED=%MOBILITY_MODULES_UNPARSED:xxx=%
|
||||
|
||||
REM reset default modules as we expect a modules list
|
||||
set MOBILITY_MODULES=
|
||||
set ORGANIZER_REQUESTED=no
|
||||
|
||||
echo Checking selected modules:
|
||||
:modulesTag2
|
||||
|
||||
for /f "tokens=1,*" %%a in ("%MOBILITY_MODULES_UNPARSED%") do (
|
||||
set FIRST=%%a
|
||||
set REMAINING=%%b
|
||||
)
|
||||
|
||||
: What we want is a switch as we need to check module name and only want to
|
||||
: distinguish between false and correct module names being passed
|
||||
if %FIRST% == bearer (
|
||||
echo Bearer Management selected
|
||||
) else if %FIRST% == contacts (
|
||||
echo Contacts selected
|
||||
) else if %FIRST% == location (
|
||||
echo Location selected
|
||||
) else if %FIRST% == messaging (
|
||||
echo Messaging selected
|
||||
) else if %FIRST% == multimedia (
|
||||
echo Multimedia selected
|
||||
) else if %FIRST% == publishsubscribe (
|
||||
echo PublishSubscribe selected
|
||||
) else if %FIRST% == systeminfo (
|
||||
echo Systeminfo selected
|
||||
) else if %FIRST% == serviceframework (
|
||||
echo ServiceFramework selected
|
||||
) else if %FIRST% == versit (
|
||||
echo Versit selected ^(implies Contacts^)
|
||||
) else if %FIRST% == organizer (
|
||||
echo Organizer selected
|
||||
set ORGANIZER_REQUESTED=yes
|
||||
) else if %FIRST% == feedback (
|
||||
echo Feedback selected
|
||||
) else if %FIRST% == sensors (
|
||||
echo Sensors selected
|
||||
) else if %FIRST% == gallery (
|
||||
echo Gallery selected
|
||||
) else if %FIRST% == connectivity (
|
||||
echo Connectivity selected
|
||||
) else (
|
||||
echo Unknown module %FIRST%
|
||||
goto errorTag
|
||||
)
|
||||
|
||||
set MOBILITY_MODULES=%MOBILITY_MODULES% %FIRST%
|
||||
|
||||
if "%REMAINING%" == "" (
|
||||
shift
|
||||
) else (
|
||||
set MOBILITY_MODULES_UNPARSED=%REMAINING%
|
||||
goto modulesTag2
|
||||
)
|
||||
|
||||
SET REMAINING=
|
||||
SET FIRST=
|
||||
goto cmdline_parsing
|
||||
|
||||
:startProcessing
|
||||
|
||||
echo CONFIG += %RELEASEMODE% >> %PROJECT_CONFIG%
|
||||
echo CONFIG_WIN32 += %WIN32_RELEASEMODE% %RELEASEMODE% >> %PROJECT_CONFIG%
|
||||
set RELEASEMODE=
|
||||
set WIN32_RELEASEMODE=
|
||||
|
||||
set CURRENTDIR=%CD%
|
||||
echo %CURRENTDIR%
|
||||
if exist %QT_MOBILITY_PREFIX% goto prefixExists
|
||||
mkdir %QT_MOBILITY_PREFIX%
|
||||
if errorlevel 1 goto invalidPrefix
|
||||
cd /D %QT_MOBILITY_PREFIX%
|
||||
set QT_MOBILITY_PREFIX=%CD%
|
||||
cd /D %CURRENTDIR%
|
||||
rd /S /Q %QT_MOBILITY_PREFIX%
|
||||
goto endprefixProcessing
|
||||
|
||||
:invalidPrefix
|
||||
echo "%QT_MOBILITY_PREFIX%" is not a valid directory path.
|
||||
goto :exitTag
|
||||
|
||||
:prefixExists
|
||||
cd /D %QT_MOBILITY_PREFIX%
|
||||
set QT_MOBILITY_PREFIX=%CD%
|
||||
cd /D %CURRENTDIR%
|
||||
|
||||
:endprefixProcessing
|
||||
echo QT_MOBILITY_PREFIX = %QT_MOBILITY_PREFIX:\=/% >> %PROJECT_CONFIG%
|
||||
|
||||
echo build_unit_tests = %BUILD_UNITTESTS% >> %PROJECT_CONFIG%
|
||||
set BUILD_UNITTESTS=
|
||||
|
||||
echo build_public_unit_tests = %BUILD_PUBLIC_UNITTESTS% >> %PROJECT_CONFIG%
|
||||
set BUILD_PUBLIC_UNITTESTS=
|
||||
|
||||
echo build_examples = %BUILD_EXAMPLES% >> %PROJECT_CONFIG%
|
||||
set BUILD_EXAMPLES=
|
||||
|
||||
echo build_demos = %BUILD_DEMOS% >> %PROJECT_CONFIG%
|
||||
set BUILD_DEMOS=
|
||||
|
||||
echo build_docs = %BUILD_DOCS% >> %PROJECT_CONFIG%
|
||||
set BUILD_DOCS=
|
||||
|
||||
echo build_tools = %BUILD_TOOLS% >> %PROJECT_CONFIG%
|
||||
set BUILD_TOOLS=
|
||||
|
||||
echo qmf_enabled = no >> %PROJECT_CONFIG%
|
||||
|
||||
echo !symbian:isEmpty($$QT_MOBILITY_INCLUDE):QT_MOBILITY_INCLUDE=$$QT_MOBILITY_PREFIX/include >> %PROJECT_CONFIG%
|
||||
echo isEmpty($$QT_MOBILITY_LIB):QT_MOBILITY_LIB=$$QT_MOBILITY_PREFIX/lib >> %PROJECT_CONFIG%
|
||||
echo isEmpty($$QT_MOBILITY_BIN):QT_MOBILITY_BIN=$$QT_MOBILITY_PREFIX/bin >> %PROJECT_CONFIG%
|
||||
echo isEmpty($$QT_MOBILITY_PLUGINS):QT_MOBILITY_PLUGINS=$$QT_MOBILITY_PREFIX/plugins >> %PROJECT_CONFIG%
|
||||
echo isEmpty($$QT_MOBILITY_EXAMPLES):QT_MOBILITY_EXAMPLES=$$QT_MOBILITY_PREFIX/bin >> %PROJECT_CONFIG%
|
||||
echo isEmpty($$QT_MOBILITY_DEMOS):QT_MOBILITY_DEMOS=$$QT_MOBILITY_PREFIX/bin >> %PROJECT_CONFIG%
|
||||
|
||||
echo selected_languages = %LANGUAGES_CONFIG% >> %PROJECT_CONFIG%
|
||||
|
||||
echo mobility_modules = %MOBILITY_MODULES% >> %PROJECT_CONFIG%
|
||||
echo contains(mobility_modules,versit): mobility_modules *= contacts >> %PROJECT_CONFIG%
|
||||
echo contains(mobility_modules,connectivity): mobility_modules *= serviceframework >> %PROJECT_CONFIG%
|
||||
|
||||
echo Checking available Qt
|
||||
call %QT_PATH%qmake -v >> %PROJECT_LOG% 2>&1
|
||||
if errorlevel 1 goto qmakeNotFound
|
||||
goto qmakeFound
|
||||
:qmakeNotFound
|
||||
echo ... Not found >> %PROJECT_LOG% 2>&1
|
||||
if "%QT_PATH%" == "" (
|
||||
echo >&2Cannot find 'qmake' in your PATH.
|
||||
echo >&2Your PATH is: "%PATH%"
|
||||
) else (
|
||||
echo >&2Cannot find 'qmake' in "%QT_PATH%".
|
||||
)
|
||||
echo >&2Aborting.
|
||||
goto errorTag
|
||||
|
||||
:qmakeFound
|
||||
call %QT_PATH%qmake -query QT_VERSION
|
||||
|
||||
goto checkMake
|
||||
|
||||
REM Detect make tool
|
||||
:makeTest
|
||||
setlocal
|
||||
set CURRENT_PWD=%CD%
|
||||
|
||||
if %BUILD_PATH% == %SOURCE_PATH% (
|
||||
cd %SOURCE_PATH%\config.tests\make
|
||||
if exist make del make
|
||||
) else (
|
||||
rmdir /S /Q config.tests\make
|
||||
mkdir config.tests\make
|
||||
cd config.tests\make
|
||||
)
|
||||
|
||||
for /f "tokens=2,3" %%a in ('call %QT_PATH%qmake %SOURCE_PATH%\config.tests\make\make.pro 2^>^&1 1^>NUL') do (
|
||||
if "%%a" == "MESSAGE:" (
|
||||
set BUILDSYSTEM=%%b)
|
||||
)
|
||||
|
||||
if "%BUILDSYSTEM%" == "symbian-abld" (
|
||||
call make -h >> %PROJECT_LOG% 2>&1
|
||||
if not errorlevel 1 (
|
||||
echo ... Symbian abld make found.
|
||||
set MAKE=make
|
||||
)
|
||||
) else if "%BUILDSYSTEM%" == "symbian-sbsv2" (
|
||||
call make -h >> %PROJECT_LOG% 2>&1
|
||||
if not errorlevel 1 (
|
||||
echo ... Symbian sbsv2 make found.
|
||||
set MAKE=make
|
||||
)
|
||||
) else if "%BUILDSYSTEM%" == "win32-nmake" (
|
||||
call nmake /? >> %PROJECT_LOG% 2>&1
|
||||
if not errorlevel 1 (
|
||||
echo ... nmake found.
|
||||
set MAKE=nmake
|
||||
)
|
||||
) else if "%BUILDSYSTEM%" == "win32-mingw" (
|
||||
call mingw32-make -v >> %PROJECT_LOG% 2>&1
|
||||
if not errorlevel 1 (
|
||||
echo ... mingw32-make found.
|
||||
set MAKE=mingw32-make
|
||||
)
|
||||
) else (
|
||||
echo ... Unknown target environment %BUILDSYSTEM%.
|
||||
)
|
||||
call cd %CURRENT_PWD%
|
||||
call endlocal&set %1=%MAKE%&set %2=%BUILDSYSTEM%&goto :EOF
|
||||
|
||||
:checkMake
|
||||
echo Checking make
|
||||
call :makeTest MOBILITY_MAKE MOBILITY_BUILDSYSTEM
|
||||
if not "%MOBILITY_MAKE%" == "" goto compileTests
|
||||
|
||||
echo >&2Cannot find 'nmake', 'mingw32-make' or 'make' in your PATH
|
||||
echo >&2Aborting.
|
||||
goto errorTag
|
||||
|
||||
:compileTest
|
||||
setlocal
|
||||
@echo off
|
||||
echo Checking %1
|
||||
set CURRENT_PWD=%CD%
|
||||
|
||||
if %BUILD_PATH% == %SOURCE_PATH% (
|
||||
cd %SOURCE_PATH%\config.tests\%2
|
||||
if exist %2 del %2
|
||||
) else (
|
||||
rmdir /S /Q config.tests\%2
|
||||
mkdir config.tests\%2
|
||||
cd config.tests\%2
|
||||
)
|
||||
|
||||
call %QT_PATH%qmake %SOURCE_PATH%\config.tests\%2\%2.pro >> %PROJECT_LOG% 2>&1
|
||||
|
||||
set FAILED=0
|
||||
if "%MOBILITY_BUILDSYSTEM%" == "symbian-sbsv2" (
|
||||
call %MOBILITY_MAKE% release-armv5 >> %PROJECT_LOG% 2>&1
|
||||
for /f "tokens=2" %%i in ('%MOBILITY_MAKE% release-armv5 SBS^="@sbs --check"') do set FAILED=1
|
||||
) else if "%MOBILITY_BUILDSYSTEM%" == "symbian-abld" (
|
||||
call %MOBILITY_MAKE% release-gcce >> %PROJECT_LOG% 2>&1
|
||||
for /f "tokens=2" %%i in ('%MOBILITY_MAKE% release-gcce ABLD^="@ABLD.BAT -c" 2^>^&1') do if not %%i == bldfiles set FAILED=1
|
||||
) else (
|
||||
REM Make for other builds
|
||||
call %MOBILITY_MAKE% >> %PROJECT_LOG% 2>&1
|
||||
REM have to check error level for windows / other builds to be sure.
|
||||
if errorlevel 1 (
|
||||
set FAILED=1
|
||||
)
|
||||
)
|
||||
|
||||
if %FAILED% == 0 (
|
||||
echo ... OK
|
||||
echo %2_enabled = yes >> %PROJECT_CONFIG%
|
||||
) else (
|
||||
echo ... Not Found
|
||||
echo %2_enabled = no >> %PROJECT_CONFIG%
|
||||
)
|
||||
|
||||
cd %CURRENT_PWD%
|
||||
endlocal&goto :EOF
|
||||
|
||||
:compileTests
|
||||
|
||||
REM No reason to do config tests if we got a platform configuration
|
||||
if not "%PLATFORM_CONFIG%" == "" goto platformconfig
|
||||
|
||||
REM We shouldn't enable some of these if the corresponding modules are not enabled
|
||||
echo.
|
||||
echo Start of compile tests
|
||||
REM compile tests go here.
|
||||
for /f "tokens=3" %%i in ('call %QT_PATH%qmake %SOURCE_PATH%\config.tests\make\make.pro 2^>^&1 1^>NUL') do set BUILDSYSTEM=%%i
|
||||
if "%BUILDSYSTEM%" == "symbian-abld" goto symbianTests
|
||||
if "%BUILDSYSTEM%" == "symbian-sbsv2" (
|
||||
perl -S %SOURCE_PATH%\bin\compilercheck.pl
|
||||
goto symbianTests
|
||||
)
|
||||
goto windowsTests
|
||||
|
||||
:symbianTests
|
||||
|
||||
call :compileTest LBT lbt
|
||||
call :compileTest SNAP snap
|
||||
call :compileTest OCC occ
|
||||
call :compileTest SymbianENote symbianenote
|
||||
call :compileTest SymbianContactSIM symbiancntsim
|
||||
call :compileTest SymbianContactModel symbiancntmodel
|
||||
call :compileTest SymbianContactModelv2 symbiancntmodelv2
|
||||
call :compileTest S60_Sensor_API sensors_s60_31
|
||||
call :compileTest Symbian_Sensor_Framework sensors_symbian
|
||||
call :compileTest Sensor_Framework_Light sensors_symbian_light
|
||||
call :compileTest Symbian_Hb hb_symbian
|
||||
call :compileTest Audiorouting_s60 audiorouting_s60
|
||||
call :compileTest Tunerlibrary_for_3.1 tunerlib_s60
|
||||
call :compileTest RadioUtility_for_post_3.1 radioutility_s60
|
||||
REM Currently not being supported
|
||||
REM call :compileTest OpenMaxAl_support openmaxal_symbian
|
||||
call :compileTest Surfaces_s60 surfaces_s60
|
||||
call :compileTest Symbian_Messaging_Freestyle messaging_freestyle
|
||||
call :compileTest Symbian_Messaging_Freestyle_MAPI12 messaging_freestyle_mapi12
|
||||
call :compileTest callinformation_symbian callinformation_symbian
|
||||
call :compileTest IMMERSION immersion
|
||||
call :compileTest Symbian_CamAutoFocus_31 symbian_camera_camautofocus
|
||||
call :compileTest Symbian_ECamAdvancedSettings_Post31 symbian_camera_ecamadvsettings
|
||||
call :compileTest Symbian_DevVideoRecord symbian_camera_devvideorecord
|
||||
call :compileTest Symbian_SnapShotAPI symbian_camera_snapshot
|
||||
call :compileTest AdvancedTouchFeedback advancedtouchfeedback
|
||||
call :compileTest CHWRMHaptics chwrmhaptics
|
||||
call :compileTest MDS mds
|
||||
call :compileTest MDS_25 mds_25
|
||||
call :compileTest MDS_25_92MCL mds_25_92mcl
|
||||
if "%NFC_SYMBIAN%" == "auto" (
|
||||
call :compileTest Symbian_NFC nfc_symbian
|
||||
) else (
|
||||
echo nfc_symbian_enabled = no >> %PROJECT_CONFIG%
|
||||
)
|
||||
call :compileTest BTEngineConnectionManager_Symbian btengconnman_symbian
|
||||
call :compileTest BTEngineDeviceManager_Symbian btengdevman_symbian
|
||||
call :compileTest LockandFlipKeys LockandFlipPSkeys
|
||||
call :compileTest FmTxClientCheck FmTxClient
|
||||
call :compileTest DiskNotifyClientCheck DiskNotifyClient
|
||||
call :compileTest ThermalStatus_Symbian thermalstatus_symbian
|
||||
call :compileTest Flextimer_Symbian symbianflextimer
|
||||
call :compileTest ETelPacketservice_symbian etelpacketservice_symbian
|
||||
call :compileTest mmf_http_cookies mmf_http_cookies
|
||||
goto noTests
|
||||
|
||||
:windowsTests
|
||||
|
||||
call :compileTest DirectShow directshow
|
||||
call :compileTest WindowsMediaSDK wmsdk
|
||||
call :compileTest WindowMediaPlayer wmp
|
||||
call :compileTest EnhancedVideoRenderer evr
|
||||
|
||||
:noTests
|
||||
|
||||
echo End of compile tests
|
||||
echo.
|
||||
echo.
|
||||
goto processHeaders
|
||||
|
||||
:platformconfig
|
||||
|
||||
echo.
|
||||
echo Skipping configure tests
|
||||
echo Loading ... features\platformconfig\%PLATFORM_CONFIG%.pri
|
||||
|
||||
if not exist "%SOURCE_PATH%\features\platformconfig\%PLATFORM_CONFIG%.pri" (
|
||||
echo >&2Invalid platform configuration %PLATFORM_CONFIG%.pri
|
||||
goto errorTag
|
||||
)
|
||||
echo include($${QT_MOBILITY_SOURCE_TREE}/features/platformconfig/%PLATFORM_CONFIG%.pri) >> %PROJECT_CONFIG%
|
||||
|
||||
:processHeaders
|
||||
REM we could skip generating headers if a module is not enabled
|
||||
if not exist "%BUILD_PATH%\features" mkdir %BUILD_PATH%\features
|
||||
if not exist "%BUILD_PATH%\features\strict_flags.prf" copy %SOURCE_PATH%\features\strict_flags.prf %BUILD_PATH%\features
|
||||
|
||||
echo Generating Mobility Headers...
|
||||
rd /s /q %BUILD_PATH%\include
|
||||
mkdir %BUILD_PATH%\include
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include %SOURCE_PATH%\src\global
|
||||
|
||||
set MODULES_TEMP=%MOBILITY_MODULES%
|
||||
|
||||
:generateHeaders
|
||||
|
||||
for /f "tokens=1,*" %%a in ("%MODULES_TEMP%") do (
|
||||
set FIRST=%%a
|
||||
set REMAINING=%%b
|
||||
)
|
||||
|
||||
if %FIRST% == bearer (
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtBearer %SOURCE_PATH%\src\bearer
|
||||
) else if %FIRST% == contacts (
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtContacts %SOURCE_PATH%\src\contacts
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtContacts %SOURCE_PATH%\src\contacts\requests
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtContacts %SOURCE_PATH%\src\contacts\filters
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtContacts %SOURCE_PATH%\src\contacts\details
|
||||
) else if %FIRST% == location (
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtLocation %SOURCE_PATH%\src\location
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtLocation %SOURCE_PATH%\src\location\landmarks
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtLocation %SOURCE_PATH%\src\location\maps
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtLocation %SOURCE_PATH%\src\location\maps\tiled
|
||||
) else if %FIRST% == messaging (
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtMessaging %SOURCE_PATH%\src\messaging
|
||||
) else if %FIRST% == multimedia (
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtMultimediaKit %SOURCE_PATH%\src\multimedia
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtMultimediaKit %SOURCE_PATH%\src\multimedia\audio
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtMultimediaKit %SOURCE_PATH%\src\multimedia\video
|
||||
) else if %FIRST% == publishsubscribe (
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtPublishSubscribe %SOURCE_PATH%\src\publishsubscribe
|
||||
) else if %FIRST% == systeminfo (
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtSystemInfo %SOURCE_PATH%\src\systeminfo
|
||||
) else if %FIRST% == serviceframework (
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtServiceFramework %SOURCE_PATH%\src\serviceframework
|
||||
) else if %FIRST% == versit (
|
||||
REM versit implies contacts. organizer includes might also be necessary
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtVersit %SOURCE_PATH%\src\versit
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtContacts %SOURCE_PATH%\src\contacts
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtContacts %SOURCE_PATH%\src\contacts\requests
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtContacts %SOURCE_PATH%\src\contacts\filters
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtContacts %SOURCE_PATH%\src\contacts\details
|
||||
if %ORGANIZER_REQUESTED% == yes (
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtVersitOrganizer %SOURCE_PATH%\src\versitorganizer
|
||||
)
|
||||
) else if %FIRST% == sensors (
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtSensors %SOURCE_PATH%\src\sensors
|
||||
) else if %FIRST% == gallery (
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtGallery %SOURCE_PATH%\src\gallery
|
||||
) else if %FIRST% == organizer (
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtOrganizer %SOURCE_PATH%\src\organizer
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtOrganizer %SOURCE_PATH%\src\organizer\items
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtOrganizer %SOURCE_PATH%\src\organizer\requests
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtOrganizer %SOURCE_PATH%\src\organizer\filters
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtOrganizer %SOURCE_PATH%\src\organizer\details
|
||||
) else if %FIRST% == feedback (
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtFeedback %SOURCE_PATH%\src\feedback
|
||||
) else if %FIRST% == connectivity (
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtConnectivity %SOURCE_PATH%\src\connectivity
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtConnectivity %SOURCE_PATH%\src\connectivity\nfc
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtConnectivity %SOURCE_PATH%\src\connectivity\bluetooth
|
||||
REM connectivity/nfc implies sfw
|
||||
perl -S %SOURCE_PATH%\bin\syncheaders %BUILD_PATH%\include\QtServiceFramework %SOURCE_PATH%\src\serviceframework
|
||||
)
|
||||
|
||||
if "%REMAINING%" == "" (
|
||||
shift
|
||||
) else (
|
||||
set MODULES_TEMP=%REMAINING%
|
||||
goto generateHeaders
|
||||
)
|
||||
|
||||
SET REMAINING=
|
||||
SET FIRST=
|
||||
SET MODULES_TEMP=
|
||||
|
||||
if exist config.pri del config.pri
|
||||
ren %PROJECT_CONFIG% config.pri
|
||||
|
||||
echo.
|
||||
echo Running qmake...
|
||||
call %QT_PATH%qmake -recursive %VC_TEMPLATE_OPTION% %SOURCE_PATH%\qtmultimediakit.pro
|
||||
if errorlevel 1 goto qmakeRecError
|
||||
echo.
|
||||
echo configure has finished. You may run %MOBILITY_MAKE% to build the project now.
|
||||
goto exitTag
|
||||
|
||||
:qmakeRecError
|
||||
echo.
|
||||
echo configure failed.
|
||||
goto errorTag
|
||||
|
||||
REM Unset the internal variables
|
||||
:errorTag
|
||||
set BUILD_PATH=
|
||||
set CURRENTDIR=
|
||||
set MOBILITY_MAKE=
|
||||
set MOBILITY_BUILDSYSTEM=
|
||||
set PROJECT_CONFIG=
|
||||
set PROJECT_LOG=
|
||||
set QT_MOBILITY_PREFIX=
|
||||
set QT_PATH=
|
||||
set SOURCE_PATH=
|
||||
set MOBILITY_MODULES=
|
||||
set MOBILITY_MODULES_UNPARSED=
|
||||
set REMAINING=
|
||||
set FIRST=
|
||||
set MODULES_TEMP=
|
||||
set QT_MOBILITY_EXAMPLES=
|
||||
set QT_MOBILITY_DEMOS=
|
||||
set ORGANIZER_REQUESTED=
|
||||
set PLATFORM_CONFIG=
|
||||
set LANGUAGES_CONFIG=
|
||||
exit /b 1
|
||||
|
||||
:exitTag
|
||||
set BUILD_PATH=
|
||||
set CURRENTDIR=
|
||||
set MOBILITY_MAKE=
|
||||
set MOBILITY_BUILDSYSTEM=
|
||||
set PROJECT_CONFIG=
|
||||
set PROJECT_LOG=
|
||||
set QT_MOBILITY_PREFIX=
|
||||
set QT_PATH=
|
||||
set SOURCE_PATH=
|
||||
set MOBILITY_MODULES=
|
||||
set MOBILITY_MODULES_UNPARSED=
|
||||
set REMAINING=
|
||||
set FIRST=
|
||||
set MODULES_TEMP=
|
||||
set QT_MOBILITY_EXAMPLES=
|
||||
set QT_MOBILITY_DEMOS=
|
||||
set ORGANIZER_REQUESTED=
|
||||
set PLATFORM_CONFIG=
|
||||
set LANGUAGES_CONFIG=
|
||||
exit /b 0
|
||||
@@ -1,3 +1,3 @@
|
||||
TEMPLATE = subdirs
|
||||
|
||||
!symbian: SUBDIRS += multimedia-snippets
|
||||
SUBDIRS += multimedia-snippets
|
||||
|
||||
@@ -10,10 +10,6 @@ SOURCES = audiodevices.cpp \
|
||||
|
||||
FORMS += audiodevicesbase.ui
|
||||
|
||||
symbian {
|
||||
TARGET.CAPABILITY = UserEnvironment WriteDeviceData ReadDeviceData
|
||||
}
|
||||
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/qtmultimediakit/audiodevices
|
||||
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro
|
||||
sources.path = $$[QT_INSTALL_EXAMPLES]/qtmultimediakit/audiodevices
|
||||
|
||||
@@ -48,11 +48,7 @@ int main(int argv, char **args)
|
||||
app.setApplicationName("Audio Device Test");
|
||||
|
||||
AudioTest audio;
|
||||
#ifdef Q_OS_SYMBIAN
|
||||
audio.showMaximized();
|
||||
#else
|
||||
audio.show();
|
||||
#endif
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
#include "audiorecorder.h"
|
||||
|
||||
#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) || defined(SYMBIAN_S60_3X)
|
||||
#if defined(Q_WS_MAEMO_6)
|
||||
#include "ui_audiorecorder_small.h"
|
||||
#else
|
||||
#include "ui_audiorecorder.h"
|
||||
|
||||
@@ -12,15 +12,9 @@ SOURCES = \
|
||||
|
||||
maemo*: {
|
||||
FORMS += audiorecorder_small.ui
|
||||
}else:symbian:contains(S60_VERSION, 3.2)|contains(S60_VERSION, 3.1){
|
||||
DEFINES += SYMBIAN_S60_3X
|
||||
FORMS += audiorecorder_small.ui
|
||||
}else {
|
||||
FORMS += audiorecorder.ui
|
||||
}
|
||||
symbian: {
|
||||
TARGET.CAPABILITY = UserEnvironment ReadDeviceData WriteDeviceData
|
||||
}
|
||||
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/qtmultimediakit/audiorecorder
|
||||
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro
|
||||
|
||||
@@ -47,11 +47,7 @@ int main(int argc, char *argv[])
|
||||
QApplication app(argc, argv);
|
||||
|
||||
AudioRecorder recorder;
|
||||
#ifdef Q_OS_SYMBIAN
|
||||
recorder.showMaximized();
|
||||
#else
|
||||
recorder.show();
|
||||
#endif
|
||||
|
||||
return app.exec();
|
||||
};
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
#include <QtGui>
|
||||
|
||||
#if (defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)) && QT_VERSION >= 0x040700
|
||||
#if (defined(Q_WS_MAEMO_6)) && QT_VERSION >= 0x040700
|
||||
#define HAVE_CAMERA_BUTTONS
|
||||
#endif
|
||||
|
||||
|
||||
@@ -19,13 +19,6 @@ FORMS += \
|
||||
videosettings.ui \
|
||||
imagesettings.ui
|
||||
|
||||
symbian {
|
||||
include(camerakeyevent_symbian/camerakeyevent_symbian.pri)
|
||||
TARGET.CAPABILITY += UserEnvironment WriteUserData ReadUserData
|
||||
TARGET.EPOCHEAPSIZE = 0x20000 0x3000000
|
||||
LIBS += -lavkon -leiksrv -lcone -leikcore
|
||||
}
|
||||
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/qtmultimediakit/camera
|
||||
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro
|
||||
sources.path = $$[QT_INSTALL_EXAMPLES]/qtmultimediakit/camera
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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 examples of the Qt Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
|
||||
** the names of its contributors may be used to endorse or promote
|
||||
** products derived from this software without specific prior written
|
||||
** permission.
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "camerakeyevent_symbian.h"
|
||||
|
||||
#include <QtGui/QWidget> // WId
|
||||
#include <eikon.hrh> // EKeyCamera
|
||||
#include <coecntrl.h> // CCoeControl (WId)
|
||||
#include <w32std.h> // RWindowbase, RWindowGroup, RWsSession
|
||||
|
||||
QSymbianCameraKeyListener::QSymbianCameraKeyListener(QWidget *widget):
|
||||
QObject(widget),
|
||||
m_widget(widget)
|
||||
{
|
||||
if (!m_widget)
|
||||
return;
|
||||
|
||||
// Get view's native Symbian window
|
||||
WId windowId = 0;
|
||||
if (m_widget->internalWinId())
|
||||
windowId = m_widget->internalWinId();
|
||||
else if (m_widget->parentWidget() && m_widget->effectiveWinId())
|
||||
windowId = m_widget->effectiveWinId();
|
||||
RWindowBase *window = windowId ? static_cast<RWindowBase*>(windowId->DrawableWindow()) : 0;
|
||||
|
||||
// Get hold of the window group
|
||||
TInt wGroupId = window ? window->WindowGroupId() : 0;
|
||||
if (!wGroupId)
|
||||
return;
|
||||
RWsSession &wsSession = CCoeEnv::Static()->WsSession();
|
||||
TUint wGroupHandle = wsSession.GetWindowGroupHandle(wGroupId);
|
||||
if (wGroupHandle) {
|
||||
RWindowGroup wGroup(wsSession);
|
||||
wGroup.Construct(wGroupHandle);
|
||||
if (wGroup.CaptureKey(EKeyCamera, 0, 0, 100) < 0)
|
||||
qWarning("Unable to register for camera capture key events, SwEvent capability may be missing");
|
||||
}
|
||||
}
|
||||
|
||||
QSymbianCameraKeyListener::~QSymbianCameraKeyListener()
|
||||
{
|
||||
if (!m_widget)
|
||||
return;
|
||||
|
||||
// Get view's native Symbian window
|
||||
WId windowId = 0;
|
||||
if (m_widget->internalWinId())
|
||||
windowId = m_widget->internalWinId();
|
||||
else if (m_widget->parentWidget() && m_widget->effectiveWinId())
|
||||
windowId = m_widget->effectiveWinId();
|
||||
RWindowBase *window = windowId ? static_cast<RWindowBase*>(windowId->DrawableWindow()) : 0;
|
||||
|
||||
// Get hold of the window group
|
||||
TInt wGroupId = window ? window->WindowGroupId() : 0;
|
||||
if (!wGroupId)
|
||||
return;
|
||||
RWsSession &wsSession = CCoeEnv::Static()->WsSession();
|
||||
TUint wGroupHandle = wsSession.GetWindowGroupHandle(wGroupId);
|
||||
if (wGroupHandle) {
|
||||
RWindowGroup wGroup(wsSession);
|
||||
wGroup.Construct(wGroupHandle);
|
||||
wGroup.CancelCaptureKey(EKeyCamera);
|
||||
}
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
#ifndef CAMERAKEYEVENT_SYMBIAN_H
|
||||
#define CAMERAKEYEVENT_SYMBIAN_H
|
||||
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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 examples of the Qt Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
|
||||
** the names of its contributors may be used to endorse or promote
|
||||
** products derived from this software without specific prior written
|
||||
** permission.
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Description:
|
||||
* This header can be used to register application on Symbian platforms
|
||||
* for the Camera capture button key events. Application can avoid native
|
||||
* camera application from starting by not forwarding the key event.
|
||||
*
|
||||
* Usage:
|
||||
* Application needs to include this header and include the needed Symbian
|
||||
* libraries. Optionally application can include camerakeyevent_symbian.pri
|
||||
* file. Application can register and unregister for the Camera capture
|
||||
* key events by creating/destructing the QSymbianCameraKeyListener helper
|
||||
* object. The widget needs to be shown before it registers for the
|
||||
* Camera key event.
|
||||
*
|
||||
* Libraries needed:
|
||||
* User needs to define following in the .pro file (or optionally include
|
||||
* the camerakeyevent_symbian.pri):
|
||||
* LIBS += -lcone -lws32
|
||||
*
|
||||
* Symbian Capabilities needed:
|
||||
* To use this header user needs to have SwEvent capability (included in
|
||||
* the camerakeyevent_symbian.pri):
|
||||
* TARGET.CAPABILITY += SwEvent
|
||||
*/
|
||||
|
||||
#include <QtCore/QObject>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
QT_FORWARD_DECLARE_CLASS(QWidget)
|
||||
QT_END_NAMESPACE
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
|
||||
class QSymbianCameraKeyListener : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QSymbianCameraKeyListener(QWidget *parent = 0);
|
||||
~QSymbianCameraKeyListener();
|
||||
private:
|
||||
QWidget *m_widget;
|
||||
};
|
||||
|
||||
#endif // CAMERAKEYEVENT_SYMBIAN_H
|
||||
@@ -1,7 +0,0 @@
|
||||
message("camerakeyevent_symbian: Including Symbian camera capture key event register methods")
|
||||
|
||||
HEADERS += $$PWD/camerakeyevent_symbian.h
|
||||
SOURCES += $$PWD/camerakeyevent_symbian.cpp
|
||||
INCLUDEPATH += $$PWD
|
||||
LIBS *= -lcone -lws32
|
||||
TARGET.CAPABILITY *= SwEvent
|
||||
@@ -39,34 +39,15 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "camera.h"
|
||||
#ifdef Q_OS_SYMBIAN
|
||||
#include "camerakeyevent_symbian.h"
|
||||
#endif // Q_OS_SYMBIAN
|
||||
|
||||
#include <QtGui>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#if defined (Q_OS_SYMBIAN)
|
||||
QApplication::setGraphicsSystem("raster");
|
||||
QApplication app(argc, argv);
|
||||
// lock orientation before constructing camera
|
||||
CAknAppUi* appUi = dynamic_cast<CAknAppUi*>(CEikonEnv::Static()->AppUi());
|
||||
if(appUi){
|
||||
QT_TRAP_THROWING(appUi ->SetOrientationL(CAknAppUi::EAppUiOrientationLandscape));
|
||||
}
|
||||
#else
|
||||
QApplication app(argc, argv);
|
||||
#endif
|
||||
|
||||
Camera camera;
|
||||
|
||||
#ifdef Q_OS_SYMBIAN
|
||||
camera.showMaximized();
|
||||
new QSymbianCameraKeyListener(&camera);
|
||||
#else
|
||||
camera.show();
|
||||
#endif
|
||||
|
||||
return app.exec();
|
||||
};
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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 examples of the Qt Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
|
||||
** the names of its contributors may be used to endorse or promote
|
||||
** products derived from this software without specific prior written
|
||||
** permission.
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "camerakeyevent_symbian.h"
|
||||
|
||||
#include <QtGui/QWidget> // WId
|
||||
#include <eikon.hrh> // EKeyCamera
|
||||
#include <coecntrl.h> // CCoeControl (WId)
|
||||
#include <w32std.h> // RWindowbase, RWindowGroup, RWsSession
|
||||
|
||||
QSymbianCameraKeyListener::QSymbianCameraKeyListener(QWidget *widget):
|
||||
QObject(widget),
|
||||
m_widget(widget)
|
||||
{
|
||||
if (!m_widget)
|
||||
return;
|
||||
|
||||
// Get view's native Symbian window
|
||||
WId windowId = 0;
|
||||
if (m_widget->internalWinId())
|
||||
windowId = m_widget->internalWinId();
|
||||
else if (m_widget->parentWidget() && m_widget->effectiveWinId())
|
||||
windowId = m_widget->effectiveWinId();
|
||||
RWindowBase *window = windowId ? static_cast<RWindowBase*>(windowId->DrawableWindow()) : 0;
|
||||
|
||||
// Get hold of the window group
|
||||
TInt wGroupId = window ? window->WindowGroupId() : 0;
|
||||
if (!wGroupId)
|
||||
return;
|
||||
RWsSession &wsSession = CCoeEnv::Static()->WsSession();
|
||||
TUint wGroupHandle = wsSession.GetWindowGroupHandle(wGroupId);
|
||||
if (wGroupHandle) {
|
||||
RWindowGroup wGroup(wsSession);
|
||||
wGroup.Construct(wGroupHandle);
|
||||
if (wGroup.CaptureKey(EKeyCamera, 0, 0, 100) < 0)
|
||||
qWarning("Unable to register for camera capture key events, SwEvent capability may be missing");
|
||||
}
|
||||
}
|
||||
|
||||
QSymbianCameraKeyListener::~QSymbianCameraKeyListener()
|
||||
{
|
||||
if (!m_widget)
|
||||
return;
|
||||
|
||||
// Get view's native Symbian window
|
||||
WId windowId = 0;
|
||||
if (m_widget->internalWinId())
|
||||
windowId = m_widget->internalWinId();
|
||||
else if (m_widget->parentWidget() && m_widget->effectiveWinId())
|
||||
windowId = m_widget->effectiveWinId();
|
||||
RWindowBase *window = windowId ? static_cast<RWindowBase*>(windowId->DrawableWindow()) : 0;
|
||||
|
||||
// Get hold of the window group
|
||||
TInt wGroupId = window ? window->WindowGroupId() : 0;
|
||||
if (!wGroupId)
|
||||
return;
|
||||
RWsSession &wsSession = CCoeEnv::Static()->WsSession();
|
||||
TUint wGroupHandle = wsSession.GetWindowGroupHandle(wGroupId);
|
||||
if (wGroupHandle) {
|
||||
RWindowGroup wGroup(wsSession);
|
||||
wGroup.Construct(wGroupHandle);
|
||||
wGroup.CancelCaptureKey(EKeyCamera);
|
||||
}
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
#ifndef CAMERAKEYEVENT_SYMBIAN_H
|
||||
#define CAMERAKEYEVENT_SYMBIAN_H
|
||||
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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 examples of the Qt Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
|
||||
** the names of its contributors may be used to endorse or promote
|
||||
** products derived from this software without specific prior written
|
||||
** permission.
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Description:
|
||||
* This header can be used to register application on Symbian platforms
|
||||
* for the Camera capture button key events. Application can avoid native
|
||||
* camera application from starting by not forwarding the key event.
|
||||
*
|
||||
* Usage:
|
||||
* Application needs to include this header and include the needed Symbian
|
||||
* libraries. Optionally application can include camerakeyevent_symbian.pri
|
||||
* file. Application can register and unregister for the Camera capture
|
||||
* key events by creating/destructing the QSymbianCameraKeyListener helper
|
||||
* object. The widget needs to be shown before it registers for the
|
||||
* Camera key event.
|
||||
*
|
||||
* Libraries needed:
|
||||
* User needs to define following in the .pro file (or optionally include
|
||||
* the camerakeyevent_symbian.pri):
|
||||
* LIBS += -lcone -lws32
|
||||
*
|
||||
* Symbian Capabilities needed:
|
||||
* To use this header user needs to have SwEvent capability (included in
|
||||
* the camerakeyevent_symbian.pri):
|
||||
* TARGET.CAPABILITY += SwEvent
|
||||
*/
|
||||
|
||||
#include <QtCore/QObject>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
QT_FORWARD_DECLARE_CLASS(QWidget)
|
||||
QT_END_NAMESPACE
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
|
||||
class QSymbianCameraKeyListener : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QSymbianCameraKeyListener(QWidget *parent = 0);
|
||||
~QSymbianCameraKeyListener();
|
||||
private:
|
||||
QWidget *m_widget;
|
||||
};
|
||||
|
||||
#endif // CAMERAKEYEVENT_SYMBIAN_H
|
||||
@@ -1,7 +0,0 @@
|
||||
message("camerakeyevent_symbian: Including Symbian camera capture key event register methods")
|
||||
|
||||
HEADERS += $$PWD/camerakeyevent_symbian.h
|
||||
SOURCES += $$PWD/camerakeyevent_symbian.cpp
|
||||
INCLUDEPATH += $$PWD
|
||||
LIBS *= -lcone -lws32
|
||||
TARGET.CAPABILITY *= SwEvent
|
||||
@@ -3,10 +3,8 @@ TEMPLATE=app
|
||||
|
||||
QT += declarative qtquick1 network multimediakit
|
||||
|
||||
!maemo5 {
|
||||
contains(QT_CONFIG, opengl) {
|
||||
QT += opengl
|
||||
}
|
||||
contains(QT_CONFIG, opengl) {
|
||||
QT += opengl
|
||||
}
|
||||
|
||||
SOURCES += $$PWD/qmlcamera.cpp
|
||||
@@ -15,13 +13,6 @@ else:TARGET = QmlCamera
|
||||
|
||||
RESOURCES += declarative-camera.qrc
|
||||
|
||||
symbian {
|
||||
include(camerakeyevent_symbian/camerakeyevent_symbian.pri)
|
||||
load(data_caging_paths)
|
||||
TARGET.CAPABILITY += UserEnvironment NetworkServices Location ReadUserData WriteUserData
|
||||
TARGET.EPOCHEAPSIZE = 0x20000 0x3000000
|
||||
}
|
||||
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/qtmultimediakit/qml_camera
|
||||
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro
|
||||
sources.path = $$[QT_INSTALL_EXAMPLES]/qtmultimediakit/qml_camera
|
||||
|
||||
@@ -47,14 +47,10 @@
|
||||
#include <QtOpenGL/QGLWidget>
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_SYMBIAN
|
||||
#include "camerakeyevent_symbian.h"
|
||||
#endif // Q_OS_SYMBIAN
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
#if defined (Q_WS_X11) || defined (Q_WS_MAC) || defined (Q_OS_SYMBIAN)
|
||||
#if defined (Q_WS_X11) || defined (Q_WS_MAC)
|
||||
//### default to using raster graphics backend for now
|
||||
bool gsSpecified = false;
|
||||
for (int i = 0; i < argc; ++i) {
|
||||
@@ -72,7 +68,7 @@ int main(int argc, char *argv[])
|
||||
QApplication application(argc, argv);
|
||||
const QString mainQmlApp = QLatin1String("qrc:/declarative-camera.qml");
|
||||
QDeclarativeView view;
|
||||
#if !defined(QT_NO_OPENGL) && !defined(Q_WS_MAEMO_5) && !defined(Q_WS_S60)
|
||||
#if !defined(QT_NO_OPENGL)
|
||||
view.setViewport(new QGLWidget);
|
||||
#endif
|
||||
view.setSource(QUrl(mainQmlApp));
|
||||
@@ -80,12 +76,9 @@ int main(int argc, char *argv[])
|
||||
// Qt.quit() called in embedded .qml by default only emits
|
||||
// quit() signal, so do this (optionally use Qt.exit()).
|
||||
QObject::connect(view.engine(), SIGNAL(quit()), qApp, SLOT(quit()));
|
||||
#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
|
||||
#if defined(Q_WS_MAEMO_6)
|
||||
view.setGeometry(application.desktop()->screenGeometry());
|
||||
view.showFullScreen();
|
||||
#ifdef Q_OS_SYMBIAN
|
||||
new QSymbianCameraKeyListener(&view);
|
||||
#endif // Q_OS_SYMBIAN
|
||||
#else
|
||||
view.setGeometry(QRect(100, 100, 800, 480));
|
||||
view.show();
|
||||
|
||||
@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
Player player;
|
||||
|
||||
#if defined(Q_OS_SYMBIAN) || defined(Q_WS_SIMULATOR)
|
||||
#if defined(Q_WS_SIMULATOR)
|
||||
# if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 2))
|
||||
player.setAttribute(Qt::WA_LockLandscapeOrientation);
|
||||
# else
|
||||
|
||||
@@ -182,14 +182,7 @@ Player::~Player()
|
||||
|
||||
void Player::open()
|
||||
{
|
||||
#ifdef Q_WS_MAEMO_5
|
||||
QStringList fileNames;
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Open Files"), "/");
|
||||
if (!fileName.isEmpty())
|
||||
fileNames << fileName;
|
||||
#else
|
||||
QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Open Files"));
|
||||
#endif
|
||||
addToPlaylist(fileNames);
|
||||
}
|
||||
|
||||
@@ -405,25 +398,16 @@ void Player::showColorDialog()
|
||||
connect(saturationSlider, SIGNAL(sliderMoved(int)), videoWidget, SLOT(setSaturation(int)));
|
||||
connect(videoWidget, SIGNAL(saturationChanged(int)), saturationSlider, SLOT(setValue(int)));
|
||||
|
||||
#if defined(Q_OS_SYMBIAN)
|
||||
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok);
|
||||
#endif
|
||||
QFormLayout *layout = new QFormLayout;
|
||||
layout->addRow(tr("Brightness"), brightnessSlider);
|
||||
layout->addRow(tr("Contrast"), contrastSlider);
|
||||
layout->addRow(tr("Hue"), hueSlider);
|
||||
layout->addRow(tr("Saturation"), saturationSlider);
|
||||
#if defined(Q_OS_SYMBIAN)
|
||||
layout->addWidget(buttonBox);
|
||||
#endif
|
||||
|
||||
QPushButton *button = new QPushButton(tr("Close"));
|
||||
layout->addRow(button);
|
||||
|
||||
colorDialog = new QDialog(this);
|
||||
#if defined(Q_OS_SYMBIAN)
|
||||
connect(buttonBox, SIGNAL(clicked(QAbstractButton*)), colorDialog, SLOT(hide()));
|
||||
#endif
|
||||
colorDialog->setWindowTitle(tr("Color Options"));
|
||||
colorDialog->setLayout(layout);
|
||||
|
||||
|
||||
@@ -22,11 +22,6 @@ maemo* {
|
||||
DEFINES += PLAYER_NO_COLOROPTIONS
|
||||
}
|
||||
|
||||
symbian {
|
||||
LIBS += -lavkon -lcone -leikcore
|
||||
TARGET.CAPABILITY = ReadUserData
|
||||
}
|
||||
|
||||
#install
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/qtmultimediakit/player
|
||||
sources.files = $$SOURCES $HEADERS $$RESOURCES $$FORMS *.pro
|
||||
|
||||
@@ -84,7 +84,6 @@ PlayerControls::PlayerControls(QWidget *parent)
|
||||
|
||||
connect(muteButton, SIGNAL(clicked()), this, SLOT(muteClicked()));
|
||||
|
||||
#ifndef Q_WS_MAEMO_5
|
||||
volumeSlider = new QSlider(Qt::Horizontal, this);
|
||||
volumeSlider->setRange(0, 100);
|
||||
|
||||
@@ -98,7 +97,6 @@ PlayerControls::PlayerControls(QWidget *parent)
|
||||
rateBox->setCurrentIndex(1);
|
||||
|
||||
connect(rateBox, SIGNAL(activated(int)), SLOT(updateRate()));
|
||||
#endif
|
||||
|
||||
QBoxLayout *layout = new QHBoxLayout;
|
||||
layout->setMargin(0);
|
||||
|
||||
@@ -56,11 +56,6 @@ VideoWidget::VideoWidget(QWidget *parent)
|
||||
|
||||
void VideoWidget::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
#ifdef Q_OS_SYMBIAN
|
||||
if (isFullScreen())
|
||||
setFullScreen(false);
|
||||
#endif
|
||||
|
||||
if (event->key() == Qt::Key_Escape && isFullScreen()) {
|
||||
showNormal();
|
||||
|
||||
@@ -83,13 +78,6 @@ void VideoWidget::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
|
||||
void VideoWidget::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
#ifdef Q_WS_MAEMO_5
|
||||
if (isFullScreen())
|
||||
setFullScreen(false);
|
||||
|
||||
event->accept();
|
||||
#else
|
||||
QVideoWidget::mousePressEvent(event);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -47,11 +47,7 @@ int main(int argc, char *argv[])
|
||||
QApplication app(argc, argv);
|
||||
|
||||
Radio radio;
|
||||
#ifdef Q_OS_SYMBIAN
|
||||
radio.showMaximized();
|
||||
#else
|
||||
radio.show();
|
||||
#endif
|
||||
|
||||
return app.exec();
|
||||
};
|
||||
|
||||
@@ -55,9 +55,6 @@ Radio::Radio()
|
||||
QWidget *window = new QWidget;
|
||||
QVBoxLayout* layout = new QVBoxLayout;
|
||||
QHBoxLayout* buttonBar = new QHBoxLayout;
|
||||
#if defined Q_OS_SYMBIAN // this is so that we can see all buttons also in 3.1 devices, where the screens are smaller..
|
||||
QHBoxLayout* buttonBar2 = new QHBoxLayout;
|
||||
#endif
|
||||
QHBoxLayout* topBar = new QHBoxLayout;
|
||||
|
||||
layout->addLayout(topBar);
|
||||
@@ -72,22 +69,13 @@ Radio::Radio()
|
||||
else
|
||||
signal->setText(tr("No radio found"));
|
||||
topBar->addWidget(signal);
|
||||
#if defined Q_WS_MAEMO_5
|
||||
QSpacerItem *spacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||
topBar->addItem(spacer);
|
||||
volumeSlider = new QSlider(Qt::Horizontal,this);
|
||||
#else
|
||||
volumeSlider = new QSlider(Qt::Vertical,this);
|
||||
#endif
|
||||
volumeSlider->setRange(0,100);
|
||||
volumeSlider->setValue(50);
|
||||
connect(volumeSlider,SIGNAL(valueChanged(int)),this,SLOT(updateVolume(int)));
|
||||
topBar->addWidget(volumeSlider);
|
||||
|
||||
layout->addLayout(buttonBar);
|
||||
#if defined Q_OS_SYMBIAN
|
||||
layout->addLayout(buttonBar2);
|
||||
#endif
|
||||
|
||||
searchLeft = new QPushButton;
|
||||
searchLeft->setText(tr("scan Down"));
|
||||
@@ -97,20 +85,12 @@ Radio::Radio()
|
||||
left = new QPushButton;
|
||||
left->setText(tr("Freq Down"));
|
||||
connect(left,SIGNAL(clicked()),SLOT(freqDown()));
|
||||
#if defined Q_OS_SYMBIAN
|
||||
buttonBar2->addWidget(left);
|
||||
#else
|
||||
buttonBar->addWidget(left);
|
||||
#endif
|
||||
|
||||
right = new QPushButton;
|
||||
connect(right,SIGNAL(clicked()),SLOT(freqUp()));
|
||||
right->setText(tr("Freq Up"));
|
||||
#if defined Q_OS_SYMBIAN
|
||||
buttonBar2->addWidget(right);
|
||||
#else
|
||||
buttonBar->addWidget(right);
|
||||
#endif
|
||||
|
||||
searchRight = new QPushButton;
|
||||
searchRight->setText(tr("scan Up"));
|
||||
|
||||
@@ -10,10 +10,6 @@ SOURCES = \
|
||||
main.cpp \
|
||||
radio.cpp
|
||||
|
||||
symbian: {
|
||||
TARGET.CAPABILITY = UserEnvironment WriteDeviceData ReadDeviceData SwEvent
|
||||
}
|
||||
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/qtmultimediakit/radio
|
||||
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro
|
||||
sources.path = $$[QT_INSTALL_EXAMPLES]/qtmultimediakit/radio
|
||||
|
||||
@@ -47,11 +47,7 @@ int main(int argc, char *argv[])
|
||||
QApplication app(argc, argv);
|
||||
|
||||
SlideShow slideShow;
|
||||
#ifdef Q_OS_SYMBIAN
|
||||
slideShow.showMaximized();
|
||||
#else
|
||||
slideShow.show();
|
||||
#endif
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
||||
@@ -10,11 +10,6 @@ SOURCES = \
|
||||
main.cpp \
|
||||
slideshow.cpp
|
||||
|
||||
symbian {
|
||||
TARGET.CAPABILITY = NetworkServices
|
||||
TARGET.EPOCHEAPSIZE = 0x20000 0x3000000
|
||||
}
|
||||
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/qtmultimediakit/slideshow
|
||||
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro
|
||||
sources.path = $$[QT_INSTALL_EXAMPLES]/qtmultimediakit/slideshow
|
||||
|
||||
@@ -31,16 +31,10 @@ SOURCES += fftreal_wrapper.cpp
|
||||
|
||||
DEFINES += FFTREAL_LIBRARY
|
||||
|
||||
symbian {
|
||||
# Provide unique ID for the generated binary, required by Symbian OS
|
||||
TARGET.UID3 = 0xA000E403
|
||||
TARGET.CAPABILITY = UserEnvironment
|
||||
}
|
||||
|
||||
macx {
|
||||
CONFIG += lib_bundle
|
||||
} else {
|
||||
!symbian: DESTDIR = ../..$${spectrum_build_dir}
|
||||
DESTDIR = ../..$${spectrum_build_dir}
|
||||
}
|
||||
|
||||
# Install
|
||||
|
||||
@@ -44,30 +44,15 @@ INCLUDEPATH += $${fftreal_dir}
|
||||
|
||||
RESOURCES = spectrum.qrc
|
||||
|
||||
symbian {
|
||||
# Platform security capability required to record audio on Symbian
|
||||
TARGET.CAPABILITY = UserEnvironment
|
||||
|
||||
# Provide unique ID for the generated binary, required by Symbian OS
|
||||
TARGET.UID3 = 0xA000E402
|
||||
}
|
||||
|
||||
|
||||
# Dynamic linkage against FFTReal DLL
|
||||
!contains(DEFINES, DISABLE_FFT) {
|
||||
symbian {
|
||||
# Must explicitly add the .dll suffix to ensure dynamic linkage
|
||||
LIBS += -lfftreal.dll
|
||||
QMAKE_LIBDIR += $${fftreal_dir}
|
||||
macx {
|
||||
# Link to fftreal framework
|
||||
LIBS += -F$${fftreal_dir}
|
||||
LIBS += -framework fftreal
|
||||
} else {
|
||||
macx {
|
||||
# Link to fftreal framework
|
||||
LIBS += -F$${fftreal_dir}
|
||||
LIBS += -framework fftreal
|
||||
} else {
|
||||
LIBS += -L..$${spectrum_build_dir}
|
||||
LIBS += -lfftreal
|
||||
}
|
||||
LIBS += -L..$${spectrum_build_dir}
|
||||
LIBS += -lfftreal
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,37 +66,26 @@ INSTALLS += sources images
|
||||
|
||||
# Deployment
|
||||
|
||||
symbian {
|
||||
CONFIG += qt_demo
|
||||
|
||||
DESTDIR = ..$${spectrum_build_dir}
|
||||
macx {
|
||||
!contains(DEFINES, DISABLE_FFT) {
|
||||
# Include FFTReal DLL in the SIS file
|
||||
fftreal.files = ../fftreal.dll
|
||||
fftreal.path = !:/sys/bin
|
||||
DEPLOYMENT += fftreal
|
||||
# Relocate fftreal.framework into spectrum.app bundle
|
||||
framework_dir = ../spectrum.app/Contents/Frameworks
|
||||
framework_name = fftreal.framework/Versions/1/fftreal
|
||||
QMAKE_POST_LINK = \
|
||||
mkdir -p $${framework_dir} &&\
|
||||
rm -rf $${framework_dir}/fftreal.framework &&\
|
||||
cp -R $${fftreal_dir}/fftreal.framework $${framework_dir} &&\
|
||||
install_name_tool -id @executable_path/../Frameworks/$${framework_name} \
|
||||
$${framework_dir}/$${framework_name} &&\
|
||||
install_name_tool -change $${framework_name} \
|
||||
@executable_path/../Frameworks/$${framework_name} \
|
||||
../spectrum.app/Contents/MacOS/spectrum
|
||||
}
|
||||
} else {
|
||||
DESTDIR = ..$${spectrum_build_dir}
|
||||
macx {
|
||||
!contains(DEFINES, DISABLE_FFT) {
|
||||
# Relocate fftreal.framework into spectrum.app bundle
|
||||
framework_dir = ../spectrum.app/Contents/Frameworks
|
||||
framework_name = fftreal.framework/Versions/1/fftreal
|
||||
QMAKE_POST_LINK = \
|
||||
mkdir -p $${framework_dir} &&\
|
||||
rm -rf $${framework_dir}/fftreal.framework &&\
|
||||
cp -R $${fftreal_dir}/fftreal.framework $${framework_dir} &&\
|
||||
install_name_tool -id @executable_path/../Frameworks/$${framework_name} \
|
||||
$${framework_dir}/$${framework_name} &&\
|
||||
install_name_tool -change $${framework_name} \
|
||||
@executable_path/../Frameworks/$${framework_name} \
|
||||
../spectrum.app/Contents/MacOS/spectrum
|
||||
}
|
||||
} else {
|
||||
linux-g++*: {
|
||||
# Provide relative path from application to fftreal library
|
||||
QMAKE_LFLAGS += -Wl,--rpath=\\\$\$ORIGIN
|
||||
}
|
||||
linux-g++*: {
|
||||
# Provide relative path from application to fftreal library
|
||||
QMAKE_LFLAGS += -Wl,--rpath=\\\$\$ORIGIN
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,11 +47,7 @@ int main(int argc, char **argv)
|
||||
app.setApplicationName("QtMultimediaKit spectrum analyzer");
|
||||
MainWidget w;
|
||||
|
||||
#ifdef Q_OS_SYMBIAN
|
||||
w.showMaximized();
|
||||
#else
|
||||
w.show();
|
||||
#endif
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
||||
@@ -149,12 +149,7 @@ void MainWidget::infoMessage(const QString &message, int timeoutMs)
|
||||
|
||||
void MainWidget::errorMessage(const QString &heading, const QString &detail)
|
||||
{
|
||||
#ifdef Q_OS_SYMBIAN
|
||||
const QString message = heading + "\n" + detail;
|
||||
QMessageBox::warning(this, "", message, QMessageBox::Close);
|
||||
#else
|
||||
QMessageBox::warning(this, heading, detail, QMessageBox::Close);
|
||||
#endif
|
||||
}
|
||||
|
||||
void MainWidget::timerEvent(QTimerEvent *event)
|
||||
|
||||
@@ -13,15 +13,6 @@ SUBDIRS += app
|
||||
|
||||
TARGET = spectrum
|
||||
|
||||
symbian {
|
||||
# Create a 'make sis' rule which can be run from the top-level
|
||||
|
||||
CONFIG += qt_demo
|
||||
|
||||
# UID for the SIS file
|
||||
TARGET.UID3 = 0xA000E402
|
||||
}
|
||||
|
||||
sources.files = README.txt spectrum.pri spectrum.pro TODO.txt
|
||||
sources.path = $$[QT_INSTALL_EXAMPLES]/qtmultimediakit/spectrum
|
||||
INSTALLS += sources
|
||||
|
||||
@@ -3,7 +3,7 @@ TARGET = videographicsitem
|
||||
|
||||
QT += multimediakit
|
||||
|
||||
!symbian:contains(QT_CONFIG, opengl): QT += opengl
|
||||
contains(QT_CONFIG, opengl): QT += opengl
|
||||
|
||||
HEADERS += videoplayer.h \
|
||||
videoitem.h
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include <QtGui>
|
||||
#include <qvideosurfaceformat.h>
|
||||
|
||||
#if !defined(QT_NO_OPENGL) && !defined(Q_OS_SYMBIAN)
|
||||
#if !defined(QT_NO_OPENGL)
|
||||
# include <QtOpenGL/QGLWidget>
|
||||
#endif
|
||||
|
||||
@@ -60,7 +60,7 @@ VideoPlayer::VideoPlayer(QWidget *parent, Qt::WindowFlags flags)
|
||||
QGraphicsScene *scene = new QGraphicsScene(this);
|
||||
QGraphicsView *graphicsView = new QGraphicsView(scene);
|
||||
|
||||
#if !defined(QT_NO_OPENGL) && !defined(Q_OS_SYMBIAN)
|
||||
#if !defined(QT_NO_OPENGL)
|
||||
graphicsView->setViewport(new QGLWidget);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -465,7 +465,7 @@ QList<QByteArray> QAudioDeviceInfoInternal::availableDevices(QAudio::Mode mode)
|
||||
if (idx > 0)
|
||||
devices.append("default");
|
||||
#endif
|
||||
#if (!defined(Q_WS_MAEMO_5) && !defined(Q_WS_MAEMO_6))
|
||||
#if !defined(Q_WS_MAEMO_6)
|
||||
if (devices.size() == 0 && allDevices.size() > 0)
|
||||
return allDevices;
|
||||
#endif
|
||||
|
||||
@@ -102,9 +102,6 @@ QStringList QAudioPluginLoader::pluginList() const
|
||||
#endif
|
||||
for (int j=0; j < files.count(); j++) {
|
||||
const QString &file = files.at(j);
|
||||
#if defined(Q_WS_MAEMO_5)
|
||||
if (!file.contains(QLatin1String("n900audio")))
|
||||
#endif
|
||||
plugins << pluginsDir.absoluteFilePath(file);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
#include "qsoundeffect_pulse_p.h"
|
||||
|
||||
#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
|
||||
#if defined(Q_WS_MAEMO_6)
|
||||
#include <pulse/ext-stream-restore.h>
|
||||
#endif
|
||||
|
||||
@@ -204,7 +204,7 @@ private:
|
||||
case PA_CONTEXT_SETTING_NAME:
|
||||
break;
|
||||
case PA_CONTEXT_READY:
|
||||
#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
|
||||
#if defined(Q_WS_MAEMO_6)
|
||||
pa_ext_stream_restore_read(c, &stream_restore_info_callback, self);
|
||||
pa_ext_stream_restore_set_subscribe_cb(c, &stream_restore_monitor_callback, self);
|
||||
pa_ext_stream_restore_subscribe(c, 1, 0, self);
|
||||
@@ -216,7 +216,7 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
|
||||
#if defined(Q_WS_MAEMO_6)
|
||||
|
||||
static void stream_restore_monitor_callback(pa_context *c, void *userdata)
|
||||
{
|
||||
|
||||
@@ -8,12 +8,7 @@ QT += core multimediakit-private
|
||||
# TARGET = tst_qaudioinput
|
||||
# CONFIG += testcase
|
||||
|
||||
wince*{
|
||||
DEFINES += SRCDIR=\\\"\\\"
|
||||
QT += gui
|
||||
} else {
|
||||
!symbian:DEFINES += SRCDIR=\\\"$$PWD/\\\"
|
||||
}
|
||||
DEFINES += SRCDIR=\\\"$$PWD/\\\"
|
||||
|
||||
HEADERS += wavheader.h
|
||||
SOURCES += wavheader.cpp tst_qaudioinput.cpp
|
||||
|
||||
@@ -53,10 +53,6 @@
|
||||
|
||||
#define AUDIO_BUFFER 192000
|
||||
|
||||
#if defined(Q_OS_SYMBIAN)
|
||||
#define SRCDIR ""
|
||||
#endif
|
||||
|
||||
#ifndef QTRY_VERIFY2
|
||||
#define QTRY_VERIFY2(__expr,__msg) \
|
||||
do { \
|
||||
|
||||
@@ -8,12 +8,7 @@ QT += core multimediakit-private
|
||||
# TARGET = tst_qaudiooutput
|
||||
# CONFIG += testcase
|
||||
|
||||
wince*: {
|
||||
DEFINES += SRCDIR=\\\"\\\"
|
||||
QT += gui
|
||||
} else {
|
||||
!symbian:DEFINES += SRCDIR=\\\"$$PWD/\\\"
|
||||
}
|
||||
DEFINES += SRCDIR=\\\"$$PWD/\\\"
|
||||
|
||||
HEADERS += wavheader.h
|
||||
SOURCES += wavheader.cpp tst_qaudiooutput.cpp
|
||||
|
||||
@@ -53,10 +53,6 @@
|
||||
|
||||
#define AUDIO_BUFFER 192000
|
||||
|
||||
#if defined(Q_OS_SYMBIAN)
|
||||
#define SRCDIR ""
|
||||
#endif
|
||||
|
||||
#ifndef QTRY_VERIFY2
|
||||
#define QTRY_VERIFY2(__expr,__msg) \
|
||||
do { \
|
||||
|
||||
@@ -7,9 +7,4 @@ QT += multimediakit-private
|
||||
|
||||
SOURCES += tst_qcamera.cpp
|
||||
|
||||
symbian {
|
||||
TARGET.CAPABILITY = ALL -TCB
|
||||
TARGET.EPOCHEAPSIZE = 0x20000 0x3000000
|
||||
}
|
||||
|
||||
maemo*:CONFIG += insignificant_test
|
||||
|
||||
@@ -7,9 +7,4 @@ QT += multimediakit-private
|
||||
|
||||
SOURCES += tst_qcamerabackend.cpp
|
||||
|
||||
symbian {
|
||||
TARGET.CAPABILITY = ALL -TCB
|
||||
TARGET.EPOCHEAPSIZE = 0x20000 0x3000000
|
||||
}
|
||||
|
||||
maemo*:CONFIG += insignificant_test
|
||||
|
||||
@@ -538,7 +538,7 @@ void tst_QCameraBackend::testCameraCaptureMetadata()
|
||||
|
||||
void tst_QCameraBackend::testExposureCompensation()
|
||||
{
|
||||
#if !defined(Q_WS_MAEMO_6) && !defined(Q_WS_MAEMO_5) && !defined(Q_OS_SYMBIAN)
|
||||
#if !defined(Q_WS_MAEMO_6)
|
||||
QSKIP("Capture exposure parameters are supported only on mobile platforms", SkipAll);
|
||||
#endif
|
||||
|
||||
@@ -547,12 +547,6 @@ void tst_QCameraBackend::testExposureCompensation()
|
||||
|
||||
QSignalSpy exposureCompensationSignal(exposure, SIGNAL(exposureCompensationChanged(qreal)));
|
||||
|
||||
#ifdef Q_OS_SYMBIAN
|
||||
// Camera needs to be started, see: QTMOBILITY-1566
|
||||
camera.load();
|
||||
QTRY_COMPARE(camera.status(), QCamera::LoadedStatus);
|
||||
#endif // Q_OS_SYMBIAN
|
||||
|
||||
//it should be possible to set exposure parameters in Unloaded state
|
||||
QCOMPARE(exposure->exposureCompensation()+1.0, 1.0);
|
||||
exposure->setExposureCompensation(1.0);
|
||||
@@ -591,7 +585,7 @@ void tst_QCameraBackend::testExposureCompensation()
|
||||
|
||||
void tst_QCameraBackend::testExposureMode()
|
||||
{
|
||||
#if !defined(Q_WS_MAEMO_6) && !defined(Q_WS_MAEMO_5) && !defined(Q_OS_SYMBIAN)
|
||||
#if !defined(Q_WS_MAEMO_6)
|
||||
QSKIP("Capture exposure parameters are supported only on mobile platforms", SkipAll);
|
||||
#endif
|
||||
|
||||
@@ -603,12 +597,6 @@ void tst_QCameraBackend::testExposureMode()
|
||||
#endif
|
||||
QCOMPARE(exposure->exposureMode(), QCameraExposure::ExposureAuto);
|
||||
|
||||
#ifdef Q_OS_SYMBIAN
|
||||
// Camera needs to be started, see: QTMOBILITY-1566
|
||||
camera.load();
|
||||
QTRY_COMPARE(camera.status(), QCamera::LoadedStatus);
|
||||
#endif // Q_OS_SYMBIAN
|
||||
|
||||
// Night
|
||||
exposure->setExposureMode(QCameraExposure::ExposureNight);
|
||||
QCOMPARE(exposure->exposureMode(), QCameraExposure::ExposureNight);
|
||||
@@ -619,12 +607,6 @@ void tst_QCameraBackend::testExposureMode()
|
||||
camera.unload();
|
||||
QTRY_COMPARE(camera.status(), QCamera::UnloadedStatus);
|
||||
|
||||
#ifdef Q_OS_SYMBIAN
|
||||
// Camera needs to be started, see: QTMOBILITY-1566
|
||||
camera.load();
|
||||
QTRY_COMPARE(camera.status(), QCamera::LoadedStatus);
|
||||
#endif // Q_OS_SYMBIAN
|
||||
|
||||
#ifdef Q_WS_MAEMO_6
|
||||
//resource policy doesn't work correctly when resource is released and immediately requested again.
|
||||
QTest::qWait(250);
|
||||
|
||||
@@ -7,6 +7,4 @@ QT += multimediakit-private
|
||||
|
||||
SOURCES += tst_qgraphicsvideoitem.cpp
|
||||
|
||||
symbian: TARGET.CAPABILITY = ReadDeviceData WriteDeviceData
|
||||
|
||||
maemo*:CONFIG += insignificant_test
|
||||
|
||||
@@ -42,10 +42,6 @@
|
||||
#include <QtTest/QtTest>
|
||||
|
||||
#include "tst_qmediaobject.h"
|
||||
#ifdef Q_OS_SYMBIAN
|
||||
#include "tst_qmediaobject_xa.h"
|
||||
#include "tst_qmediaobject_mmf.h"
|
||||
#endif
|
||||
|
||||
int main(int argc, char**argv)
|
||||
{
|
||||
@@ -53,25 +49,5 @@ int main(int argc, char**argv)
|
||||
int ret;
|
||||
tst_QMediaObject test_api;
|
||||
ret = QTest::qExec(&test_api, argc, argv);
|
||||
#ifdef Q_OS_SYMBIAN
|
||||
char *new_argv[3];
|
||||
QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + "_xa.log";
|
||||
QByteArray bytes = str.toAscii();
|
||||
char arg1[] = "-o";
|
||||
new_argv[0] = argv[0];
|
||||
new_argv[1] = arg1;
|
||||
new_argv[2] = bytes.data();
|
||||
tst_QMetadata_xa test_xa;
|
||||
ret = QTest::qExec(&test_xa, 3, new_argv);
|
||||
char *new_argv1[3];
|
||||
QString str1 = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + "_s60.log";
|
||||
QByteArray bytes1 = str1.toAscii();
|
||||
char arg2[] = "-o";
|
||||
new_argv1[0] = argv[0];
|
||||
new_argv1[1] = arg2;
|
||||
new_argv1[2] = bytes1.data();
|
||||
tst_QMediaObject_mmf test_mmf;
|
||||
ret = QTest::qExec(&test_mmf, 3, new_argv1);
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -5,23 +5,6 @@ QT += multimediakit-private
|
||||
# TARGET = tst_qmediaobject
|
||||
# CONFIG += testcase
|
||||
|
||||
symbian {
|
||||
HEADERS += tst_qmediaobject_xa.h
|
||||
SOURCES += tst_qmediaobject_xa.cpp
|
||||
TARGET.CAPABILITY = ALL -TCB
|
||||
|
||||
testFiles.sources = testfiles/*
|
||||
testFiles.path = /Data/testfiles
|
||||
DEPLOYMENT += testFiles
|
||||
HEADERS += tst_qmediaobject_mmf.h
|
||||
SOURCES += tst_qmediaobject_mmf.cpp
|
||||
TARGET.CAPABILITY = ALL -TCB
|
||||
|
||||
testFiles.sources = testfiles/*
|
||||
testFiles.path = /Data/testfiles
|
||||
DEPLOYMENT += testFiles
|
||||
}
|
||||
|
||||
HEADERS+= tst_qmediaobject.h
|
||||
SOURCES += main.cpp tst_qmediaobject.cpp
|
||||
|
||||
|
||||
@@ -1,278 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the Qt Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
#include <tst_qmediaobject_mmf.h>
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
|
||||
void tst_QMediaObject_mmf::initTestCase_data()
|
||||
{
|
||||
QTest::addColumn<bool>("valid");
|
||||
QTest::addColumn<QMediaContent>("mediaContent");
|
||||
QTest::addColumn<bool>("metaDataAvailable");
|
||||
|
||||
QTest::newRow("TestDataNull")
|
||||
<< false // valid
|
||||
<< QMediaContent() // mediaContent
|
||||
<< false; // metaDataAvailable
|
||||
|
||||
QTest::newRow("test_amr.amr")
|
||||
<< true // valid
|
||||
<< QMediaContent(QUrl("file:///C:/data/testfiles/test_amr.amr")) // mediaContent
|
||||
<< false; // metaDataAvailable
|
||||
|
||||
QTest::newRow("test_flash_video.flv")
|
||||
<< true // valid
|
||||
<< QMediaContent(QUrl("file:///C:/data/testfiles/test_flash_video.flv")) // mediaContent
|
||||
<< false; // metaDataAvailable
|
||||
|
||||
QTest::newRow("test_invalid_extension_mp4.xyz")
|
||||
<< true // valid
|
||||
<< QMediaContent(QUrl("file:///C:/data/testfiles/test_invalid_extension_mp4.xyz")) // mediaContent
|
||||
<< false; // metaDataAvailable
|
||||
|
||||
QTest::newRow("test_invalid_extension_wav.xyz")
|
||||
<< true // valid
|
||||
<< QMediaContent(QUrl("file:///C:/data/testfiles/test_invalid_extension_wav.xyz")) // mediaContent
|
||||
<< false; // metaDataAvailable
|
||||
|
||||
QTest::newRow("test_mp3.mp3")
|
||||
<< true // valid
|
||||
<< QMediaContent(QUrl("file:///C:/data/testfiles/test_mp3.mp3")) // mediaContent
|
||||
#if !defined(__WINS__) || !defined(__WINSCW__)
|
||||
<< true; // metaDataAvailable
|
||||
#else
|
||||
<< false; // metaDataAvailable
|
||||
#endif // !defined(__WINS__) || defined(__WINSCW__)
|
||||
|
||||
QTest::newRow("test_mp3_no_metadata.mp3")
|
||||
<< true // valid
|
||||
<< QMediaContent(QUrl("file:///C:/data/testfiles/test_mp3_no_metadata.mp3")) // mediaContent
|
||||
<< false; // metaDataAvailable
|
||||
|
||||
QTest::newRow("test_mp4.mp4")
|
||||
<< true // valid
|
||||
<< QMediaContent(QUrl("file:///C:/data/testfiles/test_mp4.mp4")) // mediaContent
|
||||
#if defined(__WINS__) || defined(__WINSCW__)
|
||||
<< true; // metaDataAvailable
|
||||
#else
|
||||
<< false; // metaDataAvailable
|
||||
#endif // !defined(__WINS__) || defined(__WINSCW__)
|
||||
|
||||
QTest::newRow("test_wav.wav")
|
||||
<< true // valid
|
||||
<< QMediaContent(QUrl("file:///C:/data/testfiles/test_wav.wav")) // mediaContent
|
||||
<< false; // metaDataAvailable
|
||||
|
||||
QTest::newRow("test_wmv9.wmv")
|
||||
<< true // valid
|
||||
<< QMediaContent(QUrl("file:///C:/data/testfiles/test_wmv9.wmv")) // mediaContent
|
||||
<< false; // metaDataAvailable
|
||||
|
||||
QTest::newRow("test youtube stream")
|
||||
<< true // valid
|
||||
<< QMediaContent(QUrl("rtsp://v3.cache4.c.youtube.com/CkgLENy73wIaPwlU2rm7yu8PFhMYESARFEIJbXYtZ29vZ2xlSARSB3JlbGF0ZWRaDkNsaWNrVGh1bWJuYWlsYPi6_IXT2rvpSgw=/0/0/0/video.3gp")) // mediaContent
|
||||
<< false; // metaDataAvailable
|
||||
}
|
||||
|
||||
void tst_QMediaObject_mmf::initTestCase()
|
||||
{
|
||||
}
|
||||
|
||||
void tst_QMediaObject_mmf::cleanupTestCase()
|
||||
{
|
||||
}
|
||||
|
||||
void tst_QMediaObject_mmf::init()
|
||||
{
|
||||
qRegisterMetaType<QMediaContent>("QMediaContent");
|
||||
}
|
||||
|
||||
void tst_QMediaObject_mmf::cleanup()
|
||||
{
|
||||
}
|
||||
|
||||
void tst_QMediaObject_mmf::isMetaDataAvailable()
|
||||
{
|
||||
QFETCH_GLOBAL(QMediaContent, mediaContent);
|
||||
QFETCH_GLOBAL(bool, metaDataAvailable);
|
||||
QMediaPlayer player;
|
||||
|
||||
player.setMedia(mediaContent);
|
||||
QTest::qWait(700);
|
||||
QVERIFY(player.isMetaDataAvailable() == metaDataAvailable);
|
||||
}
|
||||
|
||||
void tst_QMediaObject_mmf::metaData()
|
||||
{
|
||||
QFETCH_GLOBAL(QMediaContent, mediaContent);
|
||||
QFETCH_GLOBAL(bool, metaDataAvailable);
|
||||
QMediaPlayer player;
|
||||
|
||||
player.setMedia(mediaContent);
|
||||
QTest::qWait(700);
|
||||
const QString artist(QLatin1String("Artist"));
|
||||
const QString title(QLatin1String("Title"));
|
||||
|
||||
if (player.isMetaDataAvailable()) {
|
||||
QCOMPARE(player.metaData(QtMultimediaKit::AlbumArtist).toString(), artist);
|
||||
QCOMPARE(player.metaData(QtMultimediaKit::Title).toString(), title);
|
||||
}
|
||||
}
|
||||
|
||||
void tst_QMediaObject_mmf::availableMetaData()
|
||||
{
|
||||
QFETCH_GLOBAL(QMediaContent, mediaContent);
|
||||
QFETCH_GLOBAL(bool, metaDataAvailable);
|
||||
QMediaPlayer player;
|
||||
|
||||
player.setMedia(mediaContent);
|
||||
QTest::qWait(700);
|
||||
|
||||
if (player.isMetaDataAvailable()) {
|
||||
QList<QtMultimediaKit::MetaData> metaDataKeys = player.availableMetaData();
|
||||
QVERIFY(metaDataKeys.count() > 0);
|
||||
QVERIFY(metaDataKeys.contains(QtMultimediaKit::AlbumArtist));
|
||||
QVERIFY(metaDataKeys.contains(QtMultimediaKit::Title));
|
||||
}
|
||||
}
|
||||
|
||||
void tst_QMediaObject_mmf::extendedMetaData()
|
||||
{
|
||||
QFETCH_GLOBAL(QMediaContent, mediaContent);
|
||||
QMediaPlayer player;
|
||||
|
||||
player.setMedia(mediaContent);
|
||||
QTest::qWait(700);
|
||||
const QString artist(QLatin1String("Artist"));
|
||||
const QString title(QLatin1String("Title"));
|
||||
|
||||
if (player.isMetaDataAvailable()) {
|
||||
QCOMPARE(player.extendedMetaData(metaDataKeyAsString(QtMultimediaKit::AlbumArtist)).toString(), artist);
|
||||
QCOMPARE(player.extendedMetaData(metaDataKeyAsString(QtMultimediaKit::Title)).toString(), title);
|
||||
}
|
||||
}
|
||||
|
||||
void tst_QMediaObject_mmf::availableExtendedMetaData()
|
||||
{
|
||||
QFETCH_GLOBAL(QMediaContent, mediaContent);
|
||||
QMediaPlayer player;
|
||||
|
||||
player.setMedia(mediaContent);
|
||||
QTest::qWait(700);
|
||||
const QString artist(QLatin1String("Artist"));
|
||||
const QString title(QLatin1String("Title"));
|
||||
|
||||
if (player.isMetaDataAvailable()) {
|
||||
QStringList metaDataKeys = player.availableExtendedMetaData();
|
||||
QVERIFY(metaDataKeys.count() > 0);
|
||||
/* qWarning() << "metaDataKeys.count: " << metaDataKeys.count();
|
||||
int count = metaDataKeys.count();
|
||||
count = count-1;
|
||||
int i = 0;
|
||||
while(count >= i)
|
||||
{
|
||||
qWarning() << "metaDataKeys "<<i<<"." << metaDataKeys.at(i);
|
||||
i++;
|
||||
}*/
|
||||
QVERIFY(metaDataKeys.contains(metaDataKeyAsString(QtMultimediaKit::AlbumArtist)));
|
||||
QVERIFY(metaDataKeys.contains(metaDataKeyAsString(QtMultimediaKit::Title)));
|
||||
}
|
||||
}
|
||||
|
||||
QString tst_QMediaObject_mmf::metaDataKeyAsString(QtMultimediaKit::MetaData key) const
|
||||
{
|
||||
switch(key) {
|
||||
case QtMultimediaKit::Title: return "title";
|
||||
case QtMultimediaKit::AlbumArtist: return "artist";
|
||||
case QtMultimediaKit::Comment: return "comment";
|
||||
case QtMultimediaKit::Genre: return "genre";
|
||||
case QtMultimediaKit::Year: return "year";
|
||||
case QtMultimediaKit::Copyright: return "copyright";
|
||||
case QtMultimediaKit::AlbumTitle: return "album";
|
||||
case QtMultimediaKit::Composer: return "composer";
|
||||
case QtMultimediaKit::TrackNumber: return "albumtrack";
|
||||
case QtMultimediaKit::AudioBitRate: return "audiobitrate";
|
||||
case QtMultimediaKit::VideoBitRate: return "videobitrate";
|
||||
case QtMultimediaKit::Duration: return "duration";
|
||||
case QtMultimediaKit::MediaType: return "contenttype";
|
||||
case QtMultimediaKit::SubTitle:
|
||||
case QtMultimediaKit::Description:
|
||||
case QtMultimediaKit::Category:
|
||||
case QtMultimediaKit::Date:
|
||||
case QtMultimediaKit::UserRating:
|
||||
case QtMultimediaKit::Keywords:
|
||||
case QtMultimediaKit::Language:
|
||||
case QtMultimediaKit::Publisher:
|
||||
case QtMultimediaKit::ParentalRating:
|
||||
case QtMultimediaKit::RatingOrganisation:
|
||||
case QtMultimediaKit::Size:
|
||||
case QtMultimediaKit::AudioCodec:
|
||||
case QtMultimediaKit::AverageLevel:
|
||||
case QtMultimediaKit::ChannelCount:
|
||||
case QtMultimediaKit::PeakValue:
|
||||
case QtMultimediaKit::SampleRate:
|
||||
case QtMultimediaKit::Author:
|
||||
case QtMultimediaKit::ContributingArtist:
|
||||
case QtMultimediaKit::Conductor:
|
||||
case QtMultimediaKit::Lyrics:
|
||||
case QtMultimediaKit::Mood:
|
||||
case QtMultimediaKit::TrackCount:
|
||||
case QtMultimediaKit::CoverArtUrlSmall:
|
||||
case QtMultimediaKit::CoverArtUrlLarge:
|
||||
case QtMultimediaKit::Resolution:
|
||||
case QtMultimediaKit::PixelAspectRatio:
|
||||
case QtMultimediaKit::VideoFrameRate:
|
||||
case QtMultimediaKit::VideoCodec:
|
||||
case QtMultimediaKit::PosterUrl:
|
||||
case QtMultimediaKit::ChapterNumber:
|
||||
case QtMultimediaKit::Director:
|
||||
case QtMultimediaKit::LeadPerformer:
|
||||
case QtMultimediaKit::Writer:
|
||||
case QtMultimediaKit::CameraManufacturer:
|
||||
case QtMultimediaKit::CameraModel:
|
||||
case QtMultimediaKit::Event:
|
||||
case QtMultimediaKit::Subject:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return QString();
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the Qt Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef TST_QMEDIAOBJECT_MMF_H
|
||||
#define TST_QMEDIAOBJECT_MMF_H
|
||||
|
||||
#include <QtTest/QtTest>
|
||||
#include <QtCore>
|
||||
#include <QtGui>
|
||||
|
||||
#include <qtmedianamespace.h>
|
||||
#include <QMediaPlayer>
|
||||
#include <QMediaPlayerControl>
|
||||
#include <QMediaPlaylist>
|
||||
#include <QMediaService>
|
||||
#include <QMediaStreamsControl>
|
||||
#include <QVideoWidget>
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
|
||||
class tst_QMediaObject_mmf : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public slots:
|
||||
void initTestCase_data();
|
||||
void initTestCase();
|
||||
void cleanupTestCase();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
private slots:
|
||||
void isMetaDataAvailable();
|
||||
void metaData();
|
||||
void availableMetaData();
|
||||
void extendedMetaData();
|
||||
void availableExtendedMetaData();
|
||||
|
||||
private:
|
||||
QString metaDataKeyAsString(QtMultimediaKit::MetaData key) const;
|
||||
};
|
||||
|
||||
#endif // TST_QMEDIAOBJECT_MMF_H
|
||||
@@ -1,158 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the Qt Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "tst_qmediaobject_xa.h"
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
|
||||
#define WAIT_FOR_CONDITION(a,e) \
|
||||
for (int _i = 0; _i < 500; _i += 1) { \
|
||||
if ((a) == (e)) break; \
|
||||
QTest::qWait(10);}
|
||||
|
||||
|
||||
#define WAIT_LONG_FOR_CONDITION(a,e) \
|
||||
for (int _i = 0; _i < 1800; _i += 1) { \
|
||||
if ((a) == (e)) break; \
|
||||
QTest::qWait(100);}
|
||||
|
||||
Q_DECLARE_METATYPE(QtMultimediaKit::MetaData)
|
||||
|
||||
void tst_QMetadata_xa::initTestCase_data()
|
||||
{
|
||||
QTest::addColumn<QMediaContent>("mediaContent");
|
||||
QTest::addColumn<int>("count");
|
||||
QTest::addColumn<QtMultimediaKit::MetaData>("key");
|
||||
QTest::addColumn<qint64>("intValue");
|
||||
QTest::addColumn<QString>("strValue");
|
||||
|
||||
QTest::newRow("testmp3.mp3 - No Metadata")
|
||||
<< QMediaContent(QUrl("file:///C:/data/testfiles/test.mp3")) // mediaContent
|
||||
<< 0 //count
|
||||
<< QtMultimediaKit::Title //key - irrelavant when count 0
|
||||
<< qint64(-1) //intValue
|
||||
<< QString(); //strValue
|
||||
|
||||
QTest::newRow("JapJap.mp3 - Title")
|
||||
<< QMediaContent(QUrl("file:///C:/data/testfiles/JapJap.mp3")) // mediaContent
|
||||
<< -1 //count - ignore
|
||||
<< QtMultimediaKit::Title //key
|
||||
<< qint64(-1) //intValue
|
||||
<< QString("JapJap");//strValue
|
||||
|
||||
QTest::newRow("JapJap.mp3 - Artist")
|
||||
<< QMediaContent(QUrl("file:///C:/data/testfiles/JapJap.mp3")) // mediaContent
|
||||
<< -1 //count - ignore
|
||||
<< QtMultimediaKit::AlbumArtist //key
|
||||
<< qint64(-1) //intValue
|
||||
<< QString("Screaming trees");//strValue
|
||||
|
||||
QTest::newRow("JapJap.mp3 - Album")
|
||||
<< QMediaContent(QUrl("file:///C:/data/testfiles/JapJap.mp3")) // mediaContent
|
||||
<< -1 //count - ignore
|
||||
<< QtMultimediaKit::AlbumTitle //key
|
||||
<< qint64(-1) //intValue
|
||||
<< QString("Sweet oblivion"); //strValue
|
||||
|
||||
QTest::newRow("JapJap.mp3 - CoverArt")
|
||||
<< QMediaContent(QUrl("file:///C:/data/testfiles/JapJap.mp3")) // mediaContent
|
||||
<< -1 //count - ignore
|
||||
<< QtMultimediaKit::CoverArtImage //key
|
||||
<< qint64(28521) //intValue
|
||||
<< QString("C:/data/testfiles/JapJapCoverArt.jpeg"); //strValue
|
||||
}
|
||||
|
||||
void tst_QMetadata_xa::initTestCase()
|
||||
{
|
||||
m_player = new QMediaPlayer();
|
||||
|
||||
// Symbian back end needs coecontrol for creation.
|
||||
m_widget = new QVideoWidget();
|
||||
//m_widget->setMediaObject(m_player);
|
||||
m_widget->show();
|
||||
runonce = false;
|
||||
}
|
||||
|
||||
void tst_QMetadata_xa::cleanupTestCase()
|
||||
{
|
||||
delete m_player;
|
||||
delete m_widget;
|
||||
}
|
||||
|
||||
void tst_QMetadata_xa::init()
|
||||
{
|
||||
qRegisterMetaType<QMediaContent>("QMediaContent");
|
||||
qRegisterMetaType<QtMultimediaKit::MetaData>("QtMultimediaKit::MetaData");
|
||||
}
|
||||
|
||||
void tst_QMetadata_xa::cleanup()
|
||||
{
|
||||
}
|
||||
|
||||
void tst_QMetadata_xa::testMetadata()
|
||||
{
|
||||
QFETCH_GLOBAL(QMediaContent, mediaContent);
|
||||
QFETCH_GLOBAL(int, count);
|
||||
QFETCH_GLOBAL(QtMultimediaKit::MetaData, key);
|
||||
QFETCH_GLOBAL(QString, strValue);
|
||||
QFETCH_GLOBAL(qint64, intValue);
|
||||
|
||||
QSignalSpy spy(m_player, SIGNAL(metaDataAvailableChanged(bool)));
|
||||
m_player->setMedia(mediaContent);
|
||||
|
||||
WAIT_FOR_CONDITION(spy.count(), 1);
|
||||
//get metadata count
|
||||
QList<QtMultimediaKit::MetaData> mdList = m_player->availableMetaData ();
|
||||
QStringList amdList = m_player->availableExtendedMetaData();
|
||||
|
||||
int numMetadataItems = mdList.size() + amdList.size();
|
||||
if (count>=0) //-1 indicate ignore count
|
||||
QVERIFY(count==numMetadataItems);
|
||||
|
||||
if (numMetadataItems>0 && !strValue.isEmpty()) {
|
||||
QVariant val = m_player->metaData(key);
|
||||
|
||||
if(key == QtMultimediaKit::CoverArtImage)
|
||||
val.value<QImage>().save(strValue);
|
||||
else
|
||||
QVERIFY(strValue == val.toString());
|
||||
}
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the Qt Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef TST_QMEDIAOBJECT_XA_H
|
||||
#define TST_QMEDIAOBJECT_XA_H
|
||||
|
||||
#include <QtTest/QtTest>
|
||||
#include <QtCore>
|
||||
#include <QtGui>
|
||||
|
||||
#include <QMediaPlayer>
|
||||
#include <QMediaPlayerControl>
|
||||
#include <QMediaPlaylist>
|
||||
#include <QMediaService>
|
||||
#include <QMediaStreamsControl>
|
||||
#include <QVideoWidget>
|
||||
|
||||
#include <QList>
|
||||
#include <QStringList>
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
|
||||
class tst_QMetadata_xa: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public slots:
|
||||
void initTestCase_data();
|
||||
void initTestCase();
|
||||
void cleanupTestCase();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
private slots:
|
||||
void testMetadata();
|
||||
|
||||
|
||||
private:
|
||||
void displayImage(QImage);
|
||||
QMediaPlayer *m_player;
|
||||
QVideoWidget *m_widget;
|
||||
bool runonce;
|
||||
};
|
||||
|
||||
#endif //TST_QMEDIAOBJECT_XA_H
|
||||
@@ -43,38 +43,11 @@
|
||||
|
||||
#include "tst_qmediaplayer.h"
|
||||
|
||||
#ifdef Q_OS_SYMBIAN
|
||||
#include "tst_qmediaplayer_xa.h"
|
||||
#include "tst_qmediaplayer_s60.h"
|
||||
#endif
|
||||
|
||||
int main(int argc, char**argv)
|
||||
{
|
||||
QApplication app(argc,argv);
|
||||
int ret;
|
||||
tst_QMediaPlayer test_api;
|
||||
ret = QTest::qExec(&test_api, argc, argv);
|
||||
#ifdef Q_OS_SYMBIAN
|
||||
#ifdef HAS_OPENMAXAL_MEDIAPLAY_BACKEND
|
||||
char *new_argv[3];
|
||||
QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + "_s60.log";
|
||||
QByteArray bytes = str.toAscii();
|
||||
char arg1[] = "-o";
|
||||
new_argv[0] = argv[0];
|
||||
new_argv[1] = arg1;
|
||||
new_argv[2] = bytes.data();
|
||||
tst_QMediaPlayer_xa test_xa;
|
||||
ret = QTest::qExec(&test_xa, 3, new_argv);
|
||||
#endif
|
||||
char *new_argv1[3];
|
||||
QString str1 = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + "_s60.log";
|
||||
QByteArray bytes1 = str1.toAscii();
|
||||
char arg2[] = "-o";
|
||||
new_argv1[0] = argv[0];
|
||||
new_argv1[1] = arg2;
|
||||
new_argv1[2] = bytes1.data();
|
||||
tst_QMediaPlayer_s60 test_s60;
|
||||
ret = QTest::qExec(&test_s60, 3, new_argv1);
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -5,21 +5,6 @@ QT += network multimediakit-private
|
||||
# TARGET = tst_qmediaplayer
|
||||
# CONFIG += testcase
|
||||
|
||||
symbian {
|
||||
TARGET.CAPABILITY = NetworkServices
|
||||
testFiles.sources = testfiles/*
|
||||
testFiles.path = /Data/testfiles
|
||||
DEPLOYMENT += testFiles
|
||||
contains(openmaxal_symbian_enabled, no) {
|
||||
DEFINES += HAS_OPENMAXAL_MEDIAPLAY_BACKEND
|
||||
HEADERS += tst_qmediaplayer_xa.h
|
||||
SOURCES += tst_qmediaplayer_xa.cpp
|
||||
} else {
|
||||
HEADERS += tst_qmediaplayer_s60.h
|
||||
SOURCES += tst_qmediaplayer_s60.cpp
|
||||
}
|
||||
}
|
||||
|
||||
HEADERS += tst_qmediaplayer.h
|
||||
SOURCES += main.cpp tst_qmediaplayer.cpp
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,137 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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 Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
#ifndef TST_QMEDIAPLAYER_S60_H
|
||||
#define TST_QMEDIAPLAYER_S60_H
|
||||
|
||||
#include <QtTest/QtTest>
|
||||
#include <QtCore>
|
||||
#include <QtGui>
|
||||
#include <QFile>
|
||||
|
||||
#include <QMediaPlayer>
|
||||
#include <QMediaPlayerControl>
|
||||
#include <QMediaPlaylist>
|
||||
#include <QMediaService>
|
||||
#include <QMediaStreamsControl>
|
||||
#include <QVideoWidget>
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
|
||||
#define WAIT_FOR_CONDITION(a,e) \
|
||||
for (int _i = 0; _i < 500; _i += 1) { \
|
||||
if ((a) == (e)) break; \
|
||||
QTest::qWait(10);}
|
||||
|
||||
|
||||
#define WAIT_LONG_FOR_CONDITION(a,e) \
|
||||
for (int _i = 0; _i < 1800; _i += 1) { \
|
||||
if ((a) == (e)) break; \
|
||||
QTest::qWait(100);}
|
||||
|
||||
class mediaStatusList : public QObject, public QList<QMediaPlayer::MediaStatus>
|
||||
{
|
||||
Q_OBJECT
|
||||
public slots:
|
||||
void mediaStatus(QMediaPlayer::MediaStatus status) {
|
||||
append(status);
|
||||
}
|
||||
|
||||
public:
|
||||
mediaStatusList(QObject *obj, const char *aSignal)
|
||||
: QObject()
|
||||
{
|
||||
connect(obj, aSignal, this, SLOT(mediaStatus(QMediaPlayer::MediaStatus)));
|
||||
}
|
||||
};
|
||||
|
||||
class MockProvider_s60 : public QMediaServiceProvider
|
||||
{
|
||||
public:
|
||||
MockProvider_s60(QMediaService *service):mockService(service) {}
|
||||
QMediaService *requestService(const QByteArray &, const QMediaServiceProviderHint &)
|
||||
{
|
||||
return mockService;
|
||||
}
|
||||
|
||||
void releaseService(QMediaService *service) { delete service; }
|
||||
|
||||
QMediaService *mockService;
|
||||
};
|
||||
|
||||
class tst_QMediaPlayer_s60: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public slots:
|
||||
void initTestCase_data();
|
||||
void initTestCase_data_default_winscw();
|
||||
void initTestCase_data_default_armv5();
|
||||
void initTestCase();
|
||||
void cleanupTestCase();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
private slots:
|
||||
void testNullService();
|
||||
void testMedia();
|
||||
void testDuration();
|
||||
void testPosition();
|
||||
void testPositionWhilePlaying();
|
||||
void testVolume();
|
||||
void testVolumeWhilePlaying();
|
||||
void testMuted();
|
||||
void testMutedWhilePlaying();
|
||||
void testVideoAndAudioAvailability();
|
||||
void testError();
|
||||
void testPlay();
|
||||
void testPause();
|
||||
void testStop();
|
||||
void testMediaStatus();
|
||||
void testPlaylist();
|
||||
void testStreamControl();
|
||||
|
||||
private:
|
||||
QMediaPlayer *m_player;
|
||||
QVideoWidget *m_widget;
|
||||
bool runonce;
|
||||
};
|
||||
|
||||
#endif // TST_QMEDIAPLAYER_S60_H
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,194 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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 Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
#ifndef TST_QMEDIAPLAYER_XA_H
|
||||
#define TST_QMEDIAPLAYER_XA_H
|
||||
|
||||
#include <QtTest/QtTest>
|
||||
#include <QtCore>
|
||||
#include <QtGui>
|
||||
#include <QFile>
|
||||
|
||||
#include <QMediaPlayer>
|
||||
#include <QMediaPlayerControl>
|
||||
#include <QMediaService>
|
||||
#include <QMediaStreamsControl>
|
||||
#include <QVideoWidget>
|
||||
#include <QVideoWidgetControl>
|
||||
#include <QVideoWindowControl>
|
||||
#include <QMetadataReaderControl>
|
||||
#include <QtNetwork/qnetworkconfiguration.h>
|
||||
#include <QtNetwork/qnetworkconfigmanager.h>
|
||||
#include <qmedianetworkaccesscontrol.h>
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
class mediaStatusList;
|
||||
/*
|
||||
class mediaStatusList : public QObject, public QList<QMediaPlayer::MediaStatus>
|
||||
{
|
||||
Q_OBJECT
|
||||
public slots:
|
||||
void mediaStatus(QMediaPlayer::MediaStatus status) {
|
||||
append(status);
|
||||
}
|
||||
|
||||
public:
|
||||
mediaStatusList(QObject *obj, const char *aSignal)
|
||||
: QObject()
|
||||
{
|
||||
connect(obj, aSignal, this, SLOT(mediaStatus(QMediaPlayer::MediaStatus)));
|
||||
}
|
||||
};
|
||||
*/
|
||||
class tst_QMediaPlayer_xa: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
tst_QMediaPlayer_xa();
|
||||
~tst_QMediaPlayer_xa();
|
||||
|
||||
private slots:
|
||||
void initTestCase_data();
|
||||
void initTestCase();
|
||||
void cleanupTestCase();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
void testMediaStatus();
|
||||
void testBufferStatus();
|
||||
void testPositionWhilePlaying();
|
||||
void testFullScreen();
|
||||
void testWindowControl_FullScreen();
|
||||
void testSeekable();
|
||||
void testStreamInformation();
|
||||
void testAspectRatioMode();
|
||||
void testMedia();
|
||||
void testDuration();
|
||||
void testPosition();
|
||||
void testVolume();
|
||||
void testVolumeWhilePlaying();
|
||||
void testMuted();
|
||||
void testMutedWhilePlaying();
|
||||
void testVideoAndAudioAvailability();
|
||||
void testPlay();
|
||||
void testPause();
|
||||
void testStop();
|
||||
void testPlaybackRate();
|
||||
void testPlaybackRateWhilePlaying();
|
||||
void testWindowControl_NativeSize();
|
||||
void testWindowControl_AspectRatioMode();
|
||||
void testSetconfigurationsAP();
|
||||
void testSetAccesspoint();
|
||||
void testGetAccesspoint();
|
||||
void testDiffmediacontentAP();
|
||||
void testInvalidaddressAP();
|
||||
void testMultipleAccesspoints();
|
||||
void testReconnectAPWhilestreaming();
|
||||
void teststreampausestream();
|
||||
void testStressAccessPoint();
|
||||
|
||||
private:
|
||||
|
||||
void resetPlayer();
|
||||
void resetPlayer_WindowControl();
|
||||
|
||||
void updateLog(QString str, bool delFile=false);
|
||||
void setAudioOnlyContent()
|
||||
{
|
||||
mediaContent = audioOnlyContent;
|
||||
|
||||
m_player->setMedia(*mediaContent);
|
||||
}
|
||||
|
||||
void setVideoOnlyContent()
|
||||
{
|
||||
mediaContent = videoOnlyContent;
|
||||
duration = 60000;
|
||||
|
||||
m_player->setMedia(*mediaContent);
|
||||
}
|
||||
|
||||
void setAudioVideoContent()
|
||||
{
|
||||
if (mediaContent == audioVideoContent) {
|
||||
mediaContent = audioVideoAltContent;
|
||||
duration = 101840;
|
||||
} else {
|
||||
mediaContent = audioVideoContent;
|
||||
duration = 141000;
|
||||
}
|
||||
m_player->setMedia(*mediaContent);
|
||||
}
|
||||
|
||||
void setStreamingContent3gp()
|
||||
{
|
||||
mediaContent = streamingContent3gp;
|
||||
|
||||
m_player->setMedia(*mediaContent);
|
||||
}
|
||||
|
||||
void setAudioStreamingContent()
|
||||
{
|
||||
mediaContent = audioStreamingContent;
|
||||
|
||||
m_player->setMedia(*mediaContent);
|
||||
}
|
||||
|
||||
|
||||
QMediaContent* audioOnlyContent;
|
||||
QMediaContent* videoOnlyContent;
|
||||
QMediaContent* audioVideoContent;
|
||||
QMediaContent* audioVideoAltContent;
|
||||
QMediaContent* mediaContent;
|
||||
QMediaContent* streamingContent3gp;
|
||||
QMediaContent* audioStreamingContent;
|
||||
//for access-point requirement
|
||||
QList<QNetworkConfiguration> accesspointlist;
|
||||
QList<QNetworkConfiguration> secaccesspoint;
|
||||
QNetworkConfigurationManager manager;
|
||||
|
||||
qint64 duration;
|
||||
QMediaPlayer *m_player;
|
||||
QVideoWidget *m_widget;
|
||||
QWidget *m_windowWidget;
|
||||
};
|
||||
|
||||
#endif // TST_QMEDIAPLAYER_XA_H
|
||||
@@ -8,17 +8,7 @@ QT += multimediakit-private
|
||||
# TARGET = tst_qmediaplayerbackend
|
||||
# CONFIG += testcase
|
||||
|
||||
symbian*: {
|
||||
PLAYLIST_TESTDATA.sources = testdata/*
|
||||
PLAYLIST_TESTDATA.path = testdata
|
||||
DEPLOYMENT += PLAYLIST_TESTDATA
|
||||
}
|
||||
|
||||
wince* {
|
||||
DEFINES+= TESTDATA_DIR=\\\"./\\\"
|
||||
}else:!symbian {
|
||||
DEFINES += TESTDATA_DIR=\\\"$$PWD/\\\"
|
||||
}
|
||||
DEFINES += TESTDATA_DIR=\\\"$$PWD/\\\"
|
||||
|
||||
SOURCES += \
|
||||
tst_qmediaplayerbackend.cpp
|
||||
|
||||
@@ -8,17 +8,7 @@ QT += multimediakit-private
|
||||
# TARGET = tst_qmediaplaylist
|
||||
# CONFIG += testcase
|
||||
|
||||
symbian*: {
|
||||
PLAYLIST_TESTDATA.sources = testdata/*
|
||||
PLAYLIST_TESTDATA.path = testdata
|
||||
DEPLOYMENT += PLAYLIST_TESTDATA
|
||||
}
|
||||
|
||||
wince* {
|
||||
DEFINES+= TESTDATA_DIR=\\\"./\\\"
|
||||
}else:!symbian {
|
||||
DEFINES += TESTDATA_DIR=\\\"$$PWD/\\\"
|
||||
}
|
||||
DEFINES += TESTDATA_DIR=\\\"$$PWD/\\\"
|
||||
|
||||
HEADERS += \
|
||||
$$QT.multimediakit.sources/../plugins/m3u/qm3uhandler.h
|
||||
|
||||
@@ -454,20 +454,12 @@ void tst_QMediaPlaylist::saveAndLoad()
|
||||
QCOMPARE(playlist.media(0), playlist2.media(0));
|
||||
QCOMPARE(playlist.media(1), playlist2.media(1));
|
||||
QCOMPARE(playlist.media(3), playlist2.media(3));
|
||||
#ifdef Q_OS_SYMBIAN
|
||||
res = playlist.save(QUrl(QLatin1String("file:///c:/data/test_m3u.m3u")), "m3u");
|
||||
#else
|
||||
res = playlist.save(QUrl(QLatin1String("tmp.m3u")), "m3u");
|
||||
#endif
|
||||
QVERIFY(res);
|
||||
|
||||
playlist2.clear();
|
||||
QVERIFY(playlist2.isEmpty());
|
||||
#ifdef Q_OS_SYMBIAN
|
||||
playlist2.load(QUrl(QLatin1String("file:///c:/data/test_m3u.m3u")), "m3u");
|
||||
#else
|
||||
playlist2.load(QUrl(QLatin1String("tmp.m3u")), "m3u");
|
||||
#endif
|
||||
QCOMPARE(playlist.error(), QMediaPlaylist::NoError);
|
||||
|
||||
QCOMPARE(playlist.mediaCount(), playlist2.mediaCount());
|
||||
|
||||
@@ -43,38 +43,11 @@
|
||||
|
||||
#include "tst_qmediarecorder.h"
|
||||
|
||||
#ifdef Q_OS_SYMBIAN
|
||||
#include "s60common.h"
|
||||
#include "tst_qmediarecorder_xa.h"
|
||||
#include "tst_qmediarecorder_mmf.h"
|
||||
#endif
|
||||
|
||||
int main(int argc, char**argv)
|
||||
{
|
||||
QApplication app(argc,argv);
|
||||
int ret;
|
||||
tst_QMediaRecorder test_api;
|
||||
ret = QTest::qExec(&test_api, argc, argv);
|
||||
#ifdef Q_OS_SYMBIAN
|
||||
char *new_argv[3];
|
||||
QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log";
|
||||
QByteArray bytes = str.toAscii();
|
||||
char arg1[] = "-o";
|
||||
new_argv[0] = argv[0];
|
||||
new_argv[1] = arg1;
|
||||
new_argv[2] = bytes.data();
|
||||
tst_QMediaRecorder_xa test_xa;
|
||||
ret = QTest::qExec(&test_xa, 3, new_argv);
|
||||
char *new_argv1[3];
|
||||
QString str1 = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + "_s60.log";
|
||||
QByteArray bytes1 = str1.toAscii();
|
||||
char arg2[] = "-o";
|
||||
new_argv1[0] = argv[0];
|
||||
new_argv1[1] = arg2;
|
||||
new_argv1[2] = bytes1.data();
|
||||
tst_QMediaRecorder_mmf test_mmf;
|
||||
ret = QTest::qExec(&test_mmf, 3, new_argv1);
|
||||
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -5,14 +5,6 @@ QT += multimediakit-private
|
||||
# TARGET = tst_qmediarecorder
|
||||
# CONFIG += testcase
|
||||
|
||||
symbian {
|
||||
HEADERS += s60common.h
|
||||
HEADERS += tst_qmediarecorder_xa.h
|
||||
SOURCES += tst_qmediarecorder_xa.cpp
|
||||
HEADERS += tst_qmediarecorder_mmf.h
|
||||
SOURCES += tst_qmediarecorder_mmf.cpp
|
||||
TARGET.CAPABILITY = UserEnvironment ReadDeviceData WriteDeviceData AllFiles
|
||||
}
|
||||
HEADERS += tst_qmediarecorder.h
|
||||
SOURCES += main.cpp tst_qmediarecorder.cpp
|
||||
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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 Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef S60COMMON_H
|
||||
#define S60COMMON_H
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
|
||||
#define QTRY_COMPARE(a,e) \
|
||||
for (int _i = 0; _i < 5000; _i += 100) { \
|
||||
if ((a) == (e)) break; \
|
||||
QTest::qWait(100); \
|
||||
} \
|
||||
QCOMPARE(a, e)
|
||||
|
||||
#define QTRY_VERIFY(a) \
|
||||
for (int _i = 0; _i < 5000; _i += 100) { \
|
||||
if (a) break; \
|
||||
QTest::qWait(100); \
|
||||
} \
|
||||
QVERIFY(a)
|
||||
|
||||
#endif //S60COMMON_H
|
||||
@@ -1,180 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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 Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
#include "tst_qmediarecorder_mmf.h"
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
|
||||
void tst_QMediaRecorder_mmf::initTestCase()
|
||||
{
|
||||
qRegisterMetaType<QMediaRecorder::State>("QMediaRecorder::State");
|
||||
qRegisterMetaType<QMediaRecorder::Error>("QMediaRecorder::Error");
|
||||
|
||||
captureSource = new QAudioCaptureSource;
|
||||
audiocapture = new QMediaRecorder(captureSource);
|
||||
|
||||
QVERIFY(captureSource->service());
|
||||
|
||||
audioEndpoint = qobject_cast<QAudioEndpointSelector*>(captureSource->service()->requestControl(QAudioEndpointSelector_iid));
|
||||
audioEncoder = qobject_cast<QAudioEncoderControl*>(captureSource->service()->requestControl(QAudioEncoderControl_iid));
|
||||
}
|
||||
|
||||
void tst_QMediaRecorder_mmf::cleanupTestCase()
|
||||
{
|
||||
delete audiocapture;
|
||||
delete captureSource;
|
||||
}
|
||||
|
||||
QUrl tst_QMediaRecorder_mmf::recordPathAudio(QDir outputDir)
|
||||
{
|
||||
int lastImage = 0;
|
||||
int fileCount = 0;
|
||||
foreach( QString fileName, outputDir.entryList(QStringList() << "testclip_*.amr") ) {
|
||||
int imgNumber = fileName.mid(5, fileName.size()-9).toInt();
|
||||
lastImage = qMax(lastImage, imgNumber);
|
||||
if (outputDir.exists(fileName))
|
||||
fileCount+=1;
|
||||
}
|
||||
lastImage+=fileCount;
|
||||
|
||||
QUrl location(QDir::toNativeSeparators(outputDir.canonicalPath()+QString("/testclip_%1.amr").arg(lastImage+1,4,10,QLatin1Char('0'))));
|
||||
return location;
|
||||
}
|
||||
|
||||
void tst_QMediaRecorder_mmf::testAudioSink()
|
||||
{
|
||||
audiocapture->setOutputLocation(QUrl("test.tmp"));
|
||||
QUrl s = audiocapture->outputLocation();
|
||||
QCOMPARE(s.toString(), QString("test.tmp"));
|
||||
}
|
||||
|
||||
void tst_QMediaRecorder_mmf::testAudioRecord()
|
||||
{
|
||||
QSignalSpy stateSignal(audiocapture,SIGNAL(stateChanged(QMediaRecorder::State)));
|
||||
QCOMPARE(audiocapture->state(), QMediaRecorder::StoppedState);
|
||||
QTest::qWait(500); // wait for recorder to initialize itself
|
||||
audiocapture->setOutputLocation(recordPathAudio(QDir::rootPath()));
|
||||
audiocapture->record();
|
||||
QTRY_COMPARE(stateSignal.count(), 1); // wait for callbacks to complete in symbian API
|
||||
QCOMPARE(audiocapture->state(), QMediaRecorder::RecordingState);
|
||||
QCOMPARE(audiocapture->error(), QMediaRecorder::NoError);
|
||||
QCOMPARE(audiocapture->errorString(), QString());
|
||||
QCOMPARE(stateSignal.count(), 1);
|
||||
audiocapture->pause();
|
||||
QTRY_COMPARE(stateSignal.count(), 2); // wait for callbacks to complete in symbian API
|
||||
QCOMPARE(audiocapture->state(), QMediaRecorder::PausedState);
|
||||
QCOMPARE(stateSignal.count(), 2);
|
||||
audiocapture->stop();
|
||||
QTRY_COMPARE(stateSignal.count(), 3); // wait for callbacks to complete in symbian API
|
||||
QCOMPARE(audiocapture->state(), QMediaRecorder::StoppedState);
|
||||
QCOMPARE(stateSignal.count(), 3);
|
||||
}
|
||||
|
||||
void tst_QMediaRecorder_mmf::testAudioRecordWithAMR()
|
||||
{
|
||||
QSignalSpy stateSignal(audiocapture,SIGNAL(stateChanged(QMediaRecorder::State)));
|
||||
QCOMPARE(audiocapture->state(), QMediaRecorder::StoppedState);
|
||||
audiocapture->setOutputLocation(recordPathAudio(QDir::rootPath()));
|
||||
QAudioEncoderSettings audioSettings;
|
||||
QVideoEncoderSettings videoSettings;
|
||||
audioSettings.setCodec("AMR");
|
||||
QString format = audiocapture->containerMimeType();
|
||||
format = QString("audio/amr");
|
||||
audiocapture->setEncodingSettings(audioSettings,videoSettings,format);
|
||||
audiocapture->record();
|
||||
QTRY_COMPARE(stateSignal.count(), 1); // wait for callbacks to complete in symbian API
|
||||
QCOMPARE(audiocapture->state(), QMediaRecorder::RecordingState);
|
||||
QCOMPARE(audiocapture->error(), QMediaRecorder::NoError);
|
||||
QCOMPARE(audiocapture->errorString(), QString());
|
||||
QCOMPARE(stateSignal.count(), 1);
|
||||
audiocapture->pause();
|
||||
QTRY_COMPARE(stateSignal.count(), 2); // wait for callbacks to complete in symbian API
|
||||
QCOMPARE(audiocapture->state(), QMediaRecorder::PausedState);
|
||||
QCOMPARE(stateSignal.count(), 2);
|
||||
audiocapture->stop();
|
||||
QTRY_COMPARE(stateSignal.count(), 3); // wait for callbacks to complete in symbian API
|
||||
QCOMPARE(audiocapture->state(), QMediaRecorder::StoppedState);
|
||||
QCOMPARE(stateSignal.count(), 3);
|
||||
}
|
||||
|
||||
void tst_QMediaRecorder_mmf::testAudioEndPointSelector()
|
||||
{
|
||||
QSignalSpy audioSignal(audioEndpoint,SIGNAL(activeEndpointChanged(QString)));
|
||||
QVERIFY(audioEndpoint->availableEndpoints().count() == 1);
|
||||
QVERIFY(audioEndpoint->defaultEndpoint().compare("default") == 0);
|
||||
audioEndpoint->setActiveEndpoint("device2");
|
||||
QVERIFY(audioEndpoint->activeEndpoint().compare("device2") == 0);
|
||||
QVERIFY(audioSignal.count() == 1);
|
||||
QVERIFY(audioEndpoint->endpointDescription("device2").compare("") == 0);
|
||||
}
|
||||
|
||||
void tst_QMediaRecorder_mmf::testAudioEncoderControl()
|
||||
{
|
||||
QStringList codecs = audiocapture->supportedAudioCodecs();
|
||||
QVERIFY(codecs.count() == 2);
|
||||
QVERIFY(audiocapture->audioCodecDescription("PCM") == "Pulse code modulation");
|
||||
QStringList options = audioEncoder->supportedEncodingOptions("PCM");
|
||||
QCOMPARE(options.count(), 3);
|
||||
QCOMPARE(audiocapture->supportedAudioSampleRates().count(), 12);
|
||||
audioEncoder->setEncodingOption("PCM", "channels", QVariant(2));
|
||||
QCOMPARE(audioEncoder->encodingOption("PCM","channels").toInt(), 2);
|
||||
audioEncoder->setEncodingOption("PCM", "quality", QVariant(int(QtMultimediaKit::NormalQuality)));
|
||||
QCOMPARE(audioEncoder->encodingOption("PCM","quality").toInt(), int(QtMultimediaKit::NormalQuality));
|
||||
audioEncoder->setEncodingOption("PCM", "samplerate", QVariant(44100));
|
||||
QCOMPARE(audioEncoder->encodingOption("PCM","samplerate").toInt(), 44100);
|
||||
}
|
||||
|
||||
void tst_QMediaRecorder_mmf::testMediaFormatsControl()
|
||||
{
|
||||
//audioocontainer types
|
||||
// Containers supported are dynamically queried from MMF. We cannot guarentee that 2 platforms
|
||||
// will support the same set.
|
||||
//QCOMPARE(audiocapture->supportedContainers(), QStringList() << "audio/wav" << "audio/amr");
|
||||
QCOMPARE(audiocapture->containerDescription("audio/wav"), QString("WAV Write Format"));
|
||||
QCOMPARE(audiocapture->containerDescription("audio/amr"), QString("AMR Write Format"));
|
||||
}
|
||||
|
||||
void tst_QMediaRecorder_mmf::testDefaultAudioEncodingSettings()
|
||||
{
|
||||
QAudioEncoderSettings audioSettings = audiocapture->audioSettings();
|
||||
QCOMPARE(audioSettings.codec(), QString("AMR"));
|
||||
QString format = audiocapture->containerMimeType();
|
||||
QCOMPARE(format, QString("audio/amr"));
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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 Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
#ifndef TST_QMEDIARECORDER_MMF
|
||||
#define TST_QMEDIARECORDER_MMF
|
||||
|
||||
#include <QtTest/QtTest>
|
||||
#include <QDebug>
|
||||
#include <qmediaobject.h>
|
||||
#include <qmediacontrol.h>
|
||||
#include <qmediaservice.h>
|
||||
#include <qmediarecordercontrol.h>
|
||||
#include <qmediarecorder.h>
|
||||
#include <qaudioendpointselector.h>
|
||||
#include <qaudioencodercontrol.h>
|
||||
#include <qmediacontainercontrol.h>
|
||||
#include <qaudioformat.h>
|
||||
#include <qaudiocapturesource.h>
|
||||
|
||||
#include "s60common.h"
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
class tst_QMediaRecorder_mmf: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public slots:
|
||||
void initTestCase();
|
||||
void cleanupTestCase();
|
||||
|
||||
private slots:
|
||||
void testAudioSink();
|
||||
void testAudioRecord();
|
||||
void testAudioRecordWithAMR();
|
||||
void testAudioEndPointSelector();
|
||||
void testAudioEncoderControl();
|
||||
void testMediaFormatsControl();
|
||||
void testDefaultAudioEncodingSettings();
|
||||
|
||||
private:
|
||||
QUrl recordPathAudio(QDir outputDir);
|
||||
|
||||
QAudioEncoderControl *audioEncoder;
|
||||
QAudioEndpointSelector *audioEndpoint;
|
||||
QMediaRecorder *audiocapture;
|
||||
QAudioCaptureSource *captureSource;
|
||||
};
|
||||
#endif
|
||||
@@ -1,323 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the Qt Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "tst_qmediarecorder_xa.h"
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
|
||||
void tst_QMediaRecorder_xa::initTestCase()
|
||||
{
|
||||
audiosource = new QAudioCaptureSource;
|
||||
audiocapture = new QMediaRecorder(audiosource);
|
||||
}
|
||||
|
||||
void tst_QMediaRecorder_xa::cleanupTestCase()
|
||||
{
|
||||
delete audiocapture;
|
||||
delete audiosource;
|
||||
}
|
||||
|
||||
void tst_QMediaRecorder_xa::testMediaRecorderObject()
|
||||
{
|
||||
//audioocontainer types
|
||||
QCOMPARE(audiocapture->audioCodecDescription("pcm"), QString("pcm"));
|
||||
QCOMPARE(audiocapture->audioCodecDescription("amr"), QString("amr"));
|
||||
QCOMPARE(audiocapture->audioCodecDescription("aac"), QString("aac"));
|
||||
QCOMPARE(audiocapture->containerDescription("audio/wav"), QString("wav container"));
|
||||
QCOMPARE(audiocapture->containerDescription("audio/amr"), QString("amr File format"));
|
||||
QCOMPARE(audiocapture->containerDescription("audio/mpeg"), QString("mpeg container"));
|
||||
QCOMPARE(audiocapture->containerMimeType(), QString("audio/wav"));
|
||||
QCOMPARE(audiocapture->error(), QMediaRecorder::NoError);
|
||||
QCOMPARE(audiocapture->errorString(), QString());
|
||||
QCOMPARE(audiocapture->outputLocation().toLocalFile(), QString());
|
||||
QCOMPARE(audiocapture->state(), QMediaRecorder::StoppedState);
|
||||
QCOMPARE(audiocapture->supportedAudioCodecs().count(), 3); // "pcm", "amr", "aac"
|
||||
QAudioEncoderSettings settings;
|
||||
settings.setCodec("pcm");
|
||||
QCOMPARE(audiocapture->supportedAudioSampleRates(settings).count(), 5);
|
||||
bool isContinuous;
|
||||
audiocapture->supportedAudioSampleRates(settings, &isContinuous);
|
||||
QCOMPARE(isContinuous, false);
|
||||
QCOMPARE(audiocapture->supportedContainers().count(), 3); // "audio/wav", "audio/amr", "audio/mpeg"
|
||||
}
|
||||
|
||||
void tst_QMediaRecorder_xa::testDefaultAudioEncodingSettings()
|
||||
{
|
||||
QAudioEncoderSettings audioSettings = audiocapture->audioSettings();
|
||||
QCOMPARE(audioSettings.codec(), QString("pcm"));
|
||||
QCOMPARE(audiocapture->containerMimeType(), QString("audio/wav"));
|
||||
QCOMPARE(audioSettings.bitRate(), 0);
|
||||
QCOMPARE(audioSettings.channelCount(), -1);
|
||||
QCOMPARE(audioSettings.encodingMode(), QtMultimediaKit::ConstantQualityEncoding);
|
||||
QCOMPARE(audioSettings.quality(), QtMultimediaKit::NormalQuality);
|
||||
QCOMPARE(audioSettings.sampleRate(), -1);
|
||||
}
|
||||
|
||||
void tst_QMediaRecorder_xa::testAudioRecordingLocationOnly()
|
||||
{
|
||||
QSignalSpy stateSignal(audiocapture,SIGNAL(stateChanged(QMediaRecorder::State)));
|
||||
QCOMPARE(audiocapture->state(), QMediaRecorder::StoppedState);
|
||||
QTest::qWait(500); // wait for recorder to initialize itself
|
||||
audiocapture->setOutputLocation(nextFileName(QDir::rootPath(), "locationonly", "wav"));
|
||||
audiocapture->record();
|
||||
QTRY_COMPARE(stateSignal.count(), 1); // wait for callbacks to complete in symbian API
|
||||
QCOMPARE(audiocapture->state(), QMediaRecorder::RecordingState);
|
||||
QCOMPARE(audiocapture->error(), QMediaRecorder::NoError);
|
||||
QCOMPARE(audiocapture->errorString(), QString());
|
||||
QCOMPARE(stateSignal.count(), 1);
|
||||
QTest::qWait(5000); // wait for 5 seconds
|
||||
audiocapture->pause();
|
||||
QTRY_COMPARE(stateSignal.count(), 2); // wait for callbacks to complete in symbian API
|
||||
QCOMPARE(audiocapture->state(), QMediaRecorder::PausedState);
|
||||
QCOMPARE(stateSignal.count(), 2);
|
||||
audiocapture->stop();
|
||||
QTRY_COMPARE(stateSignal.count(), 3); // wait for callbacks to complete in symbian API
|
||||
QCOMPARE(audiocapture->state(), QMediaRecorder::StoppedState);
|
||||
QCOMPARE(stateSignal.count(), 3);
|
||||
}
|
||||
|
||||
void tst_QMediaRecorder_xa::testAudioRecording_data()
|
||||
{
|
||||
QTest::addColumn<QString>("mime"); // "audio/wav", "audio/amr", "audio/mpeg"
|
||||
QTest::addColumn<QString>("codec"); // "pcm", "amr", "aac"
|
||||
QTest::addColumn<QString>("filename_desc");
|
||||
QTest::addColumn<QString>("filename_ext"); // "wav", "amr", "mp4"
|
||||
QTest::addColumn<QString>("settings");
|
||||
QTest::addColumn<int>("bitrate");
|
||||
QTest::addColumn<int>("samplerate");
|
||||
QTest::addColumn<int>("channels");
|
||||
|
||||
QTest::newRow("wav default") << "audio/wav" << "pcm" << "default" << "wav" << "default" << 0 << 0 << 0;
|
||||
QTest::newRow("amr default") << "audio/amr" << "amr" << "default" << "amr" << "default" << 4750 << 8000 << -1;
|
||||
QTest::newRow("aac default") << "audio/mpeg" << "aac" << "default" << "mp4" << "default" << 0 << 48000 << -1;
|
||||
QTest::newRow("wav 08kHz Mono") << "audio/wav" << "pcm" << "Sr08kHzMono" << "wav" << "user" << 0 << 8000 << 1;
|
||||
QTest::newRow("wav 08kHz Stereo") << "audio/wav" << "pcm" << "Sr08kHzStereo" << "wav" << "user" << 0 << 8000 << 2;
|
||||
QTest::newRow("wav 16kHz Mono") << "audio/wav" << "pcm" << "Sr16kHzMono" << "wav" << "user" << 0 << 16000 << 1;
|
||||
QTest::newRow("wav 16kHz Stereo") << "audio/wav" << "pcm" << "Sr16kHzStereo" << "wav" << "user" << 0 << 16000 << 2;
|
||||
QTest::newRow("wav 32kHz Mono") << "audio/wav" << "pcm" << "Sr32kHzMono" << "wav" << "user" << 0 << 32000 << 1;
|
||||
QTest::newRow("wav 32kHz Stereo") << "audio/wav" << "pcm" << "Sr32kHzStereo" << "wav" << "user" << 0<< 32000 << 2;
|
||||
QTest::newRow("wav 48kHz Mono") << "audio/wav" << "pcm" << "Sr48kHzMono" << "wav" << "user" << 0 << 48000 << 1;
|
||||
QTest::newRow("wav 48kHz Stereo") << "audio/wav" << "pcm" << "Sr48kHzStereo" << "wav" << "user" << 0 << 48000 << 2;
|
||||
QTest::newRow("amr Br04750bps") << "audio/amr" << "amr" << "Br04750bps" << "amr" << "user" << 4750 << 8000 << 1;
|
||||
QTest::newRow("amr Br05150bps") << "audio/amr" << "amr" << "Br05150bps" << "amr" << "user" << 5150 << 8000 << 1;
|
||||
QTest::newRow("amr Br05900bps") << "audio/amr" << "amr" << "Br05900bps" << "amr" << "user" << 5900 << 8000 << 1;
|
||||
QTest::newRow("amr Br06700bps") << "audio/amr" << "amr" << "Br06700bps" << "amr" << "user" << 6700 << 8000 << 1;
|
||||
QTest::newRow("amr Br07400bps") << "audio/amr" << "amr" << "Br07400bps" << "amr" << "user" << 7400 << 8000 << 1;
|
||||
QTest::newRow("amr Br07950bps") << "audio/amr" << "amr" << "Br07950bps" << "amr" << "user" << 7950 << 8000 << 1;
|
||||
QTest::newRow("amr Br10200bps") << "audio/amr" << "amr" << "Br10200bps" << "amr" << "user" << 10200 << 8000 << 1;
|
||||
QTest::newRow("amr Br12200bps") << "audio/amr" << "amr" << "Br12200bps" << "amr" << "user" << 10200 << 8000 << 1;
|
||||
QTest::newRow("amr verylowqual") << "audio/amr" << "amr" << "verylowqual" << "amr" << "preset" << -1 << 8000 << -1;
|
||||
QTest::newRow("amr lowqual") << "audio/amr" << "amr" << "lowqual" << "amr" << "preset" << -2 << 8000 << -1;
|
||||
QTest::newRow("amr normalqual") << "audio/amr" << "amr" << "normalqual" << "amr" << "preset" << -3 << 8000 << -1;
|
||||
QTest::newRow("amr highqual") << "audio/amr" << "amr" << "highqual" << "amr" << "preset" << -4 << 8000 << -1;
|
||||
QTest::newRow("amr veryhighqual") << "audio/amr" << "amr" << "veryhighqual" << "amr" << "preset" << -5 << 8000 << -1;
|
||||
|
||||
// Combinations supported for sample rate 8kHz
|
||||
QTest::newRow("aac Br32k Sr8kHz Mono") << "audio/mpeg" << "aac" << "Br32kSr8kHzMono" << "mp4" << "user" << 32000 << 8000 << 1;
|
||||
QTest::newRow("aac Br32k Sr8kHz Stereo") << "audio/mpeg" << "aac" << "Br32kSr8kHzStereo" << "mp4" << "user" << 32000 << 8000 << 2;
|
||||
QTest::newRow("aac Br64k Sr8kHz Stereo") << "audio/mpeg" << "aac" << "Br64kSr8kHzStereo" << "mp4" << "user" << 64000 << 8000 << 2;
|
||||
// Combinations supported for sample rate 16kHz
|
||||
QTest::newRow("aac Br32k Sr16kHz Mono") << "audio/mpeg" << "aac" << "Br32kSr16kHzMono" << "mp4" << "user" << 32000 << 16000 << 1;
|
||||
QTest::newRow("aac Br64k Sr16kHz Mono") << "audio/mpeg" << "aac" << "Br64kSr16kHzMonoo" << "mp4" << "user" << 64000 << 16000 << 1;
|
||||
QTest::newRow("aac Br32k Sr16kHz Stereo") << "audio/mpeg" << "aac" << "Br32kSr16kHzStereo" << "mp4" << "user" << 32000 << 16000 << 2;
|
||||
QTest::newRow("aac Br64k Sr16kHz Stereo") << "audio/mpeg" << "aac" << "Br64kSr16kHzStereo" << "mp4" << "user" << 64000 << 16000 << 2;
|
||||
QTest::newRow("aac Br96k Sr16kHz Stereo") << "audio/mpeg" << "aac" << "Br96kSr16kHzStereo" << "mp4" << "user" << 96000 << 16000 << 2;
|
||||
QTest::newRow("aac Br128k Sr16kHz Stereo") << "audio/mpeg" << "aac" << "Br128kSr16kHzStereo" << "mp4" << "user" << 128000 << 16000 << 2;
|
||||
QTest::newRow("aac Br160k Sr16kHz Stereo") << "audio/mpeg" << "aac" << "Br160kSr16kHzStereo" << "mp4" << "user" << 160000 << 16000 << 2;
|
||||
// Combinations supported for sample rate 24kHz
|
||||
QTest::newRow("aac Br32k Sr24kHz Mono") << "audio/mpeg" << "aac" << "Br32kSr24kHzMono" << "mp4" << "user" << 32000 << 24000 << 1;
|
||||
QTest::newRow("aac Br64k Sr24kHz Mono") << "audio/mpeg" << "aac" << "Br64kSr24kHzMono" << "mp4" << "user" << 64000 << 24000 << 1;
|
||||
QTest::newRow("aac Br96k Sr24kHz Mono") << "audio/mpeg" << "aac" << "Br96kSr24kHzMono" << "mp4" << "user" << 96000 << 24000 << 1;
|
||||
QTest::newRow("aac Br32k Sr24kHz Stereo") << "audio/mpeg" << "aac" << "Br32kSr24kHzStereo" << "mp4" << "user" << 32000 << 24000 << 2;
|
||||
QTest::newRow("aac Br64k Sr24kHz Stereo") << "audio/mpeg" << "aac" << "Br64kSr24kHzStereo" << "mp4" << "user" << 64000 << 24000 << 2;
|
||||
QTest::newRow("aac Br96k Sr24kHz Stereo") << "audio/mpeg" << "aac" << "Br96kSr24kHzStereo" << "mp4" << "user" << 96000 << 24000 << 2;
|
||||
QTest::newRow("aac Br128k Sr24kHz Stereo") << "audio/mpeg" << "aac" << "Br128kSr24kHzStereo" << "mp4" << "user" << 128000 << 24000 << 2;
|
||||
QTest::newRow("aac Br160k Sr24kHz Stereo") << "audio/mpeg" << "aac" << "Br160kSr24kHzStereo" << "mp4" << "user" << 160000 << 24000 << 2;
|
||||
QTest::newRow("aac Br192k Sr24kHz Stereo") << "audio/mpeg" << "aac" << "Br192kSr24kHzStereo" << "mp4" << "user" << 192000 << 24000 << 2;
|
||||
// Combinations supported for sample rate 32kHz
|
||||
QTest::newRow("aac Br32k Sr32kHz Mono") << "audio/mpeg" << "aac" << "Br32kSr32kHzMono" << "mp4" << "user" << 32000 << 32000 << 1;
|
||||
QTest::newRow("aac Br64k Sr32kHz Mono") << "audio/mpeg" << "aac" << "Br64kSr32kHzMono" << "mp4" << "user" << 64000 << 32000 << 1;
|
||||
QTest::newRow("aac Br96k Sr32kHz Mono") << "audio/mpeg" << "aac" << "Br96kSr32kHzMono" << "mp4" << "user" << 96000 << 32000 << 1;
|
||||
QTest::newRow("aac Br128k Sr32kHz Mono") << "audio/mpeg" << "aac" << "Br128kSr32kHzMono" << "mp4" << "user" << 128000 << 32000 << 1;
|
||||
QTest::newRow("aac Br160k Sr32kHz Mono") << "audio/mpeg" << "aac" << "Br160kSr32kHzMono" << "mp4" << "user" << 160000 << 32000 << 1;
|
||||
QTest::newRow("aac Br32k Sr32kHz Stereo") << "audio/mpeg" << "aac" << "Br32kSr32kHzStereo" << "mp4" << "user" << 32000 << 32000 << 2;
|
||||
QTest::newRow("aac Br64k Sr32kHz Stereo") << "audio/mpeg" << "aac" << "Br64kSr32kHzStereo" << "mp4" << "user" << 64000 << 32000 << 2;
|
||||
QTest::newRow("aac Br96k Sr32kHz Stereo") << "audio/mpeg" << "aac" << "Br96kSr32kHzStereo" << "mp4" << "user" << 96000 << 32000 << 2;
|
||||
QTest::newRow("aac Br128k Sr32kHz Stereo") << "audio/mpeg" << "aac" << "Br128kSr32kHzStereo" << "mp4" << "user" << 128000 << 32000 << 2;
|
||||
QTest::newRow("aac Br160k Sr32kHz Stereo") << "audio/mpeg" << "aac" << "Br160kSr32kHzStereo" << "mp4" << "user" << 160000 << 32000 << 2;
|
||||
QTest::newRow("aac Br192k Sr32kHz Stereo") << "audio/mpeg" << "aac" << "Br192kSr32kHzStereo" << "mp4" << "user" << 192000 << 32000 << 2;
|
||||
QTest::newRow("aac Br224k Sr32kHz Stereo") << "audio/mpeg" << "aac" << "Br224kSr32kHzStereo" << "mp4" << "user" << 224000 << 32000 << 2;
|
||||
QTest::newRow("aac Br256k Sr32kHz Stereo") << "audio/mpeg" << "aac" << "Br256kSr32kHzStereo" << "mp4" << "user" << 256000 << 32000 << 2;
|
||||
// Combinations supported for sample rate 48kHz
|
||||
QTest::newRow("aac Br32k Sr48kHz Mono") << "audio/mpeg" << "aac" << "Br32kSr48kHzMono" << "mp4" << "user" << 32000 << 48000 << 1;
|
||||
QTest::newRow("aac Br64k Sr48kHz Mono") << "audio/mpeg" << "aac" << "Br64kSr48kHzMono" << "mp4" << "user" << 64000 << 48000 << 1;
|
||||
QTest::newRow("aac Br96k Sr48kHz Mono") << "audio/mpeg" << "aac" << "Br96kSr48kHzMono" << "mp4" << "user" << 96000 << 48000 << 1;
|
||||
QTest::newRow("aac Br128k Sr48kHz Mono") << "audio/mpeg" << "aac" << "Br128kSr48kHzMono" << "mp4" << "user" << 128000 << 48000 << 1;
|
||||
QTest::newRow("aac Br160k Sr48kHz Mono") << "audio/mpeg" << "aac" << "Br160kSr48kHzMono" << "mp4" << "user" << 160000 << 48000 << 1;
|
||||
QTest::newRow("aac Br192k Sr48kHz Mono") << "audio/mpeg" << "aac" << "Br192kSr48kHzMono" << "mp4" << "user" << 192000 << 48000 << 1;
|
||||
QTest::newRow("aac Br224k Sr48kHz Mono") << "audio/mpeg" << "aac" << "Br224kSr48kHzMono" << "mp4" << "user" << 224000 << 48000 << 1;
|
||||
QTest::newRow("aac Br32k Sr48kHz Stereo") << "audio/mpeg" << "aac" << "Br32kSr48kHzStereo" << "mp4" << "user" << 32000 << 48000 << 2;
|
||||
QTest::newRow("aac Br64k Sr48kHz Stereo") << "audio/mpeg" << "aac" << "Br64kSr48kHzStereo" << "mp4" << "user" << 64000 << 48000 << 2;
|
||||
QTest::newRow("aac Br96k Sr48kHz Stereo") << "audio/mpeg" << "aac" << "Br96kSr48kHzStereo" << "mp4" << "user" << 96000 << 48000 << 2;
|
||||
QTest::newRow("aac Br128k Sr48kHz Stereo") << "audio/mpeg" << "aac" << "Br128kSr48kHzStereo" << "mp4" << "user" << 128000 << 48000 << 2;
|
||||
QTest::newRow("aac Br160k Sr48kHz Stereo") << "audio/mpeg" << "aac" << "Br160kSr48kHzStereo" << "mp4" << "user" << 160000 << 48000 << 2;
|
||||
QTest::newRow("aac Br192k Sr48kHz Stereo") << "audio/mpeg" << "aac" << "Br192kSr48kHzStereo" << "mp4" << "user" << 192000 << 48000 << 2;
|
||||
QTest::newRow("aac Br224k Sr48kHz Stereo") << "audio/mpeg" << "aac" << "Br224kSr48kHzStereo" << "mp4" << "user" << 224000 << 48000 << 2;
|
||||
QTest::newRow("aac Br256k Sr48kHz Stereo") << "audio/mpeg" << "aac" << "Br256kSr48kHzStereo" << "mp4" << "user" << 256000 << 48000 << 2;
|
||||
QTest::newRow("aac verylowqual") << "audio/mpeg" << "aac" << "verylowqual" << "mp4" << "preset" << -1 << 8000 << -1;
|
||||
QTest::newRow("aac lowqual") << "audio/mpeg" << "aac" << "lowqual" << "mp4" << "preset" << -2 << 24000 << -1;
|
||||
QTest::newRow("aac normalqual") << "audio/mpeg" << "aac" << "normalqual" << "mp4" << "preset" << -3 << 32000 << -1;
|
||||
QTest::newRow("aac highqual") << "audio/mpeg" << "aac" << "highqual" << "mp4" << "preset" << -4 << 48000 << -1;
|
||||
QTest::newRow("aac veryhighqual") << "audio/mpeg" << "aac" << "veryhighqual" << "mp4" << "preset" << -5 << 48000 << -1;
|
||||
}
|
||||
|
||||
void tst_QMediaRecorder_xa::testAudioRecording()
|
||||
{
|
||||
QFETCH(QString, mime);
|
||||
QFETCH(QString, codec);
|
||||
QFETCH(QString, filename_desc);
|
||||
QFETCH(QString, filename_ext);
|
||||
QFETCH(QString, settings);
|
||||
|
||||
QSignalSpy stateSignal(audiocapture,SIGNAL(stateChanged(QMediaRecorder::State)));
|
||||
audiocapture->setOutputLocation(nextFileName(QDir::rootPath(), filename_desc, filename_ext));
|
||||
QAudioEncoderSettings audioSettings;
|
||||
audioSettings.setCodec(codec);
|
||||
if (settings.compare("default") == 0) {
|
||||
audioSettings.setSampleRate(-1);
|
||||
}
|
||||
else if (settings.compare("user") == 0) {
|
||||
QFETCH(int, bitrate);
|
||||
QFETCH(int, samplerate);
|
||||
QFETCH(int, channels);
|
||||
audioSettings.setEncodingMode(QtMultimediaKit::ConstantBitRateEncoding);
|
||||
if (bitrate > 0)
|
||||
audioSettings.setBitRate(bitrate);
|
||||
if (samplerate > 0)
|
||||
audioSettings.setSampleRate(samplerate);
|
||||
if ((channels > 0) || (channels == -1))
|
||||
audioSettings.setChannelCount(channels);
|
||||
}
|
||||
else if (settings.compare("preset") == 0) {
|
||||
QFETCH(int, bitrate);
|
||||
QFETCH(int, samplerate);
|
||||
QFETCH(int, channels);
|
||||
audioSettings.setEncodingMode(QtMultimediaKit::ConstantQualityEncoding);
|
||||
QtMultimediaKit::EncodingQuality quality = QtMultimediaKit::NormalQuality;
|
||||
switch(bitrate) {
|
||||
case -1:
|
||||
quality = QtMultimediaKit::VeryLowQuality;
|
||||
break;
|
||||
case -2:
|
||||
quality = QtMultimediaKit::LowQuality;
|
||||
break;
|
||||
default:
|
||||
case -3:
|
||||
quality = QtMultimediaKit::NormalQuality;
|
||||
break;
|
||||
case -4:
|
||||
quality = QtMultimediaKit::HighQuality;
|
||||
break;
|
||||
case -5:
|
||||
quality = QtMultimediaKit::VeryHighQuality;
|
||||
break;
|
||||
}
|
||||
audioSettings.setQuality(quality);
|
||||
if (samplerate > 0)
|
||||
audioSettings.setSampleRate(samplerate);
|
||||
if ((channels > 0) || (channels == -1))
|
||||
audioSettings.setChannelCount(channels);
|
||||
}
|
||||
QVideoEncoderSettings videoSettings;
|
||||
audiocapture->setEncodingSettings(audioSettings, videoSettings, mime);
|
||||
QCOMPARE(audiocapture->state(), QMediaRecorder::StoppedState);
|
||||
QTest::qWait(500); // wait for recorder to initialize itself
|
||||
int expectedSignalCount = 1;
|
||||
audiocapture->record();
|
||||
QTRY_COMPARE(stateSignal.count(), expectedSignalCount); // wait for callbacks to complete in symbian API
|
||||
QCOMPARE(audiocapture->state(), QMediaRecorder::RecordingState);
|
||||
QCOMPARE(audiocapture->error(), QMediaRecorder::NoError);
|
||||
QCOMPARE(audiocapture->errorString(), QString());
|
||||
QCOMPARE(stateSignal.count(), expectedSignalCount);
|
||||
QTest::qWait(5000); // wait for 5 seconds
|
||||
// If we are not testing aac recording to mp4 container
|
||||
if (!((mime.compare("audio/mpeg") == 0) && (codec.compare("aac") == 0))) {
|
||||
expectedSignalCount++;
|
||||
audiocapture->pause();
|
||||
QTRY_COMPARE(stateSignal.count(), expectedSignalCount); // wait for callbacks to complete in symbian API
|
||||
QCOMPARE(audiocapture->state(), QMediaRecorder::PausedState);
|
||||
QCOMPARE(stateSignal.count(), expectedSignalCount);
|
||||
}
|
||||
expectedSignalCount++;
|
||||
audiocapture->stop();
|
||||
QTRY_COMPARE(stateSignal.count(), expectedSignalCount); // wait for callbacks to complete in symbian API
|
||||
QCOMPARE(audiocapture->state(), QMediaRecorder::StoppedState);
|
||||
QCOMPARE(stateSignal.count(), expectedSignalCount);
|
||||
/* testAudioRecording() function gets executed for each rown in the table.
|
||||
* If and when all tests in the table passes, test log will just contain one
|
||||
* entry 'PASS : tst_QMediaRecorder_xa::testAudioRecording()'. To figure out
|
||||
* which test in the loop completed successfully, just print a debug message
|
||||
* which also goes into the test log generated.*/
|
||||
qDebug() << "----> PASS";
|
||||
}
|
||||
|
||||
void tst_QMediaRecorder_xa::testOutputLocation()
|
||||
{
|
||||
audiocapture->setOutputLocation(QUrl("test.wav"));
|
||||
QUrl s = audiocapture->outputLocation();
|
||||
QCOMPARE(s.toString(), QString("test.wav"));
|
||||
}
|
||||
|
||||
QUrl tst_QMediaRecorder_xa::nextFileName(QDir outputDir, QString appendName, QString ext)
|
||||
{
|
||||
int lastImage = 0;
|
||||
int fileCount = 0;
|
||||
foreach( QString fileName, outputDir.entryList(QStringList() << "testclip_*." + ext) ) {
|
||||
int imgNumber = fileName.mid(5, fileName.size()-9).toInt();
|
||||
lastImage = qMax(lastImage, imgNumber);
|
||||
if (outputDir.exists(fileName))
|
||||
fileCount+=1;
|
||||
}
|
||||
lastImage+=fileCount;
|
||||
|
||||
QUrl location(QDir::toNativeSeparators(outputDir.canonicalPath() + QString("/testclip_%1").arg(lastImage+1 , 4, 10, QLatin1Char('0')) + appendName + "." + ext));
|
||||
return location;
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** This file is part of the Qt Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef TST_QMEDIARECORDER_XA_H
|
||||
#define TST_QMEDIARECORDER_XA_H
|
||||
|
||||
#include <QtTest/QtTest>
|
||||
#include <qmediarecorder.h>
|
||||
#include <qaudiocapturesource.h>
|
||||
|
||||
#include "s60common.h"
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
|
||||
class tst_QMediaRecorder_xa: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public slots:
|
||||
void initTestCase();
|
||||
void cleanupTestCase();
|
||||
|
||||
private slots:
|
||||
void testMediaRecorderObject(); //1
|
||||
void testDefaultAudioEncodingSettings(); //2
|
||||
void testOutputLocation(); //3
|
||||
void testAudioRecordingLocationOnly(); //4
|
||||
void testAudioRecording_data(); //5
|
||||
void testAudioRecording(); //6
|
||||
|
||||
private:
|
||||
QUrl nextFileName(QDir outputDir, QString appendName, QString ext);
|
||||
|
||||
private:
|
||||
QAudioCaptureSource* audiosource;
|
||||
QMediaRecorder* audiocapture;
|
||||
|
||||
};
|
||||
|
||||
#endif /* TST_QMEDIARECORDER_XA_H */
|
||||
@@ -1,7 +1,7 @@
|
||||
load(qttest_p4)
|
||||
|
||||
QT += multimediakit-private
|
||||
contains(QT_CONFIG, opengl) | contains(QT_CONFIG, opengles2): !symbian {
|
||||
contains(QT_CONFIG, opengl) | contains(QT_CONFIG, opengles2) {
|
||||
QT += opengl
|
||||
} else {
|
||||
DEFINES += QT_NO_OPENGL
|
||||
|
||||
@@ -43,37 +43,11 @@
|
||||
|
||||
#include "tst_qradiotuner.h"
|
||||
|
||||
#ifdef Q_OS_SYMBIAN
|
||||
#include "tst_qradiotuner_xa.h"
|
||||
#include "tst_qradiotuner_s60.h"
|
||||
#endif
|
||||
|
||||
int main(int argc, char**argv)
|
||||
{
|
||||
QApplication app(argc,argv);
|
||||
int ret;
|
||||
tst_QRadioTuner test_api;
|
||||
ret = QTest::qExec(&test_api, argc, argv);
|
||||
#ifdef Q_OS_SYMBIAN
|
||||
char *new_argv[3];
|
||||
QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + "_xa.log";
|
||||
QByteArray bytes = str.toAscii();
|
||||
char arg1[] = "-o";
|
||||
new_argv[0] = argv[0];
|
||||
new_argv[1] = arg1;
|
||||
new_argv[2] = bytes.data();
|
||||
tst_QXARadio_xa test_xa;
|
||||
ret = QTest::qExec(&test_xa, 3, new_argv);
|
||||
char *new_argv1[3];
|
||||
QString str1 = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + "_s60.log";
|
||||
QByteArray bytes1 = str1.toAscii();
|
||||
char arg2[] = "-o";
|
||||
new_argv1[0] = argv[0];
|
||||
new_argv1[1] = arg2;
|
||||
new_argv1[2] = bytes1.data();
|
||||
tst_QRadioTuner_s60 test_s60;
|
||||
ret = QTest::qExec(&test_s60, 3, new_argv1);
|
||||
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -5,15 +5,6 @@ QT += multimediakit-private
|
||||
# TARGET = tst_qradiotuner
|
||||
# CONFIG += testcase
|
||||
|
||||
symbian {
|
||||
HEADERS += tst_qradiotuner_xa.h
|
||||
SOURCES += tst_qradiotuner_xa.cpp
|
||||
TARGET.CAPABILITY = ALL -TCB
|
||||
HEADERS += tst_qradiotuner_s60.h
|
||||
SOURCES += tst_qradiotuner_s60.cpp
|
||||
|
||||
}
|
||||
|
||||
HEADERS += tst_qradiotuner.h
|
||||
SOURCES += main.cpp tst_qradiotuner.cpp
|
||||
|
||||
|
||||
@@ -1,170 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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 Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
//TESTED_COMPONENT=src/multimedia
|
||||
|
||||
#include "tst_qradiotuner_s60.h"
|
||||
|
||||
#define QTRY_COMPARE_S60(a,e) \
|
||||
for (int _i = 0; _i < 5000; _i += 100) { \
|
||||
if ((a) == (e)) break; \
|
||||
QTest::qWait(100); \
|
||||
}
|
||||
|
||||
void tst_QRadioTuner_s60::initTestCase()
|
||||
{
|
||||
qRegisterMetaType<QRadioTuner::State>("QRadioTuner::State");
|
||||
qRegisterMetaType<QRadioTuner::Band>("QRadioTuner::Band");
|
||||
|
||||
radio = new QRadioTuner(0);
|
||||
QVERIFY(radio->service() != 0);
|
||||
|
||||
QSignalSpy stateSpy(radio, SIGNAL(stateChanged(QRadioTuner::State)));
|
||||
|
||||
QCOMPARE(radio->state(), QRadioTuner::StoppedState);
|
||||
radio->start();
|
||||
//QCOMPARE(radio->state(), QRadioTuner::ActiveState);
|
||||
QTRY_COMPARE_S60(radio->state(), QRadioTuner::ActiveState);
|
||||
|
||||
QCOMPARE(stateSpy.count(), 1);
|
||||
QCOMPARE(stateSpy.first()[0].value<QRadioTuner::State>(), QRadioTuner::ActiveState);
|
||||
}
|
||||
|
||||
void tst_QRadioTuner_s60::cleanupTestCase()
|
||||
{
|
||||
QVERIFY(radio->error() == QRadioTuner::NoError);
|
||||
QVERIFY(radio->errorString().isEmpty());
|
||||
|
||||
QSignalSpy stateSpy(radio, SIGNAL(stateChanged(QRadioTuner::State)));
|
||||
|
||||
radio->stop();
|
||||
QTRY_COMPARE_S60(radio->state(), QRadioTuner::StoppedState);
|
||||
QCOMPARE(stateSpy.count(), 1);
|
||||
|
||||
QCOMPARE(stateSpy.first()[0].value<QRadioTuner::State>(), QRadioTuner::StoppedState);
|
||||
|
||||
delete radio;
|
||||
}
|
||||
|
||||
void tst_QRadioTuner_s60::testBand()
|
||||
{
|
||||
QVERIFY(radio->isBandSupported(QRadioTuner::FM));
|
||||
QVERIFY(!radio->isBandSupported(QRadioTuner::SW));
|
||||
|
||||
if(radio->isBandSupported(QRadioTuner::AM)) {
|
||||
QSignalSpy readSignal(radio, SIGNAL(bandChanged(QRadioTuner::Band)));
|
||||
radio->setBand(QRadioTuner::AM);
|
||||
QTestEventLoop::instance().enterLoop(1);
|
||||
QVERIFY(radio->band() == QRadioTuner::AM);
|
||||
QVERIFY(readSignal.count() == 1);
|
||||
}
|
||||
}
|
||||
|
||||
void tst_QRadioTuner_s60::testFrequency()
|
||||
{
|
||||
QSignalSpy readSignal(radio, SIGNAL(frequencyChanged(int)));
|
||||
radio->setFrequency(104500000);
|
||||
QTestEventLoop::instance().enterLoop(1);
|
||||
QVERIFY(radio->frequency() == 104500000);
|
||||
QVERIFY(readSignal.count() == 1);
|
||||
|
||||
// frequencyStep for FM radio is 100kHz (100000Hz)
|
||||
QVERIFY(radio->frequencyStep(QRadioTuner::FM) == 100000);
|
||||
QPair<int,int> test = radio->frequencyRange(QRadioTuner::FM);
|
||||
// frequency range for FM radio is 87,5MHz - 108MHz
|
||||
QVERIFY(test.first == 87500000);
|
||||
QVERIFY(test.second == 108000000);
|
||||
}
|
||||
|
||||
void tst_QRadioTuner_s60::testMute()
|
||||
{
|
||||
QSignalSpy readSignal(radio, SIGNAL(mutedChanged(bool)));
|
||||
radio->setMuted(true);
|
||||
QTestEventLoop::instance().enterLoop(1);
|
||||
QVERIFY(radio->isMuted());
|
||||
QVERIFY(readSignal.count() == 1);
|
||||
}
|
||||
|
||||
void tst_QRadioTuner_s60::testSearch()
|
||||
{
|
||||
QSignalSpy readSignal(radio, SIGNAL(searchingChanged(bool)));
|
||||
QVERIFY(!radio->isSearching());
|
||||
|
||||
radio->searchForward();
|
||||
QVERIFY(radio->isSearching());
|
||||
QVERIFY(readSignal.count() == 1);
|
||||
|
||||
radio->cancelSearch();
|
||||
QTestEventLoop::instance().enterLoop(1);
|
||||
QVERIFY(!radio->isSearching());
|
||||
QVERIFY(readSignal.count() == 2);
|
||||
|
||||
radio->searchBackward();
|
||||
QVERIFY(radio->isSearching());
|
||||
QVERIFY(readSignal.count() == 3);
|
||||
|
||||
radio->cancelSearch();
|
||||
QVERIFY(!radio->isSearching());
|
||||
}
|
||||
|
||||
void tst_QRadioTuner_s60::testVolume()
|
||||
{
|
||||
QVERIFY(radio->volume() == 50);
|
||||
QSignalSpy readSignal(radio, SIGNAL(volumeChanged(int)));
|
||||
radio->setVolume(70);
|
||||
QTestEventLoop::instance().enterLoop(1);
|
||||
QTRY_COMPARE_S60(radio->volume() , 70);
|
||||
QTRY_COMPARE_S60(readSignal.count() ,1);
|
||||
}
|
||||
|
||||
void tst_QRadioTuner_s60::testSignal()
|
||||
{
|
||||
int signalStrength = radio->signalStrength();
|
||||
QVERIFY(signalStrength == signalStrength);
|
||||
// There is no set of this only a get, do nothing else.
|
||||
}
|
||||
|
||||
void tst_QRadioTuner_s60::testStereo()
|
||||
{
|
||||
QVERIFY(radio->isStereo());
|
||||
radio->setStereoMode(QRadioTuner::ForceMono);
|
||||
QVERIFY(radio->stereoMode() == QRadioTuner::ForceMono);
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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 Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
#ifndef TST_QRADIOTUNER_S60_H
|
||||
#define TST_QRADIOTUNER_S60_H
|
||||
|
||||
#include <QtTest/QtTest>
|
||||
#include <QDebug>
|
||||
#include <QTimer>
|
||||
|
||||
#include <qmediaobject.h>
|
||||
#include <qmediacontrol.h>
|
||||
#include <qmediaservice.h>
|
||||
#include <qradiotunercontrol.h>
|
||||
#include <qradiotuner.h>
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
|
||||
class tst_QRadioTuner_s60: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public slots:
|
||||
void initTestCase();
|
||||
void cleanupTestCase();
|
||||
|
||||
private slots:
|
||||
void testBand();
|
||||
void testFrequency();
|
||||
void testMute();
|
||||
void testSearch();
|
||||
void testVolume();
|
||||
void testSignal();
|
||||
void testStereo();
|
||||
|
||||
private:
|
||||
QRadioTuner *radio;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,224 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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 Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "tst_qradiotuner_xa.h"
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
|
||||
#define QTEST_MAIN_S60(TestObject) \
|
||||
int main(int argc, char *argv[]) { \
|
||||
char *new_argv[3]; \
|
||||
QApplication app(argc, argv); \
|
||||
\
|
||||
QString str = "C:\\data\\" + QFileInfo(QCoreApplication::applicationFilePath()).baseName() + ".log"; \
|
||||
QByteArray bytes = str.toAscii(); \
|
||||
\
|
||||
char arg1[] = "-o"; \
|
||||
\
|
||||
new_argv[0] = argv[0]; \
|
||||
new_argv[1] = arg1; \
|
||||
new_argv[2] = bytes.data(); \
|
||||
\
|
||||
TestObject tc; \
|
||||
return QTest::qExec(&tc, 3, new_argv); \
|
||||
}
|
||||
|
||||
#define QTRY_COMPARE(a,e) \
|
||||
for (int _i = 0; _i < 5000; _i += 100) { \
|
||||
if ((a) == (e)) break; \
|
||||
QTest::qWait(100); \
|
||||
} \
|
||||
// QCOMPARE(a, e)
|
||||
|
||||
void tst_QXARadio_xa::initTestCase()
|
||||
{
|
||||
qRegisterMetaType<QRadioTuner::State>("QRadioTuner::State");
|
||||
radio = new QRadioTuner(0);
|
||||
// QVERIFY(radio->service() != 0);
|
||||
// QSignalSpy stateSpy(radio, SIGNAL(stateChanged(QRadioTuner::State)));
|
||||
radio->start();
|
||||
// QTRY_COMPARE(stateSpy.count(), 1); // wait for callbacks to complete in symbian API
|
||||
// QCOMPARE(radio->state(), QRadioTuner::ActiveState);
|
||||
|
||||
}
|
||||
|
||||
void tst_QXARadio_xa::cleanupTestCase()
|
||||
{
|
||||
QVERIFY(radio->service() != 0);
|
||||
}
|
||||
|
||||
void tst_QXARadio_xa::testBand()
|
||||
{
|
||||
qRegisterMetaType<QRadioTuner::Band>("QRadioTuner::Band");
|
||||
|
||||
QVERIFY(radio->isBandSupported(QRadioTuner::FM));
|
||||
QVERIFY(!radio->isBandSupported(QRadioTuner::SW));
|
||||
radio->setBand(QRadioTuner::FM);
|
||||
QVERIFY(radio->band() == QRadioTuner::FM);
|
||||
if(radio->isBandSupported(QRadioTuner::AM)) {
|
||||
QSignalSpy readSignal(radio, SIGNAL(bandChanged(QRadioTuner::Band)));
|
||||
radio->setBand(QRadioTuner::AM);
|
||||
QTRY_COMPARE(readSignal.count(), 1); // wait for callbacks to complete in symbian API
|
||||
QVERIFY(radio->band() == QRadioTuner::AM);
|
||||
}
|
||||
}
|
||||
|
||||
void tst_QXARadio_xa::testFrequency()
|
||||
{
|
||||
QSignalSpy readSignal(radio, SIGNAL(frequencyChanged(int)));
|
||||
radio->setFrequency(90900000);
|
||||
QTRY_COMPARE(readSignal.count(), 1); // wait for callbacks to complete in symbian API
|
||||
QVERIFY(radio->frequency() == 90900000);
|
||||
// frequencyStep for FM radio is 100kHz (100000Hz)
|
||||
QVERIFY(radio->frequencyStep(QRadioTuner::FM) == 100000);
|
||||
QPair<int,int> test = radio->frequencyRange(QRadioTuner::FM);
|
||||
// frequency range for FM radio is 87,5MHz - 108MHz
|
||||
QVERIFY(test.first == 87500000);
|
||||
QVERIFY(test.second == 108000000);
|
||||
}
|
||||
|
||||
void tst_QXARadio_xa::testMute()
|
||||
{
|
||||
QSignalSpy readSignal(radio, SIGNAL(mutedChanged(bool)));
|
||||
radio->setMuted(true);
|
||||
QTRY_COMPARE(readSignal.count(), 1); // wait for callbacks to complete in symbian API
|
||||
QVERIFY(radio->isMuted());
|
||||
QVERIFY(readSignal.count() == 1);
|
||||
}
|
||||
|
||||
void tst_QXARadio_xa::testSearch()
|
||||
{
|
||||
QSignalSpy readSignal(radio, SIGNAL(searchingChanged(bool)));
|
||||
QVERIFY(!radio->isSearching());
|
||||
|
||||
radio->searchForward();
|
||||
// Note: DON'T wait for callback to complete in symbian API
|
||||
QVERIFY(radio->isSearching());
|
||||
|
||||
radio->cancelSearch();
|
||||
QTRY_COMPARE(readSignal.count(), 1); // wait for callbacks to complete in symbian API
|
||||
QVERIFY(!radio->isSearching());
|
||||
|
||||
radio->searchBackward();
|
||||
// Note: DON'T wait for callbacks to complete in symbian API
|
||||
QVERIFY(radio->isSearching());
|
||||
|
||||
radio->cancelSearch();
|
||||
QTRY_COMPARE(readSignal.count(), 1); // wait for callbacks to complete in symbian API
|
||||
QVERIFY(!radio->isSearching());
|
||||
}
|
||||
|
||||
void tst_QXARadio_xa::testVolume()
|
||||
{
|
||||
QSignalSpy readSignal(radio, SIGNAL(volumeChanged(int)));
|
||||
radio->setVolume(50);
|
||||
QTRY_COMPARE(readSignal.count(), 1); // wait for callbacks to complete in symbian API
|
||||
QVERIFY(radio->volume() == 50);
|
||||
}
|
||||
|
||||
void tst_QXARadio_xa::testSignal()
|
||||
{
|
||||
QVERIFY(radio->signalStrength() != 0);
|
||||
// There is no set of this only a get, do nothing else.
|
||||
}
|
||||
|
||||
void tst_QXARadio_xa::testStereo()
|
||||
{
|
||||
// Default = Auto. Testing transition from auto to mono:
|
||||
QVERIFY(radio->isStereo());
|
||||
QSignalSpy readSignal(radio, SIGNAL(stereoStatusChanged(bool)));
|
||||
radio->setStereoMode(QRadioTuner::ForceMono);
|
||||
QTRY_COMPARE(readSignal.count(), 1); // wait for callbacks to complete in symbian API
|
||||
QVERIFY(radio->stereoMode() == QRadioTuner::ForceMono);
|
||||
// QVERIFY(readSignal.count() == 1);
|
||||
|
||||
// testing transition from mono to stereo:
|
||||
radio->setStereoMode(QRadioTuner::ForceStereo);
|
||||
QTRY_COMPARE(readSignal.count(), 1); // wait for callbacks to complete in symbian API
|
||||
QVERIFY(radio->stereoMode() == QRadioTuner::ForceStereo);
|
||||
// QVERIFY(readSignal.count() == 1);
|
||||
|
||||
// testing transition from stereo to auto:
|
||||
radio->setStereoMode(QRadioTuner::Auto);
|
||||
QTRY_COMPARE(readSignal.count(), 1); // wait for callbacks to complete in symbian API
|
||||
QVERIFY(radio->stereoMode() == QRadioTuner::Auto);
|
||||
// QVERIFY(readSignal.count() == 1);
|
||||
|
||||
// testing transition from auto to stereo:
|
||||
radio->setStereoMode(QRadioTuner::ForceStereo);
|
||||
QTRY_COMPARE(readSignal.count(), 1); // wait for callbacks to complete in symbian API
|
||||
QVERIFY(radio->stereoMode() == QRadioTuner::ForceStereo);
|
||||
// QVERIFY(readSignal.count() == 1);
|
||||
|
||||
// testing transition from stereo to mono:
|
||||
radio->setStereoMode(QRadioTuner::ForceMono);
|
||||
QTRY_COMPARE(readSignal.count(), 1); // wait for callbacks to complete in symbian API
|
||||
QVERIFY(radio->stereoMode() == QRadioTuner::ForceMono);
|
||||
// QVERIFY(readSignal.count() == 1);
|
||||
|
||||
// testing transition from mono to auto:
|
||||
radio->setStereoMode(QRadioTuner::Auto);
|
||||
QTRY_COMPARE(readSignal.count(), 1); // wait for callbacks to complete in symbian API
|
||||
QVERIFY(radio->stereoMode() == QRadioTuner::Auto);
|
||||
// QVERIFY(readSignal.count() == 1);
|
||||
|
||||
}
|
||||
|
||||
void tst_QXARadio_xa::testAvailability()
|
||||
{
|
||||
QVERIFY(radio->isAvailable());
|
||||
QVERIFY(radio->availabilityError() == QtMultimediaKit::NoError);
|
||||
}
|
||||
|
||||
void tst_QXARadio_xa::testStopRadio()
|
||||
{
|
||||
QVERIFY(radio->service() != 0);
|
||||
QVERIFY(radio->error() == QRadioTuner::NoError);
|
||||
QVERIFY(radio->errorString().isEmpty());
|
||||
|
||||
QSignalSpy stateSpy(radio, SIGNAL(stateChanged(QRadioTuner::State)));
|
||||
|
||||
radio->stop();
|
||||
QTRY_COMPARE(stateSpy.count(), 1); // wait for callbacks to complete in symbian API
|
||||
QCOMPARE(radio->state(), QRadioTuner::StoppedState);
|
||||
|
||||
// delete radio;
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** 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 Mobility Components.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** 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.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
#ifndef TST_QRADIOTUNER_XA_H
|
||||
#define TST_QRADIOTUNER_XA_H
|
||||
|
||||
#include <QtTest/QtTest>
|
||||
#include <QDebug>
|
||||
#include <QTimer>
|
||||
#include <qmediaobject.h>
|
||||
#include <qmediacontrol.h>
|
||||
#include <qmediaservice.h>
|
||||
#include <qradiotunercontrol.h>
|
||||
#include <qradiotuner.h>
|
||||
#include <qtmedianamespace.h>
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
QT_USE_NAMESPACE
|
||||
|
||||
class tst_QXARadio_xa: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public slots:
|
||||
void initTestCase();
|
||||
void cleanupTestCase();
|
||||
|
||||
private slots:
|
||||
void testBand();
|
||||
void testFrequency();
|
||||
void testMute();
|
||||
void testSearch();
|
||||
void testVolume();
|
||||
void testSignal();
|
||||
void testStereo();
|
||||
void testAvailability();
|
||||
void testStopRadio();
|
||||
|
||||
private:
|
||||
QRadioTuner *radio;
|
||||
};
|
||||
|
||||
#endif // TST_QRADIOTUNER_XA_H
|
||||
@@ -6,17 +6,9 @@ QT += core declarative multimediakit-private
|
||||
|
||||
SOURCES += tst_qsoundeffect.cpp
|
||||
|
||||
wince*|symbian {
|
||||
deploy.files = test.wav
|
||||
DEPLOYMENT = deploy
|
||||
DEFINES += QT_QSOUNDEFFECT_USEAPPLICATIONPATH
|
||||
} else:maemo* {
|
||||
DEFINES += QT_QSOUNDEFFECT_USEAPPLICATIONPATH
|
||||
} else {
|
||||
DEFINES += SRCDIR=\\\"$$PWD/\\\"
|
||||
}
|
||||
DEFINES += SRCDIR=\\\"$$PWD/\\\"
|
||||
|
||||
unix:!mac:!symbian {
|
||||
unix:!mac {
|
||||
!contains(QT_CONFIG, pulseaudio) {
|
||||
DEFINES += QT_MULTIMEDIA_QMEDIAPLAYER
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user