From 202599637075b581800feff5714c75c3530c3ec1 Mon Sep 17 00:00:00 2001 From: Tats Date: Thu, 16 Nov 2017 18:12:55 -0500 Subject: [PATCH 01/25] Allows possibility of changing paint of a mapping from the interface (related to #302). --- src/core/Mapping.cpp | 10 ++++++++++ src/core/Mapping.h | 9 +++++++++ src/core/MappingManager.cpp | 11 +++++++++++ src/core/MappingManager.h | 3 +++ src/gui/MainWindow.cpp | 22 +++++++++++++++++++++- src/gui/MainWindow.h | 3 +++ src/gui/MappingGui.cpp | 34 +++++++++++++++++++++++++++++++++- src/gui/MappingGui.h | 6 ++++++ src/gui/ShapeGraphicsItem.cpp | 20 ++++++++++++-------- src/gui/ShapeGraphicsItem.h | 3 ++- 10 files changed, 110 insertions(+), 11 deletions(-) diff --git a/src/core/Mapping.cpp b/src/core/Mapping.cpp index 95c5139..3dce796 100644 --- a/src/core/Mapping.cpp +++ b/src/core/Mapping.cpp @@ -168,4 +168,14 @@ void Mapping::_writeShape(QDomElement& obj, bool isOutput) obj.appendChild(shapeObj); } +bool ColorMapping::paintIsCompatible(Paint::ptr paint) const +{ + return paint->inherits("mmp::Color"); +} + +bool TextureMapping::paintIsCompatible(Paint::ptr paint) const +{ + return paint->inherits("mmp::Texture"); +} + } diff --git a/src/core/Mapping.h b/src/core/Mapping.h index 94298e7..ff8c209 100644 --- a/src/core/Mapping.h +++ b/src/core/Mapping.h @@ -110,6 +110,9 @@ public: /// The type of the mapping (expressed as a string). virtual QString getType() const = 0; + /// Returns true iff paint is compatible with mapping. + virtual bool paintIsCompatible(Paint::ptr paint) const = 0; + /// Returns the paint. Paint::ptr getPaint() const { return _paint; } @@ -169,6 +172,9 @@ public: /// Returns true iff the mapping possesses an input (source) shape. virtual bool hasInputShape() const { return false; } + /// Returns true iff paint is compatible with mapping. + virtual bool paintIsCompatible(Paint::ptr paint) const; + virtual QString getType() const { return getShape()->getType() + "_color"; } @@ -198,6 +204,9 @@ public: /// Returns true iff the mapping possesses an input (source) shape. virtual bool hasInputShape() const { return true; } + /// Returns true iff paint is compatible with mapping. + virtual bool paintIsCompatible(Paint::ptr paint) const; + virtual QString getType() const { return getShape()->getType() + "_texture"; } diff --git a/src/core/MappingManager.cpp b/src/core/MappingManager.cpp index 4441ab2..f99c9cc 100644 --- a/src/core/MappingManager.cpp +++ b/src/core/MappingManager.cpp @@ -53,6 +53,17 @@ QVector MappingManager::getPaintsByNameRegExp(QString namePattern) return _getElementsByNameRegExp(paintVector, namePattern); } +QVector MappingManager::getPaintsCompatibleWith(Mapping::ptr mapping) +{ + QVector paints; + for (QVector::const_iterator it = paintVector.constBegin(); + it != paintVector.constEnd(); ++it) + if (mapping->paintIsCompatible(*it)) + paints.append(*it); + qDebug() << "Compatible paints: " << paints << endl; + return paints; +} + Mapping::ptr MappingManager::getMappingByName(QString name) { return _getElementByName(mappingVector, name); diff --git a/src/core/MappingManager.h b/src/core/MappingManager.h index 928587d..ebe7c56 100644 --- a/src/core/MappingManager.h +++ b/src/core/MappingManager.h @@ -87,6 +87,9 @@ public: /// Returns all mappings with given regexp. QVector getPaintsByNameRegExp(QString namePattern); + /// Get paints compatible with given mapping. + QVector getPaintsCompatibleWith(Mapping::ptr mapping); + /// Adds a mapping and returns its uid. uid addMapping(Mapping::ptr mapping); diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index c944745..7dff679 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -2689,7 +2689,7 @@ void MainWindow::addPaintItem(uid paintId, const QIcon& icon, const QString& nam // Set size. item->setSizeHint(QSize(item->sizeHint().width(), MainWindow::PAINT_LIST_ITEM_HEIGHT)); - + // Set tooltip. item->setToolTip(QString("ID: %1").arg(paint->getId())); @@ -2700,6 +2700,9 @@ void MainWindow::addPaintItem(uid paintId, const QIcon& icon, const QString& nam paintList->addItem(item); paintList->setCurrentItem(item); + // Update mapping guis. + updateMappers(); + // Window was modified. windowModified(); @@ -2715,6 +2718,9 @@ void MainWindow::updatePaintItem(uid paintId, const QIcon& icon, const QString& item->setIcon(icon); item->setText(name); + // Update mapping guis. + updateMappers(); + // Window was modified. windowModified(); } @@ -2794,6 +2800,10 @@ void MainWindow::addMappingItem(uid mappingId) connect(mapper.data(), SIGNAL(valueChanged()), this, SLOT(updateCanvases())); + // Also update playing state in case paint was changed. + connect(mapper.data(), SIGNAL(valueChanged()), + this, SLOT(updatePlayingState())); + connect(sourceCanvas, SIGNAL(shapeChanged(MShape*)), mapper.data(), SLOT(updateShape(MShape*))); @@ -2886,6 +2896,8 @@ void MainWindow::removePaintItem(uid paintId) paintPropertyPanel->removeWidget(paintGuis[paintId]->getPropertiesEditor()); paintGuis.remove(paintId); + updateMappers(); + // Remove widget from paintList. int row = getItemRowFromId(*paintList, paintId); Q_ASSERT( row >= 0 ); @@ -3011,6 +3023,14 @@ void MainWindow::updateCanvases() updateStatusBar(); } +void MainWindow::updateMappers() { + // Update mapping guis. + for (QMap::iterator it = mappers.begin(); + it != mappers.end(); ++it) { + it.value()->updatePaints(); + } +} + void MainWindow::processFrame() { // Number of frames processed (restarted every second). diff --git a/src/gui/MainWindow.h b/src/gui/MainWindow.h index 1e0d79d..a8503e0 100644 --- a/src/gui/MainWindow.h +++ b/src/gui/MainWindow.h @@ -229,6 +229,9 @@ public slots: /// Updates all canvases. void updateCanvases(); + /// Update all mapping guis. + void updateMappers(); + /** * This function is triggered framesPerSeconds() times per second. It makes sure * the image is refreshed (updateCanvases()) and performs other necessary operations. diff --git a/src/gui/MappingGui.cpp b/src/gui/MappingGui.cpp index 4aef3e8..e19db1d 100644 --- a/src/gui/MappingGui.cpp +++ b/src/gui/MappingGui.cpp @@ -19,6 +19,7 @@ */ #include "MappingGui.h" +#include "MainWindow.h" namespace mmp { @@ -36,7 +37,9 @@ MappingGui::MappingGui(Mapping::ptr mapping) _variantFactory = new VariantFactory; _propertyBrowser->setFactoryForManager(_variantManager, _variantFactory); - + + _paintEnumManager = new QtEnumPropertyManager(this); + // Mapping UID. _idItem = _variantManager->addProperty(QVariant::Int, QObject::tr("ID")); _idItem->setEnabled(false); @@ -51,6 +54,10 @@ MappingGui::MappingGui(Mapping::ptr mapping) _opacityItem->setValue(_mapping->getOpacity()*100.0); _propertyBrowser->addProperty(_opacityItem); + _paintItem = _variantManager->addProperty(QtVariantPropertyManager::enumTypeId(), "Paints"); + _propertyBrowser->addProperty(_paintItem); + updatePaints(); + // Output shape. _outputItem = _variantManager->addProperty(QtVariantPropertyManager::groupTypeId(), QObject::tr("Output shape")); @@ -78,6 +85,15 @@ void MappingGui::setValue(QtProperty* property, const QVariant& value) emit valueChanged(); } } + else if (property == _paintItem) + { + int paintIndex = value.toInt(); + Paint::ptr newPaint = MainWindow::window()->getMappingManager().getPaint(paintIndex); + if (newPaint != _mapping->getPaint() && _mapping->paintIsCompatible(newPaint)) { + _mapping->setPaint(newPaint); + emit valueChanged(); + } + } else { std::map >::iterator it = _propertyToVertex.find(property); @@ -109,6 +125,22 @@ void MappingGui::updateShape(MShape* shape) } } +void MappingGui::updatePaints() +{ + int currentPaint = -1; + MappingManager& manager = MainWindow::window()->getMappingManager(); + QStringList paintList; + QVector paints = manager.getPaintsCompatibleWith(_mapping); + for (int i=0; igetName()); + if (paints[i] == _mapping->getPaint()) + currentPaint = i; + } + _paintItem->setAttribute("enumNames", paintList); + _paintItem->setValue(currentPaint); +} + void MappingGui::_buildShapeProperty(QtProperty* shapeItem, MShape* shape) { for (int i=0; inVertices(); i++) diff --git a/src/gui/MappingGui.h b/src/gui/MappingGui.h index aeffb34..9ee9f27 100644 --- a/src/gui/MappingGui.h +++ b/src/gui/MappingGui.h @@ -36,6 +36,7 @@ #include "Shape.h" #include "Paint.h" #include "Mapping.h" +#include "MappingManager.h" #include "MapperGLCanvas.h" @@ -55,6 +56,8 @@ namespace mmp { +class MainWindow; + /** * This is the "view" side of the Mapping class (model). It contains the graphic items for * both input and output as well as the properties editor. @@ -87,6 +90,7 @@ public slots: virtual void setValue(QtProperty* property, const QVariant& value); virtual void setValue(QString propertyName, QVariant value); virtual void updateShape(MShape* shape); + virtual void updatePaints(); signals: void valueChanged(); @@ -97,9 +101,11 @@ protected: QSharedPointer _propertyBrowser; QtVariantEditorFactory* _variantFactory; QtVariantPropertyManager* _variantManager; + QtEnumPropertyManager* _paintEnumManager; QtVariantProperty* _idItem; QtVariantProperty* _opacityItem; + QtVariantProperty* _paintItem; QtProperty* _outputItem; std::map > _propertyToVertex; diff --git a/src/gui/ShapeGraphicsItem.cpp b/src/gui/ShapeGraphicsItem.cpp index 1ca9bfc..a33a00e 100644 --- a/src/gui/ShapeGraphicsItem.cpp +++ b/src/gui/ShapeGraphicsItem.cpp @@ -208,9 +208,6 @@ TextureGraphicsItem::TextureGraphicsItem(Mapping::ptr mapping, bool output) _textureMapping = qSharedPointerCast(mapping); Q_CHECK_PTR(_textureMapping); - _texture = qSharedPointerCast(_textureMapping.toStrongRef()->getPaint()); - Q_CHECK_PTR(_texture); - _inputShape = qSharedPointerCast(_textureMapping.toStrongRef()->getInputShape()); Q_CHECK_PTR(_inputShape); } @@ -234,7 +231,7 @@ void TextureGraphicsItem::_doDrawInput(QPainter* painter) // FIXME: Does this draw the quad counterclockwise? glBegin (GL_QUADS); { - QRectF rect = mapFromScene(_texture.toStrongRef()->getRect()).boundingRect(); + QRectF rect = mapFromScene(_getTexture()->getRect()).boundingRect(); Util::correctGlTexCoord(0, 0); glVertex3f (rect.x(), rect.y(), 0); @@ -255,8 +252,10 @@ void TextureGraphicsItem::_doDrawInput(QPainter* painter) void TextureGraphicsItem::_prePaint(QPainter* painter, const QStyleOptionGraphicsItem *option) { + QSharedPointer texture = _getTexture(); + Q_CHECK_PTR(texture); + Q_UNUSED(option); - QSharedPointer texture = _texture.toStrongRef(); painter->beginNativePainting(); // Project source texture and sent it to destination. @@ -311,6 +310,11 @@ void TextureGraphicsItem::_postPaint(QPainter* painter, painter->endNativePainting(); } +QSharedPointer TextureGraphicsItem::_getTexture() +{ + return qSharedPointerCast(_textureMapping.toStrongRef()->getPaint()); +} + QPainterPath PolygonTextureGraphicsItem::shape() const { QPainterPath path; @@ -334,7 +338,7 @@ void TriangleTextureGraphicsItem::_doDrawOutput(QPainter* painter) { for (int i=0; inVertices(); i++) { - Util::setGlTexPoint(*_texture.toStrongRef(), inputShape->getVertex(i), mapFromScene(getShape()->getVertex(i))); + Util::setGlTexPoint(*_getTexture(), inputShape->getVertex(i), mapFromScene(getShape()->getVertex(i))); } } glEnd(); @@ -420,7 +424,7 @@ void MeshTextureGraphicsItem::_doDrawOutput(QPainter* painter) glBegin(GL_QUADS); for (int i = 0; i < outputQuad->nVertices(); i++) { - Util::setGlTexPoint(*_texture.toStrongRef(), m.input->getVertex(i), mapFromScene(m.output->getVertex(i))); + Util::setGlTexPoint(*_getTexture(), m.input->getVertex(i), mapFromScene(m.output->getVertex(i))); } glEnd(); } @@ -578,7 +582,7 @@ void EllipseTextureGraphicsItem::_doDrawOutput(QPainter* painter) // Get input and output ellipses. QSharedPointer inputEllipse = qSharedPointerCast(_inputShape); QSharedPointer outputEllipse = qSharedPointerCast(_shape); - QSharedPointer texture = _texture.toStrongRef(); + QSharedPointer texture = _getTexture(); // Data for calculating drawing. DrawingData inputData(inputEllipse); diff --git a/src/gui/ShapeGraphicsItem.h b/src/gui/ShapeGraphicsItem.h index b263c22..3428e86 100644 --- a/src/gui/ShapeGraphicsItem.h +++ b/src/gui/ShapeGraphicsItem.h @@ -186,8 +186,9 @@ protected: protected: QWeakPointer _textureMapping; - QWeakPointer _texture; QWeakPointer _inputShape; + + QSharedPointer _getTexture(); }; /// Graphics item for textured polygons (eg. triangles). From beb1266eea30fbd0d454609d1aa7b0c37070de91 Mon Sep 17 00:00:00 2001 From: Tats Date: Thu, 16 Nov 2017 18:36:11 -0500 Subject: [PATCH 02/25] Added paintId as property + preserved backwards compatibility for files. --- src/core/Mapping.cpp | 18 ++++++++++++++---- src/core/Mapping.h | 7 ++++++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/core/Mapping.cpp b/src/core/Mapping.cpp index 3dce796..6c7a0a7 100644 --- a/src/core/Mapping.cpp +++ b/src/core/Mapping.cpp @@ -84,15 +84,25 @@ void Mapping::setLocked(bool locked) Element::setLocked(locked); } +void Mapping::setPaint(Paint::ptr paint) +{ + _paint = paint; + _emitPropertyChanged("paintId"); +} + +void Mapping::setPaintById(uid paintId) +{ + setPaint(MainWindow::window()->getMappingManager().getPaintById(paintId)); +} void Mapping::read(const QDomElement& obj) { // Read basic data. Element::read(obj); - // Read paint. + // // Read paint (stored in attributes for backward compatibility). int paintId = obj.attribute(ProjectLabels::PAINT_ID).toInt(); - setPaint(MainWindow::window()->getMappingManager().getPaintById(paintId)); + setPaintById(paintId); // Read output shape. _readShape(obj, true); @@ -110,8 +120,8 @@ void Mapping::write(QDomElement& obj) // Write basic data. Element::write(obj); - // Write paint ID. - obj.setAttribute("paintId", getPaint()->getId()); + // // Write paint ID. + obj.setAttribute("paintId", getPaintId()); // Write output shape. _writeShape(obj, true); diff --git a/src/core/Mapping.h b/src/core/Mapping.h index ff8c209..f0a0894 100644 --- a/src/core/Mapping.h +++ b/src/core/Mapping.h @@ -64,6 +64,7 @@ class Mapping : public Element // Q_PROPERTY(MShape::ptr inputShape READ getInputShape) Q_PROPERTY(bool hasInputShape READ hasInputShape STORED false) + Q_PROPERTY(uid paintId READ getPaintId WRITE setPaintById STORED false) // Q_PROPERTY(Paint::ptr paint READ getPaint WRITE setPaint) protected: @@ -116,6 +117,9 @@ public: /// Returns the paint. Paint::ptr getPaint() const { return _paint; } + /// Returns paint id. + uid getPaintId() const { return _paint->getId(); } + /// Returns the (output) shape. MShape::ptr getShape() const { return _shape; } @@ -140,7 +144,8 @@ public: virtual float getComputedOpacity() const { return getOpacity() * _paint->getOpacity(); } - virtual void setPaint(Paint::ptr p) { _paint = p; } + virtual void setPaint(Paint::ptr paint); + virtual void setPaintById(uid paintId); virtual void setShape(MShape::ptr s) { _shape = s; } virtual void setInputShape(MShape::ptr s) { _inputShape = s; } From 9d19a5264003005d60e4f42cd3c9d51d2404e656 Mon Sep 17 00:00:00 2001 From: Tats Date: Thu, 16 Nov 2017 18:36:42 -0500 Subject: [PATCH 03/25] Fixed allows change of paint id on mapping using OSC (closes #302). --- src/gui/MainWindow.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 7dff679..e668fbb 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -298,6 +298,11 @@ void MainWindow::mappingPropertyChanged(uid id, QString propertyName, QVariant v { mappingLockedAction->setChecked(value.toBool()); } + else if (propertyName == "paintId") + { + mappingGui->updatePaints(); + updatePlayingState(); + } } // Send to list items. From 3284ee8e2ccaf1dec905e9a909ee1618e84f215e Mon Sep 17 00:00:00 2001 From: Tats Date: Thu, 16 Nov 2017 18:42:24 -0500 Subject: [PATCH 04/25] Prevent changing paint for mapping if not compatible. --- src/core/Mapping.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/Mapping.cpp b/src/core/Mapping.cpp index 6c7a0a7..8cf4bf5 100644 --- a/src/core/Mapping.cpp +++ b/src/core/Mapping.cpp @@ -86,8 +86,11 @@ void Mapping::setLocked(bool locked) void Mapping::setPaint(Paint::ptr paint) { - _paint = paint; - _emitPropertyChanged("paintId"); + if (paintIsCompatible(paint)) + { + _paint = paint; + _emitPropertyChanged("paintId"); + } } void Mapping::setPaintById(uid paintId) From ea739def6491e69017252301790a3de2c075a576 Mon Sep 17 00:00:00 2001 From: Tats Date: Thu, 16 Nov 2017 20:39:58 -0500 Subject: [PATCH 05/25] Renamed Paints -> Paint in property browser. --- src/gui/MappingGui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/MappingGui.cpp b/src/gui/MappingGui.cpp index e19db1d..6631a3f 100644 --- a/src/gui/MappingGui.cpp +++ b/src/gui/MappingGui.cpp @@ -54,7 +54,7 @@ MappingGui::MappingGui(Mapping::ptr mapping) _opacityItem->setValue(_mapping->getOpacity()*100.0); _propertyBrowser->addProperty(_opacityItem); - _paintItem = _variantManager->addProperty(QtVariantPropertyManager::enumTypeId(), "Paints"); + _paintItem = _variantManager->addProperty(QtVariantPropertyManager::enumTypeId(), "Paint"); _propertyBrowser->addProperty(_paintItem); updatePaints(); From 2cfeb3522d9b83aa990ad29810d247080414486f Mon Sep 17 00:00:00 2001 From: Tats Date: Thu, 16 Nov 2017 20:40:20 -0500 Subject: [PATCH 06/25] Removed unused texture item in mapping gui. --- src/gui/MappingGui.cpp | 3 --- src/gui/MappingGui.h | 1 - 2 files changed, 4 deletions(-) diff --git a/src/gui/MappingGui.cpp b/src/gui/MappingGui.cpp index 6631a3f..113514a 100644 --- a/src/gui/MappingGui.cpp +++ b/src/gui/MappingGui.cpp @@ -280,9 +280,6 @@ TextureMappingGui::TextureMappingGui(QSharedPointer mapping) textureMapping = qSharedPointerCast(_mapping); Q_CHECK_PTR(textureMapping); - texture = qSharedPointerCast(_mapping->getPaint()); - Q_CHECK_PTR(texture); - inputShape = textureMapping.toStrongRef()->getInputShape(); Q_CHECK_PTR(inputShape); diff --git a/src/gui/MappingGui.h b/src/gui/MappingGui.h index 9ee9f27..fc244ab 100644 --- a/src/gui/MappingGui.h +++ b/src/gui/MappingGui.h @@ -184,7 +184,6 @@ protected: // FIXME: use typedefs, member of the class for type names that are too long to type: QWeakPointer textureMapping; - QWeakPointer texture; QWeakPointer inputShape; }; From 07570339df93da667e689a2cb7a317a0cc81da43 Mon Sep 17 00:00:00 2001 From: Tats Date: Thu, 16 Nov 2017 20:40:42 -0500 Subject: [PATCH 07/25] Keep paint at the top in properties editor. --- src/gui/MappingGui.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/MappingGui.cpp b/src/gui/MappingGui.cpp index 113514a..fe4a7f4 100644 --- a/src/gui/MappingGui.cpp +++ b/src/gui/MappingGui.cpp @@ -194,7 +194,7 @@ MeshColorMappingGui::MeshColorMappingGui(Mapping::ptr mapping) _meshItem = _variantManager->addProperty(QVariant::Size, QObject::tr("Dimensions")); _meshItem->setValue(QSize(mesh->nColumns(), mesh->nRows())); _meshItem->setAttribute("minimum", QSize(2,2)); - _propertyBrowser->insertProperty(_meshItem, _opacityItem); // insert at the beginning + _propertyBrowser->insertProperty(_meshItem, _paintItem); // insert at the beginning } void MeshColorMappingGui::setValue(QtProperty* property, const QVariant& value) @@ -287,7 +287,7 @@ TextureMappingGui::TextureMappingGui(QSharedPointer mapping) _inputItem = _variantManager->addProperty(QtVariantPropertyManager::groupTypeId(), QObject::tr("Input shape")); _buildShapeProperty(_inputItem, inputShape.data()); - _propertyBrowser->insertProperty(_inputItem, _opacityItem); // insert + _propertyBrowser->insertProperty(_inputItem, _paintItem); // insert // Collapse input shape. _propertyBrowser->setExpanded(_propertyBrowser->items(_inputItem).at(0), false); @@ -423,7 +423,7 @@ MeshTextureMappingGui::MeshTextureMappingGui(QSharedPointer mapp _meshItem = _variantManager->addProperty(QVariant::Size, QObject::tr("Dimensions")); _meshItem->setValue(QSize(mesh->nColumns(), mesh->nRows())); _meshItem->setAttribute("minimum", QSize(2,2)); - _propertyBrowser->insertProperty(_meshItem, _opacityItem); // insert at the beginning + _propertyBrowser->insertProperty(_meshItem, _paintItem); // insert at the beginning } void MeshTextureMappingGui::setValue(QtProperty* property, const QVariant& value) From 16bb470a755cbe7de34df981a24993aaabea8ebb Mon Sep 17 00:00:00 2001 From: Tats Date: Sat, 18 Nov 2017 18:47:05 -0500 Subject: [PATCH 08/25] Renamed README to README.md --- README => README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename README => README.md (100%) diff --git a/README b/README.md similarity index 100% rename from README rename to README.md From 3467de59e859ae51804d9ed5325f108540e42275 Mon Sep 17 00:00:00 2001 From: Tats Date: Sat, 18 Nov 2017 18:48:16 -0500 Subject: [PATCH 09/25] Renamed INSTALL to INSTALL.md --- INSTALL => INSTALL.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename INSTALL => INSTALL.md (100%) diff --git a/INSTALL b/INSTALL.md similarity index 100% rename from INSTALL rename to INSTALL.md From 9a3b09f924ec24e14e570ed9303cdbea17354f08 Mon Sep 17 00:00:00 2001 From: Sofian Audry Date: Sat, 18 Nov 2017 18:55:18 -0500 Subject: [PATCH 10/25] Made some progress in updating the file to mardown format --- INSTALL.md | 97 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 62 insertions(+), 35 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index c8a35eb..be1a290 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -8,31 +8,38 @@ Build on GNU/Linux Install the dependencies. (see below) -Build it:: +Build it: - qmake mapmap.pro - make +``` +qmake mapmap.pro +make +``` -Alternatively:: +Alternatively: - ./scripts/build.sh +``` +./scripts/build.sh +``` Ubuntu 13.10, 14.04, 15.04 and 16.04 LTS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Install basic development tools fot Qt projects, plus liblo for OSC support:: +Install basic development tools fot Qt projects, plus liblo for OSC support: - sudo apt-get install -y \ +``` +sudo apt-get install -y \ liblo-dev liblo-tools \ qttools5-dev-tools \ qt5-default \ qtmultimedia5-dev \ libqt5multimedia5-plugins +``` -Install GStreamer 1.0 libraries and plugins:: +Install GStreamer 1.0 libraries and plugins: - sudo apt-get install -y \ +``` +sudo apt-get install -y \ libgstreamer1.0-dev \ libgstreamer-plugins-base1.0-dev \ gstreamer1.0-plugins-bad \ @@ -44,24 +51,30 @@ Install GStreamer 1.0 libraries and plugins:: gstreamer1.0-plugins-ugly \ gstreamer1.0-x \ gstreamer1.0-tools +``` -Install extra packages if you want to build the documentation:: +Install extra packages if you want to build the documentation: - sudo apt-get install -y \ +``` +sudo apt-get install -y \ doxygen \ graphviz \ rst2pdf \ markdown +``` Arch Linux ~~~~~~~~~~ -Install basic development tools fot Qt projects, GStreamer 1.0 and liblo for OSC support:: +Install basic development tools fot Qt projects, GStreamer 1.0 and liblo for OSC support: +``` sudo pacman -S qt5-tools qt5-multimedia liblo gstreamer +``` Install GStreamer 1.0 libraries and plugins:: +``` sudo pacman -S gst-libav \ gstreamer-vaapi \ gst-plugins-bad \ @@ -69,17 +82,22 @@ sudo pacman -S gst-libav \ gst-plugins-base-libs \ gst-plugins-good \ gst-plugins-ugly +``` To edit translations -------------------- -You might need to update the files:: +You might need to update the files: - cd src/mapmap - lupdate mapmap.pro +``` +cd src/mapmap +lupdate mapmap.pro +``` -Then, do this:: - - lrelease mapmap.pro +Then, do this: + +``` +lrelease mapmap.pro +``` Build on Mac OS X ----------------- @@ -102,9 +120,11 @@ Install tools and dependencies: - https://gstreamer.freedesktop.org/data/pkg/osx/1.6.0/gstreamer-1.0-devel-1.6.0-x86_64.pkg - http://gstreamer.freedesktop.org/data/pkg/osx/1.6.0/gstreamer-1.0-1.6.0-x86_64-packages.dmg -Do this:: +Do this: - ./build.sh +``` +./build.sh +``` It will create a .app and a .dmg. @@ -113,42 +133,49 @@ DMGVERSION.txt should be created automatically with "1" as its contents. Update Use on OS X ----------- -Download GStreamer from: -http://gstreamer.freedesktop.org/data/pkg/osx/1.6.0/gstreamer-1.0-1.6.0-x86_64-packages.dmg -http://gstreamer.freedesktop.org/data/pkg/osx/1.6.0/gstreamer-1.0-1.6.0-x86_64.pkg +Download GStreamer from +- http://gstreamer.freedesktop.org/data/pkg/osx/1.6.0/gstreamer-1.0-1.6.0-x86_64-packages.dmg +- http://gstreamer.freedesktop.org/data/pkg/osx/1.6.0/gstreamer-1.0-1.6.0-x86_64.pkg Download MapMap.dmg, decompress the app and copy it to /Applications. -If the appearance of the window of the OSC port number in the preferences seem corrupted, you might want to reset MapMap's preferences:: +If the appearance of the window of the OSC port number in the preferences seem corrupted, you might want to reset MapMap's preferences: - rm -f ~/Library/Preferences/info.mapmap.MapMap.plist +``` +rm -f ~/Library/Preferences/info.mapmap.MapMap.plist +``` To print debugging informations, launch it from the Terminal app like this:: - GST_PLUGIN_PATH=/Library/Frameworks/GStreamer.framework/Libraries GST_DEBUG=2 /Applications/MapMap.app/Contents/MacOS/MapMap +``` +GSTPLUGIN_PATH=/Library/Frameworks/GStreamer.framework/Libraries GST_DEBUG=2 /Applications/MapMap.app/Contents/MacOS/MapMap +``` Build for release on Windows ---------------------------- -- Download gstreamer-x86 runtime& devel -https://gstreamer.freedesktop.org/data/pkg/windows/1.10.2/gstreamer-1.0-x86-1.10.2.msi https://gstreamer.freedesktop.org/data/pkg/windows/1.10.2/gstreamer-1.0-devel-x86-1.10.2.msi +Download gstreamer-x86 runtime& devel + - https://gstreamer.freedesktop.org/data/pkg/windows/1.10.2/gstreamer-1.0-x86-1.10.2.msi + - https://gstreamer.freedesktop.org/data/pkg/windows/1.10.2/gstreamer-1.0-devel-x86-1.10.2.msi +Then: - Choose complete option during installation process wizard - Build Mapmap with Qt Creator (qmake, build release) - Add the bin directory of your Qt installation (e.g. e.g. C:\Qt\Qt5.6.0\5.6\mingw49_32\bin) to the PATH variable -- Open Windows console then run the following command: - windeployqt --release --no-system-d3d-compiler +- Open Windows console then run the following command: ```windeployqt --release --no-system-d3d-compiler ``` -- Copy the followings DLL into the target folder together with Mapmap.exe +Copy the followings DLL into the target folder together with Mapmap.exe: +``` libffi-6.dll libgobject-2.0-0.dll libgstbase-1.0-0.dll libgsttag-1.0-0.dll liborc-0.4-0.dll libglib-2.0-0.dll libgstapp-1.0-0.dll libgstpbutils-1.0-0.dll libgstvideo-1.0-0.dll libz.dll libgmodule-2.0-0.dll libgstaudio-1.0-0.dll libgstreamer-1.0-0.dll libintl-8.dll -- Copy all DLL files of the Gstreamer's bin folder (e.g. C:\gstreamer\1.0\x86\bin) into a new folder named 'lib' in the target folder together with mapmap.exe +``` -- Copy all DLL files of the Gstreamer's plugin folder (e.g. C:\gstreamer\1.0\x86\lib\gstreamer-1.0) into a new folder named 'plugins' in parallel of lib folder +Copy all DLL files of the Gstreamer's bin folder (e.g. C:\gstreamer\1.0\x86\bin) into a new folder named 'lib' in the target folder together with mapmap.exe +Copy all DLL files of the Gstreamer's plugin folder (e.g. C:\gstreamer\1.0\x86\lib\gstreamer-1.0) into a new folder named 'plugins' in parallel of lib folder -- Remove lib\libopenh264.dll, lib\libSoundTouch-0.dll, lib\libtag.dll +Remove lib\libopenh264.dll, lib\libSoundTouch-0.dll, lib\libtag.dll -- Run Mapamp.exe +Run Mapamp.exe From f96ed36b1201041258fce03964f4c4e92f20c861 Mon Sep 17 00:00:00 2001 From: Sofian Audry Date: Mon, 20 Nov 2017 17:50:31 -0500 Subject: [PATCH 11/25] Finished implementing markdown transition --- INSTALL.md | 57 ++++++++++++++++++++++-------------------------------- 1 file changed, 23 insertions(+), 34 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index be1a290..a7d5f67 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,12 +1,10 @@ Build instructions ================== -This file is written in rst, so that one can use rst2pdf to create a PDF out of it. - Build on GNU/Linux ------------------ -Install the dependencies. (see below) +Install the dependencies. Build it: @@ -21,8 +19,9 @@ Alternatively: ./scripts/build.sh ``` -Ubuntu 13.10, 14.04, 15.04 and 16.04 LTS -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +### Ubuntu + +NOTE: Tested on 13.10, 14.04, 15.04 and 16.04 Install basic development tools fot Qt projects, plus liblo for OSC support: @@ -35,7 +34,6 @@ sudo apt-get install -y \ libqt5multimedia5-plugins ``` - Install GStreamer 1.0 libraries and plugins: ``` @@ -63,8 +61,7 @@ sudo apt-get install -y \ markdown ``` -Arch Linux -~~~~~~~~~~ +### Arch Linux Install basic development tools fot Qt projects, GStreamer 1.0 and liblo for OSC support: @@ -84,21 +81,6 @@ sudo pacman -S gst-libav \ gst-plugins-ugly ``` -To edit translations --------------------- -You might need to update the files: - -``` -cd src/mapmap -lupdate mapmap.pro -``` - -Then, do this: - -``` -lrelease mapmap.pro -``` - Build on Mac OS X ----------------- @@ -130,14 +112,7 @@ It will create a .app and a .dmg. DMGVERSION.txt should be created automatically with "1" as its contents. Update to "2", and so on, if needed. - -Use on OS X ------------ -Download GStreamer from -- http://gstreamer.freedesktop.org/data/pkg/osx/1.6.0/gstreamer-1.0-1.6.0-x86_64-packages.dmg -- http://gstreamer.freedesktop.org/data/pkg/osx/1.6.0/gstreamer-1.0-1.6.0-x86_64.pkg - -Download MapMap.dmg, decompress the app and copy it to /Applications. +### Troubleshooting If the appearance of the window of the OSC port number in the preferences seem corrupted, you might want to reset MapMap's preferences: @@ -151,9 +126,8 @@ To print debugging informations, launch it from the Terminal app like this:: GSTPLUGIN_PATH=/Library/Frameworks/GStreamer.framework/Libraries GST_DEBUG=2 /Applications/MapMap.app/Contents/MacOS/MapMap ``` - -Build for release on Windows ----------------------------- +Build on Windows +---------------- Download gstreamer-x86 runtime& devel - https://gstreamer.freedesktop.org/data/pkg/windows/1.10.2/gstreamer-1.0-x86-1.10.2.msi @@ -179,3 +153,18 @@ Copy all DLL files of the Gstreamer's plugin folder (e.g. C:\gstreamer\1.0\x86\l Remove lib\libopenh264.dll, lib\libSoundTouch-0.dll, lib\libtag.dll Run Mapamp.exe + +Editing translations +-------------------- +You might need to update the files: + +``` +cd src/mapmap +lupdate mapmap.pro +``` + +Then, do this: + +``` +lrelease mapmap.pro +``` From eee5e641008728531a4749a964f1ed659d2e9595 Mon Sep 17 00:00:00 2001 From: Sofian Audry Date: Mon, 27 Nov 2017 16:18:41 -0500 Subject: [PATCH 12/25] Added instruction on troubleshooting gst.h missing on OSX --- INSTALL.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index a7d5f67..4fc1c46 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -93,7 +93,7 @@ Install tools and dependencies: 2) Install Qt5 - You can get the open source version from http://www.qt.io/download-open-source/ - Run the installer and choose the default location (which should be ~/Qt). - - Latest tested version: 5.5.1 + - Latest tested version: 5.5.1= 3) Install liblo - Use the following guide: http://macappstore.org/liblo/ - OR compile from the tar.gz - it should install it to /usr/local @@ -114,6 +114,12 @@ DMGVERSION.txt should be created automatically with "1" as its contents. Update ### Troubleshooting +#### GStreamer header not found + +If you have a compilation error saying that file `````` cannot be found: make sure your GStreamer.framework folder is installed and is _not_ read-protected. + +#### Corrupted OSC port + If the appearance of the window of the OSC port number in the preferences seem corrupted, you might want to reset MapMap's preferences: ``` From dfdd4fe769dcc52f9504432a7b4b17f41dc9cade Mon Sep 17 00:00:00 2001 From: baydam Date: Wed, 29 Nov 2017 19:19:14 +0000 Subject: [PATCH 13/25] Clean Up --- src/gui/MainWindow.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index e668fbb..0a0a34b 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -298,11 +298,11 @@ void MainWindow::mappingPropertyChanged(uid id, QString propertyName, QVariant v { mappingLockedAction->setChecked(value.toBool()); } - else if (propertyName == "paintId") - { - mappingGui->updatePaints(); - updatePlayingState(); - } + else if (propertyName == "paintId") + { + mappingGui->updatePaints(); + updatePlayingState(); + } } // Send to list items. @@ -572,8 +572,7 @@ bool MainWindow::saveAs() void MainWindow::importMedia() { // Stop video playback, if it is playing, to avoid lags. XXX Hack - if (pauseAction->isVisible()) - pause(false); + pause(!pauseAction->isVisible()); // Pop-up file-choosing dialog to choose media file. // TODO: restrict the type of files that can be imported @@ -584,8 +583,7 @@ void MainWindow::importMedia() .arg(MM::VIDEO_FILES_FILTER) .arg(MM::IMAGE_FILES_FILTER)); // Restart video playback if it was previously playing. XXX Hack - if (pauseAction->isVisible()) - play(false); + play(!pauseAction->isVisible()); // Check if file is image or not // according to file extension @@ -2805,7 +2803,7 @@ void MainWindow::addMappingItem(uid mappingId) connect(mapper.data(), SIGNAL(valueChanged()), this, SLOT(updateCanvases())); - // Also update playing state in case paint was changed. + // Also update playing state in case paint was changed. connect(mapper.data(), SIGNAL(valueChanged()), this, SLOT(updatePlayingState())); @@ -2901,7 +2899,7 @@ void MainWindow::removePaintItem(uid paintId) paintPropertyPanel->removeWidget(paintGuis[paintId]->getPropertiesEditor()); paintGuis.remove(paintId); - updateMappers(); + updateMappers(); // Remove widget from paintList. int row = getItemRowFromId(*paintList, paintId); @@ -3031,7 +3029,7 @@ void MainWindow::updateCanvases() void MainWindow::updateMappers() { // Update mapping guis. for (QMap::iterator it = mappers.begin(); - it != mappers.end(); ++it) { + it != mappers.end(); ++it) { it.value()->updatePaints(); } } From 1d9009e4a23441a4fefe9d78c1cd49a3e87df391 Mon Sep 17 00:00:00 2001 From: baydam Date: Wed, 29 Nov 2017 21:20:42 +0000 Subject: [PATCH 14/25] Fix compilation error on Mac OSX #368 --- mapmap.pro | 152 ++++++++++++++++++++++++++-------------------------- src/src.pri | 26 +++++++++ 2 files changed, 102 insertions(+), 76 deletions(-) diff --git a/mapmap.pro b/mapmap.pro index 2544438..bfe50d3 100644 --- a/mapmap.pro +++ b/mapmap.pro @@ -15,7 +15,7 @@ include(src/app/app.pri) TRANSLATIONS = \ translations/mapmap_en.ts \ translations/mapmap_fr.ts \ - translations/mapmap_es.ts + translations/mapmap_es.ts RESOURCES = \ translations/translation.qrc \ docs/documentation.qrc \ @@ -39,93 +39,93 @@ system($$QMAKE_LRELEASE mapmap.pro) # Run lrelease #docs.commands = (cat Doxyfile; echo "INPUT = $?") | doxygen - #QMAKE_EXTRA_TARGETS += docs - Linux-specific: -unix:!macx { - mapmapfile.files = mapmap - mapmapfile.path = /usr/bin - INSTALLS += mapmapfile - desktopfile.files = resources/texts/mapmap.desktop - desktopfile.path = /usr/share/applications - INSTALLS += desktopfile - iconfile.files = resources/images/logo/mapmap.svg - iconfile.path = /usr/share/icons/hicolor/scalable/apps - INSTALLS += iconfile - mimetypesfile.files = resources/texts/mapmap.xml - mimetypesfile.path = /usr/share/mime/packages - INSTALLS += mimetypesfile +# Linux-specific: +#unix:!macx { +# mapmapfile.files = mapmap +# mapmapfile.path = /usr/bin +# INSTALLS += mapmapfile +# desktopfile.files = resources/texts/mapmap.desktop +# desktopfile.path = /usr/share/applications +# INSTALLS += desktopfile +# iconfile.files = resources/images/logo/mapmap.svg +# iconfile.path = /usr/share/icons/hicolor/scalable/apps +# INSTALLS += iconfile +# mimetypesfile.files = resources/texts/mapmap.xml +# mimetypesfile.path = /usr/share/mime/packages +# INSTALLS += mimetypesfile - # REQUIRES ROOT PRIVILEDGES: (does not comply to the standards of Debian) - # ------------------------- - # updatemimetypes.path = /usr/share/mime/packages - # updatemimetypes.commands = update-mime-database /usr/share/mime - # INSTALLS += updatemimetypes - # updatemimeappdefault.path = /usr/share/applications - # updatemimeappdefault.commands='grep mapmap.desktop /usr/share/applications/defaults.list >/dev/null|| sudo echo "application/mapmap=mapmap.desktop;" >> /usr/share/applications/defaults.list' - # INSTALLS += updatemimeappdefault - # ------------------------- +# # REQUIRES ROOT PRIVILEDGES: (does not comply to the standards of Debian) +# # ------------------------- +# # updatemimetypes.path = /usr/share/mime/packages +# # updatemimetypes.commands = update-mime-database /usr/share/mime +# # INSTALLS += updatemimetypes +# # updatemimeappdefault.path = /usr/share/applications +# # updatemimeappdefault.commands='grep mapmap.desktop /usr/share/applications/defaults.list >/dev/null|| sudo echo "application/mapmap=mapmap.desktop;" >> /usr/share/applications/defaults.list' +# # INSTALLS += updatemimeappdefault +# # ------------------------- - # Add the docs target: - docs.depends = $(HEADERS) $(SOURCES) - docs.commands = (cat Doxyfile; echo "INPUT = $?") | doxygen - - QMAKE_EXTRA_TARGETS += docs -} +# # Add the docs target: +# docs.depends = $(HEADERS) $(SOURCES) +# docs.commands = (cat Doxyfile; echo "INPUT = $?") | doxygen - +# QMAKE_EXTRA_TARGETS += docs +#} # macOS-specific: -macx { - TARGET = MapMap - DEFINES += MACOSX - QMAKE_CXXFLAGS += -D__MACOSX_CORE__ - QMAKE_CXXFLAGS += -stdlib=libc++ - INCLUDEPATH += /Library/Frameworks/GStreamer.framework/Versions/1.0/Headers - LIBS += -F /Library/Frameworks/ -framework GStreamer - LIBS += -framework OpenGL -framework GLUT - # With Xcode Tools > 1.5, to reduce the size of your binary even more: - # LIBS += -dead_strip - # This tells qmake not to put the executable inside a bundle. - # just for reference. Do not uncomment. - # CONFIG-=app_bundle +#macx { +# TARGET = MapMap +# DEFINES += MACOSX +# QMAKE_CXXFLAGS += -D__MACOSX_CORE__ +# QMAKE_CXXFLAGS += -stdlib=libc++ +# INCLUDEPATH += /Library/Frameworks/GStreamer.framework/Versions/1.0/Headers +# LIBS += -F /Library/Frameworks/ -framework GStreamer +# LIBS += -framework OpenGL -framework GLUT +# # With Xcode Tools > 1.5, to reduce the size of your binary even more: +# # LIBS += -dead_strip +# # This tells qmake not to put the executable inside a bundle. +# # just for reference. Do not uncomment. +# # CONFIG-=app_bundle - # For OSC support: (if pkg-config was installed) - # CONFIG += link_pkgconfig - # PKGCONFIG += lo +# # For OSC support: (if pkg-config was installed) +# # CONFIG += link_pkgconfig +# # PKGCONFIG += lo - # FIXME: No OSC for now: - # LIBS += -L/usr/local/lib -llo - # INCLUDEPATH += /usr/local/include - # QMAKE_CXXFLAGS += -DHAVE_OSC -} +# # FIXME: No OSC for now: +# # LIBS += -L/usr/local/lib -llo +# # INCLUDEPATH += /usr/local/include +# # QMAKE_CXXFLAGS += -DHAVE_OSC +#} # Windows-specific: -win32 { - DEFINES += WIN32 - TARGET = Mapmap - GST_HOME = $$quote($$(GSTREAMER_1_0_ROOT_X86)) - isEmpty(GST_HOME) { - message(\"GSTREAMER_1_0_ROOT_X86\" not detected ...) - } - else { - message(\"GSTREAMER_1_0_ROOT_X86\" detected in \"$${GST_HOME}\") - } - # DESTDIR = ../../Mapmap # Just for packaging +#win32 { +# DEFINES += WIN32 +# TARGET = Mapmap +# GST_HOME = $$quote($$(GSTREAMER_1_0_ROOT_X86)) +# isEmpty(GST_HOME) { +# message(\"GSTREAMER_1_0_ROOT_X86\" not detected ...) +# } +# else { +# message(\"GSTREAMER_1_0_ROOT_X86\" detected in \"$${GST_HOME}\") +# } +# # DESTDIR = ../../Mapmap # Just for packaging -# INCLUDEPATH += $${GST_HOME}/lib/gstreamer-1.0/include \ -# $${GST_HOME}/include/glib-2.0 \ -# $${GST_HOME}/lib/glib-2.0/include \ -# $${GST_HOME}/include/gstreamer-1.0 +## INCLUDEPATH += $${GST_HOME}/lib/gstreamer-1.0/include \ +## $${GST_HOME}/include/glib-2.0 \ +## $${GST_HOME}/lib/glib-2.0/include \ +## $${GST_HOME}/include/gstreamer-1.0 -# LIBS += $${GST_HOME}/lib/gstapp-1.0.lib \ -# $${GST_HOME}/lib/gstbase-1.0.lib \ -# $${GST_HOME}/lib/gstpbutils-1.0.lib \ -# $${GST_HOME}/lib/gstreamer-1.0.lib \ -# $${GST_HOME}/lib/gobject-2.0.lib \ -# $${GST_HOME}/lib/glib-2.0.lib \ -# -lopengl32 +## LIBS += $${GST_HOME}/lib/gstapp-1.0.lib \ +## $${GST_HOME}/lib/gstbase-1.0.lib \ +## $${GST_HOME}/lib/gstpbutils-1.0.lib \ +## $${GST_HOME}/lib/gstreamer-1.0.lib \ +## $${GST_HOME}/lib/gobject-2.0.lib \ +## $${GST_HOME}/lib/glib-2.0.lib \ +## -lopengl32 - CONFIG += release +# CONFIG += release - RC_FILE = resources/windows_resource.rc - QMAKE_CXXFLAGS += -D_USE_MATH_DEFINES -} +# RC_FILE = resources/windows_resource.rc +# QMAKE_CXXFLAGS += -D_USE_MATH_DEFINES +#} # Adds the tarball target tarball.target = mapmap-$${VERSION}.tar.gz diff --git a/src/src.pri b/src/src.pri index 28f064f..c9e6fe1 100644 --- a/src/src.pri +++ b/src/src.pri @@ -26,6 +26,32 @@ unix:!macx { QMAKE_CXXFLAGS += -DHAVE_OSC } +# macOS-specific: +macx { + TARGET = MapMap + DEFINES += MACOSX + QMAKE_CXXFLAGS += -D__MACOSX_CORE__ + QMAKE_CXXFLAGS += -stdlib=libc++ + INCLUDEPATH += /Library/Frameworks/GStreamer.framework/Versions/1.0/Headers + LIBS += -F /Library/Frameworks/ -framework GStreamer + LIBS += -framework OpenGL -framework GLUT + # With Xcode Tools > 1.5, to reduce the size of your binary even more: + # LIBS += -dead_strip + # This tells qmake not to put the executable inside a bundle. + # just for reference. Do not uncomment. + # CONFIG-=app_bundle + + # For OSC support: (if pkg-config was installed) + # CONFIG += link_pkgconfig + # PKGCONFIG += lo + + # FIXME: No OSC for now: + # LIBS += -L/usr/local/lib -llo + # INCLUDEPATH += /usr/local/include + # QMAKE_CXXFLAGS += -DHAVE_OSC +} + + # Windows-specific: win32 { INCLUDEPATH += $${GST_HOME}/lib/gstreamer-1.0/include \ From 373ae3ecbd275af080e30c30bdca5df98296a403 Mon Sep 17 00:00:00 2001 From: Bay Dam Date: Tue, 6 Feb 2018 19:02:56 +0000 Subject: [PATCH 15/25] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index e3e1b3f..c4d7504 100644 --- a/README.md +++ b/README.md @@ -57,3 +57,7 @@ Contributors More info --------- Get more info from http://mapmap.info + +Licence +--------- +[GNU GPL v3](https://github.com/mapmapteam/mapmap/blob/develop/LICENSE) From e8dc1282205d4dd54217be4652cd873429aa1ba6 Mon Sep 17 00:00:00 2001 From: Bay Dam Date: Tue, 6 Feb 2018 19:18:13 +0000 Subject: [PATCH 16/25] Add travis build status on README file --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index c4d7504..6e33521 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,11 @@ extra dimensions, optical illusions, and notions of movement onto previously static objects. The video is commonly combined with, or triggered by, audio to create an audio-visual narrative. + +Build status +--------------- +Linux [![Build Status](https://travis-ci.org/mapmapteam/mapmap.svg?branch=develop)](https://travis-ci.org/mapmapteam/mapmap) + Ackowledgements --------------- This project was made possible by the support of the International From 51d9e9583c7dcc9aea97cdd7a4c53b05f682152e Mon Sep 17 00:00:00 2001 From: Bay Dam Date: Tue, 6 Feb 2018 19:19:59 +0000 Subject: [PATCH 17/25] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6e33521..b2a1bbf 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ triggered by, audio to create an audio-visual narrative. Build status --------------- -Linux [![Build Status](https://travis-ci.org/mapmapteam/mapmap.svg?branch=develop)](https://travis-ci.org/mapmapteam/mapmap) +Linux [![Build Status](https://travis-ci.org/mapmapteam/mapmap.svg?branch=develop)](https://travis-ci.org/mapmapteam/mapmap) Ackowledgements --------------- From bccdb5ddfb8c046ee4691cd39cd70d042c983377 Mon Sep 17 00:00:00 2001 From: Bay Dam Date: Tue, 6 Feb 2018 19:21:11 +0000 Subject: [PATCH 18/25] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b2a1bbf..dbb2d63 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ triggered by, audio to create an audio-visual narrative. Build status --------------- -Linux [![Build Status](https://travis-ci.org/mapmapteam/mapmap.svg?branch=develop)](https://travis-ci.org/mapmapteam/mapmap) +Linux [![Build Status](https://travis-ci.org/mapmapteam/mapmap.svg?branch=develop)](https://travis-ci.org/mapmapteam/mapmap) Ackowledgements --------------- From 60fbb34abf033ba0cbcad832daf1e7f87c87e40c Mon Sep 17 00:00:00 2001 From: baydam Date: Thu, 22 Mar 2018 09:55:35 +0000 Subject: [PATCH 19/25] Update ignored file type --- .gitignore | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 7033c6e..4ce1e7d 100644 --- a/.gitignore +++ b/.gitignore @@ -50,9 +50,9 @@ moc_*.cpp prototypes/gst/ qrc_*.cpp *.moc -src/*/mocs/ -src/*/objs/ -src/*/qrc/ +src/*/mocs/* +src/*/objs/* +src/*/qrc/* # Folders not to be included html/ From 35c47106c2440fd56ba653cd6dc4510a4ba7e766 Mon Sep 17 00:00:00 2001 From: baydam Date: Thu, 22 Mar 2018 10:07:44 +0000 Subject: [PATCH 20/25] Improved project inclusions --- mapmap.pro | 4 +++- src/gui/gui.pri | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mapmap.pro b/mapmap.pro index bfe50d3..05ae58b 100644 --- a/mapmap.pro +++ b/mapmap.pro @@ -1,4 +1,6 @@ -CONFIG += c++11 +CONFIG += qt debug c++11 + +TEMPLATE = app # Always use major.minor.micro version number format VERSION = 0.5.1 diff --git a/src/gui/gui.pri b/src/gui/gui.pri index 742f1b8..4c4872a 100644 --- a/src/gui/gui.pri +++ b/src/gui/gui.pri @@ -1,8 +1,8 @@ include(../src.pri) -include(contrib/qtpropertybrowser/src/qtpropertybrowser.pri) -include(contrib/qtpropertybrowser-extension/qtpropertybrowser-extension.pri) +include($$PWD/contrib/qtpropertybrowser/src/qtpropertybrowser.pri) +include($$PWD/contrib/qtpropertybrowser-extension/qtpropertybrowser-extension.pri) HEADERS += $$PWD/AboutDialog.h \ $$PWD/ConsoleWindow.h \ From 249259e86469e384369c87cb30f306a6f3230083 Mon Sep 17 00:00:00 2001 From: baydam Date: Thu, 22 Mar 2018 11:10:38 +0000 Subject: [PATCH 21/25] Add OSX build support on Travis --- .travis.yml | 48 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8b4db7c..8c0598c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,36 @@ -install: - - sudo apt-get update - # Qt - - sudo apt-get install qt5-default qttools5-dev-tools - # Liblo - - sudo apt-get install liblo-dev liblo-tools - # GStreamer - - sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-vaapi gstreamer1.0-plugins-base gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-x gstreamer1.0-tools - # QtMultimedia (unused) - - sudo apt-get install qtmultimedia5-dev + - os: linux + dist: trusty + sudo: required + env: TARGET="linux64" -script: - - qmake mapmap.pro - - make + install: + - sudo apt-get update + # Qt + - sudo apt-get install qt5-default qttools5-dev-tools + # Liblo + - sudo apt-get install liblo-dev liblo-tools + # GStreamer + - sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-vaapi gstreamer1.0-plugins-base gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-x gstreamer1.0-tools + # QtMultimedia (unused) + - sudo apt-get install qtmultimedia5-dev + + script: + - qmake mapmap.pro + - make + + - os: osx + osx_image: xcode8 + compiler: gcc + env: TARGET="osx" + + before_install: + - brew update && brew bundle + + install: + - brew install qt + - brew install liblo + - brew install gstreamer gst-plugins-bad gst-plugins-base gst-plugins-good gst-libav + + script: + - qmake mapmap.pro + - make From 8c2a7d0b5860b095bc1c4e24ea5d01bed311b28d Mon Sep 17 00:00:00 2001 From: baydam Date: Thu, 22 Mar 2018 12:24:52 +0000 Subject: [PATCH 22/25] Update travis config file --- .travis.yml | 63 ++++++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 30 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8c0598c..c0005c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,36 +1,39 @@ - - os: linux - dist: trusty - sudo: required - env: TARGET="linux64" +language: c++ +compiler: gcc - install: - - sudo apt-get update - # Qt - - sudo apt-get install qt5-default qttools5-dev-tools - # Liblo - - sudo apt-get install liblo-dev liblo-tools - # GStreamer - - sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-vaapi gstreamer1.0-plugins-base gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-x gstreamer1.0-tools - # QtMultimedia (unused) - - sudo apt-get install qtmultimedia5-dev +matrix: + include: + - os: linux + dist: trusty + env: TARGET="linux64" - script: - - qmake mapmap.pro - - make + - os: osx + osx_image: xcode8 + env: TARGET="osx" - - os: osx - osx_image: xcode8 - compiler: gcc - env: TARGET="osx" +before_install: + - if [ "$TARGET" == "linux64" ]; then + sudo apt-get update + fi - before_install: - - brew update && brew bundle + - if [ "$TARGET" == "osx" ]; then + brew update && brew bundle + fi - install: - - brew install qt - - brew install liblo - - brew install gstreamer gst-plugins-bad gst-plugins-base gst-plugins-good gst-libav +install: + - if [ "$TARGET" == "linux64" ]; then + sudo apt-get install qt5-default qttools5-dev-tools + sudo apt-get install liblo-dev liblo-tools + sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-vaapi gstreamer1.0-plugins-base gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-x gstreamer1.0-tools + sudo apt-get install qtmultimedia5-dev + fi - script: - - qmake mapmap.pro - - make + - if [ "$TARGET" == "linux64" ]; then + brew install qt + brew install liblo + brew install gstreamer gst-plugins-bad gst-plugins-base gst-plugins-good gst-libav + fi + +script: + - qmake mapmap.pro + - make From 1349290c8a660c3d711e4f8dc6b2ac99579b505c Mon Sep 17 00:00:00 2001 From: baydam Date: Thu, 22 Mar 2018 12:33:56 +0000 Subject: [PATCH 23/25] Fix missing semicolomn on travis config file --- .travis.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index c0005c8..30b0804 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,25 +13,25 @@ matrix: before_install: - if [ "$TARGET" == "linux64" ]; then - sudo apt-get update + sudo apt-get update; fi - if [ "$TARGET" == "osx" ]; then - brew update && brew bundle + brew update && brew bundle; fi install: - if [ "$TARGET" == "linux64" ]; then - sudo apt-get install qt5-default qttools5-dev-tools - sudo apt-get install liblo-dev liblo-tools - sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-vaapi gstreamer1.0-plugins-base gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-x gstreamer1.0-tools - sudo apt-get install qtmultimedia5-dev + sudo apt-get install qt5-default qttools5-dev-tools; + sudo apt-get install liblo-dev liblo-tools; + sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-vaapi gstreamer1.0-plugins-base gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-x gstreamer1.0-tools; + sudo apt-get install qtmultimedia5-dev; fi - if [ "$TARGET" == "linux64" ]; then - brew install qt - brew install liblo - brew install gstreamer gst-plugins-bad gst-plugins-base gst-plugins-good gst-libav + brew install qt; + brew install liblo; + brew install gstreamer gst-plugins-bad gst-plugins-base gst-plugins-good gst-libav; fi script: From 5277245325b111cea1e340a228097381071188f9 Mon Sep 17 00:00:00 2001 From: baydam Date: Thu, 22 Mar 2018 12:48:58 +0000 Subject: [PATCH 24/25] Another fix (travis.yml) --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 30b0804..2e0ac2e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ before_install: fi - if [ "$TARGET" == "osx" ]; then - brew update && brew bundle; + brew update; fi install: @@ -28,7 +28,7 @@ install: sudo apt-get install qtmultimedia5-dev; fi - - if [ "$TARGET" == "linux64" ]; then + - if [ "$TARGET" == "osx" ]; then brew install qt; brew install liblo; brew install gstreamer gst-plugins-bad gst-plugins-base gst-plugins-good gst-libav; From 6846ecf23887649f0b9adedc7c9a6c31ef48f6fa Mon Sep 17 00:00:00 2001 From: Sofian Audry Date: Thu, 22 Mar 2018 09:35:30 -0400 Subject: [PATCH 25/25] Fixed linker problem on Ubuntu 17.10 (closes #382) --- mapmap.pro | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mapmap.pro b/mapmap.pro index 05ae58b..e361b5b 100644 --- a/mapmap.pro +++ b/mapmap.pro @@ -42,7 +42,8 @@ system($$QMAKE_LRELEASE mapmap.pro) # Run lrelease #QMAKE_EXTRA_TARGETS += docs # Linux-specific: -#unix:!macx { +unix:!macx { +QMAKE_CXXFLAGS += -D_GLIBCXX_USE_CXX11_ABI=0 # mapmapfile.files = mapmap # mapmapfile.path = /usr/bin # INSTALLS += mapmapfile @@ -70,7 +71,7 @@ system($$QMAKE_LRELEASE mapmap.pro) # Run lrelease # docs.depends = $(HEADERS) $(SOURCES) # docs.commands = (cat Doxyfile; echo "INPUT = $?") | doxygen - # QMAKE_EXTRA_TARGETS += docs -#} +} # macOS-specific: #macx {