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
deb7f923
Commit
deb7f923
authored
Mar 02, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused code
parent
859f08c9
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
53 deletions
+9
-53
qgroundcontrol.pro
qgroundcontrol.pro
+0
-4
GAudioOutput.cc
src/GAudioOutput.cc
+3
-4
GAudioOutput.h
src/GAudioOutput.h
+3
-3
QGCAudioWorker.cpp
src/audio/QGCAudioWorker.cpp
+1
-31
QGCAudioWorker.h
src/audio/QGCAudioWorker.h
+2
-11
No files found.
qgroundcontrol.pro
View file @
deb7f923
...
@@ -92,10 +92,6 @@ QT += \
...
@@ -92,10 +92,6 @@ QT += \
bluetooth
\
bluetooth
\
}
}
contains
(
DEFINES
,
QGC_NOTIFY_TUNES_ENABLED
)
{
QT
+=
multimedia
}
#
testlib
is
needed
even
in
release
flavor
for
QSignalSpy
support
#
testlib
is
needed
even
in
release
flavor
for
QSignalSpy
support
QT
+=
testlib
QT
+=
testlib
...
...
src/GAudioOutput.cc
View file @
deb7f923
...
@@ -88,12 +88,11 @@ bool GAudioOutput::isMuted()
...
@@ -88,12 +88,11 @@ bool GAudioOutput::isMuted()
return
muted
;
return
muted
;
}
}
bool
GAudioOutput
::
say
(
const
QString
&
inText
,
int
severity
)
bool
GAudioOutput
::
say
(
const
QString
&
inText
)
{
{
if
(
!
muted
)
{
if
(
!
muted
&&
!
qgcApp
()
->
runningUnitTests
()
)
{
#if defined __android__
#if defined __android__
#if defined QGC_SPEECH_ENABLED
#if defined QGC_SPEECH_ENABLED
Q_UNUSED
(
severity
);
static
const
char
V_jniClassName
[]
{
"org/qgroundcontrol/qgchelper/UsbDeviceJNI"
};
static
const
char
V_jniClassName
[]
{
"org/qgroundcontrol/qgchelper/UsbDeviceJNI"
};
QAndroidJniEnvironment
env
;
QAndroidJniEnvironment
env
;
if
(
env
->
ExceptionCheck
())
{
if
(
env
->
ExceptionCheck
())
{
...
@@ -105,7 +104,7 @@ bool GAudioOutput::say(const QString& inText, int severity)
...
@@ -105,7 +104,7 @@ bool GAudioOutput::say(const QString& inText, int severity)
QAndroidJniObject
::
callStaticMethod
<
void
>
(
V_jniClassName
,
"say"
,
"(Ljava/lang/String;)V"
,
javaMessage
.
object
<
jstring
>
());
QAndroidJniObject
::
callStaticMethod
<
void
>
(
V_jniClassName
,
"say"
,
"(Ljava/lang/String;)V"
,
javaMessage
.
object
<
jstring
>
());
#endif
#endif
#else
#else
emit
textToSpeak
(
inText
,
severity
);
emit
textToSpeak
(
inText
);
#endif
#endif
}
}
return
true
;
return
true
;
...
...
src/GAudioOutput.h
View file @
deb7f923
...
@@ -79,14 +79,14 @@ public:
...
@@ -79,14 +79,14 @@ public:
bool
isMuted
();
bool
isMuted
();
public
slots
:
public
slots
:
/** @brief Say this text
if current output priority matches
*/
/** @brief Say this text */
bool
say
(
const
QString
&
text
,
int
severity
=
6
);
bool
say
(
const
QString
&
text
);
/** @brief Mute/unmute sound */
/** @brief Mute/unmute sound */
void
mute
(
bool
mute
);
void
mute
(
bool
mute
);
signals:
signals:
void
mutedChanged
(
bool
);
void
mutedChanged
(
bool
);
bool
textToSpeak
(
QString
text
,
int
severity
=
1
);
bool
textToSpeak
(
QString
text
);
void
beepOnce
();
void
beepOnce
();
protected:
protected:
...
...
src/audio/QGCAudioWorker.cpp
View file @
deb7f923
...
@@ -76,9 +76,6 @@ QGCAudioWorker::QGCAudioWorker(QObject *parent) :
...
@@ -76,9 +76,6 @@ QGCAudioWorker::QGCAudioWorker(QObject *parent) :
#if defined _MSC_VER && defined QGC_SPEECH_ENABLED
#if defined _MSC_VER && defined QGC_SPEECH_ENABLED
pVoice
(
NULL
),
pVoice
(
NULL
),
#endif
#endif
#ifdef QGC_NOTIFY_TUNES_ENABLED
sound
(
NULL
),
#endif
emergency
(
false
),
emergency
(
false
),
muted
(
false
)
muted
(
false
)
{
{
...
@@ -89,10 +86,6 @@ QGCAudioWorker::QGCAudioWorker(QObject *parent) :
...
@@ -89,10 +86,6 @@ QGCAudioWorker::QGCAudioWorker(QObject *parent) :
void
QGCAudioWorker
::
init
()
void
QGCAudioWorker
::
init
()
{
{
#ifdef QGC_NOTIFY_TUNES_ENABLED
sound
=
new
QSound
(
":/res/Alert"
);
#endif
#if defined Q_OS_LINUX && !defined __android__ && defined QGC_SPEECH_ENABLED
#if defined Q_OS_LINUX && !defined __android__ && defined QGC_SPEECH_ENABLED
espeak_Initialize
(
AUDIO_OUTPUT_SYNCH_PLAYBACK
,
500
,
NULL
,
0
);
// initialize for playback with 500ms buffer and no options (see speak_lib.h)
espeak_Initialize
(
AUDIO_OUTPUT_SYNCH_PLAYBACK
,
500
,
NULL
,
0
);
// initialize for playback with 500ms buffer and no options (see speak_lib.h)
espeak_VOICE
*
espeak_voice
=
espeak_GetCurrentVoice
();
espeak_VOICE
*
espeak_voice
=
espeak_GetCurrentVoice
();
...
@@ -135,11 +128,10 @@ QGCAudioWorker::~QGCAudioWorker()
...
@@ -135,11 +128,10 @@ QGCAudioWorker::~QGCAudioWorker()
#endif
#endif
}
}
void
QGCAudioWorker
::
say
(
QString
inText
,
int
severity
)
void
QGCAudioWorker
::
say
(
QString
inText
)
{
{
#ifdef __android__
#ifdef __android__
Q_UNUSED
(
inText
);
Q_UNUSED
(
inText
);
Q_UNUSED
(
severity
);
#else
#else
static
bool
threadInit
=
false
;
static
bool
threadInit
=
false
;
if
(
!
threadInit
)
{
if
(
!
threadInit
)
{
...
@@ -150,17 +142,6 @@ void QGCAudioWorker::say(QString inText, int severity)
...
@@ -150,17 +142,6 @@ void QGCAudioWorker::say(QString inText, int severity)
if
(
!
muted
)
if
(
!
muted
)
{
{
QString
text
=
fixTextMessageForAudio
(
inText
);
QString
text
=
fixTextMessageForAudio
(
inText
);
// Prepend high priority text with alert beep
if
(
severity
<
GAudioOutput
::
AUDIO_SEVERITY_CRITICAL
)
{
beep
();
}
#ifdef QGC_NOTIFY_TUNES_ENABLED
// Wait for the last sound to finish
while
(
!
sound
->
isFinished
())
{
QGC
::
SLEEP
::
msleep
(
100
);
}
#endif
#if defined _MSC_VER && defined QGC_SPEECH_ENABLED
#if defined _MSC_VER && defined QGC_SPEECH_ENABLED
HRESULT
hr
=
pVoice
->
Speak
(
text
.
toStdWString
().
c_str
(),
SPF_DEFAULT
,
NULL
);
HRESULT
hr
=
pVoice
->
Speak
(
text
.
toStdWString
().
c_str
(),
SPF_DEFAULT
,
NULL
);
...
@@ -195,17 +176,6 @@ void QGCAudioWorker::mute(bool mute)
...
@@ -195,17 +176,6 @@ void QGCAudioWorker::mute(bool mute)
}
}
}
}
void
QGCAudioWorker
::
beep
()
{
if
(
!
muted
)
{
#ifdef QGC_NOTIFY_TUNES_ENABLED
sound
->
play
(
":/res/Alert"
);
#endif
}
}
bool
QGCAudioWorker
::
isMuted
()
bool
QGCAudioWorker
::
isMuted
()
{
{
return
this
->
muted
;
return
this
->
muted
;
...
...
src/audio/QGCAudioWorker.h
View file @
deb7f923
...
@@ -3,9 +3,6 @@
...
@@ -3,9 +3,6 @@
#include <QObject>
#include <QObject>
#include <QTimer>
#include <QTimer>
#ifdef QGC_NOTIFY_TUNES_ENABLED
#include <QSound>
#endif
#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
...
@@ -29,19 +26,13 @@ public:
...
@@ -29,19 +26,13 @@ public:
signals:
signals:
public
slots
:
public
slots
:
/** @brief Say this text if current output priority matches */
/** @brief Say this text */
void
say
(
QString
text
,
int
severity
=
1
);
void
say
(
QString
text
);
/** @brief Sound a single beep */
void
beep
();
protected:
protected:
int
voiceIndex
;
///< The index of the flite voice to use (awb, slt, rms)
int
voiceIndex
;
///< The index of the flite voice to use (awb, slt, rms)
#if defined _MSC_VER && defined QGC_SPEECH_ENABLED
#if defined _MSC_VER && defined QGC_SPEECH_ENABLED
ISpVoice
*
pVoice
;
ISpVoice
*
pVoice
;
#endif
#ifdef QGC_NOTIFY_TUNES_ENABLED
QSound
*
sound
;
#endif
#endif
bool
emergency
;
///< Emergency status flag
bool
emergency
;
///< Emergency status flag
QTimer
*
emergencyTimer
;
QTimer
*
emergencyTimer
;
...
...
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