Added shared lib project.
authorlpcamargo <lucaspcamargo@gmail.com>
Mon, 11 May 2015 20:53:59 +0000 (23:53 +0300)
committerlpcamargo <lucaspcamargo@gmail.com>
Mon, 11 May 2015 20:53:59 +0000 (23:53 +0300)
Got rid of most comiler warnings.
The ones left are because of stb_vorbis.
Remove engine-specific class for type registration.

28 files changed:
neiasound.pro
src/nSoundBag.h
src/nSoundBuffer.cpp
src/nSoundBuffer.h
src/nSoundEffectParameters.cpp
src/nSoundEffectParameters.h
src/nSoundFormat.h
src/nSoundListener.cpp
src/nSoundListener.h
src/nSoundScriptMetatypes.cpp [deleted file]
src/nSoundScriptMetatypes.h [deleted file]
src/nSoundSource.h
src/nSoundSourceRole.h
src/nSoundStream.cpp
src/nSoundStream.h
src/nSoundStreamer.cpp
src/nSoundStreamer.h
src/nSoundStreamerPlaylist.h
src/nSoundSystem.cpp
src/nSoundSystem.h
src/nsoundroot.cpp [deleted file]
src/nsoundroot.h [deleted file]
src/stb_vorbis/nvorbisstream.cpp
src/stb_vorbis/nvorbisstream.h
src/stb_vorbis/stb_vorbis.c
src/util/nEfxHelper.h
src/wav/nwavestream.cpp
src/wav/nwavestream.h

index 85e533fdc3f2d1137819136b3d22093cb8ca6d99..efca1a8ab1be99289c9ee9a127f4ffeeb8677f1a 100644 (file)
@@ -4,17 +4,44 @@
 #
 #-------------------------------------------------
 
-QT       -= gui
+QT += gui
 
 TARGET = neiasound
 TEMPLATE = lib
 
 DEFINES += NEIASOUND_LIBRARY
 
-SOURCES += nsoundroot.cpp
+SOURCES += \
+    src/nSoundBag.cpp \
+    src/nSoundBuffer.cpp \
+    src/nSoundEffectParameters.cpp \
+    src/nSoundListener.cpp \
+    src/nSoundSource.cpp \
+    src/nSoundStream.cpp \
+    src/nSoundStreamer.cpp \
+    src/nSoundStreamerPlaylist.cpp \
+    src/nSoundSystem.cpp \
+    src/util/nEfxHelper.cpp \
+    src/stb_vorbis/nvorbisstream.cpp \
+    src/wav/nwavestream.cpp
 
