Commit c9b53416 authored by Lorenz Meier's avatar Lorenz Meier

Moved audio output out of UI widget

parent b485d7f6
...@@ -1314,11 +1314,11 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) ...@@ -1314,11 +1314,11 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
QString text = QString(b); QString text = QString(b);
int severity = mavlink_msg_statustext_get_severity(&message); int severity = mavlink_msg_statustext_get_severity(&message);
if (text.startsWith("#audio:")) if (text.startsWith("#") || severity > MAV_SEVERITY_WARNING)
{ {
text.remove("#audio:"); text.remove("#audio:");
emit textMessageReceived(uasId, message.compid, severity, QString("Audio message: ") + text); emit textMessageReceived(uasId, message.compid, severity, QString("Audio message: ") + text);
GAudioOutput::instance()->say(text, severity); GAudioOutput::instance()->say(text.toLower(), severity);
} }
else else
{ {
......
...@@ -97,8 +97,6 @@ void QGCMessageView::handleTextMessage(int uasid, int compId, int severity, QStr ...@@ -97,8 +97,6 @@ void QGCMessageView::handleTextMessage(int uasid, int compId, int severity, QStr
case MAV_SEVERITY_ALERT: case MAV_SEVERITY_ALERT:
case MAV_SEVERITY_CRITICAL: case MAV_SEVERITY_CRITICAL:
case MAV_SEVERITY_ERROR: case MAV_SEVERITY_ERROR:
// TODO: Move this audio output to UAS.cc, as it doesn't make sense to put audio output in a message logger widget.
GAudioOutput::instance()->say(text.toLower());
//Use set RGB values from given color from QGC //Use set RGB values from given color from QGC
style = QString("color: rgb(%1, %2, %3); font-weight:bold").arg(QGC::colorRed.red()).arg(QGC::colorRed.green()).arg(QGC::colorRed.blue()); style = QString("color: rgb(%1, %2, %3); font-weight:bold").arg(QGC::colorRed.red()).arg(QGC::colorRed.green()).arg(QGC::colorRed.blue());
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment