Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
38c177fd
Commit
38c177fd
authored
Nov 09, 2015
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding TTS to iOS
parent
045e3f5a
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
247 additions
and
157 deletions
+247
-157
QGCApplication.pro
QGCApplication.pro
+5
-3
QGCCommon.pri
QGCCommon.pri
+2
-0
QGCExternalLibs.pri
QGCExternalLibs.pri
+1
-1
QGCApplication.cc
src/QGCApplication.cc
+1
-3
QGCMessageBox.h
src/QGCMessageBox.h
+1
-1
OpenPilotMaps.cc
src/QtLocationPlugin/OpenPilotMaps.cc
+1
-1
qgeotilefetcherqgc.cpp
src/QtLocationPlugin/qgeotilefetcherqgc.cpp
+1
-1
VideoStreaming.cc
src/VideoStreaming/VideoStreaming.cc
+1
-3
QGCAudioWorker.cpp
src/audio/QGCAudioWorker.cpp
+8
-2
QGCAudioWorker_iOS.mm
src/audio/QGCAudioWorker_iOS.mm
+84
-0
QGCFlightGearLink.cc
src/comm/QGCFlightGearLink.cc
+139
-139
MainWindow.cc
src/ui/MainWindow.cc
+2
-2
MainToolBar.qml
src/ui/toolbar/MainToolBar.qml
+1
-1
No files found.
QGCApplication.pro
View file @
38c177fd
...
@@ -90,6 +90,8 @@ iOSBuild {
...
@@ -90,6 +90,8 @@ iOSBuild {
QMAKE_INFO_PLIST
=
$$
{
BASEDIR
}
/
ios
/
iOS
-
Info
.
plist
QMAKE_INFO_PLIST
=
$$
{
BASEDIR
}
/
ios
/
iOS
-
Info
.
plist
ICON
=
$$
{
BASEDIR
}
/
resources
/
icons
/
macx
.
icns
ICON
=
$$
{
BASEDIR
}
/
resources
/
icons
/
macx
.
icns
OTHER_FILES
+=
$$
{
BASEDIR
}
/
iOS
-
Info
.
plist
OTHER_FILES
+=
$$
{
BASEDIR
}
/
iOS
-
Info
.
plist
LIBS
+=
-
framework
AVFoundation
OBJECTIVE_SOURCES
+=
src
/
audio
/
QGCAudioWorker_iOS
.
mm
}
}
LinuxBuild
{
LinuxBuild
{
...
...
QGCCommon.pri
View file @
38c177fd
...
@@ -49,6 +49,7 @@ linux {
...
@@ -49,6 +49,7 @@ linux {
macx-clang | macx-llvm {
macx-clang | macx-llvm {
message("Mac build")
message("Mac build")
CONFIG += MacBuild
CONFIG += MacBuild
DEFINES += __macos__
QMAKE_CXXFLAGS += -fvisibility=hidden
QMAKE_CXXFLAGS += -fvisibility=hidden
} else {
} else {
error("Unsupported Mac toolchain, only 64-bit LLVM+clang is supported")
error("Unsupported Mac toolchain, only 64-bit LLVM+clang is supported")
...
@@ -60,6 +61,7 @@ linux {
...
@@ -60,6 +61,7 @@ linux {
message("iOS build")
message("iOS build")
CONFIG += iOSBuild MobileBuild app_bundle
CONFIG += iOSBuild MobileBuild app_bundle
DEFINES += __ios__
DEFINES += __ios__
QMAKE_IOS_DEPLOYMENT_TARGET = 8.0
warning("iOS build is experimental and not yet fully functional")
warning("iOS build is experimental and not yet fully functional")
} else {
} else {
error("Unsupported build platform, only Linux, Windows, Android and Mac (Mac OS and iOS) are supported")
error("Unsupported build platform, only Linux, Windows, Android and Mac (Mac OS and iOS) are supported")
...
...
QGCExternalLibs.pri
View file @
38c177fd
...
@@ -260,7 +260,7 @@ contains (DEFINES, DISABLE_SPEECH) {
...
@@ -260,7 +260,7 @@ contains (DEFINES, DISABLE_SPEECH) {
}
}
}
}
# Mac support is built into OS 10.6+.
# Mac support is built into OS 10.6+.
else:MacBuild {
else:MacBuild
|iOSBuild
{
message("Including support for speech output")
message("Including support for speech output")
DEFINES += QGC_SPEECH_ENABLED
DEFINES += QGC_SPEECH_ENABLED
}
}
...
...
src/QGCApplication.cc
View file @
38c177fd
...
@@ -140,8 +140,7 @@ static QObject* qgroundcontrolQmlGlobalSingletonFactory(QQmlEngine*, QJSEngine*)
...
@@ -140,8 +140,7 @@ static QObject* qgroundcontrolQmlGlobalSingletonFactory(QQmlEngine*, QJSEngine*)
}
}
#if defined(QGC_GST_STREAMING)
#if defined(QGC_GST_STREAMING)
#ifdef Q_OS_MAC
#if defined(__macos__)
#ifndef __ios__
#ifdef QGC_INSTALL_RELEASE
#ifdef QGC_INSTALL_RELEASE
static
void
qgcputenv
(
const
QString
&
key
,
const
QString
&
root
,
const
QString
&
path
)
static
void
qgcputenv
(
const
QString
&
key
,
const
QString
&
root
,
const
QString
&
path
)
{
{
...
@@ -151,7 +150,6 @@ static void qgcputenv(const QString& key, const QString& root, const QString& pa
...
@@ -151,7 +150,6 @@ static void qgcputenv(const QString& key, const QString& root, const QString& pa
#endif
#endif
#endif
#endif
#endif
#endif
#endif
/**
/**
* @brief Constructor for the main application.
* @brief Constructor for the main application.
...
...
src/QGCMessageBox.h
View file @
38c177fd
...
@@ -116,7 +116,7 @@ private:
...
@@ -116,7 +116,7 @@ private:
#endif
#endif
#endif
#endif
{
{
#ifdef
Q_OS_MAC
#ifdef
__macos__
QString
emptyTitle
;
QString
emptyTitle
;
QMessageBox
box
(
icon
,
emptyTitle
,
title
,
buttons
,
parent
);
QMessageBox
box
(
icon
,
emptyTitle
,
title
,
buttons
,
parent
);
box
.
setDefaultButton
(
defaultButton
);
box
.
setDefaultButton
(
defaultButton
);
...
...
src/QtLocationPlugin/OpenPilotMaps.cc
View file @
38c177fd
...
@@ -196,7 +196,7 @@ void UrlFactory::_tryCorrectGoogleVersions()
...
@@ -196,7 +196,7 @@ void UrlFactory::_tryCorrectGoogleVersions()
_network
->
setProxy
(
tProxy
);
_network
->
setProxy
(
tProxy
);
QString
url
=
"http://maps.google.com/maps?output=classic"
;
QString
url
=
"http://maps.google.com/maps?output=classic"
;
qheader
.
setUrl
(
QUrl
(
url
));
qheader
.
setUrl
(
QUrl
(
url
));
#if defined Q_OS_MAC
X
#if defined Q_OS_MAC
QByteArray
userAgent
=
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0"
;
QByteArray
userAgent
=
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0"
;
#elif defined Q_OS_WIN32
#elif defined Q_OS_WIN32
QByteArray
userAgent
=
"Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7"
;
QByteArray
userAgent
=
"Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7"
;
...
...
src/QtLocationPlugin/qgeotilefetcherqgc.cpp
View file @
38c177fd
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
QGeoTileFetcherQGC
::
QGeoTileFetcherQGC
(
QGeoTiledMappingManagerEngine
*
parent
)
QGeoTileFetcherQGC
::
QGeoTileFetcherQGC
(
QGeoTiledMappingManagerEngine
*
parent
)
:
QGeoTileFetcher
(
parent
)
:
QGeoTileFetcher
(
parent
)
,
m_networkManager
(
new
QNetworkAccessManager
(
this
))
,
m_networkManager
(
new
QNetworkAccessManager
(
this
))
#if defined Q_OS_MAC
X
#if defined Q_OS_MAC
,
m_userAgent
(
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0"
)
,
m_userAgent
(
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/21.0"
)
#elif defined Q_OS_WIN32
#elif defined Q_OS_WIN32
,
m_userAgent
(
"Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7"
)
,
m_userAgent
(
"Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7"
)
...
...
src/VideoStreaming/VideoStreaming.cc
View file @
38c177fd
...
@@ -75,8 +75,7 @@ void initializeVideoStreaming(int &argc, char* argv[])
...
@@ -75,8 +75,7 @@ void initializeVideoStreaming(int &argc, char* argv[])
GST_PLUGIN_STATIC_REGISTER
(
x264
);
GST_PLUGIN_STATIC_REGISTER
(
x264
);
#endif
#endif
#ifdef Q_OS_MAC
#ifdef __macos__
#ifndef __ios__
#ifdef QGC_INSTALL_RELEASE
#ifdef QGC_INSTALL_RELEASE
QString
currentDir
=
QCoreApplication
::
applicationDirPath
();
QString
currentDir
=
QCoreApplication
::
applicationDirPath
();
qgcputenv
(
"GST_PLUGIN_SCANNER"
,
currentDir
,
"/gst-plugin-scanner"
);
qgcputenv
(
"GST_PLUGIN_SCANNER"
,
currentDir
,
"/gst-plugin-scanner"
);
...
@@ -92,7 +91,6 @@ void initializeVideoStreaming(int &argc, char* argv[])
...
@@ -92,7 +91,6 @@ void initializeVideoStreaming(int &argc, char* argv[])
// }
// }
#endif
#endif
#endif
#endif
#endif
#else
#else
Q_UNUSED
(
argc
);
Q_UNUSED
(
argc
);
...
...
src/audio/QGCAudioWorker.cpp
View file @
38c177fd
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
#include "QGCAudioWorker.h"
#include "QGCAudioWorker.h"
#include "GAudioOutput.h"
#include "GAudioOutput.h"
#if
defined Q_OS_MAC
&& defined QGC_SPEECH_ENABLED
#if
(defined __macos__)
&& defined QGC_SPEECH_ENABLED
#include <ApplicationServices/ApplicationServices.h>
#include <ApplicationServices/ApplicationServices.h>
static
SpeechChannel
sc
;
static
SpeechChannel
sc
;
...
@@ -53,6 +53,10 @@ MacSpeech macSpeech;
...
@@ -53,6 +53,10 @@ MacSpeech macSpeech;
#endif
#endif
#if (defined __ios__) && defined QGC_SPEECH_ENABLED
extern
void
iOSSpeak
(
QString
msg
);
#endif
// Speech synthesis is only supported with MSVC compiler
// Speech synthesis is only supported with MSVC compiler
#if defined _MSC_VER && defined QGC_SPEECH_ENABLED
#if defined _MSC_VER && defined QGC_SPEECH_ENABLED
// Documentation: http://msdn.microsoft.com/en-us/library/ee125082%28v=VS.85%29.aspx
// Documentation: http://msdn.microsoft.com/en-us/library/ee125082%28v=VS.85%29.aspx
...
@@ -168,8 +172,10 @@ void QGCAudioWorker::say(QString inText, int severity)
...
@@ -168,8 +172,10 @@ void QGCAudioWorker::say(QString inText, int severity)
unsigned
int
espeak_size
=
strlen
(
text
.
toStdString
().
c_str
())
+
1
;
unsigned
int
espeak_size
=
strlen
(
text
.
toStdString
().
c_str
())
+
1
;
espeak_Synth
(
text
.
toStdString
().
c_str
(),
espeak_size
,
0
,
POS_CHARACTER
,
0
,
espeakCHARS_AUTO
,
NULL
,
NULL
);
espeak_Synth
(
text
.
toStdString
().
c_str
(),
espeak_size
,
0
,
POS_CHARACTER
,
0
,
espeakCHARS_AUTO
,
NULL
,
NULL
);
#elif
defined Q_OS_MAC
&& defined QGC_SPEECH_ENABLED
#elif
(defined __macos__)
&& defined QGC_SPEECH_ENABLED
macSpeech
.
say
(
text
.
toStdString
().
c_str
());
macSpeech
.
say
(
text
.
toStdString
().
c_str
());
#elif (defined __ios__) && defined QGC_SPEECH_ENABLED
iOSSpeak
(
text
);
#else
#else
// Make sure there isn't an unused variable warning when speech output is disabled
// Make sure there isn't an unused variable warning when speech output is disabled
Q_UNUSED
(
inText
);
Q_UNUSED
(
inText
);
...
...
src/audio/QGCAudioWorker_iOS.mm
0 → 100644
View file @
38c177fd
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009, 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
/**
* @file
* @brief TTS for iOS
*
* @author Gus Grubba <mavlink@grubba.com>
*
*/
#include <QString>
#include "QGC.h"
#if (defined __ios__) && defined QGC_SPEECH_ENABLED
#import <AVFoundation/AVSpeechSynthesis.h>
class SpeakIOS
{
public:
SpeakIOS ();
~SpeakIOS ();
void speak (QString msg );
private:
AVSpeechSynthesizer *_synth;
};
SpeakIOS::SpeakIOS()
: _synth([[AVSpeechSynthesizer alloc] init])
{
}
SpeakIOS::~SpeakIOS()
{
[_synth release];
}
void SpeakIOS::speak(QString msg)
{
while ([_synth isSpeaking]) {
QGC::SLEEP::msleep(100);
}
NSString *msg_ns = [NSString stringWithCString:msg.toStdString().c_str() encoding:[NSString defaultCStringEncoding]];
AVSpeechUtterance *utterance = [[[AVSpeechUtterance alloc] initWithString: msg_ns] autorelease];
AVSpeechSynthesisVoice* currentVoice = [AVSpeechSynthesisVoice voiceWithLanguage:[AVSpeechSynthesisVoice currentLanguageCode]];
utterance.voice = currentVoice;
//utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"en-US"];
utterance.rate = 0.5;
[_synth speakUtterance:utterance];
}
//-- The one and only static singleton
SpeakIOS kSpeakIOS;
void iOSSpeak(QString msg)
{
kSpeakIOS.speak(msg);
}
#endif
src/comm/QGCFlightGearLink.cc
View file @
38c177fd
...
@@ -658,7 +658,7 @@ bool QGCFlightGearLink::connectSimulation()
...
@@ -658,7 +658,7 @@ bool QGCFlightGearLink::connectSimulation()
// Now set the FG arguments to the arguments from the UI
// Now set the FG arguments to the arguments from the UI
_fgArgList
=
uiArgList
;
_fgArgList
=
uiArgList
;
#if defined
Q_OS_MACX
#if defined
__macos__
// Mac installs will default to the /Applications folder 99% of the time. Anything other than
// Mac installs will default to the /Applications folder 99% of the time. Anything other than
// that is pretty non-standard so we don't try to get fancy beyond hardcoding that path.
// that is pretty non-standard so we don't try to get fancy beyond hardcoding that path.
fgAppDir
.
setPath
(
"/Applications"
);
fgAppDir
.
setPath
(
"/Applications"
);
...
...
src/ui/MainWindow.cc
View file @
38c177fd
...
@@ -265,7 +265,7 @@ MainWindow::MainWindow()
...
@@ -265,7 +265,7 @@ MainWindow::MainWindow()
connect
(
_ui
.
actionStatusBar
,
&
QAction
::
triggered
,
this
,
&
MainWindow
::
showStatusBarCallback
);
connect
(
_ui
.
actionStatusBar
,
&
QAction
::
triggered
,
this
,
&
MainWindow
::
showStatusBarCallback
);
// Set OS dependent keyboard shortcuts for the main window, non OS dependent shortcuts are set in MainWindow.ui
// Set OS dependent keyboard shortcuts for the main window, non OS dependent shortcuts are set in MainWindow.ui
#ifdef
Q_OS_MACX
#ifdef
__macos__
_ui
.
actionSetup
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+1"
,
0
));
_ui
.
actionSetup
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+1"
,
0
));
_ui
.
actionPlan
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+2"
,
0
));
_ui
.
actionPlan
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+2"
,
0
));
_ui
.
actionFlight
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+3"
,
0
));
_ui
.
actionFlight
->
setShortcut
(
QApplication
::
translate
(
"MainWindow"
,
"Meta+3"
,
0
));
...
@@ -290,7 +290,7 @@ MainWindow::MainWindow()
...
@@ -290,7 +290,7 @@ MainWindow::MainWindow()
menuBar
()
->
hide
();
menuBar
()
->
hide
();
#endif
#endif
show
();
show
();
#ifdef
Q_OS_MAC
#ifdef
__macos__
// TODO HACK
// TODO HACK
// This is a really ugly hack. For whatever reason, by having a QQuickWidget inside a
// This is a really ugly hack. For whatever reason, by having a QQuickWidget inside a
// QDockWidget (MainToolBar above), the main menu is not shown when the app first
// QDockWidget (MainToolBar above), the main menu is not shown when the app first
...
...
src/ui/toolbar/MainToolBar.qml
View file @
38c177fd
...
@@ -421,7 +421,7 @@ Rectangle {
...
@@ -421,7 +421,7 @@ Rectangle {
id
:
toolBarMessage
id
:
toolBarMessage
width
:
toolBarMessageArea
.
width
-
toolBarMessageCloseButton
.
width
width
:
toolBarMessageArea
.
width
-
toolBarMessageCloseButton
.
width
wrapMode
:
Text
.
WordWrap
wrapMode
:
Text
.
WordWrap
color
:
qgcPal
.
warningText
color
:
"
#e4e428
"
lineHeightMode
:
Text
.
ProportionalHeight
lineHeightMode
:
Text
.
ProportionalHeight
lineHeight
:
1.15
lineHeight
:
1.15
anchors.margins
:
mainWindow
.
tbSpacing
anchors.margins
:
mainWindow
.
tbSpacing
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment