Browse Source

Moved audio output out of UI widget

QGC4.4
Lorenz Meier 11 years ago
parent
commit
c9b53416d1
  1. 4
      src/uas/UAS.cc
  2. 2
      src/ui/uas/QGCMessageView.cc

4
src/uas/UAS.cc

@ -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
{ {

2
src/ui/uas/QGCMessageView.cc

@ -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;

Loading…
Cancel
Save