Commit 60e0f0ff authored by pixhawk's avatar pixhawk

Added windows audio

parent 3385b837
DEPENDPATH += src
INCLUDEPATH += src
MOC_DIR = tmp
OBJECTS_DIR = obj
# Input
HEADERS += curve.h \
......@@ -52,5 +50,3 @@ SOURCES += curve.cpp \
openaerialmapadapter.cpp \
fixedimageoverlay.cpp \
emptymapadapter.cpp
QT += network
......@@ -28,7 +28,7 @@
QT += network opengl svg xml phonon
TEMPLATE = app
TARGET = opengroundcontrol
TARGET = qgroundcontrol
BASEDIR = .
BUILDDIR = build
......@@ -38,6 +38,7 @@ LANGUAGE = C++
#CONFIG += static release console
CONFIG += static debug_and_release console
QMAKE_CFLAGS += -j8
QMAKE_CXXFLAGS += -j8
OBJECTS_DIR = $$BUILDDIR/obj
MOC_DIR = $$BUILDDIR/moc
......@@ -60,14 +61,11 @@ message(Qt version> $$[QMAKESPEC])
# MAC OS X
macx {
message(Building for Mac OS X)
message(Building for Mac OS X 32/64bit)
CONFIG += x86
contains ( DEFINES, QT_MAC_USE_COCOA ) {
CONFIG += x86_64 cocoa
CONFIG -= static
}
#CONFIG += x86
CONFIG += x86_64 cocoa
CONFIG -= static
DESTDIR = $$BASEDIR/bin/mac
......@@ -79,7 +77,11 @@ macx {
-framework ApplicationServices \
-lm
DEFINES += _TTY_POSIX_
# Enable function-profiling with the OS X saturn tool
debug {
#QMAKE_CXXFLAGS += -finstrument-functions
#LIBS += -lSaturn
}
#ICON = $$BASEDIR/img/icons/empty.png
}
......@@ -98,8 +100,6 @@ linux-g++ {
}
INCLUDEPATH += /usr/include/SDL
DEFINES += _TTY_POSIX_
HARDWARE_PLATFORM = $$system(uname -a)
contains( HARDWARE_PLATFORM, x86_64 ) {
# 64-bit Linux
......@@ -142,8 +142,6 @@ win32 {
-lmingw32 -lSDLmain -lSDL -mwindows
INCLUDEPATH += $$BASEDIR/lib/sdl/include/SDL
DEFINES += _TTY_WIN_
debug {
DESTDIR = $$BASEDIR/bin
......
......@@ -11,7 +11,9 @@ include(src/lib/qwt/qwt.pri)
#include(src/lib/flite/flite.pri)
# Include QMapControl map library
include(lib/QMapControl/QMapControl.pri)
include(src/lib/qmapcontrol/qmapcontrol.pri)
#include(lib/QMapControl/QMapControl.pri)
DEPENDPATH += . \
lib/QMapControl \
lib/QMapControl/src
......
......@@ -30,16 +30,21 @@ This file is part of the PIXHAWK project
*/
#include <QApplication>
#include <QTemporaryFile>
#include "GAudioOutput.h"
#include "MG.h"
#include <QDebug>
#ifdef Q_OS_MAC
#include <ApplicationServices/ApplicationServices.h>
#endif
#include <QTemporaryFile>
#include <QDebug>
#ifdef Q_OS_WINDOWS
#include <windows.h>
using System;
using System.Speech.Synthesis;
#endif
#ifndef Q_OS_MAC
extern "C" {
......@@ -110,7 +115,13 @@ bool GAudioOutput::say(QString text, int severity)
bool res = false;
if (!emergency)
{
// Only give speech output on Linux and MacOS
#ifdef Q_OS_WINDOWS
SpeechSynthesizer synth = new SpeechSynthesizer();
synth.SelectVoice("Microsoft Anna");
synth.SpeakText("Hello, world!");
#endif
#ifdef Q_OS_LINUX
QTemporaryFile file;
file.setFileTemplate("XXXXXX.wav");
......
DEPENDPATH += src
INCLUDEPATH += src
# Input
HEADERS += curve.h \
geometry.h \
imagemanager.h \
layer.h \
layermanager.h \
linestring.h \
mapadapter.h \
mapcontrol.h \
mapnetwork.h \
point.h \
tilemapadapter.h \
wmsmapadapter.h \
circlepoint.h \
imagepoint.h \
gps_position.h \
osmmapadapter.h \
maplayer.h \
geometrylayer.h \
yahoomapadapter.h \
googlemapadapter.h \
googlesatmapadapter.h \
openaerialmapadapter.h \
fixedimageoverlay.h \
emptymapadapter.h
SOURCES += curve.cpp \
geometry.cpp \
imagemanager.cpp \
layer.cpp \
layermanager.cpp \
linestring.cpp \
mapadapter.cpp \
mapcontrol.cpp \
mapnetwork.cpp \
point.cpp \
tilemapadapter.cpp \
wmsmapadapter.cpp \
circlepoint.cpp \
imagepoint.cpp \
gps_position.cpp \
osmmapadapter.cpp \
maplayer.cpp \
geometrylayer.cpp \
yahoomapadapter.cpp \
googlemapadapter.cpp \
googlesatmapadapter.cpp \
openaerialmapadapter.cpp \
fixedimageoverlay.cpp \
emptymapadapter.cpp
......@@ -27,7 +27,9 @@ void JoystickWidget::updateJoystick(double roll, double pitch, double yaw, doubl
{
setX(roll);
setY(pitch);
setZ(yaw);
setThrottle(thrust);
setHat(xHat, yHat);
}
void JoystickWidget::changeEvent(QEvent *e)
......@@ -46,16 +48,29 @@ void JoystickWidget::setThrottle(float thrust)
{
m_ui->thrust->setValue(thrust*100);
}
void JoystickWidget::setX(float x)
{
m_ui->xSlider->setValue(x*100);
m_ui->xValue->display(x*100);
}
void JoystickWidget::setY(float y)
{
m_ui->ySlider->setValue(y*100);
m_ui->yValue->display(y*100);
}
void JoystickWidget::setZ(float z)
{
m_ui->dial->setValue(z*100);
}
void JoystickWidget::setHat(float x, float y)
{
qDebug() << __FILE__ << __LINE__ << "HAT X:" << x << "HAT Y:" << y;
}
void JoystickWidget::pressKey(int key)
{
QString colorstyle;
......@@ -64,5 +79,5 @@ void JoystickWidget::pressKey(int key)
heartbeatColor.red(), heartbeatColor.green(), heartbeatColor.blue());
m_ui->button0Label->setStyleSheet(colorstyle);
m_ui->button0Label->setAutoFillBackground(true);
qDebug() << "KEY" << key << " pressed on joystick";
qDebug() << __FILE__ << __LINE__ << "KEY" << key << " pressed on joystick";
}
......@@ -23,7 +23,7 @@ This file is part of the PIXHAWK project
/**
* @file
* @brief Definition of joystick interface
* @brief Definition of joystick widget
* @author Lorenz Meier <mavteam@student.ethz.ch>
*
*/
......@@ -57,14 +57,23 @@ public:
* @param yHat hat vector in left-right direction, -1 left, 0 center, +1 right
*/
void updateJoystick(double roll, double pitch, double yaw, double thrust, int xHat, int yHat);
/** @brief Throttle lever */
void setThrottle(float thrust);
/** @brief Back/forth movement */
void setX(float x);
/** @brief Left/right movement */
void setY(float y);
/** @brief Wrist rotation */
void setZ(float z);
/** @brief Hat switch position */
void setHat(float x, float y);
/** @brief Joystick keys, as labeled on the joystick */
void pressKey(int key);
protected:
/** @brief UI change event */
virtual void changeEvent(QEvent *e);
JoystickInput* joystick;
JoystickInput* joystick; ///< Reference to the joystick
private:
Ui::JoystickWidget *m_ui;
......
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