-HEADERS += nsoundroot.h\
-        neiasound_global.h
+HEADERS += \
+    src/neiasound_global.h \
+    src/nSoundBag.h \
+    src/nSoundBuffer.h \
+    src/nSoundEffectParameters.h \
+    src/nSoundFormat.h \
+    src/nSoundListener.h \
+    src/nSoundSource.h \
+    src/nSoundSourceRole.h \
+    src/nSoundStream.h \
+    src/nSoundStreamer.h \
+    src/nSoundStreamerPlaylist.h \
+    src/nSoundSystem.h \
+    src/util/efx-util.h \
+    src/util/nEfxHelper.h \
+    src/stb_vorbis/nvorbisstream.h \
+    src/wav/nwavestream.h
 
 unix {
     target.path = /usr/lib
index 34007c7b0e8f8048ff6060bb0486957aaf731d96..93d21502c882bfcee10468aeaf1c61abdddb80fd 100644 (file)
 #ifndef NSOUNDBAG_H
 #define NSOUNDBAG_H
 
+#include "neiasound_global.h"
 #include <QObject>
 #include "nSoundFormat.h"
 
 
-class nSoundBag : public QObject
+class NEIASOUNDSHARED_EXPORT nSoundBag : public QObject
 {
     Q_OBJECT
     Q_ENUMS(nSoundFormat)
index b644d83fc534c70cc374591316bae7f5c0dfb1ff..c06cb6311305a7dd3204baa605f05a32b5936783 100644 (file)
@@ -89,6 +89,10 @@ int nSoundBuffer::openalFormat(nSoundFormat format)
 
     case SF_16BIT_STEREO:
         return AL_FORMAT_STEREO16;
+
+    case SF_WAVE_HEADER:
+    case SF_UNDEFINED:
+        return -1;
     }
 
     return -1;
index c7bafcd44883b254319b978085c57ad7317c0253..19c561e190383ca13afd3839ed4325817a465ffc 100644 (file)
@@ -26,6 +26,7 @@
 #ifndef NSOUNDBUFFER_H
 #define NSOUNDBUFFER_H
 
+#include "neiasound_global.h"
 #include <QObject>
 #include "nSoundFormat.h"
 
@@ -33,7 +34,7 @@ class nSoundSystem;
 class nSoundBag;
 class nSoundStream;
 
-class nSoundBuffer : public QObject
+class NEIASOUNDSHARED_EXPORT nSoundBuffer : public QObject
 {
     Q_OBJECT
     Q_PROPERTY(unsigned int openalHandle READ openalHandle)
index 93361521324104c7f8ad76fda581756a0891ed4b..1e88221f92ec98a443133705c122d32239cad3a6 100644 (file)
@@ -51,6 +51,8 @@ QVariant nSoundEffectParameters::parameter(QString name)
 
 void nSoundEffectParameters::setParameter(QString name, QVariant param)
 {
+    Q_UNUSED(name)
+    Q_UNUSED(param)
 
 }
 
index 0deaca9186db00677462dea5be43316e9e62654c..030eb7b6d236e68a0aebbe5bd3470fd2a09f85f9 100644 (file)
 #ifndef NSOUNDEFFECTPARAMETERS_H
 #define NSOUNDEFFECTPARAMETERS_H
 
+#include "neiasound_global.h"
 #include <QObject>
 #include <QVariantMap>
 
-enum nSoundEffectType
+enum NEIASOUNDSHARED_EXPORT nSoundEffectType
 {
     SET_NONE,
     SET_REVERB,
@@ -45,7 +46,7 @@ enum nSoundEffectType
 
 quint32 nSoundEffectType_toOpenalType();
 
-class nSoundEffectParameters : public QObject
+class NEIASOUNDSHARED_EXPORT nSoundEffectParameters : public QObject
 {
     Q_OBJECT
     Q_ENUMS(nSoundEffectType)
index a9cf849cb6b6796a8ddc580a5afd4c3a87ec498a..971ee7aa42195a27c9c52e1046d79f421049c590 100644 (file)
 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
 #ifndef NSOUNDFORMAT_H
 #define NSOUNDFORMAT_H
 
+#include "neiasound_global.h"
 #include <QtGlobal>
 
-enum nSoundFormat
+enum NEIASOUNDSHARED_EXPORT nSoundFormat
 {
     SF_UNDEFINED,
     SF_8BIT_MONO,
@@ -38,7 +40,7 @@ enum nSoundFormat
     SF_WAVE_HEADER
 };
 
-inline quint64 nSoundFormat_getFramesize(nSoundFormat sf)
+inline quint64 NEIASOUNDSHARED_EXPORT nSoundFormat_getFramesize(nSoundFormat sf)
 {
     switch(sf)
     {
@@ -63,7 +65,7 @@ inline quint64 nSoundFormat_getFramesize(nSoundFormat sf)
 }
 
 
-inline int nSoundFormat_getChannelCount(nSoundFormat sf)
+inline int NEIASOUNDSHARED_EXPORT nSoundFormat_getChannelCount(nSoundFormat sf)
 {
     switch(sf)
     {
index e9c6c86b96a96043289599acbbd87ee8dfee499e..f880b7fd47e3d2b1f2d2cac3a1d211ae1d696a74 100644 (file)
@@ -64,6 +64,8 @@ void nSoundListener::cameraDestroyed()
 
 void nSoundListener::update(qreal frameTime)
 {
+    Q_UNUSED(frameTime)
+
 #ifdef NEIA
     if(m_updating && m_camera)
     {
index fe1f66590d96f530fc741b078ba27ab3a8f1f517..09bb5a66cae0791bab4d909641ca5ec93125f5bd 100644 (file)
 #ifndef NSOUNDLISTENER_H
 #define NSOUNDLISTENER_H
 
+#include "neiasound_global.h"
 #include <QObject>
 #include <QVector3D>
 
 class nSceneCamera;
 class nSoundSystem;
 
-class nSoundListener : public QObject
+class NEIASOUNDSHARED_EXPORT nSoundListener : public QObject
 {
     Q_OBJECT
 #ifdef NEIA
diff --git a/src/nSoundScriptMetatypes.cpp b/src/nSoundScriptMetatypes.cpp
deleted file mode 100644 (file)
index 1364d9e..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright (C) 2015 Lucas Pires Camargo
-// 
-// This file is part of neiasound - Qt-style OpenAL wrapper for games.
-// 
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-// 
-// 1. Redistributions of source code must retain the above copyright notice,
-// this list of conditions and the following disclaimer.
-// 
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-// 
-// THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT ``AS IS'' AND ANY EXPRESS
-// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
-// NO EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "nSoundScriptMetatypes.h"
-
-#ifdef NEIA
-
-N_SCRIPT_METATYPE_QOBJECT_PTR_FUNCTIONS(nSoundBag)
-N_SCRIPT_METATYPE_QOBJECT_PTR_FUNCTIONS(nSoundBuffer)
-N_SCRIPT_METATYPE_QOBJECT_PTR_FUNCTIONS(nSoundEffectParameters)
-N_SCRIPT_METATYPE_QOBJECT_PTR_FUNCTIONS(nSoundListener)
-N_SCRIPT_METATYPE_QOBJECT_PTR_FUNCTIONS(nSoundSource)
-N_SCRIPT_METATYPE_QOBJECT_PTR_FUNCTIONS(nSoundStream)
-N_SCRIPT_METATYPE_QOBJECT_PTR_FUNCTIONS(nSoundStreamer)
-N_SCRIPT_METATYPE_QOBJECT_PTR_FUNCTIONS(nSoundStreamerPlaylist)
-N_SCRIPT_METATYPE_QOBJECT_PTR_FUNCTIONS(nSoundSystem)
-
-void nSoundScriptMetatypes_registerAll(QScriptEngine & engine)
-{
-    N_SCRIPT_METATYPE_REGISTER( engine, nSoundBag);
-    N_SCRIPT_METATYPE_REGISTER( engine, nSoundBuffer);
-    N_SCRIPT_METATYPE_REGISTER( engine, nSoundEffectParameters);
-    N_SCRIPT_METATYPE_REGISTER( engine, nSoundListener);
-    N_SCRIPT_METATYPE_REGISTER( engine, nSoundSource);
-    N_SCRIPT_METATYPE_REGISTER( engine, nSoundStream);
-    N_SCRIPT_METATYPE_REGISTER( engine, nSoundStreamer);
-    N_SCRIPT_METATYPE_REGISTER( engine, nSoundStreamerPlaylist);
-    N_SCRIPT_METATYPE_REGISTER( engine, nSoundSystem);
-}
-#endif
diff --git a/src/nSoundScriptMetatypes.h b/src/nSoundScriptMetatypes.h
deleted file mode 100644 (file)
index 1833e75..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (C) 2015 Lucas Pires Camargo
-// 
-// This file is part of neiasound - Qt-style OpenAL wrapper for games.
-// 
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-// 
-// 1. Redistributions of source code must retain the above copyright notice,
-// this list of conditions and the following disclaimer.
-// 
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-// 
-// THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT ``AS IS'' AND ANY EXPRESS
-// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
-// NO EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef NSOUNDSCRIPTMETATYPES_H
-#define NSOUNDSCRIPTMETATYPES_H
-
-#include "nSoundBag.h"
-#include "nSoundBuffer.h"
-#include "nSoundEffectParameters.h"
-#include "nSoundFormat.h"
-#include "nSoundListener.h"
-#include "nSoundSource.h"
-#include "nSoundStream.h"
-#include "nSoundStreamer.h"
-#include "nSoundStreamerPlaylist.h"
-#include "nSoundSystem.h"
-
-#ifdef NEIA
-#include "../util/nScriptMetatypeMacros.h"
-
-Q_DECLARE_METATYPE(nSoundBag*)
-Q_DECLARE_METATYPE(nSoundBuffer*)
-Q_DECLARE_METATYPE(nSoundEffectParameters*)
-Q_DECLARE_METATYPE(nSoundFormat*)
-Q_DECLARE_METATYPE(nSoundListener*)
-Q_DECLARE_METATYPE(nSoundSource*)
-Q_DECLARE_METATYPE(nSoundStream*)
-Q_DECLARE_METATYPE(nSoundStreamer*)
-Q_DECLARE_METATYPE(nSoundStreamerPlaylist*)
-Q_DECLARE_METATYPE(nSoundSystem*)
-
-void nSoundScriptMetatypes_registerAll(QScriptEngine & engine);
-#endif
-
-#endif // NSOUNDSCRIPTMETATYPES_H
index 21bb06f4ce90844768c836f4bfe644abb9f332de..4b9dd43b228f22cbe5a72f5ef89eb25e99dcbecc 100644 (file)
@@ -26,6 +26,7 @@
 #ifndef NSOUNDSOURCE_H
 #define NSOUNDSOURCE_H
 
+#include "neiasound_global.h"
 #include <QObject>
 #include <QVector3D>
 #include "nSoundSourceRole.h"
@@ -34,7 +35,7 @@ class nSoundSystem;
 class nSoundBuffer;
 
 
-class nSoundSource : public QObject
+class NEIASOUNDSHARED_EXPORT nSoundSource : public QObject
 {
     Q_OBJECT
     Q_ENUMS(nSoundSourceState)
index 23e28a9d2a437e1cc6449e1de608367638d13228..f167545cb91b0a54702884a2aae6b4d4edba7ebc 100644 (file)
 #ifndef NSOUNDSOURCEROLE_H
 #define NSOUNDSOURCEROLE_H
 
-enum  nSoundSourceRole
+
+#include "neiasound_global.h"
+
+enum NEIASOUNDSHARED_EXPORT nSoundSourceRole
 {
     SSR_MUSIC,
     SSR_SFX,
index f0862293e6ddfc669c9d958208e24e2b4ebd6902..fb3ec2b0e29316e928548aebc5d14494d36015a8 100644 (file)
@@ -33,6 +33,7 @@ nSoundStream::nSoundStream(QObject *parent) :
 
 nSoundBag *nSoundStream::createSoundBag(QObject *parent)
 {
+    Q_UNUSED(parent)
     nSoundBag * bag = new nSoundBag( format(), frames(), frequency() );
     read(bag->m_data, frames());
     return bag;
index 5db9a965b9290c162856580625d1a9c8b0f4d978..5bdea5a67d788ce6991f08d84c9564da4fef871f 100644 (file)
 #ifndef NSOUNDSTREAM_H
 #define NSOUNDSTREAM_H
 
+
+#include "neiasound_global.h"
 #include <QObject>
 #include "nSoundFormat.h"
 
 class nSoundBag;
 
-class nSoundStream : public QObject
+class NEIASOUNDSHARED_EXPORT nSoundStream : public QObject
 {
     Q_OBJECT
     Q_PROPERTY(int channels READ channels)
index f29de1853da9192f98cd9222ccf3472b8c654835..ccdc388f60075d53672e27d4b43e528806c5780a 100644 (file)
@@ -126,6 +126,7 @@ nSoundStreamer::~nSoundStreamer()
 
 void nSoundStreamer::update(float frameTime)
 {
+    Q_UNUSED(frameTime)
 
     if(!m_playlist->itemCount()) {
         return;
@@ -193,8 +194,10 @@ bool nSoundStreamer::fillAndQueueBuffer(unsigned int buffer)
             {
                 m_currentStream++;
                 if(m_currentStream==m_playlist->m_items.size())
+                {
                     if(m_playlist->loopPlaylist())m_currentStream = 0;
                     else keep = false;
+                }
             }
         }
     }while ( keep && (readFrames < frames));
@@ -226,6 +229,9 @@ int nSoundStreamer::openalFormat(nSoundFormat format)
 
     case SF_16BIT_STEREO:
         return AL_FORMAT_STEREO16;
+    case SF_WAVE_HEADER:
+    case SF_UNDEFINED:
+        return -1;
     }
 
     return -1;
@@ -250,6 +256,8 @@ void nSoundStreamerUpdater::setup()
 
 void nSoundStreamerUpdater::timerEvent(QTimerEvent * evt)
 {
+    Q_UNUSED(evt)
+
     if(_keepGoing)
         _streamer->update(0);
     else {
index aed45ca5d2fb52dde85ef8535e64eb8751ffb08e..879d86da18b99e98c7f5fa61be9d1fa4cd59b9e7 100644 (file)
@@ -26,6 +26,7 @@
 #ifndef NSOUNDSTREAMER_H
 #define NSOUNDSTREAMER_H
 
+#include "neiasound_global.h"
 #include <QObject>
 #include <QThread>
 #include <QMutex>
@@ -41,7 +42,7 @@ class nSoundStreamerPlaylist;
 
 class nSoundStreamerUpdater;
 
-class nSoundStreamer : public QObject
+class NEIASOUNDSHARED_EXPORT nSoundStreamer : public QObject
 {
     Q_OBJECT
     Q_PROPERTY(nSoundSource* source READ source WRITE setSource NOTIFY sourceChanged)
index a1b867a9e68b60d6e48c0d8dcb18ef90fa490da8..a3422e4003adf41b0cd83c033fc665322fb14574 100644 (file)
 #ifndef NSOUNDSTREAMERPLAYLIST_H
 #define NSOUNDSTREAMERPLAYLIST_H
 
+#include "neiasound_global.h"
 #include <QObject>
 #include <QList>
 
 class nSoundStream;
 
-typedef struct _nSoundStreamerItem
+typedef struct NEIASOUNDSHARED_EXPORT _nSoundStreamerItem
 {
-    nSoundStream * m_soundStream = 0;
+    nSoundStream * m_soundStream;
     bool m_loop;
 } nSoundStreamerItem;
 
-class nSoundStreamerPlaylist : public QObject
+class NEIASOUNDSHARED_EXPORT nSoundStreamerPlaylist : public QObject
 {
     Q_OBJECT
     Q_PROPERTY(bool loopPlaylist READ loopPlaylist WRITE setLoopPlaylist) 
@@ -58,8 +59,8 @@ public slots:
 
 private:
     friend class nSoundStreamer;
-    QList<nSoundStreamerItem> m_items;
     bool m_loopPlaylist;
+    QList<nSoundStreamerItem> m_items;
 
 };
 
index 7cef8da5c0254cec733640c836ad30ffcfa09ed9..6b9519cbf7ce9081b9cac0c09d0e76606a188469 100644 (file)
@@ -71,11 +71,8 @@ nSoundSystem::nSoundSystem(QObject *parent) :
 #endif
 #endif
 
-    qDebug("nSoundSystem initialized successfully.");
-
     alcGetIntegerv(m_device, ALC_MAX_AUXILIARY_SENDS, 1, &m_numSends);
-    qDebug(QString("OpenAL device supports %1 auxiliary sends per source.").arg(m_numSends).toLocal8Bit());
-
+    
     nSoundSource::_resetRoleGains();
     QSettings settings;
     settings.beginGroup("Audio");
index 746e000da2dbdf2d601159c67f6b1458a1057797..e5a95ea3a56650d6a9df5f7fe3b686f81b6f4691 100644 (file)
@@ -26,6 +26,7 @@
 #ifndef NSOUNDSYSTEM_H
 #define NSOUNDSYSTEM_H
 
+#include "neiasound_global.h"
 #include <QObject>
 #include <QHash>
 #include "nSoundSourceRole.h"
@@ -43,7 +44,7 @@ class nSoundListener;
 class nSoundStreamer;
 class nSoundStreamerPlaylist;
 
-class nSoundSystem : public QObject
+class NEIASOUNDSHARED_EXPORT nSoundSystem : public QObject
 {
     Q_OBJECT
     Q_PROPERTY(int supportedAuxiliarySends READ supportedAuxiliarySends)
diff --git a/src/nsoundroot.cpp b/src/nsoundroot.cpp
deleted file mode 100644 (file)
index 2b7fb17..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "nsoundroot.h"
-
-
-nSoundRoot::nSoundRoot()
-{
-}
diff --git a/src/nsoundroot.h b/src/nsoundroot.h
deleted file mode 100644 (file)
index ad5fcf2..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef NSOUNDROOT_H
-#define NSOUNDROOT_H
-
-#include "neiasound_global.h"
-
-class NEIASOUNDSHARED_EXPORT nSoundRoot
-{
-
-public:
-    nSoundRoot();
-};
-
-#endif // NSOUNDROOT_H
index 348d56f91a38c9b6546320f429dd3a091071502d..ab8cd3b651a1774ed2a7ea093fdaaa7ef4f11a41 100644 (file)
 
 
 #define STB_VORBIS_MAX_CHANNELS     2
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wsign-compare"
+#pragma GCC diagnostic ignored "-Wtype-limits"
+#pragma GCC diagnostic ignored "-Wparentheses"
+#pragma GCC diagnostic ignored "-Wunused-parameter"
+#pragma GCC diagnostic ignored "-Wunused-value"
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#pragma GCC diagnostic ignored "-Wunused-function"
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
 #include "stb_vorbis.c"
+#pragma GCC diagnostic pop
 
 
 nVorbisStream::nVorbisStream(QIODevice * dev, QObject *parent) : nSoundStream(parent),
     _device(dev),
-    m_error(false),
     _totalFrames(0),
     _channels(0),
     _frequency(0),
-    _format(SF_16BIT_STEREO)
+    _format(SF_16BIT_STEREO),
+    m_error(false)
 {
     _vorbis = 0;
 
@@ -85,10 +95,10 @@ nVorbisStream::nVorbisStream(QIODevice * dev, QObject *parent) : nSoundStream(pa
         _vorbis = stb_vorbis_open_memory((unsigned char*)_buf, _bufSize, &err,  0 );
         if(!_vorbis || err != VORBIS__no_error)
         {
-            qDebug(QStringLiteral("[nVorbisStream] Error initializing vorbis stream: %1").arg(err).toLocal8Bit());
+            qDebug("[nVorbisStream] Error initializing vorbis stream");
         }
 
-        stb_vorbis_info info = stb_vorbis_get_info(_vorbis);
+        //stb_vorbis_info info = stb_vorbis_get_info(_vorbis);
 
         _totalFrames = stb_vorbis_stream_length_in_samples(_vorbis);
         _channels = _vorbis->channels;
index 25a672c72cb660199ccc5dae524aa1a1976c0ec4..8a7ad2c1bda3e54c12407286757d1a1415a2fe01 100644 (file)
 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Copyright (C) 2015 Lucas Pires Camargo
-// 
-// This file is part of neiasound - Qt-style OpenAL wrapper for games.
-// 
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-// 
-// 1. Redistributions of source code must retain the above copyright notice,
-// this list of conditions and the following disclaimer.
-// 
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-// 
-// THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT ``AS IS'' AND ANY EXPRESS
-// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
-// NO EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "../neiasound_global.h"
 #ifndef NVORBISSTREAM_H
 #define NVORBISSTREAM_H
 
@@ -56,7 +33,7 @@
 class QIODevice;
 class stb_vorbis;
 
-class nVorbisStream : public nSoundStream
+class NEIASOUNDSHARED_EXPORT nVorbisStream : public nSoundStream
 {
     Q_OBJECT    
     Q_PROPERTY(bool error READ error CONSTANT)
@@ -97,7 +74,6 @@ private:
     int _frequency;
     nSoundFormat _format;
 
-
     bool m_error;
 };
 
index 1589e40db00c0678f303ad590351627d61d3843c..e59a4598c74ed89fe9ec619c776ef9c1d688ca4a 100644 (file)
@@ -2363,7 +2363,6 @@ void dct_iv_slow(float *buffer, int n)
          //acc += x[j] * cos(M_PI / n * (i + 0.5) * (j + 0.5));
       buffer[i] = acc;
    }
-   free(x);
 }
 
 void inverse_mdct_slow(float *buffer, int n, vorb *f, int blocktype)
index 0c165e1974918bd4f66cff1b30aa772c7937aeac..df240ec21578b5855a3a48c1c37ecd74af822bf0 100644 (file)
 #ifndef NEFXHELPER_H
 #define NEFXHELPER_H
 
+#include "../neiasound_global.h"
 #include "AL/al.h"
 #include "AL/alc.h"
 #include "AL/alext.h"
 
-class nEfxHelper
+class NEIASOUNDSHARED_EXPORT nEfxHelper
 {
 
 public:
index 1ac3145f5106153338afb50d75cc75136aa118de..8eee4f9ea5fe509889ba2c315d28697d4fc2637a 100644 (file)
@@ -59,7 +59,7 @@ nWaveStream::nWaveStream(QIODevice *device, nSoundFormat format, int frequency,
 
 nSoundBag *nWaveStream::createSoundBag(QObject *parent)
 {
-    nSoundBag * bag = new nSoundBag( _format, _totalFrames, _frequency );
+    nSoundBag * bag = new nSoundBag( _format, _totalFrames, _frequency, parent );
     read(bag->m_data, _totalFrames);
     return bag;
 }
index bfd2cae3987955c464d8645fc76228d94219b942..12b1b65ebda009e169b799c7e197e87c006a7b31 100644 (file)
 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
 #ifndef DWSOUNDRAWSTREAM_H
 #define DWSOUNDRAWSTREAM_H
 
+#include "../neiasound_global.h"
 #include "../nSoundStream.h"
 
 class QIODevice;
 
-class nWaveStream : public nSoundStream
+class NEIASOUNDSHARED_EXPORT nWaveStream : public nSoundStream
 {
     Q_OBJECT
 public:
@@ -55,11 +57,11 @@ public slots:
 private:
 
     QIODevice * _device;
+    nSoundFormat _format;
+    int _frequency;
     quint64 _totalFrames;
     int _channels;
-    int _frequency;
     int _deviceOffset;
-    nSoundFormat _format;
 
 };