Browse Source

More cleanups

QGC4.4
Hugo Vincent 15 years ago
parent
commit
78b9e3f554
  1. 7
      README
  2. BIN
      images/icons/macx.icns
  3. 17
      mavground.pri
  4. 21
      src/AudioOutput.cc
  5. 19
      src/AudioOutput.h
  6. 2
      src/Core.cc

7
README

@ -2,4 +2,11 @@ PIXHAWK Open Source Groundstation @@ -2,4 +2,11 @@ PIXHAWK Open Source Groundstation
http://pixhawk.ethz.ch
To build on Mac OS X (10.5 or later):
1) Install http://www.libsdl.org/release/SDL-1.2.14.dmg
2) Install Qt 4.6.2 with Cocoa http://get.qt.nokia.com/qt/source/qt-mac-cocoa-opensource-4.6.2.dmg
3) Run qmake
4) Run "xcodebuild -configuration Release" or open "opengroundcontrol.xcodeproj" in Xcode and build.

BIN
images/icons/macx.icns

Binary file not shown.

17
mavground.pri

@ -52,21 +52,22 @@ INCLUDEPATH += $$BASEDIR/lib/flite/include \ @@ -52,21 +52,22 @@ INCLUDEPATH += $$BASEDIR/lib/flite/include \
# $$BASEDIR/lib/openjaus/libjaus/include \
# $$BASEDIR/lib/openjaus/libopenJaus/include
message(Qt version> $$[QMAKESPEC])
message(Qt version $$[QT_VERSION])
# MAC OS X
macx {
message(Building for Mac OS X)
CONFIG += x86_64 cocoa
CONFIG -= static
CONFIG += x86_64
CONFIG -= x86 static
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.5
DESTDIR = $$BASEDIR/bin/mac
INCLUDEPATH += -framework SDL \
/Users/hugo/Projects/PixHawkGroundControl/MAVLink/src
$$BASEDIR/MAVLink/src
LIBS += -framework IOKit \
-framework SDL \
@ -76,7 +77,7 @@ macx { @@ -76,7 +77,7 @@ macx {
DEFINES += _TTY_POSIX_
#ICON = $$BASEDIR/img/icons/empty.png
ICON = $$BASEDIR/images/icons/macx.icns
}
# GNU/Linux
@ -94,10 +95,6 @@ linux-g++ { @@ -94,10 +95,6 @@ linux-g++ {
DESTDIR = $$BASEDIR
}
INCLUDEPATH += /usr/include/SDL
# /usr/include/qwt-qt4
#-L$$BASEDIR/lib/qwt/linux \
DEFINES += _TTY_POSIX_

21
src/AudioOutput.cc

@ -1,11 +1,11 @@ @@ -1,11 +1,11 @@
#include "AudioOutput.h"
#ifndef Q_OS_MAC
#ifdef Q_OS_MAC
#include <ApplicationServices/ApplicationServices.h>
#else
#include <flite.h>
#include <phonon/mediaobject.h>
#include <QTemporaryFile>
#else
#include <ApplicationServices/ApplicationServices.h>
#endif
#include <QDebug>
@ -25,9 +25,10 @@ extern "C" { @@ -25,9 +25,10 @@ extern "C" {
};
#endif
AudioOutput::AudioOutput(QString voice, QObject* parent) : QObject(parent),
voice(NULL),
voiceIndex(0)
AudioOutput::AudioOutput(QString voice, QObject* parent)
: QObject(parent),
voice(NULL),
voiceIndex(0)
{
#if !defined(Q_OS_WIN32) && !defined(Q_OS_MAC)
flite_init();
@ -72,6 +73,7 @@ bool AudioOutput::say(QString text, int severity) @@ -72,6 +73,7 @@ bool AudioOutput::say(QString text, int severity)
#if defined(Q_OS_WIN32)
qDebug() << "Synthesized: " << text << ", NO OUTPUT SUPPORT ON WINDOWS!";
#elif defined(Q_OS_MAC)
// FIXME, copy string, set callback to free the copy
SpeakString((const unsigned char*)text.toAscii().data());
qDebug() << "Synthesized: " << text;
#else
@ -137,13 +139,11 @@ extern "C" { @@ -137,13 +139,11 @@ extern "C" {
#endif /* __cplusplus */
QStringList AudioOutput::listVoices(void)
{
QStringList l;
#if !defined(Q_OS_WIN32) && !defined(Q_OS_MAC)
cst_voice *voice;
const cst_val *v;
QStringList l;
#if !defined(Q_OS_WIN32) && !defined(Q_OS_MAC)
/*
printf("Voices available: ");
for (v=flite_voice_list; v; v=val_cdr(v))
@ -158,7 +158,6 @@ extern "C" { @@ -158,7 +158,6 @@ extern "C" {
*/
#endif
return l;
}
#ifdef __cplusplus
}

19
src/AudioOutput.h

@ -3,7 +3,14 @@ @@ -3,7 +3,14 @@
#include <QObject>
#include <QStringList>
#include <flite.h>
/* Foward declarations of speech/voice structure */
#ifdef Q_OS_MAC
struct SpeechChannelRecord;
typedef SpeechChannelRecord *SpeechChannel;
#else
struct cst_voice;
#endif
class AudioOutput : public QObject
{
@ -28,10 +35,14 @@ public: @@ -28,10 +35,14 @@ public:
void selectMaleVoice();
/** @brief Select neutral voice */
void selectNeutralVoice();
protected:
cst_voice* voice;
int voiceIndex;
protected:
#ifdef Q_OS_MAC
SpeechChannel *voice;
#else
cst_voice *voice;
#endif
int voiceIndex;
};
#endif // AUDIOOUTPUT_H

2
src/Core.cc

@ -69,7 +69,7 @@ MGCore::MGCore(int &argc, char* argv[]) : QApplication(argc, argv) @@ -69,7 +69,7 @@ MGCore::MGCore(int &argc, char* argv[]) : QApplication(argc, argv)
QFontDatabase fontDatabase = QFontDatabase();
const QString fontFileName = ":/general/vera.ttf"; ///< Font file is part of the QRC file and compiled into the app
const QString fontFamilyName = "Bitstream Vera Sans";
if(!QFile::exists(fontFileName)) printf("ERROR! font file: %s DOES NOT EXIST!\n", fontFileName.toAscii().data());
if(!QFile::exists(fontFileName)) printf("ERROR! font file: %s DOES NOT EXIST!\n", fontFileName.toStdString().c_str());
fontDatabase.addApplicationFont(fontFileName);
setFont(fontDatabase.font(fontFamilyName, "Roman", 12));

Loading…
Cancel
Save