libav name refactor
authorkoda
Tue, 30 Oct 2012 12:50:50 +0100
changeset 7897 5e7c0810f365
parent 7896 67217e6108fd
child 7898 ba735701ce7f
child 7899 468a44b74a3f
libav name refactor
QTfrontend/CMakeLists.txt
QTfrontend/net/recorder.cpp
QTfrontend/ui/page/pagevideos.cpp
QTfrontend/util/LibavInteraction.cpp
QTfrontend/util/LibavInteraction.h
QTfrontend/util/libav_iteraction.cpp
QTfrontend/util/libav_iteraction.h
project_files/hedgewars.pro
--- a/QTfrontend/CMakeLists.txt	Tue Oct 30 02:22:54 2012 +0100
+++ b/QTfrontend/CMakeLists.txt	Tue Oct 30 12:50:50 2012 +0100
@@ -131,7 +131,7 @@
     hwform.h
     team.h
     util/DataManager.h
-    util/libav_iteraction.h
+    util/LibavInteraction.h
     )
 
 set(hwfr_hdrs
--- a/QTfrontend/net/recorder.cpp	Tue Oct 30 02:22:54 2012 +0100
+++ b/QTfrontend/net/recorder.cpp	Tue Oct 30 12:50:50 2012 +0100
@@ -23,7 +23,7 @@
 #include "gameuiconfig.h"
 #include "hwconsts.h"
 #include "game.h"
-#include "libav_iteraction.h"
+#include "LibavInteraction.h"
 
 // Encoding is memory expensive process, so we need to limit maximum number
 // of simultaneous encoders.
@@ -38,7 +38,7 @@
     this->config = config;
     this->prefix = prefix;
     finished = false;
-    name = prefix + "." + LibavIteraction::instance().getExtension(config->AVFormat());
+    name = prefix + "." + LibavInteraction::instance().getExtension(config->AVFormat());
 }
 
 HWRecorder::~HWRecorder()
--- a/QTfrontend/ui/page/pagevideos.cpp	Tue Oct 30 02:22:54 2012 +0100
+++ b/QTfrontend/ui/page/pagevideos.cpp	Tue Oct 30 12:50:50 2012 +0100
@@ -47,7 +47,7 @@
 #include "hwconsts.h"
 #include "pagevideos.h"
 #include "igbox.h"
-#include "libav_iteraction.h"
+#include "LibavInteraction.h"
 #include "gameuiconfig.h"
 #include "recorder.h"
 #include "ask_quit.h"
@@ -128,7 +128,7 @@
         // list of supported formats
         comboAVFormats = new QComboBox(pOptionsGroup);
         pOptLayout->addWidget(comboAVFormats, 0, 1, 1, 4);
-        LibavIteraction::instance().fillFormats(comboAVFormats);
+        LibavInteraction::instance().fillFormats(comboAVFormats);
 
         // separator
         QFrame * hr = new QFrame(pOptionsGroup);
@@ -374,7 +374,7 @@
     comboAudioCodecs->clear();
 
     // get list of codecs for specified format
-    LibavIteraction::instance().fillCodecs(comboAVFormats->itemData(index).toString(), comboVideoCodecs, comboAudioCodecs);
+    LibavInteraction::instance().fillCodecs(comboAVFormats->itemData(index).toString(), comboVideoCodecs, comboAudioCodecs);
 
     // disable audio if there is no audio codec
     if (comboAudioCodecs->count() == 0)
@@ -651,7 +651,7 @@
     }
 #ifdef Q_WS_WIN
     // there is a bug in qt, QDir::rename() doesn't fail on such names but damages files
