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. 23
      src/AudioOutput.cc
  5. 19
      src/AudioOutput.h
  6. 2
      src/Core.cc

7
README

@ -2,4 +2,11 @@ PIXHAWK Open Source Groundstation
http://pixhawk.ethz.ch 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 \
# $$BASEDIR/lib/openjaus/libjaus/include \ # $$BASEDIR/lib/openjaus/libjaus/include \
# $$BASEDIR/lib/openjaus/libopenJaus/include # $$BASEDIR/lib/openjaus/libopenJaus/include
message(Qt version> $$[QMAKESPEC]) message(Qt version $$[QT_VERSION])
# MAC OS X # MAC OS X
macx { macx {
message(Building for Mac OS X)
message(Building for Mac OS X) CONFIG += x86_64
CONFIG -= x86 static
CONFIG += x86_64 cocoa QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.5
CONFIG -= static
DESTDIR = $$BASEDIR/bin/mac DESTDIR = $$BASEDIR/bin/mac
INCLUDEPATH += -framework SDL \ INCLUDEPATH += -framework SDL \
/Users/hugo/Projects/PixHawkGroundControl/MAVLink/src $$BASEDIR/MAVLink/src
LIBS += -framework IOKit \ LIBS += -framework IOKit \
-framework SDL \ -framework SDL \
@ -76,7 +77,7 @@ macx {
DEFINES += _TTY_POSIX_ DEFINES += _TTY_POSIX_
#ICON = $$BASEDIR/img/icons/empty.png ICON = $$BASEDIR/images/icons/macx.icns
} }
# GNU/Linux # GNU/Linux
@ -94,10 +95,6 @@ linux-g++ {
DESTDIR = $$BASEDIR DESTDIR = $$BASEDIR
} }
INCLUDEPATH += /usr/include/SDL INCLUDEPATH += /usr/include/SDL
# /usr/include/qwt-qt4
#-L$$BASEDIR/lib/qwt/linux \
DEFINES += _TTY_POSIX_ DEFINES += _TTY_POSIX_

23
src/AudioOutput.cc

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

19
src/AudioOutput.h

@ -3,7 +3,14 @@
#include <QObject> #include <QObject>
#include <QStringList> #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 class AudioOutput : public QObject
{ {
@ -28,10 +35,14 @@ public:
void selectMaleVoice(); void selectMaleVoice();
/** @brief Select neutral voice */ /** @brief Select neutral voice */
void selectNeutralVoice(); 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 #endif // AUDIOOUTPUT_H

2
src/Core.cc

@ -69,7 +69,7 @@ MGCore::MGCore(int &argc, char* argv[]) : QApplication(argc, argv)
QFontDatabase fontDatabase = QFontDatabase(); QFontDatabase fontDatabase = QFontDatabase();
const QString fontFileName = ":/general/vera.ttf"; ///< Font file is part of the QRC file and compiled into the app 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"; 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); fontDatabase.addApplicationFont(fontFileName);
setFont(fontDatabase.font(fontFamilyName, "Roman", 12)); setFont(fontDatabase.font(fontFamilyName, "Roman", 12));

Loading…
Cancel
Save