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
4bb161b8
Commit
4bb161b8
authored
Dec 09, 2014
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix beep API and unconnected slot
parent
41c25ff4
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
10 deletions
+21
-10
GAudioOutput.cc
src/GAudioOutput.cc
+2
-10
GAudioOutput.h
src/GAudioOutput.h
+1
-0
QGCAudioWorker.cpp
src/audio/QGCAudioWorker.cpp
+15
-0
QGCAudioWorker.h
src/audio/QGCAudioWorker.h
+3
-0
No files found.
src/GAudioOutput.cc
View file @
4bb161b8
...
...
@@ -65,6 +65,7 @@ GAudioOutput::GAudioOutput(QObject *parent) : QObject(parent),
{
worker
->
moveToThread
(
thread
);
connect
(
this
,
SIGNAL
(
textToSpeak
(
QString
,
int
)),
worker
,
SLOT
(
say
(
QString
,
int
)));
connect
(
this
,
SIGNAL
(
beepOnce
()),
worker
,
SLOT
(
beep
()));
thread
->
start
();
}
...
...
@@ -146,7 +147,6 @@ bool GAudioOutput::startEmergency()
// emergency = true;
// // Beep immediately and then start timer
// if (!muted) beep();
// emergencyTimer->start(1500);
// QTimer::singleShot(5000, this, SLOT(stopEmergency()));
...
...
@@ -174,13 +174,5 @@ bool GAudioOutput::stopEmergency()
void
GAudioOutput
::
beep
()
{
if
(
!
muted
)
{
// FIXME: Re-enable audio beeps
// Use QFile to transform path for all OS
//QFile f(QCoreApplication::applicationDirPath() + QString("/files/audio/alert.wav"));
//qDebug() << "FILE:" << f.fileName();
//m_media->setCurrentSource(Phonon::MediaSource(f.fileName().toStdString().c_str()));
//m_media->play();
}
emit
beepOnce
();
}
src/GAudioOutput.h
View file @
4bb161b8
...
...
@@ -86,6 +86,7 @@ public slots:
signals:
void
mutedChanged
(
bool
);
bool
textToSpeak
(
QString
text
,
int
severity
=
1
);
void
beepOnce
();
protected:
bool
muted
;
...
...
src/audio/QGCAudioWorker.cpp
View file @
4bb161b8
...
...
@@ -136,6 +136,21 @@ void QGCAudioWorker::mute(bool mute)
}
}
void
QGCAudioWorker
::
beep
()
{
// XXX beep beep
if
(
!
muted
)
{
// FIXME: Re-enable audio beeps
// Use QFile to transform path for all OS
//QFile f(QCoreApplication::applicationDirPath() + QString("/files/audio/alert.wav"));
//qDebug() << "FILE:" << f.fileName();
//m_media->setCurrentSource(Phonon::MediaSource(f.fileName().toStdString().c_str()));
//m_media->play();
}
}
bool
QGCAudioWorker
::
isMuted
()
{
return
this
->
muted
;
...
...
src/audio/QGCAudioWorker.h
View file @
4bb161b8
...
...
@@ -32,6 +32,9 @@ public slots:
/** @brief Say this text if current output priority matches */
void
say
(
QString
text
,
int
severity
=
1
);
/** @brief Sound a single beep */
void
beep
();
protected:
#if defined Q_OS_MAC && defined QGC_SPEECH_ENABLED
//NSSpeechSynthesizer
...
...
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