-    if (newName.contains(QRegExp("[\"*:<>?\/|]")))
+    if (newName.contains(QRegExp("[\"*:<>?\\/|]")))
     {
         setName(item, oldName);
         return;
@@ -749,7 +749,7 @@
         {
             // Extract description from file;
             // It will contain duration, resolution, etc and also comment added by hwengine.
-            item->desc = LibavIteraction::instance().getFileInfo(path);
+            item->desc = LibavInteraction::instance().getFileInfo(path);
 
             // extract prefix (original name) from description (it is enclosed in prefix[???]prefix)
             int prefixBegin = item->desc.indexOf("prefix[");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/util/LibavInteraction.cpp	Tue Oct 30 12:50:50 2012 +0100
@@ -0,0 +1,356 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#include "LibavInteraction.h"
+
+#if VIDEOREC
+extern "C"
+{
+#include "libavformat/avformat.h"
+}
+
+#include <QVector>
+#include <QList>
+#include <QComboBox>
+
+#include "HWApplication.h"
+
+struct Codec
+{
+    CodecID id;
+    bool isAudio;
+    QString shortName; // used for identification
+    QString longName; // used for displaying to user
+    bool isRecomended;
+};
+
+struct Format
+{
+    QString shortName;
+    QString longName;
+    bool isRecomended;
+    QString extension;
+    QVector<Codec*> codecs;
+};
+
+QList<Codec> codecs;
+QMap<QString,Format> formats;
+
+// test if given format supports given codec
+bool FormatQueryCodec(AVOutputFormat *ofmt, enum CodecID codec_id)
+{
+#if LIBAVFORMAT_VERSION_MAJOR >= 54
+    return avformat_query_codec(ofmt, codec_id, FF_COMPLIANCE_NORMAL) == 1;
+#else
+    if (ofmt->codec_tag)
+        return !!av_codec_get_tag(ofmt->codec_tag, codec_id);
+    return codec_id == ofmt->video_codec || codec_id == ofmt->audio_codec;
+#endif
+}
+
+LibavInteraction::LibavInteraction() : QObject()
+{
+    // initialize libav and register all codecs and formats
+    av_register_all();
+
+    // get list of all codecs
+    AVCodec* pCodec = NULL;
+    while (pCodec = av_codec_next(pCodec))
+    {
+#if LIBAVCODEC_VERSION_MAJOR >= 54
+        if (!av_codec_is_encoder(pCodec))
+#else
+        if (!pCodec->encode)
+#endif
+            continue;
+
+        if (pCodec->type != AVMEDIA_TYPE_VIDEO && pCodec->type != AVMEDIA_TYPE_AUDIO)
+            continue;
+
+        // this encoders seems to be buggy
+        if (strcmp(pCodec->name, "rv10") == 0 || strcmp(pCodec->name, "rv20") == 0)
+            continue;
+
+        // doesn't support stereo sound
+        if (strcmp(pCodec->name, "real_144") == 0)
+            continue;
+
+        if (!pCodec->long_name || strlen(pCodec->long_name) == 0)
+            continue;
+
+        if (pCodec->type == AVMEDIA_TYPE_VIDEO)
+        {
+            if (pCodec->supported_framerates != NULL)
+                continue;
+
+            // check if codec supports yuv 4:2:0 format
+            if (!pCodec->pix_fmts)
+                continue;
+            bool yuv420Supported = false;
+            for (const PixelFormat* pfmt = pCodec->pix_fmts; *pfmt != -1; pfmt++)
+                if (*pfmt == PIX_FMT_YUV420P)
+                {
+                    yuv420Supported = true;
+                    break;
+                }
+            if (!yuv420Supported)
+                continue;
+        }
+        if (pCodec->type == AVMEDIA_TYPE_AUDIO)
+        {
+            // check if codec supports signed 16-bit format
+            if (!pCodec->sample_fmts)
+                continue;
+            bool s16Supported = false;
+            for (const AVSampleFormat* pfmt = pCodec->sample_fmts; *pfmt != -1; pfmt++)
+                if (*pfmt == AV_SAMPLE_FMT_S16)
+                {
+                    s16Supported = true;
+                    break;
+                }
+            if (!s16Supported)
+                continue;
+        }
+        // add codec to list of codecs
+        codecs.push_back(Codec());
+        Codec & codec = codecs.back();
+        codec.id = pCodec->id;
+        codec.isAudio = pCodec->type == AVMEDIA_TYPE_AUDIO;
+        codec.shortName = pCodec->name;
+        codec.longName = pCodec->long_name;
+
+        codec.isRecomended = false;
+        if (strcmp(pCodec->name, "libx264") == 0)
+        {
+            codec.longName = "H.264/MPEG-4 Part 10 AVC (x264)";
+            codec.isRecomended = true;
+        }
+        else if (strcmp(pCodec->name, "libxvid") == 0)
+        {
+            codec.longName = "MPEG-4 Part 2 (Xvid)";
+            codec.isRecomended = true;
+        }
+        else if (strcmp(pCodec->name, "libmp3lame") == 0)
+        {
+            codec.longName = "MP3 (MPEG audio layer 3) (LAME)";
+            codec.isRecomended = true;
+        }
+        else
+            codec.longName = pCodec->long_name;
+
+        if (strcmp(pCodec->name, "mpeg4") == 0 || strcmp(pCodec->name, "ac3_fixed") == 0)
+            codec.isRecomended = true;
+
+        // FIXME: remove next line
+        //codec.longName += QString(" (%1)").arg(codec.shortName);
+    }
+
+    // get list of all formats
+    AVOutputFormat* pFormat = NULL;
+    while (pFormat = av_oformat_next(pFormat))
+    {
+        if (!pFormat->extensions)
+            continue;
+
+        // skip some strange formats to not confuse users
+        if (strstr(pFormat->long_name, "raw"))
+            continue;
+
+        Format format;
+        bool hasVideoCodec = false;
+        for (QList<Codec>::iterator codec = codecs.begin(); codec != codecs.end(); ++codec)
+        {
+            if (!FormatQueryCodec(pFormat, codec->id))
+                continue;
+            format.codecs.push_back(&*codec);
+            if (!codec->isAudio)
+                hasVideoCodec = true;
+        }
+        if (!hasVideoCodec)
+            continue;
+
+        QString ext(pFormat->extensions);
+        ext.truncate(strcspn(pFormat->extensions, ","));
+        format.extension = ext;
+        format.shortName = pFormat->name;
+        format.longName = QString("%1 (*.%2)").arg(pFormat->long_name).arg(ext);
+
+        // FIXME: remove next line
+        //format.longName += QString(" (%1)").arg(format.shortName);
+
+        format.isRecomended = strcmp(pFormat->name, "mp4") == 0 || strcmp(pFormat->name, "avi") == 0;
+
+        formats[pFormat->name] = format;
+    }
+}
+
+void LibavInteraction::fillFormats(QComboBox * pFormats)
+{
+    // first insert recomended formats
+    foreach(const Format & format, formats)
+        if (format.isRecomended)
+            pFormats->addItem(format.longName, format.shortName);
+
+    // remember where to place separator between recomended and other formats
+    int sep = pFormats->count();
+
+    // insert remaining formats
+    foreach(const Format & format, formats)
+        if (!format.isRecomended)
+            pFormats->addItem(format.longName, format.shortName);
+
+    // insert separator if necessary
+    if (sep != 0 && sep != pFormats->count())
+        pFormats->insertSeparator(sep);
+}
+
+void LibavInteraction::fillCodecs(const QString & fmt, QComboBox * pVCodecs, QComboBox * pACodecs)
+{
+    Format & format = formats[fmt];
+
+    // first insert recomended codecs
+    foreach(Codec * codec, format.codecs)
+    {
+        if (codec->isRecomended)
+        {
+            if (codec->isAudio)
+                pACodecs->addItem(codec->longName, codec->shortName);
+            else
+                pVCodecs->addItem(codec->longName, codec->shortName);
+        }
+    }
+
+    // remember where to place separators between recomended and other codecs
+    int vsep = pVCodecs->count();
+    int asep = pACodecs->count();
+
+    // insert remaining codecs
+    foreach(Codec * codec, format.codecs)
+    {
+        if (!codec->isRecomended)
+        {
+            if (codec->isAudio)
+                pACodecs->addItem(codec->longName, codec->shortName);
+            else
+                pVCodecs->addItem(codec->longName, codec->shortName);
+        }
+    }
+
+    // insert separators if necessary
+    if (vsep != 0 && vsep != pVCodecs->count())
+        pVCodecs->insertSeparator(vsep);
+    if (asep != 0 && asep != pACodecs->count())
+        pACodecs->insertSeparator(asep);
+}
+
+QString LibavInteraction::getExtension(const QString & format)
+{
+    return formats[format].extension;
+}
+
+// get information abaout file (duration, resolution etc) in multiline string
+QString LibavInteraction::getFileInfo(const QString & filepath)
+{
+    AVFormatContext* pContext = NULL;
+    QByteArray utf8path = filepath.toUtf8();
+    if (avformat_open_input(&pContext, utf8path.data(), NULL, NULL) < 0)
+        return "";
+#if LIBAVFORMAT_VERSION_MAJOR < 54
+    if (av_find_stream_info(pContext) < 0)
+#else
+    if (avformat_find_stream_info(pContext, NULL) < 0)
+#endif
+        return "";
+
+    int s = float(pContext->duration)/AV_TIME_BASE;
+    QString desc = QString(tr("Duration: %1m %2s\n")).arg(s/60).arg(s%60);
+    for (int i = 0; i < (int)pContext->nb_streams; i++)
+    {
+        AVStream* pStream = pContext->streams[i];
+        if (!pStream)
+            continue;
+        AVCodecContext* pCodec = pContext->streams[i]->codec;
+        if (!pCodec)
+            continue;
+
+        if (pCodec->codec_type == AVMEDIA_TYPE_VIDEO)
+        {
+            desc += QString(tr("Video: %1x%2, ")).arg(pCodec->width).arg(pCodec->height);
+            if (pStream->avg_frame_rate.den)
+            {
+                float fps = float(pStream->avg_frame_rate.num)/pStream->avg_frame_rate.den;
+                desc += QString(tr("%1 fps, ")).arg(fps, 0, 'f', 2);
+            }
+        }
+        else if (pCodec->codec_type == AVMEDIA_TYPE_AUDIO)
+            desc += tr("Audio: ");
+        else
+            continue;
+        AVCodec* pDecoder = avcodec_find_decoder(pCodec->codec_id);
+        desc += pDecoder? pDecoder->name : "unknown";
+        desc += "\n";
+    }
+    AVDictionaryEntry* pComment = av_dict_get(pContext->metadata, "comment", NULL, 0);
+    if (pComment)
+        desc += QString("\n") + pComment->value;
+#if LIBAVFORMAT_VERSION_MAJOR < 54
+    av_close_input_file(pContext);
+#else
+    avformat_close_input(&pContext);
+#endif
+    return desc;
+}
+
+#else
+LibavInteraction::LibavInteraction() : QObject()
+{
+
+}
+
+void LibavInteraction::fillFormats(QComboBox * pFormats)
+{
+    Q_UNUSED(pFormats);
+}
+
+void LibavInteraction::fillCodecs(const QString & format, QComboBox * pVCodecs, QComboBox * pACodecs)
+{
+    Q_UNUSED(format);
+    Q_UNUSED(pVCodecs);
+    Q_UNUSED(pACodecs);
+}
+
+QString LibavInteraction::getExtension(const QString & format)
+{
+    Q_UNUSED(format);
+
+    return QString();
+}
+
+QString LibavInteraction::getFileInfo(const QString & filepath)
+{
+    Q_UNUSED(filepath);
+
+    return QString();
+}
+#endif
+
+LibavInteraction & LibavInteraction::instance()
+{
+    static LibavInteraction instance;
+    return instance;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/QTfrontend/util/LibavInteraction.h	Tue Oct 30 12:50:50 2012 +0100
@@ -0,0 +1,51 @@
+/*
+ * Hedgewars, a free turn based strategy game
+ * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#ifndef LIBAV_ITERACTION
+#define LIBAV_ITERACTION
+
+#include <QComboBox>
+
+/**
+ * @brief Class for interacting with ffmpeg/libav libraries
+ *
+ * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
+ */
+class LibavInteraction : public QObject
+{
+    Q_OBJECT;
+
+    LibavInteraction();
+
+public:
+
+    static LibavInteraction & instance();
+
+    // fill combo box with known file formats
+    void fillFormats(QComboBox * pFormats);
+
+    // fill combo boxes with known codecs for given formats
+    void fillCodecs(const QString & format, QComboBox * pVCodecs, QComboBox * pACodecs);
+
+    QString getExtension(const QString & format);
+
+    // get information about file (duration, resolution etc) in multiline string
+    QString getFileInfo(const QString & filepath);
+};
+
+#endif // LIBAV_ITERACTION
--- a/QTfrontend/util/libav_iteraction.cpp	Tue Oct 30 02:22:54 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,356 +0,0 @@
-/*
- * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- */
-
-#include "libav_iteraction.h"
-
-#if VIDEOREC
-extern "C"
-{
-#include "libavformat/avformat.h"
-}
-
-#include <QVector>
-#include <QList>
-#include <QComboBox>
-
-#include "HWApplication.h"
-
-struct Codec
-{
-    CodecID id;
-    bool isAudio;
-    QString shortName; // used for identification
-    QString longName; // used for displaying to user
-    bool isRecomended;
-};
-
-struct Format
-{
-    QString shortName;
-    QString longName;
-    bool isRecomended;
-    QString extension;
-    QVector<Codec*> codecs;
-};
-
-QList<Codec> codecs;
-QMap<QString,Format> formats;
-
-// test if given format supports given codec
-bool FormatQueryCodec(AVOutputFormat *ofmt, enum CodecID codec_id)
-{
-#if LIBAVFORMAT_VERSION_MAJOR >= 54
-    return avformat_query_codec(ofmt, codec_id, FF_COMPLIANCE_NORMAL) == 1;
-#else
-    if (ofmt->codec_tag)
-        return !!av_codec_get_tag(ofmt->codec_tag, codec_id);
-    return codec_id == ofmt->video_codec || codec_id == ofmt->audio_codec;
-#endif
-}
-
-LibavIteraction::LibavIteraction() : QObject()
-{
-    // initialize libav and register all codecs and formats
-    av_register_all();
-
-    // get list of all codecs
-    AVCodec* pCodec = NULL;
-    while (pCodec = av_codec_next(pCodec))
-    {
-#if LIBAVCODEC_VERSION_MAJOR >= 54
-        if (!av_codec_is_encoder(pCodec))
-#else
-        if (!pCodec->encode)
-#endif
-            continue;
-
-        if (pCodec->type != AVMEDIA_TYPE_VIDEO && pCodec->type != AVMEDIA_TYPE_AUDIO)
-            continue;
-
-        // this encoders seems to be buggy
-        if (strcmp(pCodec->name, "rv10") == 0 || strcmp(pCodec->name, "rv20") == 0)
-            continue;
-
-        // doesn't support stereo sound
-        if (strcmp(pCodec->name, "real_144") == 0)
-            continue;
-
-        if (!pCodec->long_name || strlen(pCodec->long_name) == 0)
-            continue;
-
-        if (pCodec->type == AVMEDIA_TYPE_VIDEO)
-        {
-            if (pCodec->supported_framerates != NULL)
-                continue;
-
-            // check if codec supports yuv 4:2:0 format
-            if (!pCodec->pix_fmts)
-                continue;
-            bool yuv420Supported = false;
-            for (const PixelFormat* pfmt = pCodec->pix_fmts; *pfmt != -1; pfmt++)
-                if (*pfmt == PIX_FMT_YUV420P)
-                {
-                    yuv420Supported = true;
-                    break;
-                }
-            if (!yuv420Supported)
-                continue;
-        }
-        if (pCodec->type == AVMEDIA_TYPE_AUDIO)
-        {
-            // check if codec supports signed 16-bit format
-            if (!pCodec->sample_fmts)
-                continue;
-            bool s16Supported = false;
-            for (const AVSampleFormat* pfmt = pCodec->sample_fmts; *pfmt != -1; pfmt++)
-                if (*pfmt == AV_SAMPLE_FMT_S16)
-                {
-                    s16Supported = true;
-                    break;
-                }
-            if (!s16Supported)
-                continue;
-        }
-        // add codec to list of codecs
-        codecs.push_back(Codec());
-        Codec & codec = codecs.back();
-        codec.id = pCodec->id;
-        codec.isAudio = pCodec->type == AVMEDIA_TYPE_AUDIO;
-        codec.shortName = pCodec->name;
-        codec.longName = pCodec->long_name;
-
-        codec.isRecomended = false;
-        if (strcmp(pCodec->name, "libx264") == 0)
-        {
-            codec.longName = "H.264/MPEG-4 Part 10 AVC (x264)";
-            codec.isRecomended = true;
-        }
-        else if (strcmp(pCodec->name, "libxvid") == 0)
-        {
-            codec.longName = "MPEG-4 Part 2 (Xvid)";
-            codec.isRecomended = true;
-        }
-        else if (strcmp(pCodec->name, "libmp3lame") == 0)
-        {
-            codec.longName = "MP3 (MPEG audio layer 3) (LAME)";
-            codec.isRecomended = true;
-        }
-        else
-            codec.longName = pCodec->long_name;
-
-        if (strcmp(pCodec->name, "mpeg4") == 0 || strcmp(pCodec->name, "ac3_fixed") == 0)
-            codec.isRecomended = true;
-
-        // FIXME: remove next line
-        //codec.longName += QString(" (%1)").arg(codec.shortName);
-    }
-
-    // get list of all formats
-    AVOutputFormat* pFormat = NULL;
-    while (pFormat = av_oformat_next(pFormat))
-    {
-        if (!pFormat->extensions)
-            continue;
-
-        // skip some strange formats to not confuse users
-        if (strstr(pFormat->long_name, "raw"))
-            continue;
-
-        Format format;
-        bool hasVideoCodec = false;
-        for (QList<Codec>::iterator codec = codecs.begin(); codec != codecs.end(); ++codec)
-        {
-            if (!FormatQueryCodec(pFormat, codec->id))
-                continue;
-            format.codecs.push_back(&*codec);
-            if (!codec->isAudio)
-                hasVideoCodec = true;
-        }
-        if (!hasVideoCodec)
-            continue;
-
-        QString ext(pFormat->extensions);
-        ext.truncate(strcspn(pFormat->extensions, ","));
-        format.extension = ext;
-        format.shortName = pFormat->name;
-        format.longName = QString("%1 (*.%2)").arg(pFormat->long_name).arg(ext);
-
-        // FIXME: remove next line
-        //format.longName += QString(" (%1)").arg(format.shortName);
-
-        format.isRecomended = strcmp(pFormat->name, "mp4") == 0 || strcmp(pFormat->name, "avi") == 0;
-
-        formats[pFormat->name] = format;
-    }
-}
-
-void LibavIteraction::fillFormats(QComboBox * pFormats)
-{
-    // first insert recomended formats
-    foreach(const Format & format, formats)
-        if (format.isRecomended)
-            pFormats->addItem(format.longName, format.shortName);
-
-    // remember where to place separator between recomended and other formats
-    int sep = pFormats->count();
-
-    // insert remaining formats
-    foreach(const Format & format, formats)
-        if (!format.isRecomended)
-            pFormats->addItem(format.longName, format.shortName);
-
-    // insert separator if necessary
-    if (sep != 0 && sep != pFormats->count())
-        pFormats->insertSeparator(sep);
-}
-
-void LibavIteraction::fillCodecs(const QString & fmt, QComboBox * pVCodecs, QComboBox * pACodecs)
-{
-    Format & format = formats[fmt];
-
-    // first insert recomended codecs
-    foreach(Codec * codec, format.codecs)
-    {
-        if (codec->isRecomended)
-        {
-            if (codec->isAudio)
-                pACodecs->addItem(codec->longName, codec->shortName);
-            else
-                pVCodecs->addItem(codec->longName, codec->shortName);
-        }
-    }
-
-    // remember where to place separators between recomended and other codecs
-    int vsep = pVCodecs->count();
-    int asep = pACodecs->count();
-
-    // insert remaining codecs
-    foreach(Codec * codec, format.codecs)
-    {
-        if (!codec->isRecomended)
-        {
-            if (codec->isAudio)
-                pACodecs->addItem(codec->longName, codec->shortName);
-            else
-                pVCodecs->addItem(codec->longName, codec->shortName);
-        }
-    }
-
-    // insert separators if necessary
-    if (vsep != 0 && vsep != pVCodecs->count())
-        pVCodecs->insertSeparator(vsep);
-    if (asep != 0 && asep != pACodecs->count())
-        pACodecs->insertSeparator(asep);
-}
-
-QString LibavIteraction::getExtension(const QString & format)
-{
-    return formats[format].extension;
-}
-
-// get information abaout file (duration, resolution etc) in multiline string
-QString LibavIteraction::getFileInfo(const QString & filepath)
-{
-    AVFormatContext* pContext = NULL;
-    QByteArray utf8path = filepath.toUtf8();
-    if (avformat_open_input(&pContext, utf8path.data(), NULL, NULL) < 0)
-        return "";
-#if LIBAVFORMAT_VERSION_MAJOR < 54
-    if (av_find_stream_info(pContext) < 0)
-#else
-    if (avformat_find_stream_info(pContext, NULL) < 0)
-#endif
-        return "";
-
-    int s = float(pContext->duration)/AV_TIME_BASE;
-    QString desc = QString(tr("Duration: %1m %2s\n")).arg(s/60).arg(s%60);
-    for (int i = 0; i < (int)pContext->nb_streams; i++)
-    {
-        AVStream* pStream = pContext->streams[i];
-        if (!pStream)
-            continue;
-        AVCodecContext* pCodec = pContext->streams[i]->codec;
-        if (!pCodec)
-            continue;
-
-        if (pCodec->codec_type == AVMEDIA_TYPE_VIDEO)
-        {
-            desc += QString(tr("Video: %1x%2, ")).arg(pCodec->width).arg(pCodec->height);
-            if (pStream->avg_frame_rate.den)
-            {
-                float fps = float(pStream->avg_frame_rate.num)/pStream->avg_frame_rate.den;
-                desc += QString(tr("%1 fps, ")).arg(fps, 0, 'f', 2);
-            }
-        }
-        else if (pCodec->codec_type == AVMEDIA_TYPE_AUDIO)
-            desc += tr("Audio: ");
-        else
-            continue;
-        AVCodec* pDecoder = avcodec_find_decoder(pCodec->codec_id);
-        desc += pDecoder? pDecoder->name : "unknown";
-        desc += "\n";
-    }
-    AVDictionaryEntry* pComment = av_dict_get(pContext->metadata, "comment", NULL, 0);
-    if (pComment)
-        desc += QString("\n") + pComment->value;
-#if LIBAVFORMAT_VERSION_MAJOR < 54
-    av_close_input_file(pContext);
-#else
-    avformat_close_input(&pContext);
-#endif
-    return desc;
-}
-
-#else
-LibavIteraction::LibavIteraction() : QObject()
-{
-
-}
-
-void LibavIteraction::fillFormats(QComboBox * pFormats)
-{
-    Q_UNUSED(pFormats);
-}
-
-void LibavIteraction::fillCodecs(const QString & format, QComboBox * pVCodecs, QComboBox * pACodecs)
-{
-    Q_UNUSED(format);
-    Q_UNUSED(pVCodecs);
-    Q_UNUSED(pACodecs);
-}
-
-QString LibavIteraction::getExtension(const QString & format)
-{
-    Q_UNUSED(format);
-
-    return QString();
-}
-
-QString LibavIteraction::getFileInfo(const QString & filepath)
-{
-    Q_UNUSED(filepath);
-
-    return QString();
-}
-#endif
-
-LibavIteraction & LibavIteraction::instance()
-{
-    static LibavIteraction instance;
-    return instance;
-}
--- a/QTfrontend/util/libav_iteraction.h	Tue Oct 30 02:22:54 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- */
-
-#ifndef LIBAV_ITERACTION
-#define LIBAV_ITERACTION
-
-#include <QComboBox>
-
-/**
- * @brief Class for interacting with ffmpeg/libav libraries
- *
- * @see <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>
- */
-class LibavIteraction : public QObject
-{
-    Q_OBJECT;
-
-    LibavIteraction();
-
-public:
-
-    static LibavIteraction & instance();
-
-    // fill combo box with known file formats
-    void fillFormats(QComboBox * pFormats);
-
-    // fill combo boxes with known codecs for given formats
-    void fillCodecs(const QString & format, QComboBox * pVCodecs, QComboBox * pACodecs);
-
-    QString getExtension(const QString & format);
-
-    // get information about file (duration, resolution etc) in multiline string
-    QString getFileInfo(const QString & filepath);
-};
-
-#endif // LIBAV_ITERACTION
--- a/project_files/hedgewars.pro	Tue Oct 30 02:22:54 2012 +0100
+++ b/project_files/hedgewars.pro	Tue Oct 30 12:50:50 2012 +0100
@@ -1,261 +1,261 @@
-TEMPLATE = app
-TARGET = hedgewars
-DEPENDPATH += ../QTfrontend/
-INCLUDEPATH += ../QTfrontend/
-INCLUDEPATH += ../QTfrontend/model
-INCLUDEPATH += ../QTfrontend/ui
-INCLUDEPATH += ../QTfrontend/ui/widget
-INCLUDEPATH += ../QTfrontend/ui/page
-INCLUDEPATH += ../QTfrontend/ui/dialog
-INCLUDEPATH += ../QTfrontend/net
-INCLUDEPATH += ../QTfrontend/util
-INCLUDEPATH += ../misc/quazip/
-
-DESTDIR = ../bin
-
-QT += network
-QT += webkit
-
-HEADERS += ../QTfrontend/model/ThemeModel.h \
-    ../QTfrontend/model/MapModel.h \
-    ../QTfrontend/model/ammoSchemeModel.h \
-    ../QTfrontend/model/netserverslist.h \
-    ../QTfrontend/ui/page/pagedrawmap.h \
-    ../QTfrontend/ui/page/pagedata.h \
-    ../QTfrontend/ui/page/pagetraining.h \
-    ../QTfrontend/ui/page/pageselectweapon.h \
-    ../QTfrontend/ui/page/pagesingleplayer.h \
-    ../QTfrontend/ui/page/pagenettype.h \
-    ../QTfrontend/ui/page/pageingame.h \
-    ../QTfrontend/ui/page/pageadmin.h \
-    ../QTfrontend/ui/page/pagescheme.h \
-    ../QTfrontend/ui/page/pagemultiplayer.h \
-    ../QTfrontend/ui/page/pageplayrecord.h \
-    ../QTfrontend/ui/page/pagemain.h \
-    ../QTfrontend/ui/page/pageoptions.h \
-    ../QTfrontend/ui/page/pagenetgame.h \
-    ../QTfrontend/ui/page/pageeditteam.h \
-    ../QTfrontend/ui/page/pageconnecting.h \
-    ../QTfrontend/ui/page/pageroomslist.h \
-    ../QTfrontend/ui/page/pagenet.h \
-    ../QTfrontend/ui/page/pagecampaign.h \
-    ../QTfrontend/ui/page/pageinfo.h \
-    ../QTfrontend/ui/page/pagenetserver.h \
-    ../QTfrontend/ui/page/pagegamestats.h \
-    ../QTfrontend/ui/dialog/input_ip.h \
-    ../QTfrontend/ui/qaspectratiolayout.h \
-    ../QTfrontend/ui/widget/bgwidget.h \
-    ../QTfrontend/ui/widget/fpsedit.h \
-    ../QTfrontend/ui/widget/FreqSpinBox.h \
-    ../QTfrontend/ui/widget/igbox.h \
-    ../QTfrontend/ui/widget/chatwidget.h \
-    ../QTfrontend/ui/widget/togglebutton.h \
-    ../QTfrontend/ui/widget/SquareLabel.h \
-    ../QTfrontend/ui/widget/itemNum.h \
-    ../QTfrontend/ui/widget/frameTeam.h \
-    ../QTfrontend/ui/widget/teamselect.h \
-    ../QTfrontend/ui/widget/vertScrollArea.h \
-    ../QTfrontend/ui/widget/about.h \
-    ../QTfrontend/ui/widget/teamselhelper.h \
-    ../QTfrontend/ui/widget/drawmapwidget.h \
-    ../QTfrontend/ui/widget/databrowser.h \
-    ../QTfrontend/ui/widget/hedgehogerWidget.h \
-    ../QTfrontend/ui/widget/selectWeapon.h \
-    ../QTfrontend/ui/widget/weaponItem.h \
-    ../QTfrontend/ui/widget/gamecfgwidget.h \
-    ../QTfrontend/ui/widget/mapContainer.h \
-    ../QTfrontend/ui/widget/HistoryLineEdit.h \
-    ../QTfrontend/ui/widget/SmartLineEdit.h \
-    ../QTfrontend/util/DataManager.h \
-    ../QTfrontend/net/netregister.h \
-    ../QTfrontend/net/netserver.h \
-    ../QTfrontend/net/netudpwidget.h \
-    ../QTfrontend/net/tcpBase.h \
-    ../QTfrontend/net/proto.h \
-    ../QTfrontend/net/newnetclient.h \
-    ../QTfrontend/net/netudpserver.h \
-    ../QTfrontend/net/hwmap.h \
-    ../QTfrontend/util/namegen.h \
-    ../QTfrontend/ui/page/AbstractPage.h \
-    ../QTfrontend/drawmapscene.h \
-    ../QTfrontend/game.h \
-    ../QTfrontend/gameuiconfig.h \
-    ../QTfrontend/HWApplication.h \
-    ../QTfrontend/hwform.h \
-    ../QTfrontend/util/SDLInteraction.h \
-    ../QTfrontend/team.h \
-    ../QTfrontend/achievements.h \
-    ../QTfrontend/binds.h \
-    ../QTfrontend/ui_hwform.h \
-    ../QTfrontend/KB.h \
-    ../QTfrontend/hwconsts.h \
-    ../QTfrontend/sdlkeys.h \
-    ../QTfrontend/ui/mouseoverfilter.h \
-    ../QTfrontend/ui/qpushbuttonwithsound.h \
-    ../QTfrontend/ui/widget/qpushbuttonwithsound.h \
-    ../QTfrontend/ui/page/pagefeedback.h \
-    ../QTfrontend/model/roomslistmodel.h \
-    ../QTfrontend/ui/dialog/input_password.h \
-    ../QTfrontend/ui/widget/colorwidget.h \
-    ../QTfrontend/model/HatModel.h \
-    ../QTfrontend/model/GameStyleModel.h \
-    ../QTfrontend/util/libav_iteraction.h \
-    ../QTfrontend/ui/page/pagevideos.h \
-    ../QTfrontend/net/recorder.h \
-    ../QTfrontend/ui/dialog/ask_quit.h \
-    ../QTfrontend/ui/dialog/upload_video.h \
-    ../QTfrontend/campaign.h \
-    ../QTfrontend/model/playerslistmodel.h
-
-SOURCES += ../QTfrontend/model/ammoSchemeModel.cpp \
-    ../QTfrontend/model/MapModel.cpp \
-    ../QTfrontend/model/ThemeModel.cpp \
-    ../QTfrontend/model/netserverslist.cpp \
-    ../QTfrontend/ui/qaspectratiolayout.cpp \
-    ../QTfrontend/ui/page/pagemain.cpp \
-    ../QTfrontend/ui/page/pagetraining.cpp \
-    ../QTfrontend/ui/page/pageroomslist.cpp \
-    ../QTfrontend/ui/page/pagemultiplayer.cpp \
-    ../QTfrontend/ui/page/pagegamestats.cpp \
-    ../QTfrontend/ui/page/pagenettype.cpp \
-    ../QTfrontend/ui/page/pageeditteam.cpp \
-    ../QTfrontend/ui/page/pagenetgame.cpp \
-    ../QTfrontend/ui/page/pagedata.cpp \
-    ../QTfrontend/ui/page/pagedrawmap.cpp \
-    ../QTfrontend/ui/page/pageplayrecord.cpp \
-    ../QTfrontend/ui/page/pageselectweapon.cpp \
-    ../QTfrontend/ui/page/pageingame.cpp \
-    ../QTfrontend/ui/page/pagenetserver.cpp \
-    ../QTfrontend/ui/page/pagecampaign.cpp \
-    ../QTfrontend/ui/page/pageadmin.cpp \
-    ../QTfrontend/ui/page/pageinfo.cpp \
-    ../QTfrontend/ui/page/pageconnecting.cpp \
-    ../QTfrontend/ui/page/pagesingleplayer.cpp \
-    ../QTfrontend/ui/page/pagenet.cpp \
-    ../QTfrontend/ui/page/pagescheme.cpp \
-    ../QTfrontend/ui/page/pageoptions.cpp \
-    ../QTfrontend/ui/dialog/input_ip.cpp \
-    ../QTfrontend/ui/widget/igbox.cpp \
-    ../QTfrontend/ui/widget/selectWeapon.cpp \
-    ../QTfrontend/ui/widget/FreqSpinBox.cpp \
-    ../QTfrontend/ui/widget/SquareLabel.cpp \
-    ../QTfrontend/ui/widget/frameTeam.cpp \
-    ../QTfrontend/ui/widget/fpsedit.cpp \
-    ../QTfrontend/ui/widget/databrowser.cpp \
-    ../QTfrontend/ui/widget/teamselect.cpp \
-    ../QTfrontend/ui/widget/gamecfgwidget.cpp \
-    ../QTfrontend/ui/widget/chatwidget.cpp \
-    ../QTfrontend/ui/widget/itemNum.cpp \
-    ../QTfrontend/ui/widget/bgwidget.cpp \
-    ../QTfrontend/ui/widget/about.cpp \
-    ../QTfrontend/ui/widget/togglebutton.cpp \
-    ../QTfrontend/ui/widget/vertScrollArea.cpp \
-    ../QTfrontend/ui/widget/hedgehogerWidget.cpp \
-    ../QTfrontend/ui/widget/teamselhelper.cpp \
-    ../QTfrontend/ui/widget/drawmapwidget.cpp \
-    ../QTfrontend/ui/widget/weaponItem.cpp \
-    ../QTfrontend/ui/widget/mapContainer.cpp \
-    ../QTfrontend/ui/widget/HistoryLineEdit.cpp \
-    ../QTfrontend/ui/widget/SmartLineEdit.cpp \
-    ../QTfrontend/util/DataManager.cpp \
-    ../QTfrontend/net/tcpBase.cpp \
-    ../QTfrontend/net/netregister.cpp \
-    ../QTfrontend/net/proto.cpp \
-    ../QTfrontend/net/hwmap.cpp \
-    ../QTfrontend/net/netudpserver.cpp \
-    ../QTfrontend/net/newnetclient.cpp \
-    ../QTfrontend/net/netudpwidget.cpp \
-    ../QTfrontend/net/netserver.cpp \
-    ../QTfrontend/util/namegen.cpp \
-    ../QTfrontend/ui/page/AbstractPage.cpp \
-    ../QTfrontend/achievements.cpp \
-    ../QTfrontend/binds.cpp \
-    ../QTfrontend/drawmapscene.cpp \
-    ../QTfrontend/game.cpp \
-    ../QTfrontend/gameuiconfig.cpp \
-    ../QTfrontend/HWApplication.cpp \
-    ../QTfrontend/hwform.cpp \
-    ../QTfrontend/main.cpp \
-    ../QTfrontend/util/SDLInteraction.cpp \
-    ../QTfrontend/team.cpp \
-    ../QTfrontend/ui_hwform.cpp \
-    ../QTfrontend/hwconsts.cpp \
-    ../QTfrontend/ui/mouseoverfilter.cpp \
-    ../QTfrontend/ui/widget/qpushbuttonwithsound.cpp \
-    ../QTfrontend/ui/page/pagefeedback.cpp \
-    ../QTfrontend/model/roomslistmodel.cpp \
-    ../QTfrontend/ui/dialog/input_password.cpp \
-    ../QTfrontend/ui/widget/colorwidget.cpp \
-    ../QTfrontend/model/HatModel.cpp \
-    ../QTfrontend/model/GameStyleModel.cpp \
-    ../QTfrontend/util/libav_iteraction.cpp \
-    ../QTfrontend/ui/page/pagevideos.cpp \
-    ../QTfrontend/net/recorder.cpp \
-    ../QTfrontend/ui/dialog/ask_quit.cpp \
-    ../QTfrontend/ui/dialog/upload_video.cpp \
-    ../QTfrontend/campaign.cpp \
-    ../QTfrontend/model/playerslistmodel.cpp
-
-
-TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_ar.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_bg.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_cs.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_de.ts \ 
-    ../share/hedgewars/Data/Locale/hedgewars_en.ts \ 
-    ../share/hedgewars/Data/Locale/hedgewars_es.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_fi.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_fr.ts \ 
-    ../share/hedgewars/Data/Locale/hedgewars_hu.ts \ 
-    ../share/hedgewars/Data/Locale/hedgewars_it.ts \ 
-    ../share/hedgewars/Data/Locale/hedgewars_ja.ts \ 
-    ../share/hedgewars/Data/Locale/hedgewars_ko.ts \ 
-    ../share/hedgewars/Data/Locale/hedgewars_lt.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_nl.ts \ 
-    ../share/hedgewars/Data/Locale/hedgewars_pl.ts \ 
-    ../share/hedgewars/Data/Locale/hedgewars_pt_BR.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_pt_PT.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_ru.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_sk.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_sv.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_tr_TR.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_uk.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_zh_CN.ts \
-    ../share/hedgewars/Data/Locale/hedgewars_zh_TW.ts
-
-RESOURCES += ../QTfrontend/hedgewars.qrc
-
-LIBS += -L../bin -lquazip
-
-macx {
-    QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6
-    QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.6.sdk
-
-    OBJECTIVE_SOURCES += ../QTfrontend/*.m ../QTfrontend/*.mm
-    SOURCES += ../QTfrontend/AutoUpdater.cpp ../QTfrontend/InstallController.cpp \
-               ../../build/QTfrontend/hwconsts.cpp
-    HEADERS += ../QTfrontend/M3InstallController.h ../QTfrontend/M3Panel.h \
-               ../QTfrontend/NSWorkspace_RBAdditions.h ../QTfrontend/AutoUpdater.h \
-               ../QTfrontend/CocoaInitializer.h ../QTfrontend/InstallController.h \
-               ../QTfrontend/SparkleAutoUpdater.h
-
-    LIBS += -lobjc -framework AppKit -framework IOKit -framework Foundation -framework SDL -framework SDL_Mixer -framework Sparkle -DSPARKLE_ENABLED
-    INCLUDEPATH += /Library/Frameworks/SDL.framework/Headers /Library/Frameworks/SDL_Mixer.framework/Headers
-    CONFIG += warn_on x86
-    #CONFIG += x86 ppc x86_64 ppc64
-}
-
-win32 {
-    RC_FILE = ../QTfrontend/hedgewars.rc
-    SOURCES += ../QTfrontend/xfire.cpp
-    INCLUDEPATH += ../misc/winutils/include
-    LIBS += -L../misc/winutils/lib
-}
-
-!macx {
-    LIBS += -lSDL -lSDL_mixer
-    !win32 {
-        INCLUDEPATH += /usr/local/include/SDL /usr/include/SDL
-    }
-}
-
-FORMS +=
+TEMPLATE = app
+TARGET = hedgewars
+DEPENDPATH += ../QTfrontend/
+INCLUDEPATH += ../QTfrontend/
+INCLUDEPATH += ../QTfrontend/model
+INCLUDEPATH += ../QTfrontend/ui
+INCLUDEPATH += ../QTfrontend/ui/widget
+INCLUDEPATH += ../QTfrontend/ui/page
+INCLUDEPATH += ../QTfrontend/ui/dialog
+INCLUDEPATH += ../QTfrontend/net
+INCLUDEPATH += ../QTfrontend/util
+INCLUDEPATH += ../misc/quazip/
+
+DESTDIR = ../bin
+
+QT += network
+QT += webkit
+
+HEADERS += ../QTfrontend/model/ThemeModel.h \
+    ../QTfrontend/model/MapModel.h \
+    ../QTfrontend/model/ammoSchemeModel.h \
+    ../QTfrontend/model/netserverslist.h \
+    ../QTfrontend/ui/page/pagedrawmap.h \
+    ../QTfrontend/ui/page/pagedata.h \
+    ../QTfrontend/ui/page/pagetraining.h \
+    ../QTfrontend/ui/page/pageselectweapon.h \
+    ../QTfrontend/ui/page/pagesingleplayer.h \
+    ../QTfrontend/ui/page/pagenettype.h \
+    ../QTfrontend/ui/page/pageingame.h \
+    ../QTfrontend/ui/page/pageadmin.h \
+    ../QTfrontend/ui/page/pagescheme.h \
+    ../QTfrontend/ui/page/pagemultiplayer.h \
+    ../QTfrontend/ui/page/pageplayrecord.h \
+    ../QTfrontend/ui/page/pagemain.h \
+    ../QTfrontend/ui/page/pageoptions.h \
+    ../QTfrontend/ui/page/pagenetgame.h \
+    ../QTfrontend/ui/page/pageeditteam.h \
+    ../QTfrontend/ui/page/pageconnecting.h \
+    ../QTfrontend/ui/page/pageroomslist.h \
+    ../QTfrontend/ui/page/pagenet.h \
+    ../QTfrontend/ui/page/pagecampaign.h \
+    ../QTfrontend/ui/page/pageinfo.h \
+    ../QTfrontend/ui/page/pagenetserver.h \
+    ../QTfrontend/ui/page/pagegamestats.h \
+    ../QTfrontend/ui/dialog/input_ip.h \
+    ../QTfrontend/ui/qaspectratiolayout.h \
+    ../QTfrontend/ui/widget/bgwidget.h \
+    ../QTfrontend/ui/widget/fpsedit.h \
+    ../QTfrontend/ui/widget/FreqSpinBox.h \
+    ../QTfrontend/ui/widget/igbox.h \
+    ../QTfrontend/ui/widget/chatwidget.h \
+    ../QTfrontend/ui/widget/togglebutton.h \
+    ../QTfrontend/ui/widget/SquareLabel.h \
+    ../QTfrontend/ui/widget/itemNum.h \
+    ../QTfrontend/ui/widget/frameTeam.h \
+    ../QTfrontend/ui/widget/teamselect.h \
+    ../QTfrontend/ui/widget/vertScrollArea.h \
+    ../QTfrontend/ui/widget/about.h \
+    ../QTfrontend/ui/widget/teamselhelper.h \
+    ../QTfrontend/ui/widget/drawmapwidget.h \
+    ../QTfrontend/ui/widget/databrowser.h \
+    ../QTfrontend/ui/widget/hedgehogerWidget.h \
+    ../QTfrontend/ui/widget/selectWeapon.h \
+    ../QTfrontend/ui/widget/weaponItem.h \
+    ../QTfrontend/ui/widget/gamecfgwidget.h \
+    ../QTfrontend/ui/widget/mapContainer.h \
+    ../QTfrontend/ui/widget/HistoryLineEdit.h \
+    ../QTfrontend/ui/widget/SmartLineEdit.h \
+    ../QTfrontend/util/DataManager.h \
+    ../QTfrontend/net/netregister.h \
+    ../QTfrontend/net/netserver.h \
+    ../QTfrontend/net/netudpwidget.h \
+    ../QTfrontend/net/tcpBase.h \
+    ../QTfrontend/net/proto.h \
+    ../QTfrontend/net/newnetclient.h \
+    ../QTfrontend/net/netudpserver.h \
+    ../QTfrontend/net/hwmap.h \
+    ../QTfrontend/util/namegen.h \
+    ../QTfrontend/ui/page/AbstractPage.h \
+    ../QTfrontend/drawmapscene.h \
+    ../QTfrontend/game.h \
+    ../QTfrontend/gameuiconfig.h \
+    ../QTfrontend/HWApplication.h \
+    ../QTfrontend/hwform.h \
+    ../QTfrontend/util/SDLInteraction.h \
+    ../QTfrontend/team.h \
+    ../QTfrontend/achievements.h \
+    ../QTfrontend/binds.h \
+    ../QTfrontend/ui_hwform.h \
+    ../QTfrontend/KB.h \
+    ../QTfrontend/hwconsts.h \
+    ../QTfrontend/sdlkeys.h \
+    ../QTfrontend/ui/mouseoverfilter.h \
+    ../QTfrontend/ui/qpushbuttonwithsound.h \
+    ../QTfrontend/ui/widget/qpushbuttonwithsound.h \
+    ../QTfrontend/ui/page/pagefeedback.h \
+    ../QTfrontend/model/roomslistmodel.h \
+    ../QTfrontend/ui/dialog/input_password.h \
+    ../QTfrontend/ui/widget/colorwidget.h \
+    ../QTfrontend/model/HatModel.h \
+    ../QTfrontend/model/GameStyleModel.h \
+    ../QTfrontend/ui/page/pagevideos.h \
+    ../QTfrontend/net/recorder.h \
+    ../QTfrontend/ui/dialog/ask_quit.h \
+    ../QTfrontend/ui/dialog/upload_video.h \
+    ../QTfrontend/campaign.h \
+    ../QTfrontend/model/playerslistmodel.h \
+    ../QTfrontend/util/LibavInteraction.h
+
+SOURCES += ../QTfrontend/model/ammoSchemeModel.cpp \
+    ../QTfrontend/model/MapModel.cpp \
+    ../QTfrontend/model/ThemeModel.cpp \
+    ../QTfrontend/model/netserverslist.cpp \
+    ../QTfrontend/ui/qaspectratiolayout.cpp \
+    ../QTfrontend/ui/page/pagemain.cpp \
+    ../QTfrontend/ui/page/pagetraining.cpp \
+    ../QTfrontend/ui/page/pageroomslist.cpp \
+    ../QTfrontend/ui/page/pagemultiplayer.cpp \
+    ../QTfrontend/ui/page/pagegamestats.cpp \
+    ../QTfrontend/ui/page/pagenettype.cpp \
+    ../QTfrontend/ui/page/pageeditteam.cpp \
+    ../QTfrontend/ui/page/pagenetgame.cpp \
+    ../QTfrontend/ui/page/pagedata.cpp \
+    ../QTfrontend/ui/page/pagedrawmap.cpp \
+    ../QTfrontend/ui/page/pageplayrecord.cpp \
+    ../QTfrontend/ui/page/pageselectweapon.cpp \
+    ../QTfrontend/ui/page/pageingame.cpp \
+    ../QTfrontend/ui/page/pagenetserver.cpp \
+    ../QTfrontend/ui/page/pagecampaign.cpp \
+    ../QTfrontend/ui/page/pageadmin.cpp \
+    ../QTfrontend/ui/page/pageinfo.cpp \
+    ../QTfrontend/ui/page/pageconnecting.cpp \
+    ../QTfrontend/ui/page/pagesingleplayer.cpp \
+    ../QTfrontend/ui/page/pagenet.cpp \
+    ../QTfrontend/ui/page/pagescheme.cpp \
+    ../QTfrontend/ui/page/pageoptions.cpp \
+    ../QTfrontend/ui/dialog/input_ip.cpp \
+    ../QTfrontend/ui/widget/igbox.cpp \
+    ../QTfrontend/ui/widget/selectWeapon.cpp \
+    ../QTfrontend/ui/widget/FreqSpinBox.cpp \
+    ../QTfrontend/ui/widget/SquareLabel.cpp \
+    ../QTfrontend/ui/widget/frameTeam.cpp \
+    ../QTfrontend/ui/widget/fpsedit.cpp \
+    ../QTfrontend/ui/widget/databrowser.cpp \
+    ../QTfrontend/ui/widget/teamselect.cpp \
+    ../QTfrontend/ui/widget/gamecfgwidget.cpp \
+    ../QTfrontend/ui/widget/chatwidget.cpp \
+    ../QTfrontend/ui/widget/itemNum.cpp \
+    ../QTfrontend/ui/widget/bgwidget.cpp \
+    ../QTfrontend/ui/widget/about.cpp \
+    ../QTfrontend/ui/widget/togglebutton.cpp \
+    ../QTfrontend/ui/widget/vertScrollArea.cpp \
+    ../QTfrontend/ui/widget/hedgehogerWidget.cpp \
+    ../QTfrontend/ui/widget/teamselhelper.cpp \
+    ../QTfrontend/ui/widget/drawmapwidget.cpp \
+    ../QTfrontend/ui/widget/weaponItem.cpp \
+    ../QTfrontend/ui/widget/mapContainer.cpp \
+    ../QTfrontend/ui/widget/HistoryLineEdit.cpp \
+    ../QTfrontend/ui/widget/SmartLineEdit.cpp \
+    ../QTfrontend/util/DataManager.cpp \
+    ../QTfrontend/net/tcpBase.cpp \
+    ../QTfrontend/net/netregister.cpp \
+    ../QTfrontend/net/proto.cpp \
+    ../QTfrontend/net/hwmap.cpp \
+    ../QTfrontend/net/netudpserver.cpp \
+    ../QTfrontend/net/newnetclient.cpp \
+    ../QTfrontend/net/netudpwidget.cpp \
+    ../QTfrontend/net/netserver.cpp \
+    ../QTfrontend/util/namegen.cpp \
+    ../QTfrontend/ui/page/AbstractPage.cpp \
+    ../QTfrontend/achievements.cpp \
+    ../QTfrontend/binds.cpp \
+    ../QTfrontend/drawmapscene.cpp \
+    ../QTfrontend/game.cpp \
+    ../QTfrontend/gameuiconfig.cpp \
+    ../QTfrontend/HWApplication.cpp \
+    ../QTfrontend/hwform.cpp \
+    ../QTfrontend/main.cpp \
+    ../QTfrontend/util/SDLInteraction.cpp \
+    ../QTfrontend/team.cpp \
+    ../QTfrontend/ui_hwform.cpp \
+    ../QTfrontend/hwconsts.cpp \
+    ../QTfrontend/ui/mouseoverfilter.cpp \
+    ../QTfrontend/ui/widget/qpushbuttonwithsound.cpp \
+    ../QTfrontend/ui/page/pagefeedback.cpp \
+    ../QTfrontend/model/roomslistmodel.cpp \
+    ../QTfrontend/ui/dialog/input_password.cpp \
+    ../QTfrontend/ui/widget/colorwidget.cpp \
+    ../QTfrontend/model/HatModel.cpp \
+    ../QTfrontend/model/GameStyleModel.cpp \
+    ../QTfrontend/ui/page/pagevideos.cpp \
+    ../QTfrontend/net/recorder.cpp \
+    ../QTfrontend/ui/dialog/ask_quit.cpp \
+    ../QTfrontend/ui/dialog/upload_video.cpp \
+    ../QTfrontend/campaign.cpp \
+    ../QTfrontend/model/playerslistmodel.cpp \
+    ../QTfrontend/util/LibavInteraction.cpp
+
+
+TRANSLATIONS += ../share/hedgewars/Data/Locale/hedgewars_ar.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_bg.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_cs.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_de.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_en.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_es.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_fi.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_fr.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_hu.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_it.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_ja.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_ko.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_lt.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_nl.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_pl.ts \ 
+    ../share/hedgewars/Data/Locale/hedgewars_pt_BR.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_pt_PT.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_ru.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_sk.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_sv.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_tr_TR.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_uk.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_zh_CN.ts \
+    ../share/hedgewars/Data/Locale/hedgewars_zh_TW.ts
+
+RESOURCES += ../QTfrontend/hedgewars.qrc
+
+LIBS += -L../bin -lquazip
+
+macx {
+    QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6
+    QMAKE_MAC_SDK=/Developer/SDKs/MacOSX10.6.sdk
+
+    OBJECTIVE_SOURCES += ../QTfrontend/*.m ../QTfrontend/*.mm
+    SOURCES += ../QTfrontend/AutoUpdater.cpp ../QTfrontend/InstallController.cpp \
+               ../../build/QTfrontend/hwconsts.cpp
+    HEADERS += ../QTfrontend/M3InstallController.h ../QTfrontend/M3Panel.h \
+               ../QTfrontend/NSWorkspace_RBAdditions.h ../QTfrontend/AutoUpdater.h \
+               ../QTfrontend/CocoaInitializer.h ../QTfrontend/InstallController.h \
+               ../QTfrontend/SparkleAutoUpdater.h
+
+    LIBS += -lobjc -framework AppKit -framework IOKit -framework Foundation -framework SDL -framework SDL_Mixer -framework Sparkle -DSPARKLE_ENABLED
+    INCLUDEPATH += /Library/Frameworks/SDL.framework/Headers /Library/Frameworks/SDL_Mixer.framework/Headers
+    CONFIG += warn_on x86
+    #CONFIG += x86 ppc x86_64 ppc64
+}
+
+win32 {
+    RC_FILE = ../QTfrontend/hedgewars.rc
+    SOURCES += ../QTfrontend/xfire.cpp
+    INCLUDEPATH += ../misc/winutils/include
+    LIBS += -L../misc/winutils/lib
+}
+
+!macx {
+    LIBS += -lSDL -lSDL_mixer
+    !win32 {
+        INCLUDEPATH += /usr/local/include/SDL /usr/include/SDL
+    }
+}
+
+FORMS